From 9a596693ad74d8bcb1b6c3764f0be96f1198f0ac Mon Sep 17 00:00:00 2001 From: jkh Date: Fri, 26 May 1995 20:31:02 +0000 Subject: Ask name of "other" ftp site in correct place. Make TIOCCONS redirection for console messages work properly; we no longer open /dev/console for all I/O - we use the VTYs directly. --- usr.sbin/sade/system.c | 4 ++-- usr.sbin/sade/termcap.c | 17 +++++++++-------- usr.sbin/sysinstall/media.c | 10 +++++++++- usr.sbin/sysinstall/system.c | 4 ++-- usr.sbin/sysinstall/tcpip.c | 5 ++--- usr.sbin/sysinstall/termcap.c | 17 +++++++++-------- 6 files changed, 33 insertions(+), 24 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index 3ce3555..b4ee445 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.35 1995/05/26 08:41:49 jkh Exp $ + * $Id: system.c,v 1.36 1995/05/26 19:28:05 jkh Exp $ * * Jordan Hubbard * @@ -63,7 +63,7 @@ systemInitialize(int argc, char **argv) OnCDROM = TRUE; chroot("/bootcd"); } else { - close(0); open("/dev/console", O_RDWR); + close(0); open("/dev/ttyv0", O_RDWR); close(1); dup(0); close(2); dup(0); } diff --git a/usr.sbin/sade/termcap.c b/usr.sbin/sade/termcap.c index ea8a38a..ef70a75 100644 --- a/usr.sbin/sade/termcap.c +++ b/usr.sbin/sade/termcap.c @@ -32,8 +32,16 @@ set_termcap(void) OnVTY = OnSerial = FALSE; if (getpid() != 1) DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); - else + else { + int i, on; + + DebugFD = open("/dev/ttyv1", O_WRONLY); + on = 1; + i = ioctl(DebugFD, TIOCCONS, (char *)&on); + msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); RunningAsInit = TRUE; + OnVTY = TRUE; + } term = getenv("TERM"); stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); if (stat < 0) { @@ -64,13 +72,6 @@ set_termcap(void) return -1; } } - if (DebugFD == -1) { - int i; - - DebugFD = open("/dev/ttyv1", O_WRONLY); - i = ioctl(DebugFD, TIOCCONS, (char *)NULL); - msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)", DebugFD, i, !i ? "success" : strerror(errno)); - } OnVTY = TRUE; } return 0; diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 3d2234c..6fb95f9 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.16 1995/05/24 09:00:40 jkh Exp $ + * $Id: media.c,v 1.17 1995/05/26 08:41:41 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -258,6 +258,14 @@ mediaSetFTP(char *str) cp = getenv("ftp"); if (!cp) return 0; + if (!strcmp(cp, "other")) { + cp = msgGetInput("ftp://", "Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept anonymous ftp!\nA URL looks like this: ftp:///"); + if (!cp || strncmp("ftp://", cp, 6)) + return 0; + else + variable_set2("ftp", cp); + } + strcpy(ftpDevice.name, cp); ftpDevice.type = DEVICE_TYPE_NETWORK; ftpDevice.init = mediaInitFTP; diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index 3ce3555..b4ee445 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.35 1995/05/26 08:41:49 jkh Exp $ + * $Id: system.c,v 1.36 1995/05/26 19:28:05 jkh Exp $ * * Jordan Hubbard * @@ -63,7 +63,7 @@ systemInitialize(int argc, char **argv) OnCDROM = TRUE; chroot("/bootcd"); } else { - close(0); open("/dev/console", O_RDWR); + close(0); open("/dev/ttyv0", O_RDWR); close(1); dup(0); close(2); dup(0); } diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 28483e0..2baaf34 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.16 1995/05/26 08:58:35 jkh Exp $ + * $Id: tcpip.c,v 1.17 1995/05/26 19:28:06 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -216,7 +216,6 @@ tcpOpenDialog(Device *devp) /* Initialise vars from previous device values */ if (devp->private) { DevInfo *di = (DevInfo *)devp->private; - strcpy(ipaddr, di->ipaddr); strcpy(netmask, di->netmask); @@ -384,7 +383,7 @@ tcpOpenDialog(Device *devp) } /* BODGE ALERT! */ - if ((tmp = index(hostname, '.')) != NULL) { + if (((tmp = index(hostname, '.')) != NULL) && (strlen(domainname)==0)) { strncpy(domainname, tmp + 1, strlen(tmp + 1)); domainname[strlen(tmp+1)] = '\0'; RefreshStringObj(layout[1].obj); diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index ea8a38a..ef70a75 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -32,8 +32,16 @@ set_termcap(void) OnVTY = OnSerial = FALSE; if (getpid() != 1) DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); - else + else { + int i, on; + + DebugFD = open("/dev/ttyv1", O_WRONLY); + on = 1; + i = ioctl(DebugFD, TIOCCONS, (char *)&on); + msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); RunningAsInit = TRUE; + OnVTY = TRUE; + } term = getenv("TERM"); stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); if (stat < 0) { @@ -64,13 +72,6 @@ set_termcap(void) return -1; } } - if (DebugFD == -1) { - int i; - - DebugFD = open("/dev/ttyv1", O_WRONLY); - i = ioctl(DebugFD, TIOCCONS, (char *)NULL); - msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)", DebugFD, i, !i ? "success" : strerror(errno)); - } OnVTY = TRUE; } return 0; -- cgit v1.1