[os-prober] Fix parsing grub2's initrd/linux variations, rhbz #1108344

Hedayat Vatankhah hedayat at fedoraproject.org
Sat Oct 25 16:16:05 UTC 2014


commit bbf80c8d797f36146be4c4e2862c3eb513925512
Author: Hedayat Vatankhah <hedayat.fwd at gmail.com>
Date:   Sat Oct 25 19:45:44 2014 +0330

    Fix parsing grub2's initrd/linux variations, rhbz #1108344

 os-prober-grub2-parsefix.patch |   22 ++++++++++++++++++++++
 os-prober.spec                 |    7 ++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/os-prober-grub2-parsefix.patch b/os-prober-grub2-parsefix.patch
new file mode 100644
index 0000000..0ef8bda
--- /dev/null
+++ b/os-prober-grub2-parsefix.patch
@@ -0,0 +1,22 @@
+Index: os-prober-1.58/linux-boot-probes/mounted/common/40grub2
+===================================================================
+--- os-prober-1.58.orig/linux-boot-probes/mounted/common/40grub2
++++ os-prober-1.58/linux-boot-probes/mounted/common/40grub2
+@@ -77,7 +77,7 @@ parse_grub_menu () {
+ 					ignore_item=1
+ 				fi
+ 			;;
+-			linux)
++			linux*)
+ 				# Hack alert: sed off any (hdn,n) but
+ 				# assume the kernel is on the same
+ 				# partition.
+@@ -90,7 +90,7 @@ parse_grub_menu () {
+ 					kernel="/boot$kernel"
+ 				fi
+ 			;;
+-			initrd)
++			initrd*)
+ 				initrd="$(echo "$2" | sed 's/(.*)//')"
+ 				# Initrd same.
+ 				if [ "$partition" != "$bootpart" ]; then
diff --git a/os-prober.spec b/os-prober.spec
index 1a7f7b2..fd0e990 100644
--- a/os-prober.spec
+++ b/os-prober.spec
@@ -1,6 +1,6 @@
 Name:           os-prober
 Version:        1.58
-Release:        10%{?dist}
+Release:        11%{?dist}
 Summary:        Probes disks on the system for installed operating systems
 
 Group:          System Environment/Base
@@ -25,6 +25,7 @@ Patch10:        os-prober-factor-out-logger.patch
 # To be sent upstream
 Patch11:        os-prober-factored-logger-efi-fix.patch
 Patch12:        os-prober-umount-fix.patch
+Patch13:        os-prober-grub2-parsefix.patch
 
 Requires:       udev coreutils util-linux
 Requires:       grep /bin/sed /sbin/modprobe
@@ -49,6 +50,7 @@ distributions can be added easily.
 %patch10 -p1 -b .factor-out-logger
 %patch11 -p1 -b .factor-out-logger-efi-fix
 %patch12 -p1 -b .umount-fix
+%patch13 -p1 -b .grub2-parsefix
 
 find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \;
 sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \
@@ -99,6 +101,9 @@ fi
 %{_var}/lib/%{name}
 
 %changelog
+* Sat Oct 25 2014 Hedayat Vatankhah <hedayat.fwd+rpmchlog at gmail.com> - 1.58-11
+- Fix parsing grub2's initrd/linux variations, rhbz #1108344
+
 * Mon Sep 08 2014 Peter Jones <pjones at redhat.com> - 1.58-10
 - Make os-prober output include partitions for UEFI chainloads.
   Resolves: rhbz#873207


More information about the scm-commits mailing list