Date: Fri, 04 Jan 2002 13:54:44 -0500 From: Brian Fundakowski Feldman <green@FreeBSD.org> To: current@FreeBSD.org Subject: CD sysinstall broken (fix) Message-ID: <200201041854.g04IsiV40522@green.bikeshed.org>
next in thread | raw e-mail | index | archive | help
Sysinstall via the CD media (and probably other physical disc mediums) is
broken currently due to the devfs filesystem not being available at all
times in placesw here it is needed. I've changed the behavior in my
green_lomac branch to fix this, and would like if other people would verify
this indeed fixes the problem for them as well (I imagine it does) and does
what it should be expected to (which I also think it does).
Does this logic appear to be flawed in any cases? If all seems right, I
shall commit this to -CURRENT to unbreak CD installs.
==== //depot/user/green/lomac/usr.sbin/sysinstall/dist.c#2 (text+ko) ====
@@ -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 @@
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 @@
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,10 @@
*(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 */
==== //depot/user/green/lomac/usr.sbin/sysinstall/install.c#2 (text+ko) ====
@@ -812,6 +812,8 @@
/* 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 @@
command_sort();
command_execute();
- if (!mountfailed && !Fake)
- unmount("/mnt/dev", MNT_FORCE);
dialog_clear_norefresh();
return DITEM_SUCCESS | DITEM_RESTORE;
}
--
Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! /
green@FreeBSD.org `------------------------------'
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201041854.g04IsiV40522>
