From 6bfa3dd36670057e43f6ab2508471b96bce3674e Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 12 Dec 2022 17:29:47 +0100 Subject: [PATCH] image: add ISOLinux stage only for x86_64 The previous fix (9e66ee13e76b431197528d119405656444cac295) only fixed half the problem with this bug. The ISOLinux stage was still added to the iso-tree pipeline for Anaconda builds. This is now removed. --- internal/image/image_installer.go | 6 +++++- internal/image/ostree_installer.go | 6 +++++- internal/manifest/iso_tree.go | 28 +++++++++++++++++----------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/internal/image/image_installer.go b/internal/image/image_installer.go index da7117fbb..463574150 100644 --- a/internal/image/image_installer.go +++ b/internal/image/image_installer.go @@ -128,6 +128,9 @@ func (img *ImageInstaller) InstantiateManifest(m *manifest.Manifest, osPipeline.Environment = img.Environment osPipeline.Workload = img.Workload + // enable ISOLinux on x86_64 only + isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64 + isoTreePipeline := manifest.NewAnacondaISOTree(m, buildPipeline, anacondaPipeline, @@ -148,10 +151,11 @@ func (img *ImageInstaller) InstantiateManifest(m *manifest.Manifest, isoTreePipeline.OSPipeline = osPipeline isoTreePipeline.KernelOpts = img.AdditionalKernelOpts + isoTreePipeline.ISOLinux = isoLinuxEnabled isoPipeline := manifest.NewISO(m, buildPipeline, isoTreePipeline, isoLabel) isoPipeline.Filename = img.Filename - isoPipeline.ISOLinux = img.Platform.GetArch() == platform.ARCH_X86_64 + isoPipeline.ISOLinux = isoLinuxEnabled artifact := isoPipeline.Export() diff --git a/internal/image/ostree_installer.go b/internal/image/ostree_installer.go index 6639a0a1c..fac5aeeaa 100644 --- a/internal/image/ostree_installer.go +++ b/internal/image/ostree_installer.go @@ -95,6 +95,9 @@ func (img *OSTreeInstaller) InstantiateManifest(m *manifest.Manifest, bootTreePipeline.ISOLabel = isoLabel bootTreePipeline.KernelOpts = []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", isoLabel), fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", isoLabel, kspath)} + // enable ISOLinux on x86_64 only + isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64 + isoTreePipeline := manifest.NewAnacondaISOTree(m, buildPipeline, anacondaPipeline, @@ -114,10 +117,11 @@ func (img *OSTreeInstaller) InstantiateManifest(m *manifest.Manifest, isoTreePipeline.PayloadPath = "/ostree/repo" isoTreePipeline.OSTree = &img.Commit + isoTreePipeline.ISOLinux = isoLinuxEnabled isoPipeline := manifest.NewISO(m, buildPipeline, isoTreePipeline, isoLabel) isoPipeline.Filename = img.Filename - isoPipeline.ISOLinux = img.Platform.GetArch() == platform.ARCH_X86_64 + isoPipeline.ISOLinux = isoLinuxEnabled artifact := isoPipeline.Export() return artifact, nil diff --git a/internal/manifest/iso_tree.go b/internal/manifest/iso_tree.go index 47557e0eb..0f327ed1d 100644 --- a/internal/manifest/iso_tree.go +++ b/internal/manifest/iso_tree.go @@ -46,6 +46,9 @@ type AnacondaISOTree struct { OSTree *ostree.CommitSpec KernelOpts []string + + // Enable ISOLinux stage + ISOLinux bool } func NewAnacondaISOTree(m *Manifest, @@ -169,18 +172,21 @@ func (p *AnacondaISOTree) serialize() osbuild.Pipeline { squashfsStage := osbuild.NewSquashfsStage(&squashfsOptions, p.rootfsPipeline.Name()) pipeline.AddStage(squashfsStage) - isoLinuxOptions := &osbuild.ISOLinuxStageOptions{ - Product: osbuild.ISOLinuxProduct{ - Name: p.anacondaPipeline.product, - Version: p.anacondaPipeline.version, - }, - Kernel: osbuild.ISOLinuxKernel{ - Dir: "/images/pxeboot", - Opts: kernelOpts, - }, + if p.ISOLinux { + isoLinuxOptions := &osbuild.ISOLinuxStageOptions{ + Product: osbuild.ISOLinuxProduct{ + Name: p.anacondaPipeline.product, + Version: p.anacondaPipeline.version, + }, + Kernel: osbuild.ISOLinuxKernel{ + Dir: "/images/pxeboot", + Opts: kernelOpts, + }, + } + + isoLinuxStage := osbuild.NewISOLinuxStage(isoLinuxOptions, p.anacondaPipeline.Name()) + pipeline.AddStage(isoLinuxStage) } - isoLinuxStage := osbuild.NewISOLinuxStage(isoLinuxOptions, p.anacondaPipeline.Name()) - pipeline.AddStage(isoLinuxStage) filename := "images/efiboot.img" pipeline.AddStage(osbuild.NewTruncateStage(&osbuild.TruncateStageOptions{