]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dmsquash-live-root: squashfs in bare device
authorLuiz Angelo Daros de Luca <luizluca@gmail.com>
Wed, 11 Nov 2020 03:54:33 +0000 (00:54 -0300)
committerHarald Hoyer <harald@hoyer.xyz>
Wed, 10 Feb 2021 14:02:41 +0000 (15:02 +0100)
Check if dev in root=live:<dev> might be already the squashfs image.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
modules.d/90dmsquash-live/dmsquash-live-root.sh

index d686d2551d5a761fbe70db92d96290c508cdfd43..1cb200caae9dd829e66cbe37448b7d3720d79ece 100755 (executable)
@@ -78,7 +78,11 @@ if [ -f $livedev ]; then
     esac
     [ -e /sys/fs/$fstype ] || modprobe $fstype
 else
-    if [ "$(blkid -o value -s TYPE $livedev)" != "ntfs" ]; then
+    livedev_fstype=$(blkid -o value -s TYPE $livedev)
+    if [ "$livedev_fstype" = "squashfs" ]; then
+       # no mount needed - we've already got the LiveOS image in $livedev
+       SQUASHED=$livedev
+    elif [ "$livedev_fstype" != "ntfs" ]; then
         mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
     else
         # Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot