In self-generated grub.cfg
, there is a lot of
if [ x$feature_platform_search_hint = xy ] ...
if [ x$feature_default_font_path = xy]...
if [ x$feature_all_video_module = xy ]...
My believe is that it is checking if the feature is present or not in the past when the answer might be false, like when grub2 was under development. But after so many years, will they ever be false in any case?
I'm more interested in the $feature_platform_search_hint
, and as per here,
The predefined variables such as
feature_platform_search_hint
are hardcoded in the normal module at build time, and are essentially undocumented except by studying the source code. In current versions of grub, these variables are defined to be y at all times, so these variables seem to indicate support for specific features of a given grub version, and testing them can be done to write grub.cfg files that work with multiple versions of grub.
What I don't understand is why the self-generated grub.cfg
has to be such over-complicated. E.g.,
Will I ever need to worry about the $feature_platform_search_hint
now and in the future? If I manually write my own maintenance free Grub2 menu, do I have to repeat the self-generated grub.cfg like:
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 23cbdbaf-9bc8-49d0-a483-1ce445cf6fb4
else
search --no-floppy --fs-uuid --set=root 23cbdbaf-9bc8-49d0-a483-1ce445cf6fb4
fi
OK I just always use the --hint
parameters?