Setting config_directory to prefix at grub launch time
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.
Quoted 11 lines · Arbiel (gmx)
In the Ubuntu distributions, there is a
/etc/grub.d/41_customwhich 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###
Quoted 8 lines
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_fileset 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. If you always need to use prefix, just always use prefix. I'm afraid I do not understand the problem.
Quoted 20 lines · Andrei Borzenkov
Quoted 11 lines · Arbiel (gmx)
In the Ubuntu distributions, there is a
/etc/grub.d/41_customwhich 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###Quoted 8 lines
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_fileset to prefix at the beginning of grub's running, as at this very moment prefix also is the directory of the configuration file.
Quoted 2 lines
config_directoryis 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.
Quoted 2 lines
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.
Quoted 6 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 22 lines · Arbiel (gmx)
Le 15/01/2016 11:22, Andrei Borzenkov a écrit :
Quoted 20 lines · Arbiel (gmx)
Quoted 19 lines
In the Ubuntu distributions, there is a
/etc/grub.d/41_customwhich 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_fileset to prefix at the beginning of grub's running, as at this very moment prefix also is the directory of the configuration file.
Quoted 6 lines
Quoted 2 lines
config_directoryis managed by grub to point to current source of configuration.No,
config_directoryis unset when grub executes the configuration file pointed to by core.img. There is noconfig_directorylisted by the "set" command (using|grub-mkconfig (GRUB) 2.02~beta2-9ubuntu1.4|). It seems to only be set by the configfile command.
Sorry for the disturbance. config_directory is set even when the current configuration file is the one pointed to by core.img. I run a new test echoing its value as the first line of the file. Its value is the same as the value of prefix.
Quoted 7 lines
Quoted 2 lines
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.
However, I confirm config_directory is not listed in the output of the set command. Here is what I got
?=0
cmdpath=(hd0)
color_highlight=black/light-gray
color_normal=light-gray/black
defaut=0
feature_200_final=y
feature_chainloader_bpb=y
feature_default_font_path=y
feature_menuentry_id=y
feature_menuentry_option=y
feature_nativedisk_cmd=y
feature_ntdlr=y
feature_platform_search_hint=y
feature_timeout_style=y
font=unicode
gfxmode=auto
grub_cpu=i386
grub_platform=pc
lang=fr_FR
linux_gfx_mode=keep
locale_dir=(hd0,msdos1)/boot/grub/locale
menu_color_highlight=black/light-gray
menu_color_normal=white/black
menuentry-id=--id
pager=
prefix=(hd0,msdos1)/boot/grub
root=hd0,msdos1
secondary_locale_dir=
timeout_style=menu
Quoted 12 lines
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
15.01.2016 17:18, Arbiel (gmx) пишет:
Quoted 2 lines
However, I confirm
config_directoryis not listed in the output of the set command.
That's correct. config_directory is set when executing config file and unset when processing is completed. When you are in CLI, there is no config file, so it is not set. Each configfile command is executed in own environment which is destroyed when it is finished. You may have multiple (also nested) configfile invocations. What would you set it to? config_directory has no meaningful value outside of configfile processing.
Quoted 5 lines · Andrei Borzenkov
15.01.2016 17:18, Arbiel (gmx) пишет:
Quoted 2 lines
However, I confirm
config_directoryis not listed in the output of the set command.That's correct.
config_directoryis set when executing config file and unset when processing is completed.
I understand the processing of a file to come to its end when grub displays its menu.
Quoted 5 lines
When you are in CLI, there is no
config file, so it is not set. Each configfile command is executed in own environment which is destroyed when it is finished. You may have multiple (also nested) configfile invocations. What would you set it to?
I'm just happy with that. I only made a wrong deduction based on the fact that I did not see config_directory in the set's output.
Quoted 2 lines
config_directoryhas no meaningful value outside of configfile processing.
That's clear.
Quoted 7 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
16.01.2016 00:40, Arbiel (gmx) пишет:
Quoted 10 lines · Andrei Borzenkov
Quoted 5 lines
15.01.2016 17:18, Arbiel (gmx) пишет:
Quoted 2 lines
However, I confirm
config_directoryis not listed in the output of the set command.That's correct.
config_directoryis set when executing config file and unset when processing is completed.I understand the processing of a file to come to its end when grub displays its menu.
Yes. At this point config_directory gets unset before displaying menu, if any menu was defined during config file processing.
Quoted 26 lines
Quoted 5 lines
When you are in CLI, there is no
config file, so it is not set. Each configfile command is executed in own environment which is destroyed when it is finished. You may have multiple (also nested) configfile invocations. What would you set it to?I'm just happy with that. I only made a wrong deduction based on the fact that I did not see
config_directoryin the set's output.Quoted 2 lines
config_directoryhas no meaningful value outside of configfile processing.That's clear.
Quoted 7 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel