forked from pool/os-prober
Dirk Mueller
5abb83d861
- Don't hard require btrfsprogs by downgrading it to suggests (boo#1118279) * os-prober-make-btrfsprogs-optional.patch OBS-URL: https://build.opensuse.org/request/show/657082 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=91
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
Index: os-prober-1.76/os-probes/common/50mounted-tests
|
|
===================================================================
|
|
--- os-prober-1.76.orig/os-probes/common/50mounted-tests
|
|
+++ os-prober-1.76/os-probes/common/50mounted-tests
|
|
@@ -151,11 +151,20 @@ if [ "$types" = btrfs ]; then
|
|
rmdir "$tmpmnt" || true
|
|
exit 1
|
|
fi
|
|
- # besides regular subvols, get ro and snapshot so thet can be excluded
|
|
- subvols=$(btrfs subvolume list -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\<FS_TREE\>/!!)
|
|
- rosubvols=$(btrfs subvolume list -r -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\<FS_TREE\>/!!)
|
|
- sssubvols=$(btrfs subvolume list -s -a "$tmpmnt" | cut -d ' ' -f 14 | sed -e s!^\<FS_TREE\>/!!)
|
|
- defaultvol=$(btrfs subvolume get-default "$tmpmnt" | cut -d ' ' -f 9)
|
|
+
|
|
+ if type btrfs >/dev/null 2>&1; then
|
|
+ # besides regular subvols, get ro and snapshot so thet can be excluded
|
|
+ subvols=$(btrfs subvolume list -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\<FS_TREE\>/!!)
|
|
+ rosubvols=$(btrfs subvolume list -r -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\<FS_TREE\>/!!)
|
|
+ sssubvols=$(btrfs subvolume list -s -a "$tmpmnt" | cut -d ' ' -f 14 | sed -e s!^\<FS_TREE\>/!!)
|
|
+ defaultvol=$(btrfs subvolume get-default "$tmpmnt" | cut -d ' ' -f 9)
|
|
+ else
|
|
+ subvols=""
|
|
+ rosubvols=""
|
|
+ sssubvols=""
|
|
+ defaultvol=""
|
|
+ fi
|
|
+
|
|
if ! umount "$tmpmnt"; then
|
|
warn "failed to umount btrfs volume on $tmpmnt"
|
|
rmdir "$tmpmnt" || true
|