aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Quinot <thomas@FreeBSD.org>2004-05-28 21:23:23 +0000
committerThomas Quinot <thomas@FreeBSD.org>2004-05-28 21:23:23 +0000
commitc0c63fd3c59b06301ff920b9483f3036b2bdef1b (patch)
tree6f8c169d495775e98c9de6f2466bf4e92d04b5fd /tools
parent5d9ae0a2125c1d486aa9f51bb206f9bd43a4c00a (diff)
downloadsrc-c0c63fd3c59b06301ff920b9483f3036b2bdef1b.tar.gz
src-c0c63fd3c59b06301ff920b9483f3036b2bdef1b.zip
Support for optional initialization of the configuration slice by
specifying the name of a directory to be copied there in Makefile variable CFGMASTER.
Notes
Notes: svn path=/head/; revision=129821
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/nanobsd/Makefile5
-rw-r--r--tools/tools/nanobsd/i386.diskimage8
2 files changed, 12 insertions, 1 deletions
diff --git a/tools/tools/nanobsd/Makefile b/tools/tools/nanobsd/Makefile
index 444f8f74763c..6ed6e3ecd25b 100644
--- a/tools/tools/nanobsd/Makefile
+++ b/tools/tools/nanobsd/Makefile
@@ -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
diff --git a/tools/tools/nanobsd/i386.diskimage b/tools/tools/nanobsd/i386.diskimage
index 5d21ce9dc03c..fe34af6d73ce 100644
--- a/tools/tools/nanobsd/i386.diskimage
+++ b/tools/tools/nanobsd/i386.diskimage
@@ -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