From eaf3dc2ecc47506c92c5d0e242ec6917c7bbf8c7 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 9 Dec 2022 18:31:54 +0100 Subject: [PATCH] manifest: always add inst.stage2 kernel option for Anaconda The bootiso.mono stage in osbuild that we used until recently adds the inst.stage2 option unconditionally [1] whereas the current grub2.iso stage that we use now doesn't. [1] https://github.com/osbuild/osbuild/blob/8511add1695c49cc7f3df2220044a4eed17ba1a5/stages/org.osbuild.bootiso.mono#L369 --- internal/image/image_installer.go | 4 +--- internal/image/ostree_installer.go | 2 +- internal/manifest/efi_boot_tree.go | 7 +------ internal/manifest/iso_tree.go | 3 +-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/internal/image/image_installer.go b/internal/image/image_installer.go index fc7babab1..da7117fbb 100644 --- a/internal/image/image_installer.go +++ b/internal/image/image_installer.go @@ -116,11 +116,9 @@ func (img *ImageInstaller) InstantiateManifest(m *manifest.Manifest, bootTreePipeline.UEFIVendor = img.Platform.GetUEFIVendor() bootTreePipeline.ISOLabel = isoLabel - kernelOpts := make([]string, 0) + kernelOpts := []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", isoLabel)} if img.ISORootKickstart { kernelOpts = append(kernelOpts, fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", isoLabel, kspath)) - } else { - kernelOpts = append(kernelOpts, fmt.Sprintf("inst.stage2=hd:LABEL=%s", isoLabel)) } kernelOpts = append(kernelOpts, img.AdditionalKernelOpts...) bootTreePipeline.KernelOpts = kernelOpts diff --git a/internal/image/ostree_installer.go b/internal/image/ostree_installer.go index 4df91ca34..6639a0a1c 100644 --- a/internal/image/ostree_installer.go +++ b/internal/image/ostree_installer.go @@ -93,7 +93,7 @@ func (img *OSTreeInstaller) InstantiateManifest(m *manifest.Manifest, bootTreePipeline.Platform = img.Platform bootTreePipeline.UEFIVendor = img.Platform.GetUEFIVendor() bootTreePipeline.ISOLabel = isoLabel - bootTreePipeline.KernelOpts = []string{fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", isoLabel, kspath)} + bootTreePipeline.KernelOpts = []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", isoLabel), fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", isoLabel, kspath)} isoTreePipeline := manifest.NewAnacondaISOTree(m, buildPipeline, diff --git a/internal/manifest/efi_boot_tree.go b/internal/manifest/efi_boot_tree.go index 90e21f78b..61bd170fe 100644 --- a/internal/manifest/efi_boot_tree.go +++ b/internal/manifest/efi_boot_tree.go @@ -44,11 +44,6 @@ func (p *EFIBootTree) serialize() osbuild.Pipeline { panic("unsupported architecture") } - kernelOpts := []string{} - if len(p.KernelOpts) > 0 { - kernelOpts = append(kernelOpts, p.KernelOpts...) - } - grubOptions := &osbuild.GrubISOStageOptions{ Product: osbuild.Product{ Name: p.product, @@ -56,7 +51,7 @@ func (p *EFIBootTree) serialize() osbuild.Pipeline { }, Kernel: osbuild.ISOKernel{ Dir: "/images/pxeboot", - Opts: kernelOpts, + Opts: p.KernelOpts, }, ISOLabel: p.ISOLabel, Architectures: architectures, diff --git a/internal/manifest/iso_tree.go b/internal/manifest/iso_tree.go index ac2a5b149..47557e0eb 100644 --- a/internal/manifest/iso_tree.go +++ b/internal/manifest/iso_tree.go @@ -112,10 +112,9 @@ func (p *AnacondaISOTree) serialize() osbuild.Pipeline { kernelOpts := []string{} + kernelOpts = append(kernelOpts, fmt.Sprintf("inst.stage2=hd:LABEL=%s", p.isoLabel)) if p.KSPath != "" { kernelOpts = append(kernelOpts, fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", p.isoLabel, p.KSPath)) - } else { - kernelOpts = append(kernelOpts, fmt.Sprintf("inst.stage2=hd:LABEL=%s", p.isoLabel)) } if len(p.KernelOpts) > 0 {