stages/grub2: unify grub.cfg writing path

Instead of having two different places within conditionals where
the configuration is written, have only one common. In the case
of hybrid boot, in the end there will be two grub configuration
files: the canonical one in /boot/grub2/grub.cfg and a redirect
one, in the EFI directory that will redirect to the canonical.
In case of legacy only, only the canonical one in the default
location (/boot/grub2/grub.cfg) will be written.
For EFI only mode, only /boot/efi/EFI/<vendor>/grub.cfg will
be written with the main grub configuration data.
Thus the writing of the main grub configuration will now always
be written in exactly one place (now line 319).
This commit is contained in:
Christian Kellner 2020-05-13 17:24:30 +02:00 committed by David Rheinsberg
parent 823b8999a7
commit ff215aa77c

View file

@ -316,10 +316,11 @@ def main(tree, options):
config.write_redirect(tree, grubcfg)
else:
config.path = grubcfg
config.write(tree)
# Now actually write the main grub.cfg file
config.write(tree)
if legacy:
config.write(tree)
copy_modules(tree, legacy)
copy_font(tree)