aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2016-04-09 10:53:21 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2016-04-09 10:53:21 +0000
commitb805f83da7bc5de73c53e8e4433af67260d94397 (patch)
tree3aa02bfb93bfc6388c15ea405c656197e096cd7f /tools
parentdc95d65555c8c7eb772474add8e586e634061995 (diff)
downloadsrc-b805f83da7bc5de73c53e8e4433af67260d94397.tar.gz
src-b805f83da7bc5de73c53e8e4433af67260d94397.zip
Create /usr/local/etc before filling things into it.
Only run mtree if the NANO_CUST_FILES_MTREE is nonempty Also umount the packages on non-signal failure
Notes
Notes: svn path=/head/; revision=297737
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tools/nanobsd/defaults.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 3b28b3922582..19cf887c983e 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -915,7 +915,7 @@ cust_install_files ( ) (
cd "${NANO_TOOLS}/Files"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR}
- if [ -f ${NANO_CUST_FILES_MTREE} ]; then
+ if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
fi
)
@@ -925,6 +925,7 @@ cust_install_files ( ) (
cust_pkgng ( ) (
+ mkdir -p ${NANO_WORLDDIR}/usr/local/etc
local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf"
local PKGCMD="env ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg"
@@ -956,7 +957,7 @@ cust_pkgng ( ) (
mkdir -p ${NANO_WORLDDIR}/_.p
mount -t nullfs -o noatime -o ro ${NANO_PACKAGE_DIR} ${NANO_WORLDDIR}/_.p
- trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15
+ trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT
# Install packages
todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')"