os-prober/os-prober-btrfs-absolute-subvol.patch
Andrei Borzenkov d61f5aac8f Accepting request 312489 from home:michael-chang:branches:Base:System
- add os-prober-btrfs-absolute-subvol.patch
  * fix os-prober mount error, no such file or directory (bsc#931955)

OBS-URL: https://build.opensuse.org/request/show/312489
OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=56
2015-06-18 18:55:24 +00:00

29 lines
1.3 KiB
Diff

Index: os-prober-1.61/os-probes/common/50mounted-tests
===================================================================
--- os-prober-1.61.orig/os-probes/common/50mounted-tests
+++ os-prober-1.61/os-probes/common/50mounted-tests
@@ -58,9 +58,7 @@ mounted=
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
@@ -114,9 +112,9 @@ if [ "$types" = btrfs ]; then
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