Date: Mon, 13 Aug 2001 12:19:32 -0700 (PDT) From: Rob Mallory <rmallory@ensemble.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/29680: picobsd in -current needs mdconfig Message-ID: <200108131919.f7DJJW454033@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 29680
>Category: misc
>Synopsis: picobsd in -current needs mdconfig
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Aug 13 12:20:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Rob Mallory
>Release: 5.0-current
>Organization:
E
>Environment:
5.0-current Aug 2001
>Description:
/src/release/picobsd/build/Makefile.conf needs $COMPILE to ref $ARCH/compile, and there is quite a bit of work to UNBLOAT the kernel,
but here is the basic patch to fix up the picobsd script to use mdconfig
instead of deprecated vnconfig.
*** picobsd Thu Jun 21 08:49:46 2001
--- picobsd_mdconfig Tue Jul 24 20:10:46 2001
***************
*** 77,87 ****
SITE=${SITE:-}
FLOPPY_SIZE=${FLOPPY_SIZE:-1440}
- NO_DEVFS=yes # DEVFS is currently broken. Always set this.
-
# Find a suitable vnode
! VNUM=`mount | awk "/vn/ { num++ } END { printf \"%d\", num }"`
! log "---> Using vn${VNUM}..."
# Location of the boot blocks (in case you want them custom-built)
boot1=/boot/boot1
--- 77,85 ----
SITE=${SITE:-}
FLOPPY_SIZE=${FLOPPY_SIZE:-1440}
# Find a suitable vnode
! VNUM=`mount | awk "/md/ { num++ } END { printf \"%d\", num }"`
! log "---> Using ${VNUM}..."
# Location of the boot blocks (in case you want them custom-built)
boot1=/boot/boot1
***************
*** 365,371 ****
log "---> Preparing kernel \"$name\" in $MY_TREE"
(cd $MY_TREE; export name SRC CONFIG # used in this makefile ;
make -v -f ${PICO_TREE}/build/Makefile.conf )
! cp -p ${SRC}/sys/compile/PICOBSD-${name}/kernel ${BUILDDIR}/kernel || \
fail $? missing_kernel
(cd ${BUILDDIR};
strip kernel
--- 363,369 ----
log "---> Preparing kernel \"$name\" in $MY_TREE"
(cd $MY_TREE; export name SRC CONFIG # used in this makefile ;
make -v -f ${PICO_TREE}/build/Makefile.conf )
! cp -p ${SRC}/sys/i386/compile/PICOBSD-${name}/kernel ${BUILDDIR}/kernel || \
fail $? missing_kernel
(cd ${BUILDDIR};
strip kernel
***************
*** 445,457 ****
# installed so you have more space on the disk...
# For small image sizes, use std disktypes
if [ ${MFS_SIZE} -lt 1024 ] ; then
! disklabel -rw vn${VNUM} fd${MFS_SIZE} || fail $? mfs_disklabel
else
! disklabel -rw vn${VNUM} auto || fail $? mfs_disklabel
fi
! newfs -i ${MFS_INODES} -m 0 -p 0 -o space /dev/rvn${VNUM}c > /dev/null
! mount /dev/vn${VNUM}c ${MFS_MOUNTPOINT} || fail $? no_mount
! log "`df /dev/vn${VNUM}c`"
}
# Populate the memory filesystem with binaries and non-variable
--- 443,455 ----
# installed so you have more space on the disk...
# For small image sizes, use std disktypes
if [ ${MFS_SIZE} -lt 1024 ] ; then
! disklabel -rw md${VNUM} fd${MFS_SIZE} || fail $? mfs_disklabel
else
! disklabel -rw md${VNUM} auto || fail $? mfs_disklabel
fi
! newfs -i ${MFS_INODES} -m 0 -p 0 -o space /dev/md${VNUM}c > /dev/null
! mount /dev/md${VNUM}c ${MFS_MOUNTPOINT} || fail $? no_mount
! log "`df /dev/md${VNUM}c`"
}
# Populate the memory filesystem with binaries and non-variable
***************
*** 480,490 ****
ln -s /dev/null ${MFS_MOUNTPOINT}/var/run/log
ln -s /etc/termcap ${MFS_MOUNTPOINT}/usr/share/misc/termcap
- if [ "${NO_DEVFS}" != "" ] ; then
- (cd ${MFS_MOUNTPOINT}/dev ; ln -s /dev/MAKEDEV ;
- ./MAKEDEV ${MY_DEVS}; rm MAKEDEV)
- fi
-
(
cd ${BUILDDIR}/crunch
log "---> Making and installing crunch1 from `pwd`..."
--- 478,483 ----
***************
*** 530,544 ****
(log "---> Fixing permissions"; cd ${MFS_MOUNTPOINT}; chown -R root . )
df -ik ${MFS_MOUNTPOINT}
umount ${MFS_MOUNTPOINT}
! fsck -p /dev/rvn${VNUM}c
! vnconfig -u vn${VNUM}
}
# free as much as possible from the vnode
free_vnode() {
umount ${MFS_MOUNTPOINT} 2> /dev/null || true
! umount /dev/vn${VNUM} 2> /dev/null || true
! vnconfig -u vn${VNUM} 2> /dev/null || true
}
final_cleanup() {
--- 523,537 ----
(log "---> Fixing permissions"; cd ${MFS_MOUNTPOINT}; chown -R root . )
df -ik ${MFS_MOUNTPOINT}
umount ${MFS_MOUNTPOINT}
! fsck -p /dev/md${VNUM}c
! mdconfig -a -t vnode -u ${VNUM}
}
# free as much as possible from the vnode
free_vnode() {
umount ${MFS_MOUNTPOINT} 2> /dev/null || true
! umount /dev/md${VNUM} 2> /dev/null || true
! mdconfig -d -u ${VNUM} 2> /dev/null || true
}
final_cleanup() {
***************
*** 555,568 ****
echo "---> fail: Error <$errno> error code <$errcode>"
case $errcode in
no_vnconfig)
! echo "Error while doing vnconfig of ${imgname} on /dev/rvn${VNUM}..."
echo " Most probably your running kernel doesn't have the vn(4) device."
;;
mfs_disklabel)
echo "Error while labeling ${MFS_NAME} size ${MFS_SIZE}"
;;
no_mount)
! echo "Error while mounting ${MFS_NAME} (/dev/vn${VNUM}c) on ${MFS_MOUNTPOINT}"
;;
mtree)
echo "Error while making hierarchy in ${MFS_MOUNTPOINT}"
--- 548,561 ----
echo "---> fail: Error <$errno> error code <$errcode>"
case $errcode in
no_vnconfig)
! echo "Error while doing vnconfig of ${imgname} on /dev/md${VNUM}..."
echo " Most probably your running kernel doesn't have the vn(4) device."
;;
mfs_disklabel)
echo "Error while labeling ${MFS_NAME} size ${MFS_SIZE}"
;;
no_mount)
! echo "Error while mounting ${MFS_NAME} (/dev/md${VNUM}c) on ${MFS_MOUNTPOINT}"
;;
mtree)
echo "Error while making hierarchy in ${MFS_MOUNTPOINT}"
***************
*** 599,605 ****
dd if=/dev/zero of=${imgname} count=${imgsize} bs=1k 2> /dev/null
dd if=${boot1} of=${imgname} conv=notrunc 2> /dev/null
! vnconfig -c -s labels vn${VNUM} ${imgname} || fail $? no_vnconfig
}
--- 592,598 ----
dd if=/dev/zero of=${imgname} count=${imgsize} bs=1k 2> /dev/null
dd if=${boot1} of=${imgname} conv=notrunc 2> /dev/null
! mdconfig -a -t vnode -u ${VNUM} -f ${imgname} || fail $? no_vnconfig
}
***************
*** 619,630 ****
log "---> Labeling floppy image"
b2=${BUILDDIR}/boot2 # modified boot2
perl -pne 's/\/boot\/loader/\/kernel\0\0\0\0\0/' ${boot2} > ${b2}
! disklabel -Brw -b ${boot1} -s ${b2} vn${VNUM} fd${FLOPPY_SIZE} || \
fail $? floppy_disklabel
! newfs -i ${FLOPPY_INODES} -m 0 -p 0 -o space /dev/vn${VNUM}c > /dev/null
! mount /dev/vn${VNUM}c ${MFS_MOUNTPOINT}
# preload kernel, compress with kgzip and copy to floppy image
(
--- 612,623 ----
log "---> Labeling floppy image"
b2=${BUILDDIR}/boot2 # modified boot2
perl -pne 's/\/boot\/loader/\/kernel\0\0\0\0\0/' ${boot2} > ${b2}
! disklabel -Brw -b ${boot1} -s ${b2} md${VNUM} fd${FLOPPY_SIZE} || \
fail $? floppy_disklabel
! newfs -i ${FLOPPY_INODES} -m 0 -p 0 -o space /dev/md${VNUM}c > /dev/null
! mount /dev/md${VNUM}c ${MFS_MOUNTPOINT}
# preload kernel, compress with kgzip and copy to floppy image
(
>How-To-Repeat:
(cd /src/release/picobsd/build; ./picobsd) in -current
>Fix:
Hopefully the patch above will provoke a few people into fixing the rest of the broken things related to picobsd in -current.
Commiting this patch sooner rather than later would be _nice_,
since I always like to base my firewall-floppy off of -current.
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108131919.f7DJJW454033>
