[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GRUB_DEFAULT=saved with GRUB_SAVEDEFAULT=true doesn't work here

From: Andrei Borzenkov
Subject: Re: GRUB_DEFAULT=saved with GRUB_SAVEDEFAULT=true doesn't work here
Date: Sat, 23 Oct 2021 20:54:44 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 21.10.2021 20:57, Andrei Borzenkov wrote:
> The problem is, grub constructs the value of $chosen variable when it
> executes menu entry - it appends its ID (or name if ID is not defined)
> to existing value thus building full path from the top. This variable is
> also exported. When grub executes "configfile" command it retains all
> exported variables, so value of "$chosen" becomes wrong in the inner
> configfile.
> This sounds like a bug.

On the second thought, it is not.

> Command "configfile" starts with new empty menu;
> so any reference to previous menu entry is by definition invalid. It
> should clear $chosen as well at the same time.

grub will correctly strip initial menu entry from $default value, so
when nested configfile is executed, the started value for $default is

But in your case $default is overridden inside of nested config file.

So as long as we have single grub installation and every config file is
basically just "subroutine", it should work. If you try to build the
whole new environment, you need to clean up yourself.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]