summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/dist.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2002-01-14 19:42:11 +0000
committergreen <green@FreeBSD.org>2002-01-14 19:42:11 +0000
commit576dbf9ef40ac9f916f377b1f8be2a85750a0dc0 (patch)
treec5a84120e2ec6cc1a498018ef3a3e749b0bb9f0c /usr.sbin/sysinstall/dist.c
parentd40b4fe11b411750f7f89f7bb5393f3d8c848f31 (diff)
downloadFreeBSD-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/dist.c')
-rw-r--r--usr.sbin/sysinstall/dist.c15
1 files changed, 14 insertions, 1 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 */
OpenPOWER on IntegriCloud