aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2000-07-18 09:14:06 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2000-07-18 09:14:06 +0000
commit7090abf5251f1deda0ac0d82a07797f56bbb1343 (patch)
treee50c8ff95281bdd1812d852157e6010257ba2c33
parent6a5be8627cd58dd879210811dab5212e2d35bc7d (diff)
Notes
-rw-r--r--release/sysinstall/install.c5
-rw-r--r--release/sysinstall/sysinstall.h3
-rw-r--r--release/sysinstall/system.c51
-rw-r--r--usr.sbin/sade/install.c5
-rw-r--r--usr.sbin/sade/sade.h3
-rw-r--r--usr.sbin/sade/system.c51
-rw-r--r--usr.sbin/sysinstall/install.c5
-rw-r--r--usr.sbin/sysinstall/sysinstall.h3
-rw-r--r--usr.sbin/sysinstall/system.c51
9 files changed, 159 insertions, 18 deletions
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index ac3b01390c16..209c210e22b2 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -56,6 +56,7 @@
* Used by package.c
*/
int _interactiveHack;
+int FixItMode = 0;
static void create_termcap(void);
static void fixit_common(void);
@@ -248,8 +249,10 @@ installInitial(void)
int
installFixitHoloShell(dialogMenuItem *self)
{
+ FixItMode = 1;
systemCreateHoloshell();
return DITEM_SUCCESS;
+ FixItMode = 0;
}
int
@@ -397,6 +400,8 @@ fixit_common(void)
msgConfirm("Couldn't symlink the /etc/ files! I'm not sure I like this..");
if (!file_readable(TERMCAP_FILE))
create_termcap();
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if (!(child = fork())) {
int i, fd, fdstop;
struct termios foo;
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index e34735a74c90..abb2b8e147f7 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -402,6 +402,7 @@ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
+extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);
@@ -711,6 +712,8 @@ extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(int status);
extern int execExecute(char *cmd, char *name);
extern int systemExecute(char *cmd);
+extern void systemSuspendDialog(void);
+extern void systemResumeDialog(void);
extern int systemDisplayHelp(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c
index d0daba3c1c91..6010e7a25f8d 100644
--- a/release/sysinstall/system.c
+++ b/release/sysinstall/system.c
@@ -217,6 +217,28 @@ systemExecute(char *command)
return status;
}
+/* suspend/resume libdialog/curses screen */
+static WINDOW *oldW;
+
+void
+systemSuspendDialog(void)
+{
+
+ oldW = savescr();
+ dialog_clear();
+ dialog_update();
+ end_dialog();
+ DialogActive = FALSE;
+}
+
+void
+systemResumeDialog(void)
+{
+
+ DialogActive = TRUE;
+ restorescr(oldW);
+}
+
/* Display a help file in a filebox */
int
systemDisplayHelp(char *file)
@@ -355,7 +377,9 @@ vsystem(char *fmt, ...)
void
systemCreateHoloshell(void)
{
- if (OnVTY && RunningAsInit) {
+ int waitstatus;
+
+ if ((FixItMode || OnVTY) && RunningAsInit) {
if (ehs_pid != 0) {
int pstat;
@@ -377,6 +401,8 @@ systemCreateHoloshell(void)
(void) waitpid(ehs_pid, &pstat, WNOHANG);
}
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if ((ehs_pid = fork()) == 0) {
int i, fd;
struct termios foo;
@@ -385,7 +411,10 @@ systemCreateHoloshell(void)
ioctl(0, TIOCNOTTY, NULL);
for (i = getdtablesize(); i >= 0; --i)
close(i);
- fd = open("/dev/ttyv3", O_RDWR);
+ if (OnVTY)
+ fd = open("/dev/ttyv3", O_RDWR);
+ else
+ fd = open("/dev/console", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
@@ -400,16 +429,26 @@ systemCreateHoloshell(void)
}
else
msgDebug("Doctor: I'm unable to get the terminal attributes!\n");
+ if (!OnVTY){
+ printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n");
+ fflush(stdout);
+ }
execlp("sh", "-sh", 0);
msgDebug("Was unable to execute sh for Holographic shell!\n");
exit(1);
}
else {
- WINDOW *w = savescr();
+ if (OnVTY) {
+ WINDOW *w = savescr();
- msgNotify("Starting an emergency holographic shell on VTY4");
- sleep(2);
- restorescr(w);
+ msgNotify("Starting an emergency holographic shell on VTY4");
+ sleep(2);
+ restorescr(w);
+ }
+ if (!OnVTY){
+ (void)waitpid(ehs_pid, &waitstatus, 0);
+ systemResumeDialog();
+ }
}
}
}
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index ac3b01390c16..209c210e22b2 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -56,6 +56,7 @@
* Used by package.c
*/
int _interactiveHack;
+int FixItMode = 0;
static void create_termcap(void);
static void fixit_common(void);
@@ -248,8 +249,10 @@ installInitial(void)
int
installFixitHoloShell(dialogMenuItem *self)
{
+ FixItMode = 1;
systemCreateHoloshell();
return DITEM_SUCCESS;
+ FixItMode = 0;
}
int
@@ -397,6 +400,8 @@ fixit_common(void)
msgConfirm("Couldn't symlink the /etc/ files! I'm not sure I like this..");
if (!file_readable(TERMCAP_FILE))
create_termcap();
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if (!(child = fork())) {
int i, fd, fdstop;
struct termios foo;
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index e34735a74c90..abb2b8e147f7 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -402,6 +402,7 @@ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
+extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);
@@ -711,6 +712,8 @@ extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(int status);
extern int execExecute(char *cmd, char *name);
extern int systemExecute(char *cmd);
+extern void systemSuspendDialog(void);
+extern void systemResumeDialog(void);
extern int systemDisplayHelp(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index d0daba3c1c91..6010e7a25f8d 100644
--- a/usr.sbin/sade/system.c
+++ b/usr.sbin/sade/system.c
@@ -217,6 +217,28 @@ systemExecute(char *command)
return status;
}
+/* suspend/resume libdialog/curses screen */
+static WINDOW *oldW;
+
+void
+systemSuspendDialog(void)
+{
+
+ oldW = savescr();
+ dialog_clear();
+ dialog_update();
+ end_dialog();
+ DialogActive = FALSE;
+}
+
+void
+systemResumeDialog(void)
+{
+
+ DialogActive = TRUE;
+ restorescr(oldW);
+}
+
/* Display a help file in a filebox */
int
systemDisplayHelp(char *file)
@@ -355,7 +377,9 @@ vsystem(char *fmt, ...)
void
systemCreateHoloshell(void)
{
- if (OnVTY && RunningAsInit) {
+ int waitstatus;
+
+ if ((FixItMode || OnVTY) && RunningAsInit) {
if (ehs_pid != 0) {
int pstat;
@@ -377,6 +401,8 @@ systemCreateHoloshell(void)
(void) waitpid(ehs_pid, &pstat, WNOHANG);
}
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if ((ehs_pid = fork()) == 0) {
int i, fd;
struct termios foo;
@@ -385,7 +411,10 @@ systemCreateHoloshell(void)
ioctl(0, TIOCNOTTY, NULL);
for (i = getdtablesize(); i >= 0; --i)
close(i);
- fd = open("/dev/ttyv3", O_RDWR);
+ if (OnVTY)
+ fd = open("/dev/ttyv3", O_RDWR);
+ else
+ fd = open("/dev/console", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
@@ -400,16 +429,26 @@ systemCreateHoloshell(void)
}
else
msgDebug("Doctor: I'm unable to get the terminal attributes!\n");
+ if (!OnVTY){
+ printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n");
+ fflush(stdout);
+ }
execlp("sh", "-sh", 0);
msgDebug("Was unable to execute sh for Holographic shell!\n");
exit(1);
}
else {
- WINDOW *w = savescr();
+ if (OnVTY) {
+ WINDOW *w = savescr();
- msgNotify("Starting an emergency holographic shell on VTY4");
- sleep(2);
- restorescr(w);
+ msgNotify("Starting an emergency holographic shell on VTY4");
+ sleep(2);
+ restorescr(w);
+ }
+ if (!OnVTY){
+ (void)waitpid(ehs_pid, &waitstatus, 0);
+ systemResumeDialog();
+ }
}
}
}
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index ac3b01390c16..209c210e22b2 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -56,6 +56,7 @@
* Used by package.c
*/
int _interactiveHack;
+int FixItMode = 0;
static void create_termcap(void);
static void fixit_common(void);
@@ -248,8 +249,10 @@ installInitial(void)
int
installFixitHoloShell(dialogMenuItem *self)
{
+ FixItMode = 1;
systemCreateHoloshell();
return DITEM_SUCCESS;
+ FixItMode = 0;
}
int
@@ -397,6 +400,8 @@ fixit_common(void)
msgConfirm("Couldn't symlink the /etc/ files! I'm not sure I like this..");
if (!file_readable(TERMCAP_FILE))
create_termcap();
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if (!(child = fork())) {
int i, fd, fdstop;
struct termios foo;
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index e34735a74c90..abb2b8e147f7 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -402,6 +402,7 @@ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
+extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);
@@ -711,6 +712,8 @@ extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(int status);
extern int execExecute(char *cmd, char *name);
extern int systemExecute(char *cmd);
+extern void systemSuspendDialog(void);
+extern void systemResumeDialog(void);
extern int systemDisplayHelp(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index d0daba3c1c91..6010e7a25f8d 100644
--- a/usr.sbin/sysinstall/system.c
+++ b/usr.sbin/sysinstall/system.c
@@ -217,6 +217,28 @@ systemExecute(char *command)
return status;
}
+/* suspend/resume libdialog/curses screen */
+static WINDOW *oldW;
+
+void
+systemSuspendDialog(void)
+{
+
+ oldW = savescr();
+ dialog_clear();
+ dialog_update();
+ end_dialog();
+ DialogActive = FALSE;
+}
+
+void
+systemResumeDialog(void)
+{
+
+ DialogActive = TRUE;
+ restorescr(oldW);
+}
+
/* Display a help file in a filebox */
int
systemDisplayHelp(char *file)
@@ -355,7 +377,9 @@ vsystem(char *fmt, ...)
void
systemCreateHoloshell(void)
{
- if (OnVTY && RunningAsInit) {
+ int waitstatus;
+
+ if ((FixItMode || OnVTY) && RunningAsInit) {
if (ehs_pid != 0) {
int pstat;
@@ -377,6 +401,8 @@ systemCreateHoloshell(void)
(void) waitpid(ehs_pid, &pstat, WNOHANG);
}
+ if (!OnVTY)
+ systemSuspendDialog(); /* must be before the fork() */
if ((ehs_pid = fork()) == 0) {
int i, fd;
struct termios foo;
@@ -385,7 +411,10 @@ systemCreateHoloshell(void)
ioctl(0, TIOCNOTTY, NULL);
for (i = getdtablesize(); i >= 0; --i)
close(i);
- fd = open("/dev/ttyv3", O_RDWR);
+ if (OnVTY)
+ fd = open("/dev/ttyv3", O_RDWR);
+ else
+ fd = open("/dev/console", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
@@ -400,16 +429,26 @@ systemCreateHoloshell(void)
}
else
msgDebug("Doctor: I'm unable to get the terminal attributes!\n");
+ if (!OnVTY){
+ printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n");
+ fflush(stdout);
+ }
execlp("sh", "-sh", 0);
msgDebug("Was unable to execute sh for Holographic shell!\n");
exit(1);
}
else {
- WINDOW *w = savescr();
+ if (OnVTY) {
+ WINDOW *w = savescr();
- msgNotify("Starting an emergency holographic shell on VTY4");
- sleep(2);
- restorescr(w);
+ msgNotify("Starting an emergency holographic shell on VTY4");
+ sleep(2);
+ restorescr(w);
+ }
+ if (!OnVTY){
+ (void)waitpid(ehs_pid, &waitstatus, 0);
+ systemResumeDialog();
+ }
}
}
}