grub-devel
[Top][All Lists]
Advanced

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

Re: Setting config_directory to prefix at grub launch time


From: Arbiel (gmx)
Subject: Re: Setting config_directory to prefix at grub launch time
Date: Fri, 15 Jan 2016 12:32:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


Le 15/01/2016 11:22, Andrei Borzenkov a écrit :
> On Fri, Jan 15, 2016 at 1:16 PM, Arbiel (gmx) <address@hidden> wrote:
>> In the Ubuntu distributions, there is a /etc/grub.d/41_custom which
>> creates the following lines in the grub configuration file
>>
>> ### BEGIN /etc/grub.d/41_custom ###
>> if [ -f  ${config_directory}/custom.cfg ]; then
>>   source ${config_directory}/custom.cfg
>> elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
>>   source $prefix/custom.cfg;
>> fi
>> ### END /etc/grub.d/41_custom ###
>>
>> In the custom.cfg file, I use the source command to insert some private
>> scripts stored in a ${prefix}/greffons/ directory. However, when the
>> configuration file has been the target of a configfile command, the
>> source of my private scripts becomes ${config_file}/greffons/. To be
>> compatible to all situations, I need to have config_file set to prefix
>> at the beginning of grub's running, as at this very moment prefix also
>> is the directory of the configuration file.
>>
> config_directory is managed by grub to point to current source of
> configuration. 
No, config_directory is unset when grub executes the configuration file
pointed to by core.img. There is no config_directory listed by the "set"
command (using|grub-mkconfig (GRUB) 2.02~beta2-9ubuntu1.4|).
It seems to only be set by the configfile command.
> If you always need to use prefix, just always use
> prefix. I'm afraid I do not understand the problem.
I cannot always use prefix as I want to access the scripts located in
the same directory as the current configuration file. This is the reason
why I would be glad to always use config_directory, which is
unfortunately unset when the current configuration file is the one
core.img points to.
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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