|
From: | Arbiel Perlacremaz |
Subject: | Re: Activating a configuration file within a submenu or a menuentry |
Date: | Tue, 10 Apr 2012 00:18:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120310 Thunderbird/11.0 |
The trouble arises from the fact that these grub.cfg files each use their specific ${prefix} variable. And these variables are used in particular to "source" the ${prefix}/custom.cfg file if it exists.
So, to get the menu as if the PC had been booted by the grub's instance which refers to one of the other_cfg files, I have to set prefix = ${2}/boot/grub, the directory which I have Grub read the grub.cfg file, and export it to have it available in that subsequent configfiled grub.cfg file.
Obviously, difficulties may arise, as you have stated, when all Grub instances of a given configuration are not at the same level, which is presently not the case in my configuration.
However, this shows a design pitfall : Grub uses a single variable for two different purposes : accessing its own modules and accessing user defined files. It should use two variables.
However, the use of two variables may not be enough to clear the issue. Wouldn't we face inconsistencies if the grub version current when a user runs grub-mkconfig is not the same as the one which was current when he previously ran the grub-install procedure ?
What do you think ? Le 09/04/2012 20:40, Jordan Uggla a écrit :
On Mon, Apr 9, 2012 at 6:20 AM, Arbiel Perlacremaz <address@hidden> wrote:Thank you Jordan It works perfectly after I have added set prefix=${2}/boot/grub export prefix$prefix is where grub looks for its modules, you should never be changing it yourself in scripts because if you change $prefix to point to an older (or newer) grub's /boot/grub/ directory the modules in that directory will likely be incompatible. The example menu entry I gave should have worked, did it not work?
[Prev in Thread] | Current Thread | [Next in Thread] |