Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Dec 2001 23:43:31 +0900
From:      Makoto Matsushita <matusita@jp.freebsd.org>
To:        jkh@winston.freebsd.org
Cc:        current@FreeBSD.ORG
Subject:   Re: PATCH: sysinstall to remove userconfig code
Message-ID:  <20011201234331Z.matusita@jp.FreeBSD.org>
In-Reply-To: <9456.1007105983@winston.freebsd.org>
References:  <matusita@jp.freebsd.org> <20011130141914A.matusita@jp.FreeBSD.org> <9456.1007105983@winston.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

jkh> Don't you want to try the devfs mount and only copy device files
jkh> if that returns an error code?

How 'bout this patch (attached below)?  I've recreate boot floppies
with this patch, then put them to:

http://people.FreeBSD.org/~matusita/5.0-CURRENT-20011121-JPSNAP_usedevfs/

-- -
Makoto `MAR' Matsushita


Index: install.c
===================================================================
RCS file: /pub/snapshots/cvsup/FreeBSD.cvs/src/usr.sbin/sysinstall/install.c,v
retrieving revision 1.309
diff -c -r1.309 install.c
*** install.c	20 Oct 2001 09:28:53 -0000	1.309
--- install.c	1 Dec 2001 13:49:27 -0000
***************
*** 857,863 ****
  int
  installFilesystems(dialogMenuItem *self)
  {
!     int i;
      Disk *disk;
      Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev;
      Device **devs;
--- 857,863 ----
  int
  installFilesystems(dialogMenuItem *self)
  {
!     int i, mountfailed;
      Disk *disk;
      Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev;
      Device **devs;
***************
*** 932,938 ****
  	    }
  	    dialog_clear_norefresh();
  	    msgNotify("Checking integrity of existing %s filesystem.", dname);
! 	    i = vsystem("fsck -y %s", dname);
  	    if (i)
  		msgConfirm("Warning: fsck returned status of %d for %s.\n"
  			   "This partition may be unsafe to use.", i, dname);
--- 932,938 ----
  	    }
  	    dialog_clear_norefresh();
  	    msgNotify("Checking integrity of existing %s filesystem.", dname);
! 	    i = vsystem("fsck_ffs -y %s", dname);
  	    if (i)
  		msgConfirm("Warning: fsck returned status of %d for %s.\n"
  			   "This partition may be unsafe to use.", i, dname);
***************
*** 949,954 ****
--- 949,969 ----
  	    msgConfirm("Unable to mount the root file system on %s!  Giving up.", dname);
  	    return DITEM_FAILURE | DITEM_RESTORE;
  	}
+ 
+ 	/* Mount devfs for other partitions to mount */
+ 	Mkdir("/mnt/dev");
+ 	if (!Fake)
+ 	    mountfailed = mount("devfs", "/mnt/dev", 0, NULL);
+ 
+ 	if (mountfailed) {
+ 	    dialog_clear_norefresh();
+ 	    msgNotify("Copying initial device files..");
+ 	    /* Copy the boot floppy's dev files */
+ 	    if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) {
+ 		msgConfirm("Couldn't clone the /dev files!");
+ 		return DITEM_FAILURE | DITEM_RESTORE;
+ 	    }
+ 	}
      }
  
      /* Now buzz through the rest of the partitions and mount them too */
***************
*** 962,974 ****
  	    msgConfirm("No chunk list found for %s!", disk->name);
  	    return DITEM_FAILURE | DITEM_RESTORE;
  	}
! 	if (RunningAsInit && root && (root->newfs || upgrade)) {
! 	    Mkdir("/mnt/dev");
! 	    if (!Fake)
! 		MakeDevDisk(disk, "/mnt/dev");
  	}
- 	else if (!RunningAsInit && !Fake)
- 	    MakeDevDisk(disk, "/dev");
  
  	for (c1 = disk->chunks->part; c1; c1 = c1->next) {
  	    if (c1->type == freebsd) {
--- 977,991 ----
  	    msgConfirm("No chunk list found for %s!", disk->name);
  	    return DITEM_FAILURE | DITEM_RESTORE;
  	}
! 	if (mountfailed) {
! 	    if (RunningAsInit && root && (root->newfs || upgrade)) {
! 		Mkdir("/mnt/dev");
! 		if (!Fake)
! 		    MakeDevDisk(disk, "/mnt/dev");
! 	    }
! 	    else if (!RunningAsInit && !Fake)
! 		MakeDevDisk(disk, "/dev");
  	}
  
  	for (c1 = disk->chunks->part; c1; c1 = c1->next) {
  	    if (c1->type == freebsd) {
***************
*** 983,989 ****
  			if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name)))
  			    command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name);
  			else
! 			    command_shell_add(tmp->mountpoint, "fsck -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
  			if (tmp->soft)
  			    command_shell_add(tmp->mountpoint, "tunefs -n enable %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
  			command_func_add(tmp->mountpoint, Mount, c2->name);
--- 1000,1006 ----
  			if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name)))
  			    command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name);
  			else
! 			    command_shell_add(tmp->mountpoint, "fsck_ffs -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
  			if (tmp->soft)
  			    command_shell_add(tmp->mountpoint, "tunefs -n enable %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
  			command_func_add(tmp->mountpoint, Mount, c2->name);
***************
*** 1015,1032 ****
  	}
      }
  
-     if (RunningAsInit) {
- 	dialog_clear_norefresh();
- 	msgNotify("Copying initial device files..");
- 	/* Copy the boot floppy's dev files */
- 	if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) {
- 	    msgConfirm("Couldn't clone the /dev files!");
- 	    return DITEM_FAILURE | DITEM_RESTORE;
- 	}
-     }
- 
      command_sort();
      command_execute();
      dialog_clear_norefresh();
      return DITEM_SUCCESS | DITEM_RESTORE;
  }
--- 1032,1041 ----
  	}
      }
  
      command_sort();
      command_execute();
+     if (!mountfailed && !Fake)
+ 	unmount("/mnt/dev", MNT_FORCE);
      dialog_clear_norefresh();
      return DITEM_SUCCESS | DITEM_RESTORE;
  }
Index: boot_crunch.conf
===================================================================
RCS file: /pub/snapshots/cvsup/FreeBSD.cvs/src/release/i386/boot_crunch.conf,v
retrieving revision 1.50
diff -c -r1.50 boot_crunch.conf
*** boot_crunch.conf	19 Nov 2001 14:43:29 -0000	1.50
--- boot_crunch.conf	21 Nov 2001 02:13:07 -0000
***************
*** 11,21 ****
  progs cpio
  
  srcdirs /usr/src/sbin
! progs dhclient fsck fsck_ffs ifconfig
  progs mount_nfs newfs route rtsol
  progs slattach tunefs
- ln fsck_ffs fsck_4.2bsd
- ln fsck_ffs fsck_ufs
  
  srcdirs /usr/src/usr.bin
  progs find minigzip sed
--- 11,19 ----
  progs cpio
  
  srcdirs /usr/src/sbin
! progs dhclient fsck_ffs ifconfig
  progs mount_nfs newfs route rtsol
  progs slattach tunefs
  
  srcdirs /usr/src/usr.bin
  progs find minigzip sed

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?20011201234331Z.matusita>