From 111cd8871f1ee133015638f13de6f25dc8f6a02a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 9 Mar 2022 19:44:27 +0100 Subject: [PATCH] distro/rhel85: ensure grub default is not set A future change to `NewGrub2StageOptions` will result in a change of `Config.Default` to `saved` if a kernel is set. Preserve the current behavior by manually resetting it to the empty string. --- internal/distro/rhel85/pipelines.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/distro/rhel85/pipelines.go b/internal/distro/rhel85/pipelines.go index b50891975..e1dab1269 100644 --- a/internal/distro/rhel85/pipelines.go +++ b/internal/distro/rhel85/pipelines.go @@ -1277,6 +1277,12 @@ func bootloaderConfigStage(t *imageType, partitionTable *disk.PartitionTable, ke options := osbuild.NewGrub2StageOptions(partitionTable, kernelOptions, kernel, kernelVer, uefi, legacy, "redhat", install) options.Greenboot = greenboot + // `NewGrub2StageOptions` now might set this to "saved"; but when 8.5 was released + // it was not available. To keep manifests from changing we need to reset it here. + if options.Config != nil { + options.Config.Default = "" + } + // before unifying the org.osbuild.grub2 stage option generator, we didn't // set the following for RHEL 8.5, so we need to revert here to maintain // the old behaviour