summarylogtreecommitdiffstats
path: root/os-prober-skip-part-on-multipath.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-skip-part-on-multipath.patch
parent5271f23d8ac140f2db82697b645c38a41ccc78ac (diff)
downloadaur-752ceb29fd23a6c4cffbca9f65adad1cb53f4872.tar.gz
add patches from opensuse
Diffstat (limited to 'os-prober-skip-part-on-multipath.patch')
-rw-r--r--os-prober-skip-part-on-multipath.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/os-prober-skip-part-on-multipath.patch b/os-prober-skip-part-on-multipath.patch
new file mode 100644
index 000000000000..8f126b785f88
--- /dev/null
+++ b/os-prober-skip-part-on-multipath.patch
@@ -0,0 +1,43 @@
+Index: os-prober-1.61/os-prober
+===================================================================
+--- os-prober-1.61.orig/os-prober
++++ os-prober-1.61/os-prober
+@@ -23,6 +23,28 @@
+ fi
+ return 1
+ }
++mp_disks="UNDEF"
++on_multipath () {
++ type multipath >/dev/null 2>&1 || return 1
++ local parent="${1%/*}"
++ local device="${parent##*/}"
++
++ if [ "$mp_disks" = "UNDEF" ]; then
++ mp_disks=`multipath -d -l | sed -n -e 's/^.\+[0-9]\+:[0-9]\+:[0-9]\+:[0-9]\+ \([^ ]\+\) .*/\1/p'`
++ fi
++
++ if [ -z "$mp_disks" ]; then
++ return 1
++ fi
++
++ for i in $mp_disks; do
++ if [ "$device" = "$i" ]; then
++ debug "$1: part of multipath disk $i"
++ return 0
++ fi
++ done
++ return 1
++}
+
+ partitions () {
+ os_name="$(uname -s)"
+@@ -31,7 +54,7 @@ partitions () {
+ # Serial ATA RAID disk.
+ for part in /sys/block/*/*[0-9]; do
+ if [ -f "$part/start" ] && \
+- [ ! -f "$part/whole_disk" ] && ! on_sataraid $part; then
++ [ ! -f "$part/whole_disk" ] && ! on_sataraid $part && ! on_multipath $part; then
+ name="$(echo "${part##*/}" | sed 's,[!.],/,g')"
+ if [ -e "/dev/$name" ]; then
+ echo "/dev/$name"
+