summaryrefslogtreecommitdiff
path: root/sys-boot/os-prober/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-09 00:01:03 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-09 00:01:03 +0100
commita0ce545d52f231499bf9f3644493113d8af58ec9 (patch)
tree4d67c09eed0c2ae28d1317f72d7f7b08b4f6aeea /sys-boot/os-prober/files
parent5181ced3f3566a9610b85922b083c8f84f20d78f (diff)
gentoo auto-resync : 09:05:2024 - 00:01:03
Diffstat (limited to 'sys-boot/os-prober/files')
-rw-r--r--sys-boot/os-prober/files/os-prober-1.81-boot-detected-twice-v2.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/sys-boot/os-prober/files/os-prober-1.81-boot-detected-twice-v2.patch b/sys-boot/os-prober/files/os-prober-1.81-boot-detected-twice-v2.patch
new file mode 100644
index 000000000000..41e661bae86f
--- /dev/null
+++ b/sys-boot/os-prober/files/os-prober-1.81-boot-detected-twice-v2.patch
@@ -0,0 +1,57 @@
+diff --git a/common.sh b/common.sh
+index cc7a335..820caea 100644
+--- a/common.sh
++++ b/common.sh
+@@ -326,3 +326,26 @@ umount() {
+ fi
+ }
+
++list_mounts() {
++ if [ -f /proc/self/mountinfo ]; then
++ local x dev mount devs found mountinfo_placeholders
++ found=:
++
++ # mountinfo may have 10 or 11 fields depending on mount namespaces
++ if [ $(head -n1 /proc/self/mountinfo | wc -w) == 10 ]; then
++ mountinfo_placeholders="x x"
++ else
++ mountinfo_placeholders="x x x"
++ fi
++
++ while read -r x x dev x mount ${mountinfo_placeholders} fs x; do
++ if [ -L "/sys/dev/block/$dev" ]; then
++ devs="/dev/`readlink \"/sys/dev/block/$dev\" | rev | cut -d/ -f1 | rev`"
++ printf '%s %s %s\n' "$(mapdevfs "$devs")" "$mount" "$fs"
++ found="return 0"
++ fi
++ done < /proc/self/mountinfo
++ $found
++ fi
++ grep "^/dev/" /proc/mounts | parse_proc_mounts
++}
+diff --git a/linux-boot-prober b/linux-boot-prober
+index bacf219..804d9fe 100755
+--- a/linux-boot-prober
++++ b/linux-boot-prober
+@@ -17,7 +17,7 @@ bootmnt=
+ bootsv=
+ bootuuid=
+
+-grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
++list_mounts >"$OS_PROBER_TMP/mounted-map" || true
+
+ if [ -z "$1" ]; then
+ ERR=y
+diff --git a/os-prober b/os-prober
+index b76d85b..8b0c89b 100755
+--- a/os-prober
++++ b/os-prober
+@@ -128,7 +128,7 @@ done
+
+ # We need to properly canonicalize partitions with mount points and partitions
+ # used in RAID
+-grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
++list_mounts >"$OS_PROBER_TMP/mounted-map" || true
+ : >"$OS_PROBER_TMP/swaps-map"
+ if [ -f /proc/swaps ]; then
+ grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true