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.
This commit is contained in:
Jordan K. Hubbard 1995-05-26 20:31:02 +00:00
parent c5495a0f2e
commit a7f54e2e75
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8770
11 changed files with 56 additions and 47 deletions

View File

@ -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://<hostname>/<path>");
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;

View File

@ -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://<hostname>/<path>");
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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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://<hostname>/<path>");
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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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;