From a445e1eceba37490c38de6e02dc49f194e45cffaecd13a7f79bd715d51571b76 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 22 Jun 2014 12:37:45 +0000 Subject: [PATCH] Accepting request 238257 from home:jeff_mahoney:branches:Base:System different version that is more easily verifiable without dmraid hardware - add os-prober-call-dmraid-once.patch * fix os-prober: dmraid is called without a device list for every partition (bnc#883453) OBS-URL: https://build.opensuse.org/request/show/238257 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=43 --- os-prober-call-dmraid-once.patch | 36 ++++++++++++++++++++++++++++++++ os-prober.changes | 7 +++++++ os-prober.spec | 3 +++ 3 files changed, 46 insertions(+) create mode 100644 os-prober-call-dmraid-once.patch diff --git a/os-prober-call-dmraid-once.patch b/os-prober-call-dmraid-once.patch new file mode 100644 index 0000000..a7a0793 --- /dev/null +++ b/os-prober-call-dmraid-once.patch @@ -0,0 +1,36 @@ +From: Jeff Mahoney +Subject: os-prober: call dmraid -r *once* +References: bnc#883453 + +os-prober calls dmraid -r -c unqualifed for every partition and then greps +the result. dmraid -r -c without a device list will scan every device +on the system. Every time. The results will not differ between runs. + +This patch saves the results and performs the grep afterward. + +Signed-off-by: Jeff Mahoney +--- + os-prober | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/os-prober ++++ b/os-prober +@@ -14,11 +14,17 @@ log_output () { + fi + } + ++: >"$OS_PROBER_TMP/dmraid-map" ++DMRAID=$(type dmraid >/dev/null 2>&1 || true) ++if [ -n "$DMRAID" ]; then ++ dmraid -r -c >"$OS_PROBER_TMP/dmraid-map" ++fi ++ + on_sataraid () { + type dmraid >/dev/null 2>&1 || return 1 + local parent="${1%/*}" + local device="/dev/${parent##*/}" +- if dmraid -r -c | grep -q "$device"; then ++ if grep -q "$device" "$OS_PROBER_TMP/dmraid-map"; then + return 0 + fi + return 1 diff --git a/os-prober.changes b/os-prober.changes index 013dba5..742f403 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jun 20 20:42:01 UTC 2014 - jeffm@suse.com + +- add os-prober-call-dmraid-once.patch + * fix os-prober: dmraid is called without a device list for every + partition (bnc#883453) + ------------------------------------------------------------------- Sat May 31 20:49:32 UTC 2014 - crrodriguez@opensuse.org diff --git a/os-prober.spec b/os-prober.spec index f67400d..980fc59 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -53,6 +53,8 @@ Patch12: os-prober-dont-load-all-fs-module-and-dont-test-mount.patch Patch13: os-prober-fix-btrfs-subvol-mounted-tests.patch # PATCH-FIX-SLE: fix os-prober creates many unusuable entries on multipath disk (bnc#875327) Patch14: os-prober-skip-part-on-multipath.patch +# PATCH-FIX-SLE: fix os-prober: dmraid is called without a device list for every partition (bnc#883453) +Patch15: os-prober-call-dmraid-once.patch Requires: /bin/grep Requires: /bin/sed @@ -85,6 +87,7 @@ cp %SOURCE1 . %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 %build make %{?_smp_mflags} CC="%__cc" CFLAGS="%{optflags}"