Skip to content

Commit e9bc321

Browse files
committed
bib: move bib to new platform.Data{}
In images osbuild/images#1739 we dropped the hardcoded platforms. Bib needs to follow suite and this commit does it now.
1 parent 80cccd2 commit e9bc321

File tree

1 file changed

+18
-62
lines changed

1 file changed

+18
-62
lines changed

bib/cmd/bootc-image-builder/image.go

Lines changed: 18 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -385,40 +385,18 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest
385385
"console=ttyS0",
386386
}
387387

388+
img.Platform = &platform.Data{
389+
Arch: c.Architecture,
390+
UEFIVendor: c.SourceInfo.UEFIVendor,
391+
QCOW2Compat: "1.1",
392+
}
388393
switch c.Architecture {
389394
case arch.ARCH_X86_64:
390-
img.Platform = &platform.X86{
391-
BasePlatform: platform.BasePlatform{},
392-
BIOS: true,
393-
}
394-
case arch.ARCH_AARCH64:
395-
img.Platform = &platform.Aarch64{
396-
UEFIVendor: "fedora",
397-
BasePlatform: platform.BasePlatform{
398-
QCOW2Compat: "1.1",
399-
},
400-
}
401-
case arch.ARCH_S390X:
402-
img.Platform = &platform.S390X{
403-
BasePlatform: platform.BasePlatform{
404-
QCOW2Compat: "1.1",
405-
},
406-
Zipl: true,
407-
}
395+
img.Platform.(*platform.Data).BIOSPlatform = "i386-pc"
408396
case arch.ARCH_PPC64LE:
409-
img.Platform = &platform.PPC64LE{
410-
BasePlatform: platform.BasePlatform{
411-
QCOW2Compat: "1.1",
412-
},
413-
BIOS: true,
414-
}
415-
case arch.ARCH_RISCV64:
416-
img.Platform = &platform.RISCV64{
417-
UEFIVendor: "fedora",
418-
BasePlatform: platform.BasePlatform{
419-
QCOW2Compat: "1.1",
420-
},
421-
}
397+
img.Platform.(*platform.Data).BIOSPlatform = "powerpc-ieee1275"
398+
case arch.ARCH_S390X:
399+
img.Platform.(*platform.Data).ZiplSupport = true
422400
}
423401

424402
if kopts := customizations.GetKernel(); kopts != nil && kopts.Append != "" {
@@ -559,48 +537,26 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
559537
}
560538
img.InstallerCustomizations.UseRHELLoraxTemplates = needsRHELLoraxTemplates(c.SourceInfo.OSRelease)
561539

540+
img.Platform = &platform.Data{
541+
Arch: c.Architecture,
542+
ImageFormat: platform.FORMAT_ISO,
543+
UEFIVendor: c.SourceInfo.UEFIVendor,
544+
}
562545
switch c.Architecture {
563546
case arch.ARCH_X86_64:
564-
img.Platform = &platform.X86{
565-
BasePlatform: platform.BasePlatform{
566-
ImageFormat: platform.FORMAT_ISO,
567-
},
568-
BIOS: true,
569-
UEFIVendor: c.SourceInfo.UEFIVendor,
570-
}
547+
img.Platform.(*platform.Data).BIOSPlatform = "i386-pc"
571548
img.InstallerCustomizations.ISOBoot = manifest.Grub2ISOBoot
572549
case arch.ARCH_AARCH64:
573550
// aarch64 always uses UEFI, so let's enforce the vendor
574551
if c.SourceInfo.UEFIVendor == "" {
575552
return nil, fmt.Errorf("UEFI vendor must be set for aarch64 ISO")
576553
}
577-
img.Platform = &platform.Aarch64{
578-
BasePlatform: platform.BasePlatform{
579-
ImageFormat: platform.FORMAT_ISO,
580-
},
581-
UEFIVendor: c.SourceInfo.UEFIVendor,
582-
}
583554
case arch.ARCH_S390X:
584-
img.Platform = &platform.S390X{
585-
Zipl: true,
586-
BasePlatform: platform.BasePlatform{
587-
ImageFormat: platform.FORMAT_ISO,
588-
},
589-
}
555+
img.Platform.(*platform.Data).ZiplSupport = true
590556
case arch.ARCH_PPC64LE:
591-
img.Platform = &platform.PPC64LE{
592-
BIOS: true,
593-
BasePlatform: platform.BasePlatform{
594-
ImageFormat: platform.FORMAT_ISO,
595-
},
596-
}
557+
img.Platform.(*platform.Data).BIOSPlatform = "powerpc-ieee1275"
597558
case arch.ARCH_RISCV64:
598-
img.Platform = &platform.RISCV64{
599-
BasePlatform: platform.BasePlatform{
600-
ImageFormat: platform.FORMAT_ISO,
601-
},
602-
UEFIVendor: c.SourceInfo.UEFIVendor,
603-
}
559+
// nothing special needed
604560
default:
605561
return nil, fmt.Errorf("unsupported architecture %v", c.Architecture)
606562
}

0 commit comments

Comments
 (0)