svn commit: r297737 - head/tools/tools/nanobsd

Poul-Henning Kamp phk at FreeBSD.org
Sat Apr 9 10:53:22 UTC 2016


Author: phk
Date: Sat Apr  9 10:53:21 2016
New Revision: 297737
URL: https://svnweb.freebsd.org/changeset/base/297737

Log:
  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

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==============================================================================
--- head/tools/tools/nanobsd/defaults.sh	Sat Apr  9 10:51:07 2016	(r297736)
+++ head/tools/tools/nanobsd/defaults.sh	Sat Apr  9 10:53:21 2016	(r297737)
@@ -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 }')"


More information about the svn-src-head mailing list