Blob Blame History Raw
From 9334a9b2d6de855a1a027a106d3976d342044257 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Wed, 11 May 2016 18:04:20 -0400
Subject: [PATCH] Do not resolve device mapper symlinks (#1300262)

Fixes an issue where os-prober used the non-guaranteed /dev/dm-# device
name rather than the guaranteed device mapper node name.

Resolves: rhbz#1300262
---
 linux-boot-probes/mounted/common/90fallback | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/linux-boot-probes/mounted/common/90fallback b/linux-boot-probes/mounted/common/90fallback
index 9ff78e1..da12b88 100755
--- a/linux-boot-probes/mounted/common/90fallback
+++ b/linux-boot-probes/mounted/common/90fallback
@@ -9,7 +9,12 @@ bootpart="$2"
 mpoint="$3"
 type="$4"
 
-mappedpartition=$(mapdevfs "$partition" 2>/dev/null) || mappedpartition="$partition"
+# Falling back to /dev/dm-# is unreliable; do not revert them
+if [ "${partition:0:12}" == "/dev/mapper/" ]; then
+        mappedpartition="${partition}"
+else
+        mappedpartition=$(mapdevfs "$partition" 2>/dev/null) || mappedpartition="$partition"
+fi
 
 exitcode=1
 for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \
-- 
2.5.5