From ff215aa77c14ffdd2e66dc02680f6b6cfabd76a1 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 13 May 2020 17:24:30 +0200 Subject: [PATCH] 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//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). --- stages/org.osbuild.grub2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stages/org.osbuild.grub2 b/stages/org.osbuild.grub2 index afdbfb11..bed87f5d 100755 --- a/stages/org.osbuild.grub2 +++ b/stages/org.osbuild.grub2 @@ -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)