grubby/0003-grubby-fix-initrd-updating-when-multiboot-exist.patch
Peter Jones 0370b222f6 See if what people are seeing in 1141414 is actually 957681
Related: rhbz#957681
  Related: rhbz#1141414
2014-10-17 18:56:25 -04:00

38 lines
1.4 KiB
Diff

From 2f35781fde88a99dec22407057b1a46343bc00cc Mon Sep 17 00:00:00 2001
From: Junxiao Bi <junxiao.bi@oracle.com>
Date: Wed, 14 May 2014 16:44:21 +0800
Subject: [PATCH 3/9] grubby: fix initrd updating when multiboot exist
When using the following command to add an initrd for the kernel.
grubby --update-kernel=/boot/vmlinuz-2.6.32-431.17.1.el6.x86_64.debug
--initrd /boot/initramfs-2.6.32-431.17.1.el6.x86_64.debug.img
--add-multiboot=/boot/tboot.gz
The multiboot image /boot/tboot.gz is used as the key to search the
configure entry in grub.conf, this is wrong. There may be other kernels
also configure multiboot with the same name tboot.gz, if there index are
smaller than the target one, then that will make the initrd added to the
wrong kernel. Fix it to use kernel name as the search key.
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
---
grubby.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grubby.c b/grubby.c
index db91364..118cb84 100644
--- a/grubby.c
+++ b/grubby.c
@@ -3311,7 +3311,7 @@ int addMBInitrd(struct grubConfig * cfg, const char *newMBKernel,
if (!image) return 0;
- for (; (entry = findEntryByPath(cfg, newMBKernel, prefix, &index)); index++) {
+ for (; (entry = findEntryByPath(cfg, image, prefix, &index)); index++) {
kernelLine = getLineByType(LT_MBMODULE, entry->lines);
if (!kernelLine) continue;
--
1.9.3