summaryrefslogtreecommitdiff
path: root/sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-28 00:37:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-28 00:37:32 +0000
commit3f81fd7097ec931ebf6d862622e6d81834483dbb (patch)
treee8381bb314f59122a26bd714f1a14993a31ab8ee /sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch
parent351bdb27fc041435144b39e022d9830c140ebd3a (diff)
sys-boot/os-prober : shamelessly take all the patches from openSUSE Factory to make it work
Diffstat (limited to 'sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch')
-rw-r--r--sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch b/sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch
new file mode 100644
index 00000000..60c9a2f3
--- /dev/null
+++ b/sys-boot/os-prober/files/os-prober-btrfs-snapshot-detection.patch
@@ -0,0 +1,31 @@
+Index: os-prober/os-probes/common/50mounted-tests
+===================================================================
+--- os-prober.orig/os-probes/common/50mounted-tests
++++ os-prober/os-probes/common/50mounted-tests
+@@ -115,6 +115,7 @@ if [ "$types" = btrfs ]; then
+ 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 ! umount "$tmpmnt"; then
+ warn "failed to umount btrfs volume on $tmpmnt"
+ rmdir "$tmpmnt" || true
+@@ -127,11 +128,13 @@ if [ "$types" = btrfs ]; then
+ found=
+ for subvol in $subvols; do
+ debug "begin btrfs processing for $UUID subvol=$subvol"
+- if echo "$rosubvols" | grep -q -x "$subvol"; then
+- continue
+- fi
+- if echo "$sssubvols" | grep -q -x "$subvol"; then
+- continue
++ if [ "$subvol" != "$defaultvol" ]; then
++ if echo "$rosubvols" | grep -q -x "$subvol"; then
++ continue
++ fi
++ if echo "$sssubvols" | grep -q -x "$subvol"; then
++ continue
++ fi
+ fi
+ mounted=
+ mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)"