]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iso-scan: Release resources on iso-scan boots with rd.live.ram
authorFrederick Grose <fgrose@sugarlabs.org>
Tue, 30 Apr 2019 02:06:51 +0000 (22:06 -0400)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 25 Oct 2019 09:35:15 +0000 (11:35 +0200)
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

index 3df2d4ad865df98bb4d415428c3f0d53456ddabe..838445ef28bb9ad6d7ab5fc3820b03ff5fc5a64a 100755 (executable)
@@ -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