--- /dev/null
+--- a/util/getroot.c 2010-03-06 20:51:37.000000000 +0000
++++ b/util/getroot.c 2010-05-28 19:21:57.592307313 +0100
+@@ -222,9 +222,20 @@ find_root_device (const char *dir, dev_t
+ /* Ignore any error. */
+ continue;
+
+- if (S_ISLNK (st.st_mode))
+- /* Don't follow symbolic links. */
++ if (S_ISLNK (st.st_mode)) {
++#ifdef __linux__
++ if (strcmp (dir, "mapper") == 0) {
++ /* Follow symbolic links under /dev/mapper/; the canonical name
++ may be something like /dev/dm-0, but the names under
++ /dev/mapper/ are more human-readable and so we prefer them if
++ we can get them. */
++ if (stat (ent->d_name, &st) < 0)
++ continue;
++ } else
++#endif /* __linux__ */
++ /* Don't follow other symbolic links. */
+ continue;
++ }
+
+ if (S_ISDIR (st.st_mode))
+ {
# --enable-grub-emu-usb conflicts with --enable-grub-emu-pci, emu-pci seems experimental
# - to build and install the `grub-emu' debugging utility we need to re-run build with --target=emu
# - put grub-emu to subpackage if it is fixed
-# - grub2-1.97.2-2.x86_64, grub2-1.98-0.5.x86_64 affected: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544577
-# i.e "grub-probe /" would fail if rootfs is on lvm and /dev/mapper/foo-rootfs is symlink
#
# Conditional build:
%bcond_with static # build static binaries
Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
Name: grub2
Version: 1.98
-Release: 0.5
+Release: 1
License: GPL v2
Group: Base
Source0: http://alpha.gnu.org/gnu/grub/grub-%{version}.tar.gz
Patch6: pld-mkconfigdir.patch
Patch7: grub-mkconfig-diagnostics.patch
Patch8: ppc.patch
+Patch9: grub-1.98-follow-dev-mapper-symlinks.patch
BuildRequires: autoconf >= 2.53
BuildRequires: automake >= 1:1.11.1-1
BuildRequires: bison
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
%if "%{cc_version}" < "3.4"
grep -rl -- -Wno-missing-field-initializers . | xargs sed -i -e 's,-Wno-missing-field-initializers,,'