From 22eb0575f285ae9d6507f111574d41324936908d Mon Sep 17 00:00:00 2001 From: "Simon L. B. Nielsen" Date: Tue, 15 Aug 2006 21:59:33 +0000 Subject: [PATCH] Move the setup of "diskless" /etc magic files from install_etc() to a separate function which is called right after install_etc(). This makes it simpler to (ab)use nanobsd.sh as a framework to build more normal FreeBSD images where a normal /etc is used, since setup_nanobsd_etc() can just be redefined. OK'ed in principle by: phk MFC after: 1 week --- tools/tools/nanobsd/nanobsd.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index a08f04eb8557..063f4cb3b211 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -196,19 +196,6 @@ install_etc ( ) ( ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} distribution \ DESTDIR=${NANO_WORLDDIR} \ > ${MAKEOBJDIRPREFIX}/_.etc 2>&1 - ( - cd ${NANO_WORLDDIR} - - # create diskless marker file - touch etc/diskless - - # save config file for scripts - echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf - - echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab - echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab - mkdir -p cfg - ) ) install_kernel ( ) ( @@ -265,6 +252,24 @@ setup_nanobsd ( ) ( ) > ${MAKEOBJDIRPREFIX}/_.dl 2>&1 ) +setup_nanobsd_etc ( ) ( + echo "## configure nanobsd /etc" + + ( + cd ${NANO_WORLDDIR} + + # create diskless marker file + touch etc/diskless + + # save config file for scripts + echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf + + echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab + echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab + mkdir -p cfg + ) +) + prune_usr() ( # Remove all empty directories in /usr @@ -590,6 +595,7 @@ clean_world make_conf_install install_world install_etc +setup_nanobsd_etc install_kernel run_customize