From 9a596693ad74d8bcb1b6c3764f0be96f1198f0ac Mon Sep 17 00:00:00 2001 From: jkh Date: Fri, 26 May 1995 20:31:02 +0000 Subject: [PATCH] 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. --- release/sysinstall/media.c | 10 +++++++++- release/sysinstall/media_strategy.c | 10 +--------- release/sysinstall/system.c | 4 ++-- release/sysinstall/tcpip.c | 5 ++--- release/sysinstall/termcap.c | 17 +++++++++-------- 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 +++++++++-------- 11 files changed, 56 insertions(+), 47 deletions(-) diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index 3d2234c1f108..6fb95f93a5fa 100644 --- a/release/sysinstall/media.c +++ b/release/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/release/sysinstall/media_strategy.c b/release/sysinstall/media_strategy.c index e16815323206..d25a7a9d344e 100644 --- a/release/sysinstall/media_strategy.c +++ b/release/sysinstall/media_strategy.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_strategy.c,v 1.26 1995/05/26 11:21:49 jkh Exp $ + * $Id: media_strategy.c,v 1.27 1995/05/26 19:28:02 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -650,14 +650,6 @@ mediaInitFTP(Device *dev) url = getenv("ftp"); if (!url) return FALSE; - if (!strcmp(url, "other")) { - url = 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 (!url || strncmp("ftp://", url, 6)) - return FALSE; - else - variable_set2("ftp", url); - } - my_name = getenv(VAR_HOSTNAME); if (strncmp("ftp://", url, 6) != NULL) { msgConfirm("Invalid URL (`%s') passed to FTP routines!\n(must start with `ftp://')", url); diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index 3ce3555daa00..b4ee445b39eb 100644 --- a/release/sysinstall/system.c +++ b/release/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/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index 28483e057148..2baaf34385b3 100644 --- a/release/sysinstall/tcpip.c +++ b/release/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/release/sysinstall/termcap.c b/release/sysinstall/termcap.c index ea8a38a64391..ef70a75bc3a9 100644 --- a/release/sysinstall/termcap.c +++ b/release/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; diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index 3ce3555daa00..b4ee445b39eb 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 ea8a38a64391..ef70a75bc3a9 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 3d2234c1f108..6fb95f93a5fa 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 3ce3555daa00..b4ee445b39eb 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 28483e057148..2baaf34385b3 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 ea8a38a64391..ef70a75bc3a9 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;