diff options
author | dwhite <dwhite@FreeBSD.org> | 2000-04-25 19:00:08 +0000 |
---|---|---|
committer | dwhite <dwhite@FreeBSD.org> | 2000-04-25 19:00:08 +0000 |
commit | de8b1605aeb6036cca7c2ac75630f0696977fb45 (patch) | |
tree | d98f93df8f3b287089e96e3f4f3cd2abc4b65484 /release/picobsd/build | |
parent | 5b41d2de633ed80bf0f35a9a464f08ff3f39c2da (diff) | |
download | FreeBSD-src-de8b1605aeb6036cca7c2ac75630f0696977fb45.zip FreeBSD-src-de8b1605aeb6036cca7c2ac75630f0696977fb45.tar.gz |
Commit PicoBSD mega-patch:
. Bring PicoBSD up to date with -CURRENT reality.
. Make PicoBSD smart and not spam /dev/vn0 and /mnt. Now it uses the first
unused vn device and creates a temporary mountpoint in /tmp.
. Miscellaneous build cleanups and optimizations.
Unfortunately the bridge, isp, and router floppies are too big and need
the axe treatment. The install floppy needs updating to -CURRENT. Dial and
net build and (appear to) run OK. I will be adressing these in the
near future (unless someone beats me to it :-) ).
PR: misc/17737
Submitted by: Omachonu Ogali <oogali@intranova.net>
Diffstat (limited to 'release/picobsd/build')
-rw-r--r-- | release/picobsd/build/Makefile.crunch | 14 | ||||
-rwxr-xr-x | release/picobsd/build/build | 7 | ||||
-rw-r--r-- | release/picobsd/build/crunch.inc | 1 | ||||
-rw-r--r-- | release/picobsd/build/mfs.mtree | 6 | ||||
-rwxr-xr-x | release/picobsd/build/stage1 | 49 |
5 files changed, 48 insertions, 29 deletions
diff --git a/release/picobsd/build/Makefile.crunch b/release/picobsd/build/Makefile.crunch index 81fd6a4..248b760 100644 --- a/release/picobsd/build/Makefile.crunch +++ b/release/picobsd/build/Makefile.crunch @@ -2,7 +2,7 @@ # $FreeBSD$ # SRC?=/usr/src -CRUNCHFLAGS+= -DNOPAM -DRELEASE_CRUNCH -DNOSECURE -DNOCRYPT +CRUNCHFLAGS+= -DNOPAM -DRELEASE_CRUNCH -DNOSECURE -DNOCRYPT -DNONETGRAPH -DNOIPSEC all: crunch @@ -29,16 +29,16 @@ clean: *.gz install: - cp crunch1 /mnt/stand/crunch - chmod 555 /mnt/stand/crunch + cp crunch1 ${MFS_MOUNTPOINT}/stand/crunch + chmod 555 ${MFS_MOUNTPOINT}/stand/crunch for i in `crunchgen -l crunch1.conf` ; \ do \ - ln /mnt/stand/crunch /mnt/stand/$${i}; \ + ln ${MFS_MOUNTPOINT}/stand/crunch ${MFS_MOUNTPOINT}/stand/$${i}; \ done - rm /mnt/stand/crunch + rm ${MFS_MOUNTPOINT}/stand/crunch # Install the MIB files - #mkdir -p /mnt/usr/local/share/snmp/mibs - #cp ../../net/crunch1/mibs/*.txt /mnt/usr/local/share/snmp/mibs/ + #mkdir -p ${MFS_MOUNTPOINT}/usr/local/share/snmp/mibs + #cp ../../net/crunch1/mibs/*.txt ${MFS_MOUNTPOINT}/usr/local/share/snmp/mibs/ .include <bsd.prog.mk> diff --git a/release/picobsd/build/build b/release/picobsd/build/build index 3d1fe82..872c518 100755 --- a/release/picobsd/build/build +++ b/release/picobsd/build/build @@ -73,7 +73,7 @@ set_msgs() { } -# Main build procedure. It calls another scripts (stage1) +# Main build procedure. It calls another script (stage1) main() { if [ "X${TYPE}" = "X" ] ; then @@ -101,8 +101,9 @@ main() { echo "" echo "-> ERROR in \"${i}\" script. Aborting the build process." echo -n "-> Cleaning temporary files... " - umount -f /mnt - vnconfig -u /dev/rvn0 + umount -f ${MFS_MOUNTPOINT} + rm -rf ${MFS_MOUNTPOINT} + vnconfig -u /dev/rvn${VNUM} ./clean ${TYPE} echo "Done." exit 10 diff --git a/release/picobsd/build/crunch.inc b/release/picobsd/build/crunch.inc index 17fa5a0..09ecb01 100644 --- a/release/picobsd/build/crunch.inc +++ b/release/picobsd/build/crunch.inc @@ -4,3 +4,4 @@ NOCRYPT=yes NOPAM=yes NOSECURE=yes NONETGRAPH=yes +NOIPSEC=yes diff --git a/release/picobsd/build/mfs.mtree b/release/picobsd/build/mfs.mtree index 70a2c38..d63f495 100644 --- a/release/picobsd/build/mfs.mtree +++ b/release/picobsd/build/mfs.mtree @@ -47,6 +47,12 @@ share misc .. + locale + .. + syscons + .. + nls + .. .. .. var diff --git a/release/picobsd/build/stage1 b/release/picobsd/build/stage1 index 3ad452d..2aae87e 100755 --- a/release/picobsd/build/stage1 +++ b/release/picobsd/build/stage1 @@ -8,8 +8,12 @@ set -e # abort in case of untested errors +# 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 # This function is used to trap errors and print msgs # @@ -19,14 +23,14 @@ fail() { echo "--> Error $errno code $errcode" case $errcode in 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." ;; disklabel) echo "Error while labeling ${MFS_NAME} size ${MFS_SIZE}" ;; 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}" ;; mtree) echo "Error while making hierarchy in ${MFS_MOUNTPOINT}" @@ -38,7 +42,7 @@ fail() { echo "Error while building ../${TYPE}/crunch1..." ;; vnconfig2) - echo "Error while doing vnconfig of floppy.img on /dev/rvn0..." + echo "Error while doing vnconfig of floppy.img on /dev/rvn${VNUM}..." ;; disklabel) echo "Error while doing disklabel on of floppy.img size $FLOPPY_SIZE" @@ -54,6 +58,8 @@ fail() { ;; esac echo "-> Aborting $0" + umount ${MFS_MOUNTPOINT} 2> /dev/null || true + rm -rf ${MFS_MOUNTPOINT} 2> /dev/null || true exit 10 } @@ -61,16 +67,20 @@ rm -f kernel.gz ${MFS_NAME} # cleanup... create_mfs() { 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 dd of=${MFS_NAME} if=/dev/zero count=${MFS_SIZE} bs=1k 2> /dev/null awk 'BEGIN {printf "%c%c", 85, 170}' | \ dd of=${MFS_NAME} obs=1 seek=510 conv=notrunc 2> /dev/null - 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 dd if=/boot/boot1 of=${MFS_NAME} conv=notrunc 2> /dev/null @@ -78,13 +88,13 @@ create_mfs() { # This command does weird things on 2.2.x systems. # For small image sizes, use std disktypes 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 pwd=`pwd` } @@ -146,8 +156,8 @@ populate_mfs() { (echo "-> Fixing permissions"; cd ${MFS_MOUNTPOINT}; chown -R root *) df -ik ${MFS_MOUNTPOINT} umount ${MFS_MOUNTPOINT} - fsck -p /dev/rvn0c - vnconfig -u /dev/rvn0 + fsck -p /dev/rvn${VNUM}c + vnconfig -u /dev/rvn${VNUM} } # stage2 @@ -172,17 +182,17 @@ do_floppy() { awk 'BEGIN {printf "%c%c", 85, 170}' | \ dd of=picobsd.bin obs=1 seek=510 conv=notrunc 2> /dev/null - vnconfig -c /dev/rvn0 picobsd.bin || fail $? vnconfig2 + vnconfig -c /dev/rvn${VNUM} picobsd.bin || fail $? vnconfig2 dd if=/boot/boot1 of=picobsd.bin conv=notrunc 2> /dev/null # 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/vn${VNUM}c 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} echo "==> Populating floppy filesystem..." @@ -215,7 +225,7 @@ do_floppy() { fi rm -f floppy.tree/etc/mfs\.* # mfs.rc, mfs.login.conf files="motd" - echo "-> Copying language dependent files: ${files} -> /mnt/etc ..." + echo "-> Copying language dependent files: ${files} -> ${MFS_MOUNTPOINT}/etc ..." for i in ${files} ; do cat ${BUILDDIR}/../${TYPE}/lang/${i}.${LANGUAGE} | \ sed -e "s/@VER@/${VER}/g" > floppy.tree/etc/${i} @@ -263,7 +273,8 @@ __EOF df -ik ${MFS_MOUNTPOINT} > .build.reply umount ${MFS_MOUNTPOINT} - vnconfig -u /dev/rvn0 + rm -rf ${MFS_MOUNTPOINT} + vnconfig -u /dev/rvn${VNUM} # rm kernel.gz ${MFS_NAME} } |