[grubby/f16] fix the Loading... message when installing a new kernel (#737203)

Adam Williamson adamwill at fedoraproject.org
Thu Dec 8 20:27:46 UTC 2011


commit 0950b4c2e7b3a9609693a94cc5479871f4082bad
Author: Adam Williamson <awilliam at redhat.com>
Date:   Thu Dec 8 12:27:18 2011 -0800

    fix the Loading... message when installing a new kernel (#737203)

 ...-Loading.-messages-to-the-new-kernel-vers.patch |  133 ++++++++++++++++++++
 grubby.spec                                        |   10 ++-
 2 files changed, 142 insertions(+), 1 deletions(-)
---
diff --git a/0001-Update-echo-Loading.-messages-to-the-new-kernel-vers.patch b/0001-Update-echo-Loading.-messages-to-the-new-kernel-vers.patch
new file mode 100644
index 0000000..af128d4
--- /dev/null
+++ b/0001-Update-echo-Loading.-messages-to-the-new-kernel-vers.patch
@@ -0,0 +1,133 @@
+From 4bb88f93e6c7cf432e354a164fce8743794a84a5 Mon Sep 17 00:00:00 2001
+From: Mads Kiilerich <mads at kiilerich.com>
+Date: Thu, 8 Dec 2011 11:49:35 -0800
+Subject: [PATCH 331/331] Update "echo 'Loading..." messages to the new kernel
+ version
+
+grub2-mkconfig will create lines like:
+        echo    'Loading Linux 3.1.0-0.rc6.git0.0.fc16.x86_64 ...'
+- depending on the content of /etc/default/grub.
+
+grubby would recognize these lines and replace them with lines with the right
+version number such as:
+	echo 'Loading Fedora (3.1.0-0.rc6.git0.0.fc16.x86_64)'
+
+these lines were however not recognized by grubby and would not be updated on
+next kernel update when this entry would be used as template.
+
+With this patch grubby will no longer look for a specific title but patch any
+"echo 'Loading" line immediately before the kernel line.
+
+Signed-off-by: Adam Williamson <awilliam at redhat.com>
+---
+ grubby.c                |    5 +++--
+ test/grub2.1            |    4 ++--
+ test/results/add/g2-1.1 |    4 ++--
+ test/results/add/g2-1.2 |    4 ++--
+ test/results/add/g2-1.3 |    4 ++--
+ 5 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/grubby.c b/grubby.c
+index 38ca9ac..7221372 100644
+--- a/grubby.c
++++ b/grubby.c
+@@ -2960,9 +2960,10 @@ int addNewKernel(struct grubConfig * config, struct singleEntry * template,
+ 		}
+ 	    } else if (tmplLine->type == LT_ECHO) {
+ 		    requote(tmplLine, config->cfi);
++		    static const char *prefix = "'Loading ";
+ 		    if (tmplLine->numElements > 1 &&
+-			    strstr(tmplLine->elements[1].item, "'Loading Linux ")) {
+-			char *prefix = "'Loading ";
++			    strstr(tmplLine->elements[1].item, prefix) &&
++			    masterLine->next && masterLine->next->type == LT_KERNEL) {
+ 			char *newTitle = malloc(strlen(prefix) +
+ 						strlen(newKernelTitle) + 2);
+ 
+diff --git a/test/grub2.1 b/test/grub2.1
+index 242983c..fcf053a 100644
+--- a/test/grub2.1
++++ b/test/grub2.1
+@@ -36,14 +36,14 @@ set timeout=5
+ ### END /etc/grub.d/00_header ###
+ 
+ ### BEGIN /etc/grub.d/10_linux ###
+-menuentry 'Linux, with Linux 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
++menuentry 'Linux, with Fedora 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
+ 	load_video
+ 	set gfxpayload=keep
+ 	insmod part_msdos
+ 	insmod ext2
+ 	set root='(hd0,msdos1)'
+ 	search --no-floppy --fs-uuid --set=root df0170c9-7d05-415c-bbd1-d4d503ba0eed
+-	echo	'Loading Linux 2.6.38.8-32.fc15.x86_64 ...'
++	echo	'Loading Fedora 2.6.38.8-32.fc15.x86_64 ...'
+ 	linux	/vmlinuz-2.6.38.8-32.fc15.x86_64 root=/dev/mapper/vg_pjones5-lv_root ro quiet rhgb
+ 	echo	'Loading initial ramdisk ...'
+ 	initrd	/initramfs-2.6.38.8-32.fc15.x86_64.img
+diff --git a/test/results/add/g2-1.1 b/test/results/add/g2-1.1
+index a08d01d..ea17971 100644
+--- a/test/results/add/g2-1.1
++++ b/test/results/add/g2-1.1
+@@ -48,14 +48,14 @@ menuentry 'title' --class gnu-linux --class gnu --class os {
+ 	echo 'Loading initial ramdisk ...'
+ 	initrd	/new-initrd
+ }
+-menuentry 'Linux, with Linux 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
++menuentry 'Linux, with Fedora 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
+ 	load_video
+ 	set gfxpayload=keep
+ 	insmod part_msdos
+ 	insmod ext2
+ 	set root='(hd0,msdos1)'
+ 	search --no-floppy --fs-uuid --set=root df0170c9-7d05-415c-bbd1-d4d503ba0eed
+-	echo	'Loading Linux 2.6.38.8-32.fc15.x86_64 ...'
++	echo	'Loading Fedora 2.6.38.8-32.fc15.x86_64 ...'
+ 	linux	/vmlinuz-2.6.38.8-32.fc15.x86_64 root=/dev/mapper/vg_pjones5-lv_root ro quiet rhgb
+ 	echo	'Loading initial ramdisk ...'
+ 	initrd	/initramfs-2.6.38.8-32.fc15.x86_64.img
+diff --git a/test/results/add/g2-1.2 b/test/results/add/g2-1.2
+index 9797b78..b1e96c6 100644
+--- a/test/results/add/g2-1.2
++++ b/test/results/add/g2-1.2
+@@ -48,14 +48,14 @@ menuentry 'title' --class gnu-linux --class gnu --class os {
+ 	echo 'Loading initial ramdisk ...'
+ 	initrd	/new-initrd
+ }
+-menuentry 'Linux, with Linux 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
++menuentry 'Linux, with Fedora 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
+ 	load_video
+ 	set gfxpayload=keep
+ 	insmod part_msdos
+ 	insmod ext2
+ 	set root='(hd0,msdos1)'
+ 	search --no-floppy --fs-uuid --set=root df0170c9-7d05-415c-bbd1-d4d503ba0eed
+-	echo	'Loading Linux 2.6.38.8-32.fc15.x86_64 ...'
++	echo	'Loading Fedora 2.6.38.8-32.fc15.x86_64 ...'
+ 	linux	/vmlinuz-2.6.38.8-32.fc15.x86_64 root=/dev/mapper/vg_pjones5-lv_root ro quiet rhgb
+ 	echo	'Loading initial ramdisk ...'
+ 	initrd	/initramfs-2.6.38.8-32.fc15.x86_64.img
+diff --git a/test/results/add/g2-1.3 b/test/results/add/g2-1.3
+index 89f01ee..8c3a2f6 100644
+--- a/test/results/add/g2-1.3
++++ b/test/results/add/g2-1.3
+@@ -47,14 +47,14 @@ menuentry 'title' --class gnu-linux --class gnu --class os {
+ 	linux	/new-kernel.img root=/dev/mapper/vg_pjones5-lv_root ro quiet rhgb
+ 	echo 'Loading initial ramdisk ...'
+ }
+-menuentry 'Linux, with Linux 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
++menuentry 'Linux, with Fedora 2.6.38.8-32.fc15.x86_64' --class gnu-linux --class gnu --class os {
+ 	load_video
+ 	set gfxpayload=keep
+ 	insmod part_msdos
+ 	insmod ext2
+ 	set root='(hd0,msdos1)'
+ 	search --no-floppy --fs-uuid --set=root df0170c9-7d05-415c-bbd1-d4d503ba0eed
+-	echo	'Loading Linux 2.6.38.8-32.fc15.x86_64 ...'
++	echo	'Loading Fedora 2.6.38.8-32.fc15.x86_64 ...'
+ 	linux	/vmlinuz-2.6.38.8-32.fc15.x86_64 root=/dev/mapper/vg_pjones5-lv_root ro quiet rhgb
+ 	echo	'Loading initial ramdisk ...'
+ 	initrd	/initramfs-2.6.38.8-32.fc15.x86_64.img
+-- 
+1.7.7.4
+
diff --git a/grubby.spec b/grubby.spec
index 4164dc3..320cf96 100644
--- a/grubby.spec
+++ b/grubby.spec
@@ -1,6 +1,6 @@
 Name: grubby
 Version: 8.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: Command line tool for updating bootloader configs
 Group: System Environment/Base
 License: GPLv2+
@@ -9,6 +9,9 @@ URL: http://git.fedorahosted.org/git/grubby.git
 # git clone git://git.fedorahosted.org/git/grubby.git
 # git archive --format=tar --prefix=grubby-%{version}/ HEAD |bzip2 > grubby-%{version}.tar.bz2
 Source0: %{name}-%{version}.tar.bz2
+# 'upstream' 4bb88f93e6c7cf432e354a164fce8743794a84a5
+# RH #737203
+Patch0: 0001-Update-echo-Loading.-messages-to-the-new-kernel-vers.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: pkgconfig glib2-devel popt-devel 
 BuildRequires: libblkid-devel
@@ -27,6 +30,7 @@ environment.
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
@@ -54,6 +58,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Dec 08 2011 Adam Williamson <awilliam at redhat.com> - 8.3-2
+- fix the Loading... message when installing a new kernel
+  Resolves: rhbz#737203
+
 * Thu Sep 29 2011 Peter Jones <pjones at redhat.com> - 8.3-1
 - Fix new-kernel-pkg invocation of grubby for grub (patch from Mads Kiilerich)
   Resolves: rhbz#725185


More information about the scm-commits mailing list