From 2a190b59f2b98ceb5d8ec5066bbcc46d9a8d3ddb Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Fri, 20 Oct 1995 10:01:26 +0000 Subject: More bug fixing, make debug settable two ways, put more meat into the upgrade. --- release/sysinstall/installUpgrade.c | 26 ++++++++++++++++++-------- release/sysinstall/options.c | 10 ++++++++-- usr.sbin/sysinstall/installUpgrade.c | 26 ++++++++++++++++++-------- usr.sbin/sysinstall/options.c | 10 ++++++++-- 4 files changed, 52 insertions(+), 20 deletions(-) diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index 8d56032bfe72..bfb63c1f08d3 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: installUpgrade.c,v 1.1 1995/10/19 16:15:40 jkh Exp $ + * $Id: installUpgrade.c,v 1.2 1995/10/19 18:37:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -172,6 +172,12 @@ installUpgrade(char *str) int waitstatus; pid_t child; + if (!RunningAsInit) { + msgConfirm("You can only perform this procedure when booted off the installation\n" + "floppy."); + return RET_FAIL; + } + if (!Dists) { msgConfirm("You haven't specified any distributions yet. The upgrade procedure\n" "will only upgrade those portions of the system for which a distribution\n" @@ -202,12 +208,15 @@ installUpgrade(char *str) "risk it all and proceed with this upgrade?")) return RET_FAIL; + /* Note that we're now upgrading */ + variable_set2(SYSTEM_INSTALLED, "upgrade"); + msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" "you will be expected to *Mount* any partitions you're interested in\n" - "upgrading. Don't set the Newfs flag to `Y' on anything in the label\n" - "editor unless you're absolutely sure you know what you're doing! In\n" - "this instance, you'll be using the label editor as little more than a\n" - "fancy screen-oriented filesystem mounting utility!\n\n" + "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n" + "unless you're absolutely sure you know what you're doing! In this\n" + "instance, you'll be using the label editor as little more than a fancy\n" + "screen-oriented filesystem mounting utility, so think of it that way.\n\n" "Once you're done in the label editor, press Q to return here for the next\n" "step.\n"); @@ -217,6 +226,8 @@ installUpgrade(char *str) return RET_FAIL; } + /* Don't write out MBR info */ + variable_set2(DISK_PARTITIONED, "written"); if (diskLabelCommit(NULL) == RET_FAIL) { msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" "aborted."); @@ -250,7 +261,7 @@ installUpgrade(char *str) } if (file_readable("/kernel")) { - msgNotify("Moving old kernel to /kernel.205."); + msgNotify("Moving old kernel to /kernel.205"); if (system("chflags noschg /mnt/kernel && mv /mnt/kernel /mnt/kernel.205")) if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n" "treat this as a big problem and abort the upgrade?")) @@ -266,7 +277,7 @@ installUpgrade(char *str) } msgConfirm("The extraction process seems to have had some problems, but we got most\n" "of the essentials. We'll treat this as a warning since it may have been\n" - "a non-essential distribution which failed to load."); + "only non-essential distributions which failed to load."); } if (extractingBin) { @@ -318,7 +329,6 @@ installUpgrade(char *str) DialogActive = FALSE; if (!(child = fork())) { - int i, fd; struct termios foo; signal(SIGTTOU, SIG_IGN); diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c index 24083e819780..808b9a902249 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.15 1995/10/19 18:37:49 jkh Exp $ + * $Id: options.c,v 1.16 1995/10/20 07:02:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -70,6 +70,12 @@ resetLogo(char *str) return "[WHAP!]"; } +static char * +debugCheck(char *str) +{ + return isDebug() ? "ON" : "OFF"; +} + static char * mediaCheck(Option opt) { @@ -113,7 +119,7 @@ static Option Options[] = { { "NFS Slow", "User is using a slow PC or ethernet card", OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL }, { "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)", - OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, debugCheck }, { "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs", OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL }, { "FTP Abort", "On transfer failure, abort the installation of a distribution", diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index 8d56032bfe72..bfb63c1f08d3 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: installUpgrade.c,v 1.1 1995/10/19 16:15:40 jkh Exp $ + * $Id: installUpgrade.c,v 1.2 1995/10/19 18:37:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -172,6 +172,12 @@ installUpgrade(char *str) int waitstatus; pid_t child; + if (!RunningAsInit) { + msgConfirm("You can only perform this procedure when booted off the installation\n" + "floppy."); + return RET_FAIL; + } + if (!Dists) { msgConfirm("You haven't specified any distributions yet. The upgrade procedure\n" "will only upgrade those portions of the system for which a distribution\n" @@ -202,12 +208,15 @@ installUpgrade(char *str) "risk it all and proceed with this upgrade?")) return RET_FAIL; + /* Note that we're now upgrading */ + variable_set2(SYSTEM_INSTALLED, "upgrade"); + msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" "you will be expected to *Mount* any partitions you're interested in\n" - "upgrading. Don't set the Newfs flag to `Y' on anything in the label\n" - "editor unless you're absolutely sure you know what you're doing! In\n" - "this instance, you'll be using the label editor as little more than a\n" - "fancy screen-oriented filesystem mounting utility!\n\n" + "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n" + "unless you're absolutely sure you know what you're doing! In this\n" + "instance, you'll be using the label editor as little more than a fancy\n" + "screen-oriented filesystem mounting utility, so think of it that way.\n\n" "Once you're done in the label editor, press Q to return here for the next\n" "step.\n"); @@ -217,6 +226,8 @@ installUpgrade(char *str) return RET_FAIL; } + /* Don't write out MBR info */ + variable_set2(DISK_PARTITIONED, "written"); if (diskLabelCommit(NULL) == RET_FAIL) { msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" "aborted."); @@ -250,7 +261,7 @@ installUpgrade(char *str) } if (file_readable("/kernel")) { - msgNotify("Moving old kernel to /kernel.205."); + msgNotify("Moving old kernel to /kernel.205"); if (system("chflags noschg /mnt/kernel && mv /mnt/kernel /mnt/kernel.205")) if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n" "treat this as a big problem and abort the upgrade?")) @@ -266,7 +277,7 @@ installUpgrade(char *str) } msgConfirm("The extraction process seems to have had some problems, but we got most\n" "of the essentials. We'll treat this as a warning since it may have been\n" - "a non-essential distribution which failed to load."); + "only non-essential distributions which failed to load."); } if (extractingBin) { @@ -318,7 +329,6 @@ installUpgrade(char *str) DialogActive = FALSE; if (!(child = fork())) { - int i, fd; struct termios foo; signal(SIGTTOU, SIG_IGN); diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c index 24083e819780..808b9a902249 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.15 1995/10/19 18:37:49 jkh Exp $ + * $Id: options.c,v 1.16 1995/10/20 07:02:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -70,6 +70,12 @@ resetLogo(char *str) return "[WHAP!]"; } +static char * +debugCheck(char *str) +{ + return isDebug() ? "ON" : "OFF"; +} + static char * mediaCheck(Option opt) { @@ -113,7 +119,7 @@ static Option Options[] = { { "NFS Slow", "User is using a slow PC or ethernet card", OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL }, { "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)", - OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, debugCheck }, { "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs", OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL }, { "FTP Abort", "On transfer failure, abort the installation of a distribution", -- cgit v1.2.3