diff options
author | green <green@FreeBSD.org> | 2002-01-14 19:42:11 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2002-01-14 19:42:11 +0000 |
commit | 576dbf9ef40ac9f916f377b1f8be2a85750a0dc0 (patch) | |
tree | c5a84120e2ec6cc1a498018ef3a3e749b0bb9f0c /usr.sbin/sysinstall | |
parent | d40b4fe11b411750f7f89f7bb5393f3d8c848f31 (diff) | |
download | FreeBSD-src-576dbf9ef40ac9f916f377b1f8be2a85750a0dc0.zip FreeBSD-src-576dbf9ef40ac9f916f377b1f8be2a85750a0dc0.tar.gz |
Unbreak installation for the CD-ROM and possiblhy other media types.
Obtained from: LOMAC project
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/dist.c | 15 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 15f4321..1e41dc1 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -35,6 +35,8 @@ */ #include "sysinstall.h" +#include <sys/param.h> +#include <sys/mount.h> #include <sys/time.h> #include <signal.h> #include <libutil.h> @@ -544,7 +546,7 @@ check_for_interrupt(void) static Boolean distExtract(char *parent, Distribution *me) { - int i,j, status, total, intr; + int i,j, status, total, intr, unmounted_dev; int cpid, zpid, fd2, chunk, numchunks; char *path, *dist, buf[300000]; const char *tmp; @@ -684,6 +686,12 @@ distExtract(char *parent, Distribution *me) total = 0; (void)gettimeofday(&start, (struct timezone *)0); + if (me[i].my_bit == DIST_BIN && RunningAsInit && !Fake) { + unmounted_dev = 1; + unmount("/dev", MNT_FORCE); + } else + unmounted_dev = 0; + /* We have one or more chunks, initialize unpackers... */ mediaExtractDistBegin(root_bias(me[i].my_dir), &fd2, &zpid, &cpid); @@ -810,6 +818,11 @@ distExtract(char *parent, Distribution *me) *(me[i].my_mask) &= ~(me[i].my_bit); else continue; + if (unmounted_dev) { + (void)mount("devfs", "/dev", 0, NULL); + unmounted_dev = 0; + } + } } properties_free(dist_attr); sigaction(SIGINT, &old, NULL); /* Restore signal handler */ diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 108064f..d2f563d 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -812,6 +812,8 @@ installFixupBin(dialogMenuItem *self) /* BOGON #1: Resurrect /dev after bin distribution screws it up */ dialog_clear_norefresh(); msgNotify("Remaking all devices.. Please wait!"); + if (!Fake) + (void)unmount("/dev", MNT_FORCE); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE | DITEM_RESTORE; @@ -1070,8 +1072,6 @@ installFilesystems(dialogMenuItem *self) command_sort(); command_execute(); - if (!mountfailed && !Fake) - unmount("/mnt/dev", MNT_FORCE); dialog_clear_norefresh(); return DITEM_SUCCESS | DITEM_RESTORE; } |