Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 2000 12:02:08 -0500 (EST)
From:      Omachonu Ogali <oogali@intranova.net>
To:        freebsd-small@freebsd.org
Subject:   PicoBSD Stuff
Message-ID:  <Pine.BSF.4.10.10003301200220.4105-100000@hydrant.intranova.net>

next in thread | raw e-mail | index | archive | help
It's been a while (2 weeks) since I touched PicoBSD, here's a patch I
whipped up so the 'build' script doesn't clobber the first vinum device
and '/mnt'. I'm finally cvsup'ing today so I may spit out a few more
e-mails later.

-- snip --
--- /usr/src/release/picobsd/build/build	Tue Feb  8 03:24:59 2000
+++ /usr/src/release/picobsd/build/build	Thu Mar 16 10:14:44 2000
@@ -75,3 +75,3 @@
 
-# Main build procedure. It calls another scripts (stage1)
+# Main build procedure. It calls another script (stage1)
 main() {
@@ -103,4 +103,5 @@
 	echo -n "-> Cleaning temporary files... "
-	umount -f /mnt
-	vnconfig -u /dev/rvn0
+	umount -f ${MFS_MOUNTPOINT}
+	rm -r ${MFS_MOUNTPOINT}
+	vnconfig -u /dev/rvn${VNUM}
 	./clean ${TYPE}
--- /usr/src/release/picobsd/build/crunch.inc	Tue Feb  8 03:29:18 2000
+++ /usr/src/release/picobsd/build/crunch.inc	Wed Mar 15 23:28:34 2000
@@ -6 +6,2 @@
 NONETGRAPH=yes
+NOIPSEC=yes
--- /usr/src/release/picobsd/build/mfs.mtree	Tue Feb  8 06:39:28 2000
+++ /usr/src/release/picobsd/build/mfs.mtree	Wed Mar 15 23:17:20 2000
@@ -49,2 +49,8 @@
             ..
+            locale           
+            ..
+            syscons           
+            ..
+            nls           
+            ..
         ..
--- /usr/src/release/picobsd/build/stage1	Tue Feb  8 03:25:00 2000
+++ /usr/src/release/picobsd/build/stage1	Thu Mar 16 00:39:45 2000
@@ -10,4 +10,8 @@
 
+# By default, /tmp should exist.
+#
 MFS_NAME=fs.PICOBSD
-MFS_MOUNTPOINT=/mnt
+MFS_MOUNTPOINT=`mktemp -d "/tmp/picobsd.XXXXXXXXXX"`
+export MFS_MOUNTPOINT
+
 # fail errno errcode
@@ -21,4 +25,5 @@
     no_vnconfig)
-	echo "Error while doing vnconfig of ${MFS_NAME} on /dev/rvn0..."
+	echo "Error while doing vnconfig of ${MFS_NAME} on /dev/rvn${VNUM}..."
 	echo "   Most probably your running kernel doesn't have the vn(4) device."
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -26,5 +31,8 @@
 	echo "Error while labeling ${MFS_NAME} size ${MFS_SIZE}"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
     no_mount)
-	echo "Error while mounting ${MFS_NAME} (/dev/vn0c) on ${MFS_MOUNTPOINT}"
+	echo "Error while mounting ${MFS_NAME} (/dev/vn${VNUM}c) on ${MFS_MOUNTPOINT}"
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -32,2 +40,4 @@
 	echo "Error while making hierarchy in ${MFS_MOUNTPOINT}"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -35,2 +45,4 @@
 	echo "Error while making devices in ${MFS_MOUNTPOINT}"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -38,5 +50,9 @@
 	echo "Error while building ../${TYPE}/crunch1..."
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
     vnconfig2)
-	echo "Error while doing vnconfig of floppy.img on /dev/rvn0..."
+	echo "Error while doing vnconfig of floppy.img on /dev/rvn${VNUM}..."
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -44,2 +60,4 @@
 	echo "Error while doing disklabel on of floppy.img size $FLOPPY_SIZE"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -47,2 +65,4 @@
 	echo "Error while copying compressed kernel to disk"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -50,2 +70,4 @@
 	echo "Error while copying compressed mfs image to disk"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -53,2 +75,4 @@
 	echo "-> ERROR: you must build PICOBSD${suffix} kernel first"
+	umount ${MFS_MOUNTPOINT} 2> /dev/null || true
+	rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true
 	;;
@@ -63,5 +87,9 @@
     echo "-> Preparing MFS filesystem..."
-    umount /dev/vn0 2> /dev/null || true
+    VNUM=`mount | awk "/vn/ { num++ } END { printf \"%d\", num }"`
+    export VNUM
+    echo "-> Using vn${VNUM}..."
+
+    umount /dev/vn${VNUM} 2> /dev/null || true
     umount ${MFS_MOUNTPOINT} 2> /dev/null || true
-    vnconfig -u /dev/rvn0 2> /dev/null || true
+    vnconfig -u /dev/rvn${VNUM} 2> /dev/null || true
 
@@ -72,3 +100,3 @@
 
-    vnconfig -s labels -c /dev/rvn0 ${MFS_NAME} 2>/dev/null || \
+    vnconfig -s labels -c /dev/rvn${VNUM} ${MFS_NAME} 2>/dev/null || \
 	    fail $? no_vnconfig
@@ -80,9 +108,9 @@
     if [ ${MFS_SIZE} -lt 1024 ] ; then
-	disklabel -rw /dev/rvn0 fd${MFS_SIZE} || fail $? disklabel
+	disklabel -rw /dev/rvn${VNUM} fd${MFS_SIZE} || fail $? disklabel
     else
-	disklabel -rw vn0 auto || fail $? disklabel
+	disklabel -rw vn${VNUM} auto || fail $? disklabel
     fi
 
-    newfs -i ${MFS_INODES} -m 0 -p 0 -o space /dev/rvn0c
-    mount /dev/vn0c ${MFS_MOUNTPOINT} || fail $? no_mount
+    newfs -i ${MFS_INODES} -m 0 -p 0 -o space /dev/rvn${VNUM}c
+    mount /dev/vn${VNUM}c ${MFS_MOUNTPOINT} || fail $? no_mount
 
@@ -148,4 +176,4 @@
     umount ${MFS_MOUNTPOINT}
-    fsck -p /dev/rvn0c
-    vnconfig -u /dev/rvn0
+    fsck -p /dev/rvn${VNUM}c
+    vnconfig -u /dev/rvn${VNUM}
 }
@@ -174,3 +202,3 @@
 
-    vnconfig -c /dev/rvn0 picobsd.bin || fail $? vnconfig2
+    vnconfig -c /dev/rvn${VNUM} picobsd.bin || fail $? vnconfig2
 
@@ -179,8 +207,8 @@
     # XXX todo: use a type matching floppy size.
-    disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rvn0 fd1440 || \
+    disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rvn${VNUM} fd1440 || \
 	fail $?  disklabel
 
-    newfs -i ${FLOPPY_INODES} -m 0 -p 0 -o space /dev/rvn0c
+    newfs -i ${FLOPPY_INODES} -m 0 -p 0 -o space /dev/rvn${VNUM}c
 
-    mount /dev/vn0c ${MFS_MOUNTPOINT}
+    mount /dev/vn${VNUM}c ${MFS_MOUNTPOINT}
 
@@ -217,3 +245,3 @@
     files="motd"
-    echo "-> Copying language dependent files: ${files} -> /mnt/etc ..."
+    echo "-> Copying language dependent files: ${files} -> ${MFS_MOUNTPOINT}/etc ..."
     for i in ${files} ; do
@@ -265,3 +293,3 @@
     umount ${MFS_MOUNTPOINT}
-    vnconfig -u /dev/rvn0
+    vnconfig -u /dev/rvn${VNUM}
     # rm kernel.gz ${MFS_NAME}
-- snip --

-- 
+-------------------------------------------------------------------------+
| Omachonu Ogali                                     oogali@intranova.net |
| Intranova Networking Group                 http://tribune.intranova.net |
| PGP Key ID:                                                  0xBFE60839 |
| PGP Fingerprint:       C8 51 14 FD 2A 87 53 D1  E3 AA 12 12 01 93 BD 34 |
+-------------------------------------------------------------------------+



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10003301200220.4105-100000>