aboutsummaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-xmake_slackware_live.sh28
1 files changed, 18 insertions, 10 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index b3f4910..cfe4ca1 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -358,9 +358,10 @@ function cleanup() {
umount ${LIVE_ROOTDIR}/sys 2>${DBGOUT} || true
umount ${LIVE_ROOTDIR}/proc 2>${DBGOUT} || true
umount ${LIVE_ROOTDIR}/dev 2>${DBGOUT} || true
- umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+ lsof -l -n -t ${LIVE_ROOTDIR} |xargs -r kill -KILL || true
+ umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
# Need to umount the squashfs modules too:
- umount ${LIVE_WORK}/*_$$ 2>${DBGOUT} || true
+ umount -R ${LIVE_WORK}/*_$$ 2>${DBGOUT} || true
rmdir ${LIVE_ROOTDIR} 2>${DBGOUT}
rmdir ${LIVE_WORK}/*_$$ 2>${DBGOUT}
@@ -1569,7 +1570,7 @@ else
fi
# Determine additional boot parameters to be added:
-if [ -z ${KAPPEND} ]; then
+if [ -z "${KAPPEND}" ]; then
eval KAPPEND=\$KAPPEND_${LIVEDE}
fi
@@ -1604,7 +1605,7 @@ fi
if [ "$FORCE" = "YES" ]; then
echo "-- Removing old files and directories!"
umount ${LIVE_ROOTDIR}/{proc,sys,dev} 2>${DBGOUT} || true
- umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+ umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
rm -rf ${LIVE_STAGING}/${LIVEMAIN} ${LIVE_WORK} ${LIVE_ROOTDIR}
fi
@@ -1708,12 +1709,12 @@ for SPS in ${SL_SERIES} ; do
echo "${THEDATE} (${BUILDER})" > ${INSTDIR}/${MARKER}
echo "-- Installing the '${SPS}' series."
- umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+ umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
mount -t overlay -o lowerdir=${RODIRS},upperdir=${INSTDIR},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR}
# Install the package series:
install_pkgs ${SPS} ${LIVE_ROOTDIR} ${MTYPE}
- umount ${LIVE_ROOTDIR} || true
+ umount -R ${LIVE_ROOTDIR} || true
if [ "$SPS" = "a" -a "$CORE2RAM" = "NO" ] || [ "$SPS" = "${MINLIST}" ]; then
@@ -1782,7 +1783,7 @@ mkdir -p ${INSTDIR}
echo "-- Configuring the base system."
# -------------------------------------------------------------------------- #
-umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
mount -t overlay -o lowerdir=${RODIRS},upperdir=${INSTDIR},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR}
# Determine the kernel version in the Live OS:
@@ -3359,6 +3360,10 @@ if [ -x ${LIVE_ROOTDIR}/etc/cron.daily/mlocate ]; then
else
LOCATE_BIN=slocate
fi
+# Mlocate needs a mounted /proc in the chroot:
+if ! mount | grep -q 'on ${LIVE_ROOTDIR}/proc' ; then
+ mount --bind /proc ${LIVE_ROOTDIR}/proc
+fi
chroot ${LIVE_ROOTDIR} /etc/cron.daily/${LOCATE_BIN} 2>${DBGOUT}
# -----------------------------------------------------------------------------
@@ -3366,7 +3371,7 @@ chroot ${LIVE_ROOTDIR} /etc/cron.daily/${LOCATE_BIN} 2>${DBGOUT}
# -----------------------------------------------------------------------------
# Squash the configuration into its own module:
-umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
mksquashfs ${INSTDIR} ${LIVE_MOD_SYS}/0099-${DISTRO}_zzzconf-${SL_VERSION}-${SL_ARCH}.sxz -noappend -comp ${SQ_COMP} ${SQ_COMP_PARAMS}
rm -rf ${INSTDIR}/*
@@ -3386,7 +3391,7 @@ unset INSTDIR
# -----------------------------------------------------------------------------
echo "-- Preparing the system for live booting."
-umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true
+umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true
mount -t overlay -o lowerdir=${RODIRS%:*},upperdir=${LIVE_BOOT},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR}
mount --bind /proc ${LIVE_ROOTDIR}/proc
@@ -3495,8 +3500,11 @@ fi
rm -rf ${LIVE_ROOTDIR}/boot/initrd-tree
# ... and cleanup these mounts again:
+# Also, prevent a 'target is busy' error while unmounting.
+# because gpg-agent/keyboxd/scdaemon were activated and keep the mount open:
+lsof -l -n -t ${LIVE_ROOTDIR} |xargs -r kill -KILL
umount ${LIVE_ROOTDIR}/{proc,sys,dev} || true
-umount ${LIVE_ROOTDIR} || true
+umount -R ${LIVE_ROOTDIR} || true
# Paranoia:
[ ! -z "${LIVE_BOOT}" ] && rm -rf ${LIVE_BOOT}/{etc,tmp,usr,var} 1>${DBGOUT} 2>${DBGOUT}