distro/rhel86: ensure grub2.Config.Default is preserved

The `grub2.Config.Default` key is owned by `NewGrub2StageOptions`
and thus needs to be preserved in case there is a `Grub2Config`
setting present in the image configuration (`ImageConfig`).
This commit is contained in:
Christian Kellner 2022-03-24 13:44:29 +00:00 committed by Ondřej Budai
parent 96411158e6
commit 55b7b82714

View file

@ -557,6 +557,13 @@ func osPipeline(t *imageType,
if cfg := imageConfig.Grub2Config; cfg != nil {
if grub2, ok := bootloader.Options.(*osbuild.GRUB2StageOptions); ok {
// grub2.Config.Default is owned and set by `NewGrub2StageOptions`
// and thus we need to preserve it
if grub2.Config != nil {
cfg.Default = grub2.Config.Default
}
grub2.Config = cfg
}
}