From owner-freebsd-current Sat Dec 1 6:44: 9 2001 Delivered-To: freebsd-current@freebsd.org Received: from castle.jp.freebsd.org (castle.jp.FreeBSD.org [210.226.20.15]) by hub.freebsd.org (Postfix) with ESMTP id A536C37B423 for ; Sat, 1 Dec 2001 06:43:39 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id XAA19260; Sat, 1 Dec 2001 23:43:33 +0900 (JST) (envelope-from matusita@jp.FreeBSD.org) Cc: current@FreeBSD.ORG In-Reply-To: <9456.1007105983@winston.freebsd.org> References: <20011130141914A.matusita@jp.FreeBSD.org> <9456.1007105983@winston.freebsd.org> X-User-Agent: Mew/1.94.2 XEmacs/21.5 (alfalfa) X-FaceAnim: (-O_O-)(O_O- )(_O- )(O- )(- -)( -O)( -O_)( -O_O)(-O_O-) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Dispatcher: imput version 20000228(IM140) Lines: 187 From: Makoto Matsushita To: jkh@winston.freebsd.org Subject: Re: PATCH: sysinstall to remove userconfig code Date: Sat, 01 Dec 2001 23:43:31 +0900 Message-Id: <20011201234331Z.matusita@jp.FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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