From c2cb0dfbf0565424558fef067591ba43770fd8c3 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Thu, 19 Oct 1995 18:37:50 +0000 Subject: [PATCH] Sync. --- release/sysinstall/installUpgrade.c | 15 +++-------- release/sysinstall/options.c | 38 ++++++++++++++++++++++++++-- usr.sbin/sysinstall/installUpgrade.c | 15 +++-------- usr.sbin/sysinstall/options.c | 38 ++++++++++++++++++++++++++-- 4 files changed, 78 insertions(+), 28 deletions(-) diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index 15dfddf3a890..8d56032bfe72 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/sysinstall/installUpgrade.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.71.2.38 1995/10/18 05:01:55 jkh Exp $ + * $Id: installUpgrade.c,v 1.1 1995/10/19 16:15:40 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -320,20 +320,11 @@ installUpgrade(char *str) if (!(child = fork())) { int i, fd; struct termios foo; - extern int login_tty(int); - for (i = 0; i < 3; i++) - close(i); - fd = open("/dev/ttyv0", O_RDWR); - ioctl(0, TIOCSCTTY, &fd); - dup2(0, 1); - dup2(0, 2); - if (login_tty(fd) == -1) - msgDebug("Can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); - if (tcgetattr(fd, &foo) != -1) { + if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; - if (tcsetattr(fd, TCSANOW, &foo) == -1) + if (tcsetattr(0, TCSANOW, &foo) == -1) msgDebug("Unable to set the erase character.\n"); } else diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c index 0127afe8c959..28eadd5f343a 100644 --- a/release/sysinstall/options.c +++ b/release/sysinstall/options.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: options.c,v 1.13 1995/10/18 05:01:59 jkh Exp $ + * $Id: options.c,v 1.14 1995/10/19 15:55:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -70,6 +70,37 @@ resetLogo(char *str) return "[WHAP!]"; } +static char * +mediaCheck(Option opt) +{ + if (mediaDevice) { + switch(mediaDevice->type) { + case DEVICE_TYPE_UFS: + case DEVICE_TYPE_DISK: + return "File system"; + + case DEVICE_TYPE_FLOPPY: + return "Floppy"; + + case DEVICE_TYPE_FTP: + return "FTP"; + + case DEVICE_TYPE_CDROM: + return "CDROM"; + + case DEVICE_TYPE_TAPE: + return "Tape"; + + case DEVICE_TYPE_DOS: + return "DOS"; + + case DEVICE_TYPE_NFS: + return "NFS"; + } + } + return ""; +} + static Option Options[] = { { "NFS Secure", "NFS server talks only on a secure port", OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL }, @@ -97,6 +128,8 @@ static Option Options[] = { OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck }, { "Config File", "Name of default configuration file for Load command (top menu)", OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck }, +{ "Media", "The current installation media type.", + OPT_IS_FUNC, mediaGetType, MEDIA_TYPE, mediaCheck }, { "Use Defaults", "Reset all values to startup defaults", OPT_IS_FUNC, installVarDefaults, 0, resetLogo }, { NULL }, @@ -156,12 +189,13 @@ fire(Option opt) cp(NULL); } else if (opt.type == OPT_IS_VAR) { - dialog_clear(); (void)variable_get_value(opt.aux, opt.data); dialog_clear(); } if (opt.check) opt.check(opt); + clear(); + refresh(); } int diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index 15dfddf3a890..8d56032bfe72 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.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.71.2.38 1995/10/18 05:01:55 jkh Exp $ + * $Id: installUpgrade.c,v 1.1 1995/10/19 16:15:40 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -320,20 +320,11 @@ installUpgrade(char *str) if (!(child = fork())) { int i, fd; struct termios foo; - extern int login_tty(int); - for (i = 0; i < 3; i++) - close(i); - fd = open("/dev/ttyv0", O_RDWR); - ioctl(0, TIOCSCTTY, &fd); - dup2(0, 1); - dup2(0, 2); - if (login_tty(fd) == -1) - msgDebug("Can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); - if (tcgetattr(fd, &foo) != -1) { + if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; - if (tcsetattr(fd, TCSANOW, &foo) == -1) + if (tcsetattr(0, TCSANOW, &foo) == -1) msgDebug("Unable to set the erase character.\n"); } else diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c index 0127afe8c959..28eadd5f343a 100644 --- a/usr.sbin/sysinstall/options.c +++ b/usr.sbin/sysinstall/options.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: options.c,v 1.13 1995/10/18 05:01:59 jkh Exp $ + * $Id: options.c,v 1.14 1995/10/19 15:55:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -70,6 +70,37 @@ resetLogo(char *str) return "[WHAP!]"; } +static char * +mediaCheck(Option opt) +{ + if (mediaDevice) { + switch(mediaDevice->type) { + case DEVICE_TYPE_UFS: + case DEVICE_TYPE_DISK: + return "File system"; + + case DEVICE_TYPE_FLOPPY: + return "Floppy"; + + case DEVICE_TYPE_FTP: + return "FTP"; + + case DEVICE_TYPE_CDROM: + return "CDROM"; + + case DEVICE_TYPE_TAPE: + return "Tape"; + + case DEVICE_TYPE_DOS: + return "DOS"; + + case DEVICE_TYPE_NFS: + return "NFS"; + } + } + return ""; +} + static Option Options[] = { { "NFS Secure", "NFS server talks only on a secure port", OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL }, @@ -97,6 +128,8 @@ static Option Options[] = { OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck }, { "Config File", "Name of default configuration file for Load command (top menu)", OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck }, +{ "Media", "The current installation media type.", + OPT_IS_FUNC, mediaGetType, MEDIA_TYPE, mediaCheck }, { "Use Defaults", "Reset all values to startup defaults", OPT_IS_FUNC, installVarDefaults, 0, resetLogo }, { NULL }, @@ -156,12 +189,13 @@ fire(Option opt) cp(NULL); } else if (opt.type == OPT_IS_VAR) { - dialog_clear(); (void)variable_get_value(opt.aux, opt.data); dialog_clear(); } if (opt.check) opt.check(opt); + clear(); + refresh(); } int