diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-09 14:37:12 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-09 14:37:12 +0000 |
| commit | ddd1b9fbd5bdacb0f6d3dd14911a9dcc77a3c8ea (patch) | |
| tree | 8d55b8d5c4f472e4880bfc1e0ffa4208fbf3b543 /release | |
| parent | 93a5bd9bf5a03ffcb78ff127640f75bd10b20470 (diff) | |
Notes
Diffstat (limited to 'release')
| -rw-r--r-- | release/sysinstall/dist.c | 29 | ||||
| -rw-r--r-- | release/sysinstall/ftp_strat.c | 8 | ||||
| -rw-r--r-- | release/sysinstall/help/options.hlp | 14 | ||||
| -rw-r--r-- | release/sysinstall/install.c | 18 | ||||
| -rw-r--r-- | release/sysinstall/misc.c | 16 | ||||
| -rw-r--r-- | release/sysinstall/sysinstall.h | 4 |
6 files changed, 59 insertions, 30 deletions
diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c index 369ab1428185..6b463a4345a5 100644 --- a/release/sysinstall/dist.c +++ b/release/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.36.2.33 1996/07/03 01:31:09 jkh Exp $ + * $Id: dist.c,v 1.62 1996/07/09 14:28:12 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -331,7 +331,7 @@ distExtract(char *parent, Distribution *me) { int i, status, total; int cpid, zpid, fd, fd2, chunk, numchunks; - char *path, *dist, buf[10240]; + char *path, *dist, buf[BUFSIZ]; const char *tmp; Attribs *dist_attr; WINDOW *w = savescr(); @@ -374,8 +374,10 @@ distExtract(char *parent, Distribution *me) */ fd = mediaDevice->get(mediaDevice, buf, TRUE); if (fd >= 0) { - msgNotify("Extracting %s into %s directory...", me[i].my_name, me[i].my_dir); - status = mediaExtractDist(me[i].my_dir, fd); + char *dir = root_bias(me[i].my_dir); + + msgNotify("Extracting %s into %s directory...", dist, dir); + status = mediaExtractDist(dir, fd); mediaDevice->close(mediaDevice, fd); goto done; } @@ -422,32 +424,33 @@ distExtract(char *parent, Distribution *me) if (isDebug()) msgDebug("Attempting to extract distribution from %u chunks.\n", numchunks); - /* We have one or more chunks, go pick them up */ - mediaExtractDistBegin(me[i].my_dir, &fd2, &zpid, &cpid); total = 0; - (void)gettimeofday(&start, (struct timezone *)0); + /* We have one or more chunks, go pick them up */ + mediaExtractDistBegin(root_bias(me[i].my_dir), &fd2, &zpid, &cpid); for (chunk = 0; chunk < numchunks; chunk++) { - int n, retval; + int n, chunktotal, retval; char prompt[80]; snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a'); if (isDebug()) msgDebug("trying for piece %d of %d: %s\n", chunk + 1, numchunks, buf); + chunktotal = 0; + (void)gettimeofday(&start, (struct timezone *)0); fd = mediaDevice->get(mediaDevice, buf, FALSE); if (fd < 0) { msgConfirm("failed to retreive piece file %s!\n" "Aborting the transfer", buf); goto punt; } - snprintf(prompt, 80, "Extracting %s into %s directory...", me[i].my_name, me[i].my_dir); + snprintf(prompt, 80, "Extracting %s into %s directory...", dist, root_bias(me[i].my_dir)); dialog_gauge("Progress", prompt, 8, 15, 6, 50, (int)((float)(chunk + 1) / numchunks * 100)); while (1) { int seconds; - n = read(fd, buf, sizeof buf); + n = read(fd, buf, BUFSIZ); if (n <= 0) break; - total += n; + total += n, chunktotal += n; /* Print statistics about how we're doing */ (void) gettimeofday(&stop, (struct timezone *)0); @@ -458,8 +461,8 @@ distExtract(char *parent, Distribution *me) seconds = stop.tv_sec + (stop.tv_usec / 1000000.0); if (!seconds) seconds = 1; - msgInfo("%d bytes read from distribution, chunk %d of %d, %d KBytes/second", - total, chunk + 1, numchunks, (total / seconds) / 1024); + msgInfo("%d bytes read from %s distribution, chunk %d of %d @ %.1f KBytes/second", + total, dist, chunk + 1, numchunks, (chunktotal / seconds) / 1024.0); retval = write(fd2, buf, n); if (retval != n) { mediaDevice->close(mediaDevice, fd); diff --git a/release/sysinstall/ftp_strat.c b/release/sysinstall/ftp_strat.c index 4aca09ed18cb..c476d7ad1738 100644 --- a/release/sysinstall/ftp_strat.c +++ b/release/sysinstall/ftp_strat.c @@ -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: ftp_strat.c,v 1.7.2.48 1996/07/06 02:05:54 jkh Exp $ + * $Id: ftp_strat.c,v 1.22 1996/07/09 14:28:14 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -81,16 +81,14 @@ mediaInitFTP(Device *dev) msgFatal("Missing FTP host or directory specification - something's wrong!"); user = variable_get(VAR_FTP_USER); - if (!user || !*user) { - snprintf(password, BUFSIZ, "installer@%s", variable_get(VAR_HOSTNAME)); + if (!user || !*user) login_name = "anonymous"; - } else login_name = user; if (variable_get(VAR_FTP_PASS)) strcpy(password, variable_get(VAR_FTP_PASS)); else - sprintf(password, "%s@%s", login_name, hostname); + sprintf(password, "installer@%s", variable_get(VAR_HOSTNAME)); msgNotify("Logging in as %s..", login_name); if (FtpOpen(ftp, hostname, login_name, password) != 0) { if (variable_get(VAR_NO_CONFIRM)) diff --git a/release/sysinstall/help/options.hlp b/release/sysinstall/help/options.hlp index daa927e12c1c..e8d0a18d1174 100644 --- a/release/sysinstall/help/options.hlp +++ b/release/sysinstall/help/options.hlp @@ -41,6 +41,20 @@ FTP username: Specify username and password instead of anonymous. specify the username and password with this option. +Install Root: Specify some directory other than / as your "root". + + This should be left as / unless you have a really good reason to + change it. One good reason might be if you were installing to a + disk other than your own, as might happen if you needed to prepare a + disk for another machine which couldn't load FreeBSD directly + for some reason. + + Note: If you set this option, you will only be able to install + packages if the bin distribution is also installed (usually + the case anyway) since /usr/sbin/pkg_add will otherwise not be + found after the chroot() call. + + Editor: Specify which screen editor to use. At various points during the installation it may be necessary diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index c114711b1302..43f35884f08d 100644 --- a/release/sysinstall/install.c +++ b/release/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.111 1996/07/09 07:17:03 jkh Exp $ + * $Id: install.c,v 1.112 1996/07/09 14:28:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -802,20 +802,18 @@ installFilesystems(dialogMenuItem *self) int installVarDefaults(dialogMenuItem *self) { + char *cp; + /* Set default startup options */ variable_set2(VAR_ROUTEDFLAGS, "-q"); variable_set2(VAR_RELNAME, RELEASE_NAME); variable_set2(VAR_CPIO_VERBOSITY, "high"); variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE); - if (RunningAsInit) - variable_set2(VAR_EDITOR, "/usr/bin/ee"); - else { - char *cp = getenv("EDITOR"); - - if (!cp) - cp = "/usr/bin/ee"; - variable_set2(VAR_EDITOR, cp); - } + variable_set2(VAR_INSTALL_ROOT, "/"); + cp = getenv("EDITOR"); + if (!cp) + cp = "/usr/bin/ee"; + variable_set2(VAR_EDITOR, cp); variable_set2(VAR_FTP_USER, "ftp"); variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.5FM"); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx"); diff --git a/release/sysinstall/misc.c b/release/sysinstall/misc.c index 68e33c43a59f..d26d1cbb30f3 100644 --- a/release/sysinstall/misc.c +++ b/release/sysinstall/misc.c @@ -1,7 +1,7 @@ /* * Miscellaneous support routines.. * - * $Id: misc.c,v 1.12.2.15 1996/06/26 09:32:02 jkh Exp $ + * $Id: misc.c,v 1.22 1996/07/09 14:28:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -203,6 +203,20 @@ safe_realloc(void *orig, size_t size) return ptr; } +/* Create a path biased from the VAR_INSTALL_ROOT variable (if not /) */ +char * +root_bias(char *path) +{ + static char tmp[FILENAME_MAX]; + char *cp = variable_get(VAR_INSTALL_ROOT); + + if (!strcmp(cp, "/")) + return path; + strcpy(tmp, variable_get(VAR_INSTALL_ROOT)); + strcat(tmp, path); + return tmp; +} + /* * These next routines are kind of specialized just for building string lists * for dialog_menu(). diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 5730872bca39..132b16273deb 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/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.42.2.63 1996/07/08 09:07:27 jkh Exp $ + * $Id: sysinstall.h,v 1.74 1996/07/09 14:28:22 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -102,6 +102,7 @@ #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INTERFACES "network_interfaces" +#define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" @@ -517,6 +518,7 @@ extern Boolean mediaVerify(void); extern Boolean file_readable(char *fname); extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); +extern char *root_bias(char *path); extern char *itoa(int value); extern char *string_concat(char *p1, char *p2); extern char *string_concat3(char *p1, char *p2, char *p3); |
