From owner-freebsd-small Tue Apr 24 0:37:58 2001 Delivered-To: freebsd-small@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id E75F937B424 for ; Tue, 24 Apr 2001 00:37:49 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f3O7bh809710 for ; Tue, 24 Apr 2001 01:37:48 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200104240737.f3O7bh809710@harmony.village.org> To: freebsd-small@freebsd.org Subject: Fix for current Date: Tue, 24 Apr 2001 01:37:43 -0600 From: Warner Losh Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG OK, the boot sequence is ugly, but at least it works for me. People can clean up the ugliness by redirecting things, but for now I'd like to see the ugliness. I plan on committing the following patches, unless there's an objection. If someone comes up with a cooler architecture for mdconfig, then so be it. They can commit it. These are quick fixes to get past phk's sleep 15's. Oh, these do require that one does a MAKEDEV md{0,1,2,3} in the /dev that is mounted by the diskless stuff. I also think that the mfs mounting of /etc should be optional in rc.diskless1 since that's how our embedded device runs, but I'll leave that for later. Also, 4096 is way too big for /dev. It really should be more like 300 with some "tweaks" to the disklabel. We do that in our embedded device as well. http://people.freebsd.org/~imp/rc.diskless.diff Warner P.S. The above url will be the most current one, but here's the patch right now: Index: rc.diskless1 =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/etc/rc.diskless1,v retrieving revision 1.8 diff -u -r1.8 rc.diskless1 --- rc.diskless1 2001/04/20 23:10:11 1.8 +++ rc.diskless1 2001/04/24 07:24:22 @@ -62,6 +62,13 @@ esac } +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # DEBUGGING # # set -v @@ -93,12 +100,13 @@ # Create an MFS /tmp to temporarily hold files from /etc until we # can bootstrap /etc as an MFS. -/sbin/mount_mfs -s 4096 -T qp120at dummy /tmp +mount_md 4096 /tmp 0 +chmod 1777 /tmp chkerr $? "MFS mount on /tmp" /bin/cp -Rp /etc /tmp chkerr $? "cp /etc to /tmp/etc MFS" -/sbin/mount_mfs -s 4096 -T qp120at dummy /etc +mount_md 4096 /etc 1 chkerr $? "MFS mount on /etc" /bin/chmod 755 /etc @@ -107,7 +115,7 @@ rm -rf /tmp/etc /sbin/umount /tmp - +/sbin/mdconfig -d -u 0 # Allow for override files to replace files in /etc. Use /conf/*/etc # to find the override files. First choice is default files that Index: rc.diskless2 =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/etc/rc.diskless2,v retrieving revision 1.8 diff -u -r1.8 rc.diskless2 --- rc.diskless2 2001/04/24 07:02:01 1.8 +++ rc.diskless2 2001/04/24 07:24:22 @@ -29,6 +29,13 @@ # rc.diskless2 # +mount_md() { + /sbin/mdconfig -a -t malloc -s $1 -u $3 + /sbin/disklabel -r -w md$3 auto + /sbin/newfs /dev/md$3c + /sbin/mount /dev/md$3c $2 +} + # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/rc.conf ]; then @@ -39,7 +46,7 @@ fi echo "+++ mfs_mount of /var" -mount_mfs -s ${varsize:=65536} -T qp120at dummy /var +mount_md ${varsize:=65536} /var 2 echo "+++ populate /var using /etc/mtree/BSD.var.dist" /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var @@ -65,5 +72,5 @@ # extract a list of device entries, then copy them to a writable partition (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp echo "+++ mount_mfs of /dev" -mount_mfs -s 4096 -i 512 -T qp120at dummy /dev +mount_md 4096 /dev 3 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message