aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-12-26 03:32:50 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-12-26 03:32:50 +0000
commit0495d47f7ea2e1fead685da12b03b1ec5c51c01c (patch)
tree7b1ad7796d8a0c13f9adaceca1217d6fbeba41bf /usr.sbin
parentc69a537c8f5dcc568ef63f25c8306d937a260afa (diff)
downloadsrc-0495d47f7ea2e1fead685da12b03b1ec5c51c01c.tar.gz
src-0495d47f7ea2e1fead685da12b03b1ec5c51c01c.zip
Fix fixit floppy.
Notes
Notes: svn path=/head/; revision=20915
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sade/install.c30
-rw-r--r--usr.sbin/sysinstall/install.c30
2 files changed, 42 insertions, 18 deletions
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index 356567a25adc..1d09670e9826 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.144 1996/12/02 05:01:02 jkh Exp $
+ * $Id: install.c,v 1.145 1996/12/12 23:12:44 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -274,9 +274,7 @@ installFixitFloppy(dialogMenuItem *self)
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0)
return DITEM_FAILURE;
}
- dialog_clear();
- end_dialog();
- DialogActive = FALSE;
+
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
@@ -299,7 +297,20 @@ installFixitFloppy(dialogMenuItem *self)
if (!file_readable(TERMCAP_FILE))
create_termcap();
if (!(child = fork())) {
+ int i, fd;
struct termios foo;
+ extern int login_tty(int);
+
+ ioctl(0, TIOCNOTTY, NULL);
+ for (i = getdtablesize(); i >= 0; --i)
+ close(i);
+ fd = open("/dev/ttyv3", O_RDWR);
+ ioctl(0, TIOCSCTTY, &fd);
+ dup2(0, 1);
+ dup2(0, 2);
+ DebugFD = 2;
+ if (login_tty(fd) == -1)
+ msgDebug("fixit: I can't set the controlling terminal.\n");
signal(SIGTTOU, SIG_IGN);
if (tcgetattr(0, &foo) != -1) {
@@ -317,13 +328,14 @@ installFixitFloppy(dialogMenuItem *self)
msgDebug("fixit shell: Failed to execute shell!\n");
return -1;
}
- else
+ else {
+ msgNotify("Waiting for fixit shell to exit. Go to VTY4 now by\n"
+ "typing ALT-F4. When you are done, type ``exit'' to exit\n"
+ "the fixit shell and be returned here.");
(void)waitpid(child, &waitstatus, 0);
-
- DialogActive = TRUE;
- clear();
- dialog_clear();
+ }
unmount("/mnt2", MNT_FORCE);
+ dialog_clear();
msgConfirm("Please remove the fixit floppy now.");
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 356567a25adc..1d09670e9826 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.144 1996/12/02 05:01:02 jkh Exp $
+ * $Id: install.c,v 1.145 1996/12/12 23:12:44 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -274,9 +274,7 @@ installFixitFloppy(dialogMenuItem *self)
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0)
return DITEM_FAILURE;
}
- dialog_clear();
- end_dialog();
- DialogActive = FALSE;
+
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
@@ -299,7 +297,20 @@ installFixitFloppy(dialogMenuItem *self)
if (!file_readable(TERMCAP_FILE))
create_termcap();
if (!(child = fork())) {
+ int i, fd;
struct termios foo;
+ extern int login_tty(int);
+
+ ioctl(0, TIOCNOTTY, NULL);
+ for (i = getdtablesize(); i >= 0; --i)
+ close(i);
+ fd = open("/dev/ttyv3", O_RDWR);
+ ioctl(0, TIOCSCTTY, &fd);
+ dup2(0, 1);
+ dup2(0, 2);
+ DebugFD = 2;
+ if (login_tty(fd) == -1)
+ msgDebug("fixit: I can't set the controlling terminal.\n");
signal(SIGTTOU, SIG_IGN);
if (tcgetattr(0, &foo) != -1) {
@@ -317,13 +328,14 @@ installFixitFloppy(dialogMenuItem *self)
msgDebug("fixit shell: Failed to execute shell!\n");
return -1;
}
- else
+ else {
+ msgNotify("Waiting for fixit shell to exit. Go to VTY4 now by\n"
+ "typing ALT-F4. When you are done, type ``exit'' to exit\n"
+ "the fixit shell and be returned here.");
(void)waitpid(child, &waitstatus, 0);
-
- DialogActive = TRUE;
- clear();
- dialog_clear();
+ }
unmount("/mnt2", MNT_FORCE);
+ dialog_clear();
msgConfirm("Please remove the fixit floppy now.");
return DITEM_SUCCESS;
}