Bump osbuild/images dependency to v0.12.0

This brings in the support for:
 - RHEL-8.10
 - RHEL-9.4
 - ppc64le and s390x on Fedora (qcow2, container)

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-10-13 11:39:22 +02:00 committed by Achilleas Koutsou
parent 73edc381d8
commit 1903556198
136 changed files with 5293 additions and 1827 deletions

View file

@ -6,6 +6,8 @@ import (
"io"
"os"
"strings"
"github.com/hashicorp/go-version"
)
func GetHostDistroName() (string, bool, bool, error) {
@ -54,30 +56,23 @@ func readOSRelease(r io.Reader) (map[string]string, error) {
// Returns true if the version represented by the first argument is
// semantically older than the second.
//
// Meant to be used for comparing distro versions for differences between minor
// releases.
// Evaluates to false if a and b are equal.
//
// Provided version strings are of any characters which are not
// digits or periods, and then split on periods.
// Assumes any missing components are 0, so 8 < 8.1.
// Evaluates to false if a and b are equal.
func VersionLessThan(a, b string) bool {
aParts := strings.Split(a, ".")
bParts := strings.Split(b, ".")
// pad shortest argument with zeroes
for len(aParts) < len(bParts) {
aParts = append(aParts, "0")
aV, err := version.NewVersion(a)
if err != nil {
panic(err)
}
for len(bParts) < len(aParts) {
bParts = append(bParts, "0")
bV, err := version.NewVersion(b)
if err != nil {
panic(err)
}
for idx := 0; idx < len(aParts); idx++ {
if aParts[idx] < bParts[idx] {
return true
} else if aParts[idx] > bParts[idx] {
return false
}
}
// equal
return false
return aV.LessThan(bV)
}

View file

@ -6,6 +6,7 @@ import (
"path/filepath"
"github.com/google/uuid"
"github.com/osbuild/images/pkg/blueprint"
)
@ -20,14 +21,46 @@ type PartitionTable struct {
StartOffset uint64 // Starting offset of the first partition in the table (Mb)
}
func NewPartitionTable(basePT *PartitionTable, mountpoints []blueprint.FilesystemCustomization, imageSize uint64, lvmify bool, requiredSizes map[string]uint64, rng *rand.Rand) (*PartitionTable, error) {
type PartitioningMode string
const (
// AutoLVMPartitioningMode creates a LVM layout if the filesystem
// contains a mountpoint that's not defined in the base partition table
// of the specified image type. In the other case, a raw layout is used.
AutoLVMPartitioningMode PartitioningMode = "auto-lvm"
// LVMPartitioningMode always creates an LVM layout.
LVMPartitioningMode PartitioningMode = "lvm"
// RawPartitioningMode always creates a raw layout.
RawPartitioningMode PartitioningMode = "raw"
// DefaultPartitioningMode is AutoLVMPartitioningMode and is the empty state
DefaultPartitioningMode PartitioningMode = ""
)
func NewPartitionTable(basePT *PartitionTable, mountpoints []blueprint.FilesystemCustomization, imageSize uint64, mode PartitioningMode, requiredSizes map[string]uint64, rng *rand.Rand) (*PartitionTable, error) {
newPT := basePT.Clone().(*PartitionTable)
if basePT.features().LVM && mode == RawPartitioningMode {
return nil, fmt.Errorf("raw partitioning mode set for a base partition table with LVM, this is unsupported")
}
// first pass: enlarge existing mountpoints and collect new ones
newMountpoints, _ := newPT.applyCustomization(mountpoints, false)
// if there is any new mountpoint and lvmify is enabled, ensure we have LVM layout
if lvmify && len(newMountpoints) > 0 {
var ensureLVM bool
switch mode {
case LVMPartitioningMode:
ensureLVM = true
case RawPartitioningMode:
ensureLVM = false
case DefaultPartitioningMode, AutoLVMPartitioningMode:
ensureLVM = len(newMountpoints) > 0
default:
return nil, fmt.Errorf("unsupported partitioning mode %q", mode)
}
if ensureLVM {
err := newPT.ensureLVM()
if err != nil {
return nil, err
@ -626,63 +659,75 @@ func (pt *PartitionTable) ensureLVM() error {
}
} else {
panic("unsupported parent for LVM")
return fmt.Errorf("Unsupported parent for LVM")
}
return nil
}
func (pt *PartitionTable) GetBuildPackages() []string {
packages := []string{}
type partitionTableFeatures struct {
LVM bool
Btrfs bool
XFS bool
FAT bool
EXT4 bool
LUKS bool
}
hasLVM := false
hasBtrfs := false
hasXFS := false
hasFAT := false
hasEXT4 := false
hasLUKS := false
// features examines all of the PartitionTable entities
// and returns a struct with flags set for each feature used
func (pt *PartitionTable) features() partitionTableFeatures {
var ptFeatures partitionTableFeatures
introspectPT := func(e Entity, path []Entity) error {
switch ent := e.(type) {
case *LVMLogicalVolume:
hasLVM = true
ptFeatures.LVM = true
case *Btrfs:
hasBtrfs = true
ptFeatures.Btrfs = true
case *Filesystem:
switch ent.GetFSType() {
case "vfat":
hasFAT = true
ptFeatures.FAT = true
case "btrfs":
hasBtrfs = true
ptFeatures.Btrfs = true
case "xfs":
hasXFS = true
ptFeatures.XFS = true
case "ext4":
hasEXT4 = true
ptFeatures.EXT4 = true
}
case *LUKSContainer:
hasLUKS = true
ptFeatures.LUKS = true
}
return nil
}
_ = pt.ForEachEntity(introspectPT)
// TODO: LUKS
if hasLVM {
return ptFeatures
}
// GetBuildPackages returns an array of packages needed to support the features used in the PartitionTable.
func (pt *PartitionTable) GetBuildPackages() []string {
packages := []string{}
features := pt.features()
if features.LVM {
packages = append(packages, "lvm2")
}
if hasBtrfs {
if features.Btrfs {
packages = append(packages, "btrfs-progs")
}
if hasXFS {
if features.XFS {
packages = append(packages, "xfsprogs")
}
if hasFAT {
if features.FAT {
packages = append(packages, "dosfstools")
}
if hasEXT4 {
if features.EXT4 {
packages = append(packages, "e2fsprogs")
}
if hasLUKS {
if features.LUKS {
packages = append(packages,
"clevis",
"clevis-luks",

View file

@ -130,10 +130,11 @@ type ImageType interface {
// The ImageOptions specify options for a specific image build
type ImageOptions struct {
Size uint64
OSTree *ostree.ImageOptions
Subscription *subscription.ImageOptions
Facts *facts.ImageOptions
Size uint64
OSTree *ostree.ImageOptions
Subscription *subscription.ImageOptions
Facts *facts.ImageOptions
PartitioningMode disk.PartitioningMode
}
type BasePartitionTableMap map[string]disk.PartitionTable

View file

@ -541,6 +541,16 @@ func newDistro(version int) distro.Distro {
distro: &rd,
}
ppc64le := architecture{
distro: &rd,
name: platform.ARCH_PPC64LE.String(),
}
s390x := architecture{
distro: &rd,
name: platform.ARCH_S390X.String(),
}
ociImgType := qcow2ImgType
ociImgType.name = "oci"
@ -852,6 +862,36 @@ func newDistro(version int) distro.Distro {
)
}
rd.addArches(x86_64, aarch64)
ppc64le.addImageTypes(
&platform.PPC64LE{
BIOS: true,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_QCOW2,
QCOW2Compat: "1.1",
},
},
qcow2ImgType,
)
ppc64le.addImageTypes(
&platform.PPC64LE{},
containerImgType,
)
s390x.addImageTypes(
&platform.S390X{
Zipl: true,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_QCOW2,
QCOW2Compat: "1.1",
},
},
qcow2ImgType,
)
s390x.addImageTypes(
&platform.S390X{},
containerImgType,
)
rd.addArches(x86_64, aarch64, ppc64le, s390x)
return &rd
}

View file

@ -136,9 +136,18 @@ func (t *imageType) getPartitionTable(
imageSize := t.Size(options.Size)
lvmify := !t.rpmOstree
partitioningMode := options.PartitioningMode
if t.rpmOstree {
// IoT supports only LVM, force it.
// Raw is not supported, return an error if it is requested
// TODO Need a central location for logic like this
if partitioningMode == disk.RawPartitioningMode {
return nil, fmt.Errorf("partitioning mode raw not supported for %s on %s", t.Name(), t.arch.Name())
}
partitioningMode = disk.AutoLVMPartitioningMode
}
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, lvmify, t.requiredPartitionSizes, rng)
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, partitioningMode, t.requiredPartitionSizes, rng)
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -106,6 +106,67 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_PPC64LE.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
{
Size: 4 * common.MebiByte,
Type: "41",
Bootable: true,
},
{
Size: 500 * common.MebiByte,
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/boot",
Label: "boot",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
{
Size: 2 * common.GibiByte,
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
},
},
platform.ARCH_S390X.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
{
Size: 500 * common.MebiByte,
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/boot",
Label: "boot",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
{
Size: 2 * common.GibiByte,
Bootable: true,
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
},
},
}
var minimalrawPartitionTables = distro.BasePartitionTableMap{

View file

@ -125,7 +125,7 @@ func (t *imageType) getPartitionTable(
imageSize := t.Size(options.Size)
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, true, nil, rng)
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, options.PartitioningMode, nil, rng)
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -61,7 +61,7 @@ func ec2ImgTypeX86_64(rd distribution) imageType {
func ec2HaImgTypeX86_64(rd distribution) imageType {
basePartitionTables := ec2BasePartitionTables
// use legacy partition tables for RHEL 8.8 and older
if common.VersionLessThan(rd.osVersion, "8.9") {
if rd.isRHEL() && common.VersionLessThan(rd.osVersion, "8.9") {
basePartitionTables = ec2LegacyBasePartitionTables
}
@ -223,29 +223,6 @@ func baseEc2ImageConfig() *distro.ImageConfig {
},
},
},
RHSMConfig: map[subscription.RHSMStatus]*osbuild.RHSMStageOptions{
subscription.RHSMConfigNoSubscription: {
// RHBZ#1932802
SubMan: &osbuild.RHSMStageOptionsSubMan{
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
AutoRegistration: common.ToPtr(true),
},
Rhsm: &osbuild.SubManConfigRHSMSection{
ManageRepos: common.ToPtr(false),
},
},
},
subscription.RHSMConfigWithSubscription: {
// RHBZ#1932802
SubMan: &osbuild.RHSMStageOptionsSubMan{
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
AutoRegistration: common.ToPtr(true),
},
// do not disable the redhat.repo management if the user
// explicitly request the system to be subscribed
},
},
},
SystemdLogind: []*osbuild.SystemdLogindStageOptions{
{
Filename: "00-getty-fixes.conf",
@ -317,21 +294,15 @@ func baseEc2ImageConfig() *distro.ImageConfig {
func defaultEc2ImageConfig(rd distribution) *distro.ImageConfig {
ic := baseEc2ImageConfig()
if rd.isRHEL() && common.VersionLessThan(rd.osVersion, "9.1") {
// The RHSM configuration should not be applied since 8.7, but it is instead done by installing the
// redhat-cloud-client-configuration package. See COMPOSER-1804 for more information.
if rd.isRHEL() && common.VersionLessThan(rd.osVersion, "8.7") {
ic = appendRHSM(ic)
// Disable RHSM redhat.repo management
rhsmConf := ic.RHSMConfig[subscription.RHSMConfigNoSubscription]
rhsmConf.SubMan.Rhsm = &osbuild.SubManConfigRHSMSection{ManageRepos: common.ToPtr(false)}
ic.RHSMConfig[subscription.RHSMConfigNoSubscription] = rhsmConf
}
// The RHSM configuration should not be applied since 8.7, but it is instead done by installing the redhat-cloud-client-configuration package.
// See COMPOSER-1804 for more information.
rhel87PlusEc2ImageConfigOverride := &distro.ImageConfig{
RHSMConfig: map[subscription.RHSMStatus]*osbuild.RHSMStageOptions{},
}
if !common.VersionLessThan(rd.osVersion, "8.7") {
ic = rhel87PlusEc2ImageConfigOverride.InheritFrom(ic)
}
return ic
}
@ -340,7 +311,7 @@ func defaultEc2ImageConfig(rd distribution) *distro.ImageConfig {
func defaultAMIImageConfig(rd distribution) *distro.ImageConfig {
ic := defaultEc2ImageConfig(rd)
if rd.isRHEL() {
// defaultAMIImageConfig() adds the rhsm options only for RHEL < 9.1
// defaultEc2ImageConfig() adds the rhsm options only for RHEL < 8.7
// Add it unconditionally for AMI
ic = appendRHSM(ic)
}

View file

@ -125,7 +125,7 @@ func (d *distribution) getDefaultImageConfig() *distro.ImageConfig {
// New creates a new distro object, defining the supported architectures and image types
func New() distro.Distro {
// default minor: create default minor version (current GA) and rename it
d := newDistro("rhel", 8)
d := newDistro("rhel", 10)
d.name = "rhel-8"
return d
@ -155,6 +155,10 @@ func NewRHEL89() distro.Distro {
return newDistro("rhel", 9)
}
func NewRHEL810() distro.Distro {
return newDistro("rhel", 10)
}
func NewCentos() distro.Distro {
return newDistro("centos", 0)
}

View file

@ -156,9 +156,18 @@ func (t *imageType) getPartitionTable(
imageSize := t.Size(options.Size)
lvmify := !t.rpmOstree
partitioningMode := options.PartitioningMode
if t.rpmOstree {
// Edge supports only raw, force it.
// LVM is not supported, return an error if it is requested
// TODO Need a central location for logic like this
if partitioningMode == disk.LVMPartitioningMode {
return nil, fmt.Errorf("partitioning mode lvm not supported for %s on %s", t.Name(), t.arch.Name())
}
partitioningMode = disk.RawPartitioningMode
}
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, lvmify, nil, rng)
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, partitioningMode, nil, rng)
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -90,7 +90,6 @@ func ubiCommonPackageSet(t *imageType) rpmmd.PackageSet {
"elfutils-debuginfod-client",
"fedora-release",
"fedora-repos",
"file",
"fontpackages-filesystem",
"gawk-all-langpacks",
"gettext",

View file

@ -269,7 +269,7 @@ func defaultEc2ImageConfig(osVersion string, rhsm bool) *distro.ImageConfig {
func defaultAMIImageConfig(osVersion string, rhsm bool) *distro.ImageConfig {
ic := defaultEc2ImageConfig(osVersion, rhsm)
if rhsm {
// defaultAMIImageConfig() adds the rhsm options only for RHEL < 9.1
// defaultEc2ImageConfig() adds the rhsm options only for RHEL < 9.1
// Add it unconditionally for AMI
ic = appendRHSM(ic)
}

View file

@ -126,7 +126,7 @@ func (d *distribution) getDefaultImageConfig() *distro.ImageConfig {
func New() distro.Distro {
// default minor: create default minor version (current GA) and rename it
d := newDistro("rhel", 2)
d := newDistro("rhel", 4)
d.name = "rhel-9"
return d
}
@ -151,6 +151,10 @@ func NewRHEL93() distro.Distro {
return newDistro("rhel", 3)
}
func NewRHEL94() distro.Distro {
return newDistro("rhel", 4)
}
func newDistro(name string, minor int) *distribution {
var rd distribution
switch name {

View file

@ -586,7 +586,7 @@ func edgeCommitPackageSet(t *imageType) rpmmd.PackageSet {
ps = ps.Append(aarch64EdgeCommitPackageSet(t))
}
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !common.VersionLessThan(t.arch.distro.osVersion, "9-stream") {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
ps.Include = append(ps.Include, "ignition", "ignition-edge", "ssh-key-dir")
}

View file

@ -300,7 +300,7 @@ func edgeCommitImage(workload workload.Workload,
img.OSVersion = t.arch.distro.osVersion
img.Filename = t.Filename()
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.OSCustomizations.EnabledServices = append(img.OSCustomizations.EnabledServices, "ignition-firstboot-complete.service", "coreos-ignition-write-issues.service")
}
img.Environment = t.environment
@ -334,7 +334,7 @@ func edgeContainerImage(workload workload.Workload,
img.ExtraContainerPackages = packageSets[containerPkgsKey]
img.Filename = t.Filename()
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.OSCustomizations.EnabledServices = append(img.OSCustomizations.EnabledServices, "ignition-firstboot-complete.service", "coreos-ignition-write-issues.service")
}
@ -408,12 +408,12 @@ func edgeRawImage(workload workload.Workload,
img.KernelOptionsAppend = []string{"modprobe.blacklist=vc4"}
img.Keyboard = "us"
img.Locale = "C.UTF-8"
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.SysrootReadOnly = true
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "rw")
}
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.Ignition = true
img.IgnitionPlatform = "metal"
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
@ -467,7 +467,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
rawImg.KernelOptionsAppend = []string{"modprobe.blacklist=vc4"}
rawImg.Keyboard = "us"
rawImg.Locale = "C.UTF-8"
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
rawImg.SysrootReadOnly = true
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "rw")
}
@ -481,7 +481,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
}
rawImg.OSName = "redhat"
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
rawImg.Ignition = true
rawImg.IgnitionPlatform = "metal"
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {

View file

@ -161,9 +161,19 @@ func (t *imageType) getPartitionTable(
imageSize := t.Size(options.Size)
lvmify := !t.rpmOstree
partitioningMode := options.PartitioningMode
if t.rpmOstree {
// Edge supports only LVM, force it.
// Raw is not supported, return an error if it is requested
// TODO Need a central location for logic like this
if partitioningMode == disk.RawPartitioningMode {
return nil, fmt.Errorf("partitioning mode raw not supported for %s on %s", t.Name(), t.arch.Name())
}
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, lvmify, nil, rng)
partitioningMode = disk.LVMPartitioningMode
}
return disk.NewPartitionTable(&basePartitionTable, mountpoints, imageSize, partitioningMode, nil, rng)
}
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {

View file

@ -30,6 +30,7 @@ var supportedDistros = []func() distro.Distro{
rhel8.NewRHEL87,
rhel8.NewRHEL88,
rhel8.NewRHEL89,
rhel8.NewRHEL810,
rhel8.NewCentos,
rhel9.New,
@ -37,6 +38,7 @@ var supportedDistros = []func() distro.Distro{
rhel9.NewRHEL91,
rhel9.NewRHEL92,
rhel9.NewRHEL93,
rhel9.NewRHEL94,
rhel9.NewCentOS9,
}

View file

@ -58,6 +58,7 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
img.OSVersion)
livePipeline.ExtraPackages = img.ExtraBasePackages.Include
livePipeline.ExcludePackages = img.ExtraBasePackages.Exclude
livePipeline.Variant = img.Variant
livePipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)

View file

@ -63,6 +63,7 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
img.Product,
img.OSVersion)
anacondaPipeline.ExtraPackages = img.ExtraBasePackages.Include
anacondaPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
anacondaPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
anacondaPipeline.Users = img.Users
anacondaPipeline.Groups = img.Groups

View file

@ -75,6 +75,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest,
img.OSVersion)
anacondaPipeline.ExtraPackages = img.ExtraBasePackages.Include
anacondaPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
anacondaPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
anacondaPipeline.Users = img.Users
anacondaPipeline.Groups = img.Groups

View file

@ -89,6 +89,7 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
img.Product,
img.OSVersion)
coiPipeline.ExtraPackages = img.ExtraBasePackages.Include
coiPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
coiPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
coiPipeline.FDO = img.FDO
coiPipeline.Ignition = img.IgnitionEmbedded

View file

@ -30,9 +30,10 @@ type AnacondaInstaller struct {
// manifest.
Type AnacondaInstallerType
// Packages to install in addition to the ones required by the
// Packages to install and/or exclude in addition to the ones required by the
// pipeline.
ExtraPackages []string
ExtraPackages []string
ExcludePackages []string
// Extra repositories to install packages from
ExtraRepos []rpmmd.RepoConfig
@ -146,6 +147,7 @@ func (p *AnacondaInstaller) getPackageSetChain(Distro) []rpmmd.PackageSet {
return []rpmmd.PackageSet{
{
Include: append(packages, p.ExtraPackages...),
Exclude: p.ExcludePackages,
Repositories: append(p.repos, p.ExtraRepos...),
InstallWeakDeps: true,
},
@ -273,18 +275,32 @@ func (p *AnacondaInstaller) serialize() osbuild.Pipeline {
}))
}
dracutModules := append(
p.AdditionalDracutModules,
"anaconda",
"rdma",
"rngd",
"multipath",
"fcoe",
"fcoe-uefi",
"iscsi",
"lunmask",
"nfs",
)
var dracutModules []string
if p.Type == AnacondaInstallerTypePayload {
dracutModules = append(
p.AdditionalDracutModules,
"anaconda",
"rdma",
"rngd",
"multipath",
"fcoe",
"fcoe-uefi",
"iscsi",
"lunmask",
"nfs",
)
} else if p.Type == AnacondaInstallerTypeLive {
dracutModules = append(
p.AdditionalDracutModules,
"anaconda",
"rdma",
"rngd",
)
} else {
panic("invalid anaconda installer type")
}
dracutOptions := dracutStageOptions(p.kernelVer, p.Biosdevname, dracutModules)
dracutOptions.AddDrivers = p.AdditionalDrivers
pipeline.AddStage(osbuild.NewDracutStage(dracutOptions))

View file

@ -15,9 +15,10 @@ import (
type CoreOSInstaller struct {
Base
// Packages to install in addition to the ones required by the
// Packages to install or exclude in addition to the ones required by the
// pipeline.
ExtraPackages []string
ExtraPackages []string
ExcludePackages []string
// Extra repositories to install packages from
ExtraRepos []rpmmd.RepoConfig
@ -125,6 +126,7 @@ func (p *CoreOSInstaller) getPackageSetChain(Distro) []rpmmd.PackageSet {
return []rpmmd.PackageSet{
{
Include: append(packages, p.ExtraPackages...),
Exclude: p.ExcludePackages,
Repositories: append(p.repos, p.ExtraRepos...),
InstallWeakDeps: true,
},

View file

@ -17,17 +17,29 @@ func (p *PPC64LE) GetBIOSPlatform() string {
}
func (p *PPC64LE) GetPackages() []string {
return []string{
"dracut-config-generic",
"powerpc-utils",
"grub2-ppc64le",
"grub2-ppc64le-modules",
packages := p.BasePlatform.FirmwarePackages
if p.BIOS {
packages = append(packages,
"dracut-config-generic",
"powerpc-utils",
"grub2-ppc64le",
"grub2-ppc64le-modules",
)
}
return packages
}
func (p *PPC64LE) GetBuildPackages() []string {
return []string{
"grub2-ppc64le",
"grub2-ppc64le-modules",
packages := []string{}
if p.BIOS {
packages = append(packages,
"grub2-ppc64le",
"grub2-ppc64le-modules",
)
}
return packages
}

View file

@ -15,18 +15,24 @@ func (p *S390X) GetZiplSupport() bool {
func (p *S390X) GetPackages() []string {
packages := p.BasePlatform.FirmwarePackages
// TODO: should these packages be present also in images not intended for booting?
packages = append(packages,
"dracut-config-generic",
"s390utils-base",
"s390utils-core",
)
if p.Zipl {
packages = append(packages,
"dracut-config-generic",
"s390utils-base",
"s390utils-core",
)
}
return packages
}
func (p *S390X) GetBuildPackages() []string {
// TODO: should these packages be present also in images not intended for booting?
return []string{
"s390utils-base",
packages := []string{}
if p.Zipl {
packages = append(packages, "s390utils-base")
}
return packages
}