diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2000-05-16 22:05:32 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2000-05-16 22:05:32 +0000 |
commit | 9ee6ec34efb08899038548ab6b5f367d8d1133fb (patch) | |
tree | 67bf3dea6c5a5f12ba1162c1cc192cfbeb3bce70 /usr.sbin/sade/install.c | |
parent | 40316fa9812750f08462dd32cab884c0b331fc54 (diff) | |
download | src-9ee6ec34efb08899038548ab6b5f367d8d1133fb.tar.gz src-9ee6ec34efb08899038548ab6b5f367d8d1133fb.zip |
Add an option to select the Fix-it tty. The current behavior is utterly
*useless* on serial consoled machines.
Notes
Notes:
svn path=/head/; revision=60657
Diffstat (limited to 'usr.sbin/sade/install.c')
-rw-r--r-- | usr.sbin/sade/install.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index db5719ebad3b..db3a99066360 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -398,17 +398,20 @@ fixit_common(void) if (!file_readable(TERMCAP_FILE)) create_termcap(); if (!(child = fork())) { - int i, fd; + int i, fd, fdstop; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); - for (i = getdtablesize(); i >= 0; --i) + fdstop = strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0 ? 3 : 0; + for (i = getdtablesize(); i >= fdstop; --i) close(i); - fd = open("/dev/ttyv3", O_RDWR); - ioctl(0, TIOCSCTTY, &fd); - dup2(0, 1); - dup2(0, 2); + if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { + 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"); @@ -432,9 +435,15 @@ fixit_common(void) } else { dialog_clear_norefresh(); - 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."); + if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { + 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."); + } else { + msgNotify("Waiting for fixit shell to exit.\n" + "When you are done, type ``exit'' to exit\n" + "the fixit shell and be returned here."); + } (void)waitpid(child, &waitstatus, 0); } dialog_clear(); @@ -1086,6 +1095,7 @@ installVarDefaults(dialogMenuItem *self) variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "NO", -1); + variable_set2(VAR_FIXIT_TTY, "standard", 0); variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0); variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT), 0); if (getpid() != 1) |