]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dmsquash-live): allow other fstypes
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Sat, 17 Dec 2022 01:18:46 +0000 (01:18 +0000)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 26 Jun 2023 07:37:19 +0000 (09:37 +0200)
Use det_fs to determine fstype and provide fallback instead of
just calling blkid.

Many other dracut modules (e.g. fs-lib, btrfs, mdraid) are already
using det_fs to determine fstype.

modules.d/90dmsquash-live/dmsquash-live-root.sh

index a98e258c26a4cc7d1ef9d6612d2d6a97419bba1f..e9434c9343791b944b4ca92ed2b402e69d4b72ad 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+type det_fs > /dev/null 2>&1 || . /lib/fs-lib.sh
 
 command -v unpack_archive > /dev/null || . /lib/img-lib.sh
 
@@ -61,7 +62,7 @@ get_check_dev() {
 # Find the right device to run check on
 check_dev=$(get_check_dev "$livedev")
 # CD/DVD media check
-[ -b "$check_dev" ] && fs=$(blkid -s TYPE -o value "$check_dev")
+[ -b "$check_dev" ] && fs=$(det_fs "$check_dev")
 if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
     check="yes"
 fi
@@ -110,7 +111,7 @@ if [ -f "$livedev" ]; then
     esac
     [ -e /sys/fs/"$fstype" ] || modprobe "$fstype"
 else
-    livedev_fstype=$(blkid -o value -s TYPE "$livedev")
+    livedev_fstype=$(det_fs "$livedev")
     if [ "$livedev_fstype" = "squashfs" ]; then
         # no mount needed - we've already got the LiveOS image in $livedev
         SQUASHED=$livedev