From 3c8c807db1572baca0fe745e0ca82af83fa21072 Mon Sep 17 00:00:00 2001 From: Frederick Grose Date: Mon, 29 Apr 2019 22:06:51 -0400 Subject: [PATCH] iso-scan: Release resources on iso-scan boots with rd.live.ram Unmounting the image iso, detaching its loop device, and unmounting its parent partition can simplify installation to the parent disk. Note that programs or scripts using the /run/initramfs/live mount point will fail. --- modules.d/90dmsquash-live/apply-live-updates.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules.d/90dmsquash-live/apply-live-updates.sh b/modules.d/90dmsquash-live/apply-live-updates.sh index 3df2d4ad8..838445ef2 100755 --- a/modules.d/90dmsquash-live/apply-live-updates.sh +++ b/modules.d/90dmsquash-live/apply-live-updates.sh @@ -18,3 +18,9 @@ if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then done umount $NEWROOT/run fi +# release resources on iso-scan boots with rd.live.ram +if [ -d /run/initramfs/isoscan ] && + [ -f /run/initramfs/squashed.img -o -f /run/initramfs/rootfs.img ]; then + umount --detach-loop /run/initramfs/live + umount /run/initramfs/isoscan +fi -- 2.47.3