image: add ISOLinux stage only for x86_64

The previous fix (9e66ee13e7) 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.
This commit is contained in:
Achilleas Koutsou 2022-12-12 17:29:47 +01:00 committed by Ondřej Budai
parent 07a8f3d5ea
commit 6bfa3dd366
3 changed files with 27 additions and 13 deletions

View file

@ -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()

View file

@ -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

View file

@ -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{