[PATCH] change default for grub2 save_entry to 0

Vratislav Podzimek vpodzime at redhat.com
Wed Jun 4 09:43:42 UTC 2014


On Fri, 2014-05-30 at 12:59 -0400, Gene Czarcinski wrote:
> 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)
Looks good to me, I'm gonna push it tomorrow.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list