diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-05-29 01:35:33 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-05-29 01:35:33 +0000 |
| commit | b53e8a34e61271929b3bb6bd1d96451465ab11b8 (patch) | |
| tree | 6493e7cff526fb9fcce4e4be957806af800ec38d /usr.sbin/sysinstall | |
| parent | e413a1d50e682e6c62355059509d58dde42ea679 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/sysinstall')
| -rw-r--r-- | usr.sbin/sysinstall/config.c | 5 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/dist.c | 17 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/install.c | 70 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 8 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 3 |
5 files changed, 19 insertions, 84 deletions
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 1262efa94651..85eb6858553d 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.31 1996/05/16 11:47:26 jkh Exp $ + * $Id: config.c,v 1.32 1996/05/23 16:34:24 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -432,6 +432,7 @@ configPackages(dialogMenuItem *self) msgNotify("Attempting to fetch packages/INDEX file from selected media."); fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (fd < 0) { + dialog_clear(); msgConfirm("Unable to get packages/INDEX file from selected media.\n" "This may be because the packages collection is not available at\n" "on the distribution media you've chosen (most likely an FTP site\n" @@ -439,7 +440,7 @@ configPackages(dialogMenuItem *self) "(or path to media) and try again. If your local site does not\n" "carry the packages collection, then we recommend either a CD\n" "distribution or the master distribution on ftp.freebsd.org."); - return DITEM_FAILURE; + return DITEM_FAILURE | DITEM_RESTORE; } msgNotify("Got INDEX successfully, now building packages menu.."); index_init(&top, &plist); diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 67110feb483e..297483a0295e 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.53 1996/05/23 16:34:25 jkh Exp $ + * $Id: dist.c,v 1.54 1996/05/28 23:31:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -359,12 +359,13 @@ distExtract(char *parent, Distribution *me) dist_attr = NULL; numchunks = 0; - snprintf(buf, sizeof buf, "/stand/info/%s/%s.inf", path, dist); - if (file_readable(buf)) { + snprintf(buf, sizeof buf, "%s/%s.inf", path, dist); + fd = mediaDevice->get(mediaDevice, buf, TRUE); + if (fd >= 0) { if (isDebug()) msgDebug("Parsing attributes file for distribution %s\n", dist); dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS); - if (DITEM_STATUS(attr_parse_file(dist_attr, buf)) == DITEM_FAILURE) + if (DITEM_STATUS(attr_parse(dist_attr, fd)) == DITEM_FAILURE) msgConfirm("Cannot load information file for %s distribution!\n" "Please verify that your media is valid and try again.", dist); else { @@ -375,8 +376,13 @@ distExtract(char *parent, Distribution *me) numchunks = strtol(tmp, 0, 0); } safe_free(dist_attr); + mediaDevice->close(mediaDevice, fd); + } + else if (fd == -2) { /* Hard error, can't continue */ + mediaDevice->shutdown(mediaDevice); + status = FALSE; + goto done; } - if (!numchunks) continue; @@ -519,6 +525,7 @@ distExtractAll(dialogMenuItem *self) distExtract(NULL, DistTable); if (Dists) { + buf[0] = '\0'; printSelected(buf, Dists, DistTable); dialog_clear(); msgConfirm("Couldn't extract the following distributions. This may\n" diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 82f91c9869b0..16ff83c755d6 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.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.96 1996/05/02 10:09:45 jkh Exp $ + * $Id: install.c,v 1.97 1996/05/16 11:47:30 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -455,7 +455,7 @@ installNovice(dialogMenuItem *self) configPorts(self); } - if (!msgYesNo("The FreeBSD package collection is a collection of over 300 ready-to-run\n" + if (!msgYesNo("The FreeBSD package collection is a collection of over 450 ready-to-run\n" "applications, from text editors to games to WEB servers. Would you like\n" "to browse the collection now?")) configPackages(self); @@ -522,11 +522,6 @@ installCommit(dialogMenuItem *self) return i; if (DITEM_STATUS((i = configFstab())) == DITEM_FAILURE) return i; - if (!rootExtract()) { - msgConfirm("Failed to load the ROOT distribution. Please correct\n" - "this problem and try again."); - return DITEM_FAILURE; - } } i = distExtractAll(self); @@ -827,67 +822,6 @@ copySelf(void) return TRUE; } -static Boolean loop_on_root_floppy(void); - -Boolean -rootExtract(void) -{ - int fd; - static Boolean alreadyExtracted = FALSE; - - if (alreadyExtracted) - return TRUE; - - if (mediaDevice) { - if (isDebug()) - msgDebug("Attempting to extract root image from %s\n", mediaDevice->name); - switch(mediaDevice->type) { - - case DEVICE_TYPE_FLOPPY: - alreadyExtracted = loop_on_root_floppy(); - break; - - default: - if (!mediaDevice->init(mediaDevice)) - break; - fd = mediaDevice->get(mediaDevice, "floppies/root.flp", FALSE); - if (fd < 0) { - msgConfirm("Couldn't get root image from %s!\n" - "Will try to get it from floppy.", mediaDevice->name); - mediaDevice->shutdown(mediaDevice); - alreadyExtracted = loop_on_root_floppy(); - } - else { - msgNotify("Loading root image from:\n%s", mediaDevice->name); - alreadyExtracted = mediaExtractDist("/", fd); - mediaDevice->close(mediaDevice, fd); - } - break; - } - } - else - alreadyExtracted = loop_on_root_floppy(); - return alreadyExtracted; -} - -static Boolean -loop_on_root_floppy(void) -{ - int fd; - int status = FALSE; - - while (1) { - fd = getRootFloppy(); - if (fd != -1) { - msgNotify("Extracting root floppy.."); - status = mediaExtractDist("/", fd); - close(fd); - break; - } - } - return status; -} - static void create_termcap(void) { diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index a1b94e9dd32f..30bb6f4011a3 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.24 1996/04/28 20:54:02 jkh Exp $ + * $Id: installUpgrade.c,v 1.25 1996/05/16 11:47:32 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -261,12 +261,6 @@ installUpgrade(dialogMenuItem *self) chdir("/"); systemCreateHoloshell(); - if (!rootExtract()) { - msgConfirm("Failed to load the ROOT distribution. Please correct\n" - "this problem and try again (the system will now reboot)."); - systemShutdown(1); - } - if (extractingBin) { while (!saved_etc) { saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 80344931737b..84e3738e148c 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -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: sysinstall.h,v 1.55 1996/04/28 20:54:07 jkh Exp $ + * $Id: sysinstall.h,v 1.56 1996/05/16 11:47:44 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -456,7 +456,6 @@ extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern Boolean copySelf(void); -extern Boolean rootExtract(void); /* installFinal.c */ extern int configGated(dialogMenuItem *self); |
