File 0004-Fixed-regexps-for-matching-devices-in-device.map-and.patch of Package grub
From 6c4fa862919ab08f30504fc5dae30a2c6c44ff21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= <vpavlin@redhat.com>
Date: Mon, 29 Jul 2013 17:05:11 +0200
Subject: [PATCH 4/7] Fixed regexps for matching devices in device.map and
resolve symlinks when getting stats for block device
Resolves: rhbz#928938
---
util/grub-install.in | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/util/grub-install.in b/util/grub-install.in
index ce00022..c699413 100644
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -107,7 +107,7 @@ convert () {
-e 's%\(fd[0-9]*\)$%\1%' \
-e 's%/part[0-9]*$%/disc%' \
-e 's%\(c[0-7]d[0-9]*\).*$%\1%' \
- -e 's%\(/mapper/[[:alpha:]]\+[[:digit:]]\+\)p[[:digit:]]\+$%\1%' \
+ -e 's%\(/mapper/[[:alpha:]]\+[[:digit:]]*\)p[[:digit:]]\+$%\1%' \
-e 's%\(/mapper/isw_[[:alpha:]_]\+[[:alpha:]]\+[[:digit:]]\+\)p[[:digit:]]\+$%\1%' \
-e 's%\(/mapper/[[:alpha:]]\+_[[:alpha:]]\+\)[[:digit:]]\+$%\1%'`
tmp_part=`echo "$1" | grep -v '/mapper/control$' |
@@ -118,7 +118,7 @@ convert () {
-e 's%.*/floppy/[0-9]*$%%' \
-e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
-e 's%.*c[0-7]d[0-9]*%%' \
- -e 's%.*/mapper/[[:alpha:]]\+[[:digit:]]\+p\([[:digit:]]\+\)$%\1%' \
+ -e 's%.*/mapper/[[:alpha:]]\+[[:digit:]]*p\([[:digit:]]\+\)$%\1%' \
-e 's%.*/mapper/isw_[[:alpha:]_]\+[[:alpha:]]\+[[:digit:]]\+p\([[:digit:]]\+\)$%\1%' \
-e 's%.*/mapper/[[:alpha:]]\+_[[:alpha:]]\+\([[:digit:]]\+\)$%\1%' |
grep -v '.*/mapper/.*'`
@@ -266,7 +266,8 @@ find_real_devs () {
# Usage: stat_device file
# Find major:minor of a device node.
stat_device() {
- majmin=`stat -c "%t:%T" "$1" 2>/dev/null`
+ dev=`resolve_symlink $1`
+ majmin=`stat -c "%t:%T" "$dev" 2>/dev/null`
if test -z "$majmin"; then
echo "Could not find device for $1" 1>&2
exit 1
--
1.8.3.1