[PATCH] change default for grub2 save_entry to 0

Gene Czarcinski gczarcinski at gmail.com
Fri May 30 16:59:13 UTC 2014


The value that anaconda sets save_entry in /boot/grub2/grubenv is
not valid as there is no corresponding menuentry with that title.  The
only reason things work now is that if grub2 finds no match, it boots
the kernel specified in the first (top) menuentry.

grub2-set-default --help results in:
  MENU_ENTRY is a number, a menu item title or a menu item identifier

This patch changes the default to be "0".

This results in the value now being correct, produces an expected
result (booting the first kernel), and not requiring any changes
to grubby.

The user will still be able to use grub2-set-default to change the
default value to other settings.
---
 pyanaconda/bootloader.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 96c98b4..116c2b9 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1561,8 +1561,7 @@ class GRUB2(GRUB):
             log.error("bootloader password setup failed: %s", e)
 
         # make sure the default entry is the OS we are installing
-        entry_title = "%s Linux, with Linux %s" % (productName,
-                                                   self.default.version)
+        entry_title = "0"
         rc = iutil.execInSysroot("grub2-set-default", [entry_title])
         if rc:
             log.error("failed to set default menu entry to %s", productName)
-- 
1.9.3



More information about the anaconda-patches mailing list