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
This commit is contained in:
Poul-Henning Kamp 2016-04-09 10:53:21 +00:00
parent dc95d65555
commit b805f83da7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297737

View File

@ -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 }')"