help-grub
[Top][All Lists]
Advanced

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

Re: Locating a configuration file (*.cfg)


From: Arbiel (gmx)
Subject: Re: Locating a configuration file (*.cfg)
Date: Fri, 30 Oct 2015 13:37:58 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


Le 30/10/2015 12:20, Andrei Borzenkov a écrit :
> On Fri, Oct 30, 2015 at 2:02 PM, Arbiel (gmx) <address@hidden> wrote:
>> Hi
>>
>> I want to write a grub script to locate a configuration file to branch
>> grub to. This raises some issues
>>
>> 1) When --boot-directory of install-grub points to a logical volume,
>> --force-file-id seems not supported as no configuration file is embedded
>> in core.img. Does grub support searching into such a volume, assuming
>> the lvm module has been loaded ? And what kind of search does it
>> implement (uuid, label, file) ?
>>
> search command just looks at every available storage device. As long
> as drivers for it are loaded and logical volume is present in list of
> storage devices search should work.
>
>> 2) Having located the configuration file to branch to, configfile allows
>> for the branching of grub to that file. How does configfile handle the
>> ${config_directory} variable ? If this variable is not set to this "new"
>> grub directory, how is it possible to deduce the name of this directory
>> from the fully qualified name of the "new" configuration file ?
>>
> config_directory and config_file should be set to the correct value
> when entering new configuration file. If not, please report together
> with instructions how to reproduce.
a) I never saw any reference to config_file, neither in the
documentation, nor my configuration files. What value is it supposed to
hold ?
b) are those two variables to be exported ?
>
>> 3) To complement this grub script, I want to write a bash script to set
>> a environment variable which the grub script has to reset. grub seems to
>> not support save_env to a grubenv file located on a logical volume. Is
>> it possible to replace the load_env and a save_env commands by
>> identically named functions which would use these 2 commands with the -f
>> parameter (and doing so, would allow for the correct operation of
>> recordfail) ?
>>
> There is no support for writing on top of diskfilter devices - LVM,
> Linux MD etc. It may be possible to implement limited support for
> linear and RAID0 type of storage. Anything else is too complicated to
> warrant doing it. I would be happy if someone could suggest
> implementation that allowed environment block to be located anywhere,
> not only as file on a filesystem. openSUSE does something similar for
> btrfs as special case.
My question was maybe not clear enough. I meant in "to replace load_env …"
writing in my script sort of an alias to overwrite the commands.

On another hand, wouldn't it be possible to add a parameter to
grub-mkconfig to define a write-eligible environment block and reference
it in the various "load_env" et "save_env" used by grub.cfg ?
>


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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