summarylogtreecommitdiffstats
path: root/os-prober-btrfs-snapshot-detection.patch
diff options
context:
space:
mode:
authorlibrewish2021-09-12 20:30:34 +0530
committerlibrewish2021-09-12 20:30:34 +0530
commit752ceb29fd23a6c4cffbca9f65adad1cb53f4872 (patch)
treea41fd50e983356d81f724b91463f8855bae07d9a /os-prober-btrfs-snapshot-detection.patch
parent5271f23d8ac140f2db82697b645c38a41ccc78ac (diff)
downloadaur-752ceb29fd23a6c4cffbca9f65adad1cb53f4872.tar.gz
add patches from opensuse
Diffstat (limited to 'os-prober-btrfs-snapshot-detection.patch')
-rw-r--r--os-prober-btrfs-snapshot-detection.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/os-prober-btrfs-snapshot-detection.patch b/os-prober-btrfs-snapshot-detection.patch
new file mode 100644
index 00000000000..e68637e3525
--- /dev/null
+++ b/os-prober-btrfs-snapshot-detection.patch
@@ -0,0 +1,32 @@
+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)"
+