summaryrefslogtreecommitdiff
path: root/sys-boot/os-prober/files/os-prober-btrfs-multiple-device.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-multiple-device.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-multiple-device.patch')
-rw-r--r--sys-boot/os-prober/files/os-prober-btrfs-multiple-device.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys-boot/os-prober/files/os-prober-btrfs-multiple-device.patch b/sys-boot/os-prober/files/os-prober-btrfs-multiple-device.patch
new file mode 100644
index 00000000..8da09a1d
--- /dev/null
+++ b/sys-boot/os-prober/files/os-prober-btrfs-multiple-device.patch
@@ -0,0 +1,35 @@
+Index: os-prober-1.76/os-prober
+===================================================================
+--- os-prober-1.76.orig/os-prober
++++ os-prober-1.76/os-prober
+@@ -161,6 +161,15 @@ fi
+
+ : >"$OS_PROBER_TMP/btrfs-vols"
+
++btrfsrootdev=$(sed -n -e 's!\([^\s]\+\)\s\+\(/\|/target/boot\|/target\)\s\+btrfs!\1!p;ta;b;:a;q' "$OS_PROBER_TMP/mounted-map")
++if [ -n "$btrfsrootdev" ] ; then
++ if btrfsrootdev="$(mapdevfs "$btrfsrootdev")"; then
++ btrfsrootdevuuid=$(blkid -o value -s UUID "$btrfsrootdev")
++ debug "btrfs is mounted as root, uuid: $btrfsrootdevuuid"
++ echo "$btrfsrootdevuuid" >>"$OS_PROBER_TMP/btrfs-vols"
++ fi
++fi
++
+ for partition in $(partitions); do
+ if ! mapped="$(mapdevfs "$partition")"; then
+ log "Device '$partition' does not exist; skipping"
+@@ -183,13 +192,9 @@ for partition in $(partitions); do
+ # be handled by 50mounted-tests so we can do a subvol only once.
+ type=$(blkid -o value -s TYPE $mapped || true)
+ if [ "$type" = btrfs ]; then
+- mpoint=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2)
+- mpoint="$(unescape_mount "$mpoint")"
+- if [ "$mpoint" = "/target/boot" ] || [ "$mpoint" = "/target" ] || [ "$mpoint" = "/" ]; then
+- continue
+- fi
+ uuid=$(blkid -o value -s UUID $mapped)
+ if grep -q "^$uuid" "$OS_PROBER_TMP/btrfs-vols" ; then
++ debug "skipped btrfs partition=$partition uuid=$uuid"
+ continue
+ fi
+ debug "btrfs volume uuid=$uuid partition=$partition"