summaryrefslogtreecommitdiffstats
path: root/release/sysinstall/install.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-01-24 19:24:51 +0000
committerjkh <jkh@FreeBSD.org>1997-01-24 19:24:51 +0000
commitea4f82e353a9946587bb951abdf055807de19e85 (patch)
treedd1c8a0c2facff37bca8e7cce5cbf8da441b17ba /release/sysinstall/install.c
parent04cbebd0add1fa8f9192b002813594194b3b35e8 (diff)
downloadFreeBSD-src-ea4f82e353a9946587bb951abdf055807de19e85.zip
FreeBSD-src-ea4f82e353a9946587bb951abdf055807de19e85.tar.gz
OK, I've got two ideas to file in the "really seemed like a good idea
at the time, but on further reflection..." bucket with these changes. 1. Checking the media before frobbing the disks was a fine idea, and I wish it could have worked, but that leads to a rather difficult situation when you need to mount the media someplace and you're about to: a) Chroot away from your present root. b) Newfs the root to be. You're basically screwed since there's no place to stick the mount point where it will be found following the newfs/chroot (and eliminating the chroot in favor of just using the "root bias" feature would work great for the distributions but not the pkg_add calls done by the package installer). 2. Automatic timeout handling. I don't know why, but alarm() frequently returns no residual even when the alarm didn't go off, which defies the man page but hey, since when was that so unusual? Take out timeouts but retain the code which temporarily replaces the SIGINT handler in favor of a more media-specific handler. This way, at least, if it's hanging you can at least whap it. I think the timeout code would have been losing over *really slow* links anyway, so it's probably best that it go. This should fix NFS, tape & CDROM installs again (serves me right for getting complacent and using just the FTP installs in my testing).
Diffstat (limited to 'release/sysinstall/install.c')
-rw-r--r--release/sysinstall/install.c72
1 files changed, 16 insertions, 56 deletions
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index c42b084..a567f8b 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -227,7 +227,7 @@ installInitial(void)
}
if (chroot("/mnt") == -1) {
- msgConfirm("Unable to chroot to /mnt - this is bad!");
+ msgConfirm("Unable to chroot to %s - this is bad!", "/mnt");
return DITEM_FAILURE;
}
@@ -441,21 +441,6 @@ installExpress(dialogMenuItem *self)
if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE)
return i;
- if (!Dists) {
- dialog_clear_norefresh();
- if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists)
- return DITEM_FAILURE | DITEM_RESTORE;
- }
-
- if (!mediaDevice) {
- dialog_clear_norefresh();
- if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
- return DITEM_FAILURE | DITEM_RESTORE;
- }
-
- if (!mediaDevice->init(mediaDevice))
- return DITEM_FAILURE | DITEM_REDRAW;
-
if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) {
i |= DITEM_LEAVE_MENU;
/* Give user the option of one last configuration spree */
@@ -495,24 +480,6 @@ installNovice(dialogMenuItem *self)
if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
- while (1) {
- dialog_clear_norefresh();
- if (!dmenuOpenSimple(&MenuDistributions, FALSE))
- return DITEM_FAILURE | DITEM_RESTORE;
-
- if (Dists)
- break;
-
- if (msgYesNo("No distributions selected. Revisit the distributions menu?"))
- return DITEM_FAILURE | DITEM_RESTORE;
- }
-
- if (!mediaDevice && (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice))
- return DITEM_FAILURE | DITEM_RESTORE;
-
- if (!mediaDevice->init(mediaDevice))
- return DITEM_FAILURE | DITEM_RESTORE;
-
if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) {
dialog_clear_norefresh();
msgConfirm("Installation completed with some errors. You may wish to\n"
@@ -673,32 +640,12 @@ installCommit(dialogMenuItem *self)
Boolean need_bin;
if (!Dists) {
- if (!msgYesNo("No distributions are selected for installation! Do you\n"
- "want to do this now?")) {
- if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists)
- return DITEM_FAILURE | DITEM_RESTORE;
- }
- else
+ if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists)
return DITEM_FAILURE | DITEM_RESTORE;
}
if (!mediaDevice) {
- if (!msgYesNo("You need to select a media type first. Do you want\n"
- "to do this now?")) {
- if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
- return DITEM_FAILURE | DITEM_RESTORE;
- }
- else
- return DITEM_FAILURE | DITEM_RESTORE;
- }
-
- if (!mediaDevice->init(mediaDevice)) {
- if (!msgYesNo("Unable to initialize selected media. Would you like to\n"
- "adjust your media configuration?")) {
- if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
- return DITEM_FAILURE | DITEM_RESTORE;
- }
- else
+ if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
return DITEM_FAILURE | DITEM_RESTORE;
}
@@ -714,6 +661,19 @@ installCommit(dialogMenuItem *self)
return i;
}
+try_media:
+ if (!mediaDevice->init(mediaDevice)) {
+ if (!msgYesNo("Unable to initialize selected media. Would you like to\n"
+ "adjust your media configuration and try again?")) {
+ if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
+ return DITEM_FAILURE | DITEM_RESTORE;
+ else
+ goto try_media;
+ }
+ else
+ return DITEM_FAILURE | DITEM_RESTORE;
+ }
+
need_bin = Dists & DIST_BIN;
i = distExtractAll(self);
if (DITEM_STATUS(i) == DITEM_SUCCESS) {
OpenPOWER on IntegriCloud