From 51b36f56d86825b308c0a32e7cd35ca73a91df7d Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Wed, 11 Nov 2020 00:54:33 -0300 Subject: [PATCH] dmsquash-live-root: squashfs in bare device Check if dev in root=live: might be already the squashfs image. Signed-off-by: Luiz Angelo Daros de Luca --- modules.d/90dmsquash-live/dmsquash-live-root.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh index d686d255..1cb200ca 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh @@ -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