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.
master
Frederick Grose 2019-04-29 22:06:51 -04:00 committed by Harald Hoyer
parent 78efd6988e
commit 3c8c807db1
1 changed files with 6 additions and 0 deletions

View File

@ -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