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

The `grub2.Config.Default` key is owned by `NewGrub2StageOptionsUnified`
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:46:14 +00:00 committed by Ondřej Budai
parent 55b7b82714
commit 61c1ccff21

View file

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