Support for optional initialization of the configuration slice by

specifying the name of a directory to be copied there in Makefile
variable CFGMASTER.
This commit is contained in:
Thomas Quinot 2004-05-28 21:23:23 +00:00
parent 5d9ae0a212
commit c0c63fd3c5
2 changed files with 12 additions and 1 deletions

View File

@ -28,6 +28,10 @@ WD?= ${.OBJDIR}/_.w
# contents of the image filesystems.
#CUSTOMIZE?= ${.CURDIR}/somescript.sh
# Set this to the name of a directory used to populate the
# configuration slice.
#CFGMASTER?= ${.CURDIR}/cfgmaster
#
# The final resulting image is in ${.OBJDIR}/_.i and the single slice
# image in ${.OBJDIR}/_.i.s1
@ -146,6 +150,7 @@ _.md: _.cs
${SC} \
${DATASLICE} \
${WD} ${.OBJDIR}/_.i \
${CFGMASTER}
> _.md.tmp 2>&1
mv _.mtree.tmp _.mtree
mv _.md.tmp _.md

View File

@ -8,7 +8,7 @@
#
# Called as:
#
# ${.CURDIR}/i386.diskimage $SECTS $HD $SC $DATASLICE ${.OBJDIR}/_.w ${.OBJDIR}/_.i
# ${.CURDIR}/i386.diskimage $SECTS $HD $SC $DATASLICE ${.OBJDIR}/_.w ${.OBJDIR}/_.i [ ${.CURDIR}/cfgmaster ]
#
# XXX: newfs params.
@ -20,6 +20,7 @@ SC=$3
DATASLICE=$4
WD=$5
IMG=$6
CFGMASTER=$7
TMPFILE0=`mktemp -t nanobsd`
TMPFILE1=`mktemp -t nanobsd`
@ -48,6 +49,11 @@ mount /dev/${MD}s1a ${TMPMNT}
(cd ${WD} && find . -print | cpio -dump ${TMPMNT}) || true
df ${TMPMNT}
umount ${TMPMNT}
if [ -d "${CFGMASTER}" ]; then
mount /dev/${MD}s3 ${TMPMNT}
( cd ${CFGMASTER} && find . -print | cpio -dumpl ${TMPMNT} )
umount ${TMPMNT}
fi
dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k
dd if=/dev/${MD} of=${IMG} bs=64k
dd if=/dev/${MD}s1 of=${IMG}.s1 bs=64k