2017-03-02 09:02:03 +01:00
|
|
|
Index: os-prober/os-probes/common/50mounted-tests
|
2015-06-18 20:55:24 +02:00
|
|
|
===================================================================
|
2017-03-02 09:02:03 +01:00
|
|
|
--- os-prober.orig/os-probes/common/50mounted-tests
|
|
|
|
+++ os-prober/os-probes/common/50mounted-tests
|
|
|
|
@@ -72,9 +72,7 @@ mounted=
|
2015-06-18 20:55:24 +02:00
|
|
|
|
|
|
|
if [ "$types" = btrfs ]; then
|
|
|
|
partition="$BTRFSDEV"
|
|
|
|
-fi
|
|
|
|
-
|
|
|
|
-if type grub2-mount >/dev/null 2>&1 && \
|
|
|
|
+elif type grub2-mount >/dev/null 2>&1 && \
|
|
|
|
type grub2-probe >/dev/null 2>&1 && \
|
|
|
|
grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then
|
|
|
|
mounted=1
|
2017-03-02 09:02:03 +01:00
|
|
|
@@ -110,7 +108,11 @@ if [ "$mounted" ]; then
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
-do_unmount
|
|
|
|
+
|
|
|
|
+if [ "$types" != "btrfs" ]; then
|
|
|
|
+ do_unmount
|
|
|
|
+ exit 1
|
|
|
|
+fi
|
|
|
|
|
|
|
|
# all btrfs processing here. Handle both unmounted and
|
|
|
|
# mounted subvolumes.
|
|
|
|
@@ -125,9 +127,9 @@ if [ "$types" = btrfs ]; then
|
2015-06-18 20:55:24 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# besides regular subvols, get ro and snapshot so thet can be excluded
|
|
|
|
- subvols=$(btrfs subvolume list "$tmpmnt" | cut -d ' ' -f 9)
|
|
|
|
- rosubvols=$(btrfs subvolume list -r "$tmpmnt" | cut -d ' ' -f 9)
|
|
|
|
- sssubvols=$(btrfs subvolume list -s "$tmpmnt" | cut -d ' ' -f 14)
|
|
|
|
+ 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\>/!!)
|
|
|
|
if ! umount "$tmpmnt"; then
|
|
|
|
warn "failed to umount btrfs volume on $tmpmnt"
|
|
|
|
rmdir "$tmpmnt" || true
|