build(deps): bump the go-deps group with 5 updates

Bumps the go-deps group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.48.1` | `1.48.13` |
| [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) | `1.7.0` | `1.8.0` |
| [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.385` | `0.1.388` |
| [github.com/osbuild/images](https://github.com/osbuild/images) | `0.18.0` | `0.21.0` |
| [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.152.0` | `0.153.0` |


Updates `github.com/aws/aws-sdk-go` from 1.48.1 to 1.48.13
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.48.1...v1.48.13)

Updates `github.com/gophercloud/gophercloud` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/gophercloud/gophercloud/releases)
- [Changelog](https://github.com/gophercloud/gophercloud/blob/v1.8.0/CHANGELOG.md)
- [Commits](https://github.com/gophercloud/gophercloud/compare/v1.7.0...v1.8.0)

Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.385 to 0.1.388
- [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases)
- [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md)
- [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.385...v0.1.388)

Updates `github.com/osbuild/images` from 0.18.0 to 0.21.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.18.0...v0.21.0)

Updates `google.golang.org/api` from 0.152.0 to 0.153.0
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.152.0...v0.153.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/gophercloud/gophercloud
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/openshift-online/ocm-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2023-12-06 05:11:45 +00:00 committed by Tomáš Hozza
parent d3dd83aceb
commit 016051a4b8
105 changed files with 7698 additions and 2795 deletions

View file

@ -4,28 +4,11 @@ import (
"fmt"
"io"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
)
var RuntimeGOARCH = runtime.GOARCH
func CurrentArch() string {
if RuntimeGOARCH == "amd64" {
return "x86_64"
} else if RuntimeGOARCH == "arm64" {
return "aarch64"
} else if RuntimeGOARCH == "ppc64le" {
return "ppc64le"
} else if RuntimeGOARCH == "s390x" {
return "s390x"
} else {
panic("unsupported architecture")
}
}
func PanicOnError(err error) {
if err != nil {
panic(err)

81
vendor/github.com/osbuild/images/pkg/arch/arch.go generated vendored Normal file
View file

@ -0,0 +1,81 @@
package arch
import (
"runtime"
)
type Arch uint64
const ( // architecture enum
ARCH_AARCH64 Arch = iota
ARCH_PPC64LE
ARCH_S390X
ARCH_X86_64
)
func (a Arch) String() string {
switch a {
case ARCH_AARCH64:
return "aarch64"
case ARCH_PPC64LE:
return "ppc64le"
case ARCH_S390X:
return "s390x"
case ARCH_X86_64:
return "x86_64"
default:
panic("invalid architecture")
}
}
func FromString(a string) Arch {
switch a {
case "amd64":
fallthrough
case "x86_64":
return ARCH_X86_64
case "arm64":
fallthrough
case "aarch64":
return ARCH_AARCH64
case "s390x":
return ARCH_S390X
case "ppc64le":
return ARCH_PPC64LE
default:
panic("unsupported architecture")
}
}
var runtimeGOARCH = runtime.GOARCH
func Current() Arch {
switch runtimeGOARCH {
case "amd64":
return ARCH_X86_64
case "arm64":
return ARCH_AARCH64
case "ppc64le":
return ARCH_PPC64LE
case "s390x":
return ARCH_S390X
default:
panic("unsupported architecture")
}
}
func IsX86_64() bool {
return Current() == ARCH_X86_64
}
func IsAarch64() bool {
return Current() == ARCH_AARCH64
}
func IsPPC() bool {
return Current() == ARCH_PPC64LE
}
func IsS390x() bool {
return Current() == ARCH_S390X
}

View file

@ -385,7 +385,7 @@ func (pt *PartitionTable) applyCustomization(mountpoints []blueprint.FilesystemC
// Dynamically calculate and update the start point for each of the existing
// partitions. Adjusts the overall size of image to either the supplied
// value in `size` or to the sum of all partitions if that is lager.
// value in `size` or to the sum of all partitions if that is larger.
// Will grow the root partition if there is any empty space.
// Returns the updated start point.
func (pt *PartitionTable) relayout(size uint64) uint64 {
@ -406,6 +406,8 @@ func (pt *PartitionTable) relayout(size uint64) uint64 {
for idx := range pt.Partitions {
partition := &pt.Partitions[idx]
if len(entityPath(partition, "/")) != 0 {
// keep the root partition index to handle after all the other
// partitions have been moved and resized
rootIdx = idx
continue
}
@ -586,6 +588,13 @@ func resizeEntityBranch(path []Entity, size uint64) {
break
}
}
// If containerSize is 0, it means it doesn't have any direct sizeable
// children (e.g., a LUKS container with a VG child). In that case,
// set the containerSize to the desired size for the branch before
// adding any metadata.
if containerSize == 0 {
containerSize = size
}
if vc, ok := element.(VolumeContainer); ok {
containerSize += vc.MetadataSize()
}
@ -642,14 +651,17 @@ func (pt *PartitionTable) ensureLVM() error {
Description: "created via lvm2 and osbuild",
}
// create root logical volume on the new volume group with the same
// size and filesystem as the previous root partition
_, err := vg.CreateLogicalVolume("root", part.Size, filesystem)
if err != nil {
panic(fmt.Sprintf("Could not create LV: %v", err))
}
// replace the top-level partition payload with the new volume group
part.Payload = vg
// reset it so it will be grown later
// reset the vg partition size - it will be grown later
part.Size = 0
if pt.Type == "gpt" {

View file

@ -10,6 +10,7 @@ import (
"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/fsnode"
"github.com/osbuild/images/internal/oscap"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
@ -532,23 +533,23 @@ func newDistro(version int) distro.Distro {
// Architecture definitions
x86_64 := architecture{
name: platform.ARCH_X86_64.String(),
name: arch.ARCH_X86_64.String(),
distro: &rd,
}
aarch64 := architecture{
name: platform.ARCH_AARCH64.String(),
name: arch.ARCH_AARCH64.String(),
distro: &rd,
}
ppc64le := architecture{
distro: &rd,
name: platform.ARCH_PPC64LE.String(),
name: arch.ARCH_PPC64LE.String(),
}
s390x := architecture{
distro: &rd,
name: platform.ARCH_S390X.String(),
name: arch.ARCH_S390X.String(),
}
ociImgType := qcow2ImgType

View file

@ -491,7 +491,7 @@ func iotImage(workload workload.Workload,
if err != nil {
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
img := image.NewOSTreeDiskImage(commit)
img := image.NewOSTreeDiskImageFromCommit(commit)
distro := t.Arch().Distro()
@ -522,9 +522,10 @@ func iotImage(workload workload.Workload,
Name: "fedora-iot",
}
img.OSName = "fedora-iot"
img.LockRoot = true
if !common.VersionLessThan(distro.Releasever(), "38") {
img.Ignition = true
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "coreos.no_persist_ip")
switch img.Platform.GetImageFormat() {
case platform.FORMAT_RAW:
img.IgnitionPlatform = "metal"
@ -565,7 +566,7 @@ func iotSimplifiedInstallerImage(workload workload.Workload,
if err != nil {
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
rawImg := image.NewOSTreeDiskImage(commit)
rawImg := image.NewOSTreeDiskImageFromCommit(commit)
customizations := bp.Customizations
rawImg.Users = users.UsersFromBP(customizations.GetUsers())
@ -585,10 +586,11 @@ func iotSimplifiedInstallerImage(workload workload.Workload,
Name: "fedora-iot",
}
rawImg.OSName = "fedora"
rawImg.LockRoot = true
if !common.VersionLessThan(t.arch.distro.osVersion, "38") {
rawImg.Ignition = true
rawImg.IgnitionPlatform = "metal"
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}

View file

@ -7,7 +7,7 @@ import (
"strconv"
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -364,7 +364,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.Arch().Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"biosdevname",
@ -374,7 +374,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
},
})
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"dmidecode",

View file

@ -2,13 +2,13 @@ package fedora
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/platform"
)
var defaultBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -60,7 +60,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -106,7 +106,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_PPC64LE.String(): disk.PartitionTable{
arch.ARCH_PPC64LE.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
@ -139,7 +139,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
platform.ARCH_S390X.String(): disk.PartitionTable{
arch.ARCH_S390X.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
@ -170,7 +170,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
}
var minimalrawPartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
StartOffset: 8 * common.MebiByte,
@ -217,7 +217,7 @@ var minimalrawPartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "0xc1748067",
Type: "dos",
StartOffset: 8 * common.MebiByte,
@ -265,7 +265,7 @@ var minimalrawPartitionTables = distro.BasePartitionTableMap{
}
var iotBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -311,7 +311,7 @@ var iotBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "0xc1748067",
Type: "dos",
Partitions: []disk.Partition{
@ -358,7 +358,7 @@ var iotBasePartitionTables = distro.BasePartitionTableMap{
}
var iotSimplifiedInstallerPartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -428,7 +428,7 @@ var iotSimplifiedInstallerPartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "0xc1748067",
Type: "dos",
Partitions: []disk.Partition{

View file

@ -2,10 +2,10 @@ package rhel7
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/subscription"
)
@ -273,7 +273,7 @@ func azureRhuiCommonPackageSet(t *imageType) rpmmd.PackageSet {
}
var azureRhuiBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Size: 64 * common.GibiByte,

View file

@ -7,6 +7,7 @@ import (
"strings"
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
@ -200,7 +201,7 @@ func newDistro(distroName string) distro.Distro {
// Architecture definitions
x86_64 := architecture{
name: platform.ARCH_X86_64.String(),
name: arch.ARCH_X86_64.String(),
distro: &rd,
}

View file

@ -7,13 +7,13 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/image"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -40,7 +40,7 @@ func osCustomizations(
kernelOptions = append(kernelOptions, bpKernel.Append)
}
osc.KernelOptionsAppend = kernelOptions
if t.platform.GetArch() != platform.ARCH_S390X {
if t.platform.GetArch() != arch.ARCH_S390X {
osc.KernelOptionsBootloader = true
}
}

View file

@ -2,13 +2,13 @@ package rhel7
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/platform"
)
var defaultBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{

View file

@ -3,10 +3,10 @@ package rhel8
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/shell"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/subscription"
)
@ -261,7 +261,7 @@ func azureEapPackageSet(t *imageType) rpmmd.PackageSet {
// PARTITION TABLES
var azureRhuiBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Size: 64 * common.GibiByte,
@ -369,7 +369,7 @@ var azureRhuiBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Size: 64 * common.GibiByte,

View file

@ -3,7 +3,7 @@ package rhel8
import (
"fmt"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -146,7 +146,7 @@ func installerPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"biosdevname",
@ -278,7 +278,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
ps = ps.Append(anacondaBootPackageSet(t))
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"biosdevname",
@ -287,7 +287,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
},
})
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"dmidecode",

View file

@ -8,6 +8,7 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/oscap"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
@ -198,22 +199,22 @@ func newDistro(name string, minor int) *distribution {
// Architecture definitions
x86_64 := architecture{
name: platform.ARCH_X86_64.String(),
name: arch.ARCH_X86_64.String(),
distro: &rd,
}
aarch64 := architecture{
name: platform.ARCH_AARCH64.String(),
name: arch.ARCH_AARCH64.String(),
distro: &rd,
}
ppc64le := architecture{
distro: &rd,
name: platform.ARCH_PPC64LE.String(),
name: arch.ARCH_PPC64LE.String(),
}
s390x := architecture{
distro: &rd,
name: platform.ARCH_S390X.String(),
name: arch.ARCH_S390X.String(),
}
ociImgType := qcow2ImgType(rd)

View file

@ -5,8 +5,8 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/fsnode"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -249,10 +249,10 @@ func edgeCommitPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(x8664EdgeCommitPackageSet(t))
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(aarch64EdgeCommitPackageSet(t))
}
@ -370,9 +370,9 @@ func edgeSimplifiedInstallerPackageSet(t *imageType) rpmmd.PackageSet {
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(x8664EdgeCommitPackageSet(t))
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(aarch64EdgeCommitPackageSet(t))
default:

View file

@ -10,6 +10,7 @@ import (
"github.com/osbuild/images/internal/oscap"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/distro"
@ -17,7 +18,6 @@ import (
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/ostree"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -44,7 +44,7 @@ func osCustomizations(
kernelOptions = append(kernelOptions, bpKernel.Append)
}
osc.KernelOptionsAppend = kernelOptions
if t.platform.GetArch() != platform.ARCH_S390X {
if t.platform.GetArch() != arch.ARCH_S390X {
osc.KernelOptionsBootloader = true
}
}
@ -443,7 +443,7 @@ func edgeRawImage(workload workload.Workload,
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
img := image.NewOSTreeDiskImage(commit)
img := image.NewOSTreeDiskImageFromCommit(commit)
img.Users = users.UsersFromBP(customizations.GetUsers())
img.Groups = users.GroupsFromBP(customizations.GetGroups())
@ -461,6 +461,7 @@ func edgeRawImage(workload workload.Workload,
ContentURL: options.OSTree.ContentURL,
}
img.OSName = "redhat"
img.LockRoot = true
// TODO: move generation into LiveImage
pt, err := t.getPartitionTable(customizations.GetFilesystems(), options, rng)
@ -488,7 +489,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
rawImg := image.NewOSTreeDiskImage(commit)
rawImg := image.NewOSTreeDiskImageFromCommit(commit)
rawImg.Users = users.UsersFromBP(customizations.GetUsers())
rawImg.Groups = users.GroupsFromBP(customizations.GetGroups())
@ -505,6 +506,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
ContentURL: options.OSTree.ContentURL,
}
rawImg.OSName = "redhat"
rawImg.LockRoot = true
// TODO: move generation into LiveImage
pt, err := t.getPartitionTable(customizations.GetFilesystems(), options, rng)

View file

@ -5,7 +5,7 @@ package rhel8
import (
"fmt"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -30,7 +30,7 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(grubCommon)
ps = ps.Append(efiCommon)
ps = ps.Append(rpmmd.PackageSet{
@ -46,7 +46,7 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet {
"syslinux-nonlinux",
},
})
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(grubCommon)
ps = ps.Append(efiCommon)
ps = ps.Append(rpmmd.PackageSet{

View file

@ -2,13 +2,13 @@ package rhel8
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/platform"
)
var defaultBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -46,7 +46,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -78,7 +78,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_PPC64LE.String(): disk.PartitionTable{
arch.ARCH_PPC64LE.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
@ -99,7 +99,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_S390X.String(): disk.PartitionTable{
arch.ARCH_S390X.String(): disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
Partitions: []disk.Partition{
@ -119,7 +119,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
}
var ec2BasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -171,7 +171,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -222,7 +222,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
// ec2LegacyBasePartitionTables is the partition table layout for RHEL EC2
// images prior to 8.9. It is used for backwards compatibility.
var ec2LegacyBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -247,7 +247,7 @@ var ec2LegacyBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -294,7 +294,7 @@ var ec2LegacyBasePartitionTables = distro.BasePartitionTableMap{
}
var edgeBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
arch.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
@ -361,7 +361,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
arch.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{

View file

@ -155,14 +155,18 @@ func openstackCommonPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{
Include: []string{
// Defaults
"@Core", "langpacks-en",
"@Core",
"langpacks-en",
// From the lorax kickstart
"selinux-policy-targeted", "cloud-init", "qemu-guest-agent",
"selinux-policy-targeted",
"cloud-init",
"qemu-guest-agent",
"spice-vdagent",
},
Exclude: []string{
"dracut-config-rescue", "rng-tools",
"dracut-config-rescue",
"rng-tools",
},
}
}

View file

@ -300,6 +300,7 @@ func ec2BuildPackageSet(t *imageType) rpmmd.PackageSet {
func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{
Include: []string{
"@core",
"authselect-compat",
"chrony",
"cloud-init",
@ -314,6 +315,7 @@ func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"redhat-release",
"redhat-release-eula",
"rsync",
"tuned",
"tar",
},
Exclude: []string{
@ -321,16 +323,35 @@ func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"alsa-firmware",
"alsa-tools-firmware",
"biosdevname",
"firewalld",
"iprutils",
"ivtv-firmware",
"iwl1000-firmware",
"iwl100-firmware",
"iwl105-firmware",
"iwl135-firmware",
"iwl2000-firmware",
"iwl2030-firmware",
"iwl3160-firmware",
"iwl3945-firmware",
"iwl4965-firmware",
"iwl5000-firmware",
"iwl5150-firmware",
"iwl6000-firmware",
"iwl6000g2a-firmware",
"iwl6000g2b-firmware",
"iwl6050-firmware",
"iwl7260-firmware",
"libertas-sd8686-firmware",
"libertas-sd8787-firmware",
"libertas-usb8388-firmware",
"plymouth",
// RHBZ#2064087
"dracut-config-rescue",
// RHBZ#2075815
"qemu-guest-agent",
},
}.Append(coreOsCommonPackageSet(t)).Append(distroSpecificPackageSet(t))
}.Append(distroSpecificPackageSet(t))
}
// common rhel ec2 RHUI image package set

View file

@ -2,10 +2,10 @@ package rhel9
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/subscription"
)
@ -149,14 +149,6 @@ func azureCommonPackageSet(t *imageType) rpmmd.PackageSet {
},
}.Append(distroSpecificPackageSet(t))
if t.arch.distro.isRHEL() {
ps.Append(rpmmd.PackageSet{
Include: []string{
"rhc",
},
})
}
return ps
}
@ -184,7 +176,7 @@ func azureRhuiBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
}
switch t.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -293,7 +285,7 @@ func azureRhuiBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
}, true
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",

View file

@ -3,7 +3,7 @@ package rhel9
import (
"fmt"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -47,6 +47,7 @@ var (
func bareMetalPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"authselect-compat",
"chrony",
"cockpit-system",
@ -82,8 +83,12 @@ func bareMetalPackageSet(t *imageType) rpmmd.PackageSet {
"rsync",
"tar",
"tcpdump",
"tuned",
},
}.Append(coreOsCommonPackageSet(t)).Append(distroBuildPackageSet(t))
Exclude: []string{
"dracut-config-rescue",
},
}.Append(distroBuildPackageSet(t))
// Ensure to not pull in subscription-manager on non-RHEL distro
if t.arch.distro.isRHEL() {
@ -133,8 +138,22 @@ func installerPackageSet(t *imageType) rpmmd.PackageSet {
},
}
ps = ps.Append(rpmmd.PackageSet{
// Extra packages that are required by the dracut stage of all installers.
// These are weak deps of other packages in the list above, but lets be
// explicit about what we need and not rely on the weak deps. Relying
// on hard-dependencies for other modules is OK for now.
//
// TODO: add these dynamically based on the modules enabled by each
// pipeline.
Include: []string{
"mdadm",
"nss-softokn",
},
})
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"biosdevname",
@ -292,7 +311,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
ps = ps.Append(anacondaBootPackageSet(t))
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"biosdevname",
@ -302,7 +321,7 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
},
})
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"dmidecode",

View file

@ -8,6 +8,7 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/oscap"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
@ -190,23 +191,23 @@ func newDistro(name string, minor int) *distribution {
// Architecture definitions
x86_64 := architecture{
name: platform.ARCH_X86_64.String(),
name: arch.ARCH_X86_64.String(),
distro: &rd,
}
aarch64 := architecture{
name: platform.ARCH_AARCH64.String(),
name: arch.ARCH_AARCH64.String(),
distro: &rd,
}
ppc64le := architecture{
distro: &rd,
name: platform.ARCH_PPC64LE.String(),
name: arch.ARCH_PPC64LE.String(),
}
s390x := architecture{
distro: &rd,
name: platform.ARCH_S390X.String(),
name: arch.ARCH_S390X.String(),
}
qcow2ImgType := mkQcow2ImgType(rd)

View file

@ -6,10 +6,10 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/fsnode"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -237,7 +237,7 @@ func minimalrawPartitionTables(t *imageType) (disk.PartitionTable, bool) {
}
switch t.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -285,7 +285,7 @@ func minimalrawPartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
}, true
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -340,7 +340,7 @@ func minimalrawPartitionTables(t *imageType) (disk.PartitionTable, bool) {
func edgeBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
switch t.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -417,7 +417,7 @@ func edgeBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
}, true
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -582,10 +582,10 @@ func edgeCommitPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(x8664EdgeCommitPackageSet(t))
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(aarch64EdgeCommitPackageSet(t))
}
@ -682,9 +682,9 @@ func edgeSimplifiedInstallerPackageSet(t *imageType) rpmmd.PackageSet {
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(x8664EdgeCommitPackageSet(t))
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(aarch64EdgeCommitPackageSet(t))
default:

View file

@ -214,6 +214,7 @@ func defaultGceRhuiImageConfig(rhsm bool) *distro.ImageConfig {
func gceCommonPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"langpacks-en", // not in Google's KS
"acpid",
"dhcp-client",
@ -237,12 +238,14 @@ func gceCommonPackageSet(t *imageType) rpmmd.PackageSet {
// EFI
"grub2-tools",
"grub2-tools-minimal",
"firewalld", // not pulled in any more as on RHEL-8
// Performance tuning
"tuned",
},
Exclude: []string{
"alsa-utils",
"b43-fwcutter",
"dmraid",
"dracut-config-rescue",
"eject",
"gpm",
"irqbalance",
@ -256,7 +259,12 @@ func gceCommonPackageSet(t *imageType) rpmmd.PackageSet {
"ipw2200-firmware",
"ivtv-firmware",
"iwl100-firmware",
"iwl105-firmware",
"iwl135-firmware",
"iwl1000-firmware",
"iwl2000-firmware",
"iwl2030-firmware",
"iwl3160-firmware",
"iwl3945-firmware",
"iwl4965-firmware",
"iwl5000-firmware",
@ -264,6 +272,7 @@ func gceCommonPackageSet(t *imageType) rpmmd.PackageSet {
"iwl6000-firmware",
"iwl6000g2a-firmware",
"iwl6050-firmware",
"iwl7260-firmware",
"kernel-firmware",
"libertas-usb8388-firmware",
"ql2100-firmware",
@ -278,12 +287,9 @@ func gceCommonPackageSet(t *imageType) rpmmd.PackageSet {
// RHBZ#2075815
"qemu-guest-agent",
},
}.Append(coreOsCommonPackageSet(t)).Append(distroSpecificPackageSet(t))
}.Append(distroSpecificPackageSet(t))
// Some excluded packages are part of the @core group package set returned
// by coreOsCommonPackageSet(). Ensure that the conflicting packages are
// returned from the list of `Include` packages.
return ps.ResolveConflictsExclude()
return ps
}
// GCE BYOS image

View file

@ -401,7 +401,7 @@ func edgeRawImage(workload workload.Workload,
if err != nil {
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
img := image.NewOSTreeDiskImage(commit)
img := image.NewOSTreeDiskImageFromCommit(commit)
img.Users = users.UsersFromBP(customizations.GetUsers())
img.Groups = users.GroupsFromBP(customizations.GetGroups())
@ -421,8 +421,8 @@ func edgeRawImage(workload workload.Workload,
}
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.Ignition = true
img.IgnitionPlatform = "metal"
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}
@ -436,6 +436,7 @@ func edgeRawImage(workload workload.Workload,
ContentURL: options.OSTree.ContentURL,
}
img.OSName = "redhat"
img.LockRoot = true
if kopts := customizations.GetKernel(); kopts != nil && kopts.Append != "" {
img.KernelOptionsAppend = append(img.KernelOptionsAppend, kopts.Append)
@ -466,7 +467,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
if err != nil {
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
}
rawImg := image.NewOSTreeDiskImage(commit)
rawImg := image.NewOSTreeDiskImageFromCommit(commit)
rawImg.Users = users.UsersFromBP(customizations.GetUsers())
rawImg.Groups = users.GroupsFromBP(customizations.GetGroups())
@ -488,10 +489,11 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
ContentURL: options.OSTree.ContentURL,
}
rawImg.OSName = "redhat"
rawImg.LockRoot = true
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
rawImg.Ignition = true
rawImg.IgnitionPlatform = "metal"
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}

View file

@ -5,7 +5,7 @@ package rhel9
import (
"fmt"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -35,10 +35,10 @@ func distroBuildPackageSet(t *imageType) rpmmd.PackageSet {
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(x8664BuildPackageSet(t))
case platform.ARCH_PPC64LE.String():
case arch.ARCH_PPC64LE.String():
ps = ps.Append(ppc64leBuildPackageSet(t))
}
@ -84,7 +84,7 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet {
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
case arch.ARCH_X86_64.String():
ps = ps.Append(grubCommon)
ps = ps.Append(efiCommon)
ps = ps.Append(rpmmd.PackageSet{
@ -98,7 +98,7 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet {
"syslinux-nonlinux",
},
})
case platform.ARCH_AARCH64.String():
case arch.ARCH_AARCH64.String():
ps = ps.Append(grubCommon)
ps = ps.Append(efiCommon)
ps = ps.Append(rpmmd.PackageSet{
@ -118,122 +118,6 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet {
// OS package sets
// Replacement of the previously used @core package group
func coreOsCommonPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"audit",
"basesystem",
"bash",
"coreutils",
"cronie",
"crypto-policies",
"crypto-policies-scripts",
"curl",
"dnf",
"yum",
"e2fsprogs",
"filesystem",
"glibc",
"grubby",
"hostname",
"iproute",
"iproute-tc",
"iputils",
"kbd",
"kexec-tools",
"less",
"logrotate",
"man-db",
"ncurses",
"openssh-clients",
"openssh-server",
"p11-kit",
"parted",
"passwd",
"policycoreutils",
"procps-ng",
"rootfiles",
"rpm",
"rpm-plugin-audit",
"rsyslog",
"selinux-policy-targeted",
"setup",
"shadow-utils",
"sssd-common",
"sssd-kcm",
"sudo",
"systemd",
"tuned",
"util-linux",
"vim-minimal",
"xfsprogs",
"authselect",
"prefixdevname",
"dnf-plugins-core",
"NetworkManager",
"NetworkManager-team",
"NetworkManager-tui",
"libsysfs",
"linux-firmware",
"lshw",
"lsscsi",
"kernel-tools",
"sg3_utils",
"sg3_utils-libs",
"python3-libselinux",
},
}
// Do not include this in the distroSpecificPackageSet for now,
// because it includes 'insights-client' which is not installed
// by default on all RHEL images (although it would probably make sense).
if t.arch.distro.isRHEL() {
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"subscription-manager",
},
})
}
switch t.arch.Name() {
case platform.ARCH_X86_64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"irqbalance",
"microcode_ctl",
},
})
case platform.ARCH_AARCH64.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"irqbalance",
},
})
case platform.ARCH_PPC64LE.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"irqbalance",
"opal-prd",
"ppc64-diag-rtas",
"powerpc-utils-core",
"lsvpd",
},
})
case platform.ARCH_S390X.String():
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"s390utils-core",
},
})
}
return ps
}
// packages that are only in some (sub)-distributions
func distroSpecificPackageSet(t *imageType) rpmmd.PackageSet {
if t.arch.distro.isRHEL() {

View file

@ -2,8 +2,8 @@ package rhel9
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/platform"
)
func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
@ -14,7 +14,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
}
switch t.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -67,7 +67,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
}, true
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
return disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
@ -114,7 +114,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
}, true
case platform.ARCH_PPC64LE:
case arch.ARCH_PPC64LE:
return disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",
@ -148,7 +148,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
}, true
case platform.ARCH_S390X:
case arch.ARCH_S390X:
return disk.PartitionTable{
UUID: "0x14fc63d2",
Type: "dos",

View file

@ -4,7 +4,6 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/subscription"
)
@ -34,6 +33,7 @@ var (
func qcow2CommonPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"authselect-compat",
"chrony",
"cloud-init",
@ -52,6 +52,7 @@ func qcow2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"redhat-release-eula",
"rsync",
"tar",
"tuned",
"tcpdump",
},
Exclude: []string{
@ -61,10 +62,28 @@ func qcow2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"alsa-tools-firmware",
"biosdevname",
"dnf-plugin-spacewalk",
"dracut-config-rescue",
"fedora-release",
"fedora-repos",
"firewalld",
"iprutils",
"ivtv-firmware",
"iwl1000-firmware",
"iwl100-firmware",
"iwl105-firmware",
"iwl135-firmware",
"iwl2000-firmware",
"iwl2030-firmware",
"iwl3160-firmware",
"iwl3945-firmware",
"iwl4965-firmware",
"iwl5000-firmware",
"iwl5150-firmware",
"iwl6000-firmware",
"iwl6000g2a-firmware",
"iwl6000g2b-firmware",
"iwl6050-firmware",
"iwl7260-firmware",
"langpacks-*",
"langpacks-en",
"libertas-sd8787-firmware",
@ -73,7 +92,7 @@ func qcow2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"rng-tools",
"udisks2",
},
}.Append(coreOsCommonPackageSet(t)).Append(distroSpecificPackageSet(t))
}.Append(distroSpecificPackageSet(t))
// Ensure to not pull in subscription-manager on non-RHEL distro
if t.arch.distro.isRHEL() {
@ -91,8 +110,9 @@ func openstackCommonPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
// Defaults
"@core",
"langpacks-en",
"firewalld",
"tuned",
// From the lorax kickstart
"cloud-init",
@ -100,30 +120,9 @@ func openstackCommonPackageSet(t *imageType) rpmmd.PackageSet {
"spice-vdagent",
},
Exclude: []string{
"dracut-config-rescue",
"rng-tools",
},
}.Append(coreOsCommonPackageSet(t))
if t.arch.Name() == platform.ARCH_X86_64.String() {
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
// packages below used to come from @core group and were not excluded
// they may not be needed at all, but kept them here to not need
// to exclude them instead in all other images
"iwl100-firmware",
"iwl105-firmware",
"iwl135-firmware",
"iwl1000-firmware",
"iwl2000-firmware",
"iwl2030-firmware",
"iwl3160-firmware",
"iwl5000-firmware",
"iwl5150-firmware",
"iwl6000g2a-firmware",
"iwl6050-firmware",
"iwl7260-firmware",
},
})
}
return ps

View file

@ -3,7 +3,6 @@ package rhel9
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
)
@ -52,37 +51,18 @@ var ovaImgType = imageType{
func vmdkCommonPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"chrony",
"cloud-init",
"firewalld",
"langpacks-en",
"open-vm-tools",
"tuned",
},
Exclude: []string{
"dracut-config-rescue",
"rng-tools",
},
}.Append(coreOsCommonPackageSet(t))
if t.arch.Name() == platform.ARCH_X86_64.String() {
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
// packages below used to come from @core group and were not excluded
// they may not be needed at all, but kept them here to not need
// to exclude them instead in all other images
"iwl100-firmware",
"iwl105-firmware",
"iwl135-firmware",
"iwl1000-firmware",
"iwl2000-firmware",
"iwl2030-firmware",
"iwl3160-firmware",
"iwl5000-firmware",
"iwl5150-firmware",
"iwl6000g2a-firmware",
"iwl6050-firmware",
"iwl7260-firmware",
},
})
}
return ps

View file

@ -6,6 +6,7 @@ import (
"strings"
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/fedora"
"github.com/osbuild/images/pkg/distro/rhel7"
@ -52,7 +53,7 @@ func New(hostDistro distro.Distro, distros ...distro.Distro) (*Registry, error)
reg := &Registry{
distros: make(map[string]distro.Distro),
hostDistro: hostDistro,
hostArchName: common.CurrentArch(),
hostArchName: arch.Current().String(),
}
for _, d := range distros {
name := d.Name()

View file

@ -7,6 +7,7 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/manifest"
@ -61,7 +62,7 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
livePipeline.ExcludePackages = img.ExtraBasePackages.Exclude
livePipeline.Variant = img.Variant
livePipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
livePipeline.Biosdevname = (img.Platform.GetArch() == arch.ARCH_X86_64)
livePipeline.Checkpoint()
@ -103,7 +104,7 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
bootTreePipeline.KernelOpts = kernelOpts
// enable ISOLinux on x86_64 only
isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64
isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64
isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, livePipeline, rootfsImagePipeline, bootTreePipeline)
isoTreePipeline.PartitionTable = rootfsPartitionTable

View file

@ -6,6 +6,7 @@ import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/manifest"
@ -69,7 +70,7 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
anacondaPipeline.Users = img.Users
anacondaPipeline.Groups = img.Groups
anacondaPipeline.Variant = img.Variant
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == arch.ARCH_X86_64)
anacondaPipeline.Checkpoint()
anacondaPipeline.AdditionalDracutModules = img.AdditionalDracutModules
anacondaPipeline.AdditionalAnacondaModules = img.AdditionalAnacondaModules
@ -112,7 +113,7 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
}
// enable ISOLinux on x86_64 only
isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64
isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64
isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline)
isoTreePipeline.PartitionTable = rootfsPartitionTable
@ -129,6 +130,9 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
isoTreePipeline.OSTreeCommitSource = &img.Commit
isoTreePipeline.ISOLinux = isoLinuxEnabled
if img.FIPS {
isoTreePipeline.KernelOpts = append(isoTreePipeline.KernelOpts, "fips=1")
}
isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, isoLabel)
isoPipeline.SetFilename(img.Filename)

View file

@ -9,6 +9,7 @@ import (
"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/manifest"
@ -80,7 +81,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest,
anacondaPipeline.Users = img.Users
anacondaPipeline.Groups = img.Groups
anacondaPipeline.Variant = img.Variant
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == arch.ARCH_X86_64)
anacondaPipeline.AdditionalAnacondaModules = img.AdditionalAnacondaModules
anacondaPipeline.AdditionalDracutModules = img.AdditionalDracutModules
anacondaPipeline.AdditionalDrivers = img.AdditionalDrivers
@ -133,7 +134,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest,
osPipeline.Workload = img.Workload
// enable ISOLinux on x86_64 only
isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64
isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64
isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline)
isoTreePipeline.PartitionTable = rootfsPartitionTable

View file

@ -31,6 +31,8 @@ type OSTreeArchive struct {
Filename string
InstallWeakDeps bool
BootContainer bool
}
func NewOSTreeArchive(ref string) *OSTreeArchive {
@ -59,9 +61,16 @@ func (img *OSTreeArchive) InstantiateManifest(m *manifest.Manifest,
ostreeCommitPipeline := manifest.NewOSTreeCommit(buildPipeline, osPipeline, img.OSTreeRef)
ostreeCommitPipeline.OSVersion = img.OSVersion
tarPipeline := manifest.NewTar(buildPipeline, ostreeCommitPipeline, "commit-archive")
tarPipeline.SetFilename(img.Filename)
artifact := tarPipeline.Export()
var artifact *artifact.Artifact
if img.BootContainer {
encapsulatePipeline := manifest.NewOSTreeEncapsulate(buildPipeline, ostreeCommitPipeline, "ostree-encapsulate")
encapsulatePipeline.SetFilename(img.Filename)
artifact = encapsulatePipeline.Export()
} else {
tarPipeline := manifest.NewTar(buildPipeline, ostreeCommitPipeline, "commit-archive")
tarPipeline.SetFilename(img.Filename)
artifact = tarPipeline.Export()
}
return artifact, nil
}

View file

@ -8,6 +8,7 @@ import (
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/ostree"
@ -26,12 +27,14 @@ type OSTreeDiskImage struct {
Users []users.User
Groups []users.Group
CommitSource ostree.SourceSpec
CommitSource *ostree.SourceSpec
ContainerSource *container.SourceSpec
SysrootReadOnly bool
Remote ostree.Remote
OSName string
Ref string
KernelOptionsAppend []string
Keyboard string
@ -39,7 +42,6 @@ type OSTreeDiskImage struct {
Filename string
Ignition bool
IgnitionPlatform string
Compression string
@ -47,17 +49,38 @@ type OSTreeDiskImage struct {
Files []*fsnode.File
FIPS bool
// Lock the root account in the deployment unless the user defined root
// user options in the build configuration.
LockRoot bool
}
func NewOSTreeDiskImage(commit ostree.SourceSpec) *OSTreeDiskImage {
func NewOSTreeDiskImageFromCommit(commit ostree.SourceSpec) *OSTreeDiskImage {
return &OSTreeDiskImage{
Base: NewBase("ostree-raw-image"),
CommitSource: commit,
CommitSource: &commit,
}
}
func NewOSTreeDiskImageFromContainer(container container.SourceSpec, ref string) *OSTreeDiskImage {
return &OSTreeDiskImage{
Base: NewBase("ostree-raw-image"),
ContainerSource: &container,
Ref: ref,
}
}
func baseRawOstreeImage(img *OSTreeDiskImage, m *manifest.Manifest, buildPipeline *manifest.Build) *manifest.RawOSTreeImage {
osPipeline := manifest.NewOSTreeDeployment(buildPipeline, m, img.CommitSource, img.OSName, img.Ignition, img.IgnitionPlatform, img.Platform)
var osPipeline *manifest.OSTreeDeployment
switch {
case img.CommitSource != nil:
osPipeline = manifest.NewOSTreeCommitDeployment(buildPipeline, m, img.CommitSource, img.OSName, img.Platform)
case img.ContainerSource != nil:
osPipeline = manifest.NewOSTreeContainerDeployment(buildPipeline, m, img.ContainerSource, img.Ref, img.OSName, img.Platform)
default:
panic("no content source defined for ostree image")
}
osPipeline.PartitionTable = img.PartitionTable
osPipeline.Remote = img.Remote
osPipeline.KernelOptionsAppend = img.KernelOptionsAppend
@ -69,6 +92,8 @@ func baseRawOstreeImage(img *OSTreeDiskImage, m *manifest.Manifest, buildPipelin
osPipeline.Directories = img.Directories
osPipeline.Files = img.Files
osPipeline.FIPS = img.FIPS
osPipeline.IgnitionPlatform = img.IgnitionPlatform
osPipeline.LockRoot = img.LockRoot
// other image types (e.g. live) pass the workload to the pipeline.
osPipeline.EnabledServices = img.Workload.GetServices()

View file

@ -9,6 +9,7 @@ import (
"github.com/osbuild/images/internal/fdo"
"github.com/osbuild/images/internal/ignition"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/manifest"
@ -93,7 +94,7 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
coiPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
coiPipeline.FDO = img.FDO
coiPipeline.Ignition = img.IgnitionEmbedded
coiPipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
coiPipeline.Biosdevname = (img.Platform.GetArch() == arch.ARCH_X86_64)
coiPipeline.Variant = img.Variant
coiPipeline.AdditionalDracutModules = img.AdditionalDracutModules
@ -146,7 +147,7 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
}
// enable ISOLinux on x86_64 only
isoLinuxEnabled := img.Platform.GetArch() == platform.ARCH_X86_64
isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64
isoTreePipeline := manifest.NewCoreOSISOTree(buildPipeline, compressedImage, coiPipeline, bootTreePipeline)
isoTreePipeline.KernelOpts = kernelOpts

View file

@ -6,6 +6,7 @@ import (
"github.com/osbuild/images/internal/fsnode"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/ostree"
@ -107,7 +108,7 @@ func (p *AnacondaInstaller) anacondaBootPackageSet() []string {
}
switch p.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
packages = append(packages,
"grub2-efi-x64",
"grub2-efi-x64-cdboot",
@ -117,7 +118,7 @@ func (p *AnacondaInstaller) anacondaBootPackageSet() []string {
"syslinux",
"syslinux-nonlinux",
)
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
packages = append(packages,
"grub2-efi-aa64-cdboot",
"grub2-efi-aa64",

View file

@ -5,6 +5,7 @@ import (
"github.com/osbuild/images/internal/fdo"
"github.com/osbuild/images/internal/ignition"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/ostree"
@ -85,7 +86,7 @@ func (p *CoreOSInstaller) getBootPackages() []string {
// For Fedora, this will add a lot of duplicates, but we also add them here
// for RHEL and CentOS.
switch p.platform.GetArch() {
case platform.ARCH_X86_64:
case arch.ARCH_X86_64:
packages = append(packages,
"grub2-efi-x64",
"grub2-efi-x64-cdboot",
@ -95,7 +96,7 @@ func (p *CoreOSInstaller) getBootPackages() []string {
"syslinux",
"syslinux-nonlinux",
)
case platform.ARCH_AARCH64:
case arch.ARCH_AARCH64:
packages = append(packages,
"grub2-efi-aa64-cdboot",
"grub2-efi-aa64",

View file

@ -1,6 +1,7 @@
package manifest
import (
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
)
@ -33,11 +34,11 @@ func NewEFIBootTree(m *Manifest, buildPipeline *Build, product, version string)
func (p *EFIBootTree) serialize() osbuild.Pipeline {
pipeline := p.Base.serialize()
arch := p.Platform.GetArch().String()
a := p.Platform.GetArch().String()
var architectures []string
if arch == platform.ARCH_X86_64.String() {
if a == arch.ARCH_X86_64.String() {
architectures = []string{"X64"}
} else if arch == platform.ARCH_AARCH64.String() {
} else if a == arch.ARCH_AARCH64.String() {
architectures = []string{"AA64"}
} else {
panic("unsupported architecture")

View file

@ -11,6 +11,7 @@ import (
"github.com/osbuild/images/internal/shell"
"github.com/osbuild/images/internal/users"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/osbuild"
@ -610,7 +611,7 @@ func (p *OS) serialize() osbuild.Pipeline {
var bootloader *osbuild.Stage
switch p.platform.GetArch() {
case platform.ARCH_S390X:
case arch.ARCH_S390X:
bootloader = osbuild.NewZiplStage(new(osbuild.ZiplStageOptions))
default:
if p.NoBLS {

View file

@ -1,6 +1,7 @@
package manifest
import (
"fmt"
"os"
"strings"
@ -24,12 +25,25 @@ type OSTreeDeployment struct {
OSVersion string
commitSource ostree.SourceSpec
ostreeSpecs []ostree.CommitSpec
// commitSource represents the source that will be used to retrieve the
// ostree commit for this pipeline.
commitSource *ostree.SourceSpec
// ostreeSpec is the resolved commit that will be deployed in this pipeline.
ostreeSpec *ostree.CommitSpec
// containerSource represents the source that will be used to retrieve the
// ostree native container for this pipeline.
containerSource *container.SourceSpec
// containerSpec is the resolved ostree native container that will be
// deployed in this pipeline.
containerSpec *container.Spec
SysrootReadOnly bool
osName string
ref string
KernelOptionsAppend []string
Keyboard string
@ -42,11 +56,9 @@ type OSTreeDeployment struct {
PartitionTable *disk.PartitionTable
// Whether ignition is in use or not
ignition bool
// Specifies the ignition platform to use
ignitionPlatform string
// Specifies the ignition platform to use.
// If empty, ignition is not enabled.
IgnitionPlatform string
Directories []*fsnode.Directory
Files []*fsnode.File
@ -55,25 +67,46 @@ type OSTreeDeployment struct {
DisabledServices []string
FIPS bool
// Lock the root account in the deployment unless the user defined root
// user options in the build configuration.
LockRoot bool
}
// NewOSTreeDeployment creates a pipeline for an ostree deployment from a
// NewOSTreeCommitDeployment creates a pipeline for an ostree deployment from a
// commit.
func NewOSTreeDeployment(buildPipeline *Build,
func NewOSTreeCommitDeployment(buildPipeline *Build,
m *Manifest,
commit ostree.SourceSpec,
commit *ostree.SourceSpec,
osName string,
ignition bool,
ignitionPlatform string,
platform platform.Platform) *OSTreeDeployment {
p := &OSTreeDeployment{
Base: NewBase(m, "ostree-deployment", buildPipeline),
commitSource: commit,
osName: osName,
platform: platform,
ignition: ignition,
ignitionPlatform: ignitionPlatform,
Base: NewBase(m, "ostree-deployment", buildPipeline),
commitSource: commit,
osName: osName,
platform: platform,
}
buildPipeline.addDependent(p)
m.addPipeline(p)
return p
}
// NewOSTreeDeployment creates a pipeline for an ostree deployment from a
// container
func NewOSTreeContainerDeployment(buildPipeline *Build,
m *Manifest,
container *container.SourceSpec,
ref string,
osName string,
platform platform.Platform) *OSTreeDeployment {
p := &OSTreeDeployment{
Base: NewBase(m, "ostree-deployment", buildPipeline),
containerSource: container,
osName: osName,
ref: ref,
platform: platform,
}
buildPipeline.addDependent(p)
m.addPipeline(p)
@ -88,89 +121,76 @@ func (p *OSTreeDeployment) getBuildPackages(Distro) []string {
}
func (p *OSTreeDeployment) getOSTreeCommits() []ostree.CommitSpec {
return p.ostreeSpecs
if p.ostreeSpec == nil {
return []ostree.CommitSpec{}
}
return []ostree.CommitSpec{*p.ostreeSpec}
}
func (p *OSTreeDeployment) getOSTreeCommitSources() []ostree.SourceSpec {
if p.commitSource == nil {
return []ostree.SourceSpec{}
}
return []ostree.SourceSpec{
p.commitSource,
*p.commitSource,
}
}
func (p *OSTreeDeployment) getContainerSpecs() []container.Spec {
if p.containerSpec == nil {
return []container.Spec{}
}
return []container.Spec{*p.containerSpec}
}
func (p *OSTreeDeployment) getContainerSources() []container.SourceSpec {
if p.containerSource == nil {
return []container.SourceSpec{}
}
return []container.SourceSpec{
*p.containerSource,
}
}
func (p *OSTreeDeployment) serializeStart(packages []rpmmd.PackageSpec, containers []container.Spec, commits []ostree.CommitSpec) {
if len(p.ostreeSpecs) > 0 {
if p.ostreeSpec != nil || p.containerSpec != nil {
panic("double call to serializeStart()")
}
if len(commits) != 1 {
panic("pipeline requires exactly one ostree commit")
switch {
case len(commits) == 1:
p.ostreeSpec = &commits[0]
case len(containers) == 1:
p.containerSpec = &containers[0]
default:
panic(fmt.Sprintf("pipeline requires exactly one ostree commit or one container (have commits: %v; containers: %v)", commits, containers))
}
p.ostreeSpecs = commits
}
func (p *OSTreeDeployment) serializeEnd() {
if len(p.ostreeSpecs) == 0 {
switch {
case p.ostreeSpec == nil && p.containerSpec == nil:
panic("serializeEnd() call when serialization not in progress")
case p.ostreeSpec != nil && p.containerSpec != nil:
panic("serializeEnd() multiple payload sources defined")
}
p.ostreeSpecs = nil
p.ostreeSpec = nil
p.containerSpec = nil
}
func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
if len(p.ostreeSpecs) == 0 {
panic("serialization not started")
}
if len(p.ostreeSpecs) > 1 {
panic("multiple ostree commit specs found; this is a programming error")
}
commit := p.ostreeSpecs[0]
const repoPath = "/ostree/repo"
pipeline := p.Base.serialize()
pipeline.AddStage(osbuild.OSTreeInitFsStage())
func (p *OSTreeDeployment) doOSTreeSpec(pipeline *osbuild.Pipeline, repoPath string, kernelOpts []string) string {
commit := *p.ostreeSpec
ref := commit.Ref
pipeline.AddStage(osbuild.NewOSTreePullStage(
&osbuild.OSTreePullStageOptions{Repo: repoPath, Remote: p.Remote.Name},
osbuild.NewOstreePullStageInputs("org.osbuild.source", commit.Checksum, commit.Ref),
osbuild.NewOstreePullStageInputs("org.osbuild.source", commit.Checksum, ref),
))
pipeline.AddStage(osbuild.NewOSTreeOsInitStage(
&osbuild.OSTreeOsInitStageOptions{
OSName: p.osName,
},
))
pipeline.AddStage(osbuild.NewMkdirStage(&osbuild.MkdirStageOptions{
Paths: []osbuild.MkdirStagePath{
{
Path: "/boot/efi",
Mode: common.ToPtr(os.FileMode(0700)),
},
},
}))
kernelOpts := osbuild.GenImageKernelOptions(p.PartitionTable)
kernelOpts = append(kernelOpts, p.KernelOptionsAppend...)
if p.ignition {
if p.ignitionPlatform == "" {
panic("ignition is enabled but ignition platform ID is not set")
}
kernelOpts = append(kernelOpts,
"coreos.no_persist_ip", // users cannot add connections as we don't have a live iso, this prevents connections to bleed into the system from the ign initrd
"ignition.platform.id="+p.ignitionPlatform,
"$ignition_firstboot",
)
}
if p.FIPS {
kernelOpts = append(kernelOpts, osbuild.GenFIPSKernelOptions(p.PartitionTable)...)
p.Files = append(p.Files, osbuild.GenFIPSFiles()...)
}
pipeline.AddStage(osbuild.NewOSTreeDeployStage(
&osbuild.OSTreeDeployStageOptions{
OsName: p.osName,
Ref: commit.Ref,
Ref: ref,
Remote: p.Remote.Name,
Mounts: []string{"/boot", "/boot/efi"},
Rootfs: osbuild.Rootfs{
@ -200,11 +220,87 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
&osbuild.OSTreeFillvarStageOptions{
Deployment: osbuild.OSTreeDeployment{
OSName: p.osName,
Ref: commit.Ref,
Ref: ref,
},
},
))
return ref
}
func (p *OSTreeDeployment) doOSTreeContainerSpec(pipeline *osbuild.Pipeline, repoPath string, kernelOpts []string) string {
cont := *p.containerSpec
ref := p.ref
options := &osbuild.OSTreeDeployContainerStageOptions{
OsName: p.osName,
KernelOpts: p.KernelOptionsAppend,
// NOTE: setting the target imgref to be the container source but
// we should make this configurable
TargetImgref: fmt.Sprintf("ostree-remote-registry:%s:%s", p.Remote.Name, p.containerSpec.Source),
Mounts: []string{"/boot", "/boot/efi"},
Rootfs: &osbuild.Rootfs{
Label: "root",
},
}
images := osbuild.NewContainersInputForSources([]container.Spec{cont})
pipeline.AddStage(osbuild.NewOSTreeDeployContainerStage(options, images))
return ref
}
func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
switch {
case p.ostreeSpec == nil && p.containerSpec == nil:
panic("serialization not started")
case p.ostreeSpec != nil && p.containerSpec != nil:
panic("serialize() multiple payload sources defined")
}
const repoPath = "/ostree/repo"
pipeline := p.Base.serialize()
pipeline.AddStage(osbuild.OSTreeInitFsStage())
pipeline.AddStage(osbuild.NewOSTreeOsInitStage(
&osbuild.OSTreeOsInitStageOptions{
OSName: p.osName,
},
))
pipeline.AddStage(osbuild.NewMkdirStage(&osbuild.MkdirStageOptions{
Paths: []osbuild.MkdirStagePath{
{
Path: "/boot/efi",
Mode: common.ToPtr(os.FileMode(0700)),
},
},
}))
kernelOpts := osbuild.GenImageKernelOptions(p.PartitionTable)
kernelOpts = append(kernelOpts, p.KernelOptionsAppend...)
if p.IgnitionPlatform != "" {
kernelOpts = append(kernelOpts,
"ignition.platform.id="+p.IgnitionPlatform,
"$ignition_firstboot",
)
}
if p.FIPS {
kernelOpts = append(kernelOpts, osbuild.GenFIPSKernelOptions(p.PartitionTable)...)
p.Files = append(p.Files, osbuild.GenFIPSFiles()...)
}
var ref string
switch {
case p.ostreeSpec != nil:
ref = p.doOSTreeSpec(&pipeline, repoPath, kernelOpts)
case p.containerSpec != nil:
ref = p.doOSTreeContainerSpec(&pipeline, repoPath, kernelOpts)
default:
// this should be caught at the top of the function, but let's check
// again to avoid bugs from bad refactoring.
panic("no content source defined for ostree deployment")
}
configStage := osbuild.NewOSTreeConfigStage(
&osbuild.OSTreeConfigStageOptions{
Repo: repoPath,
@ -216,12 +312,12 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
},
},
)
configStage.MountOSTree(p.osName, commit.Ref, 0)
configStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(configStage)
fstabOptions := osbuild.NewFSTabStageOptions(p.PartitionTable)
fstabStage := osbuild.NewFSTabStage(fstabOptions)
fstabStage.MountOSTree(p.osName, commit.Ref, 0)
fstabStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(fstabStage)
if len(p.Users) > 0 {
@ -229,17 +325,17 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
if err != nil {
panic("password encryption failed")
}
usersStage.MountOSTree(p.osName, commit.Ref, 0)
usersStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(usersStage)
}
if len(p.Groups) > 0 {
grpStage := osbuild.GenGroupsStage(p.Groups)
grpStage.MountOSTree(p.osName, commit.Ref, 0)
grpStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(grpStage)
}
if p.ignition {
if p.IgnitionPlatform != "" {
pipeline.AddStage(osbuild.NewIgnitionStage(&osbuild.IgnitionStageOptions{
// This is a workaround to make the systemd believe it's firstboot when ignition runs on real firstboot.
// Right now, since we ship /etc/machine-id, systemd thinks it's not firstboot and ignition depends on it
@ -260,7 +356,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
// creating a preset file.
if len(p.EnabledServices) != 0 || len(p.DisabledServices) != 0 {
presetsStage := osbuild.GenServicesPresetStage(p.EnabledServices, p.DisabledServices)
presetsStage.MountOSTree(p.osName, commit.Ref, 0)
presetsStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(presetsStage)
}
}
@ -274,7 +370,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
}
}
if !hasRoot {
if p.LockRoot && !hasRoot {
userOptions := &osbuild.UsersStageOptions{
Users: map[string]osbuild.UsersStageOptionsUser{
"root": {
@ -283,7 +379,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
},
}
rootLockStage := osbuild.NewUsersStage(userOptions)
rootLockStage.MountOSTree(p.osName, commit.Ref, 0)
rootLockStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(rootLockStage)
}
@ -292,7 +388,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
Keymap: p.Keyboard,
}
keymapStage := osbuild.NewKeymapStage(options)
keymapStage.MountOSTree(p.osName, commit.Ref, 0)
keymapStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(keymapStage)
}
@ -301,13 +397,13 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
Language: p.Locale,
}
localeStage := osbuild.NewLocaleStage(options)
localeStage.MountOSTree(p.osName, commit.Ref, 0)
localeStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(localeStage)
}
if p.FIPS {
for _, stage := range osbuild.GenFIPSStages() {
stage.MountOSTree(p.osName, commit.Ref, 0)
stage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(stage)
}
}
@ -319,21 +415,21 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
p.platform.GetBIOSPlatform(),
p.platform.GetUEFIVendor(), true)
grubOptions.Greenboot = true
grubOptions.Ignition = p.ignition
grubOptions.Ignition = p.IgnitionPlatform != ""
grubOptions.Config = &osbuild.GRUB2Config{
Default: "saved",
Timeout: 1,
TerminalOutput: []string{"console"},
}
bootloader := osbuild.NewGRUB2Stage(grubOptions)
bootloader.MountOSTree(p.osName, commit.Ref, 0)
bootloader.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(bootloader)
// First create custom directories, because some of the files may depend on them
if len(p.Directories) > 0 {
dirStages := osbuild.GenDirectoryNodesStages(p.Directories)
for _, stage := range dirStages {
stage.MountOSTree(p.osName, commit.Ref, 0)
stage.MountOSTree(p.osName, ref, 0)
}
pipeline.AddStages(dirStages...)
}
@ -341,7 +437,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
if len(p.Files) > 0 {
fileStages := osbuild.GenFileNodesStages(p.Files)
for _, stage := range fileStages {
stage.MountOSTree(p.osName, commit.Ref, 0)
stage.MountOSTree(p.osName, ref, 0)
}
pipeline.AddStages(fileStages...)
}
@ -351,7 +447,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
EnabledServices: p.EnabledServices,
DisabledServices: p.DisabledServices,
})
systemdStage.MountOSTree(p.osName, commit.Ref, 0)
systemdStage.MountOSTree(p.osName, ref, 0)
pipeline.AddStage(systemdStage)
}
@ -359,7 +455,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
&osbuild.OSTreeSelinuxStageOptions{
Deployment: osbuild.OSTreeDeployment{
OSName: p.osName,
Ref: commit.Ref,
Ref: ref,
},
},
))

View file

@ -0,0 +1,57 @@
package manifest
import (
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/osbuild"
)
type OSTreeEncapsulate struct {
Base
filename string
inputPipeline Pipeline
}
func NewOSTreeEncapsulate(buildPipeline *Build, inputPipeline Pipeline, pipelinename string) *OSTreeEncapsulate {
p := &OSTreeEncapsulate{
Base: NewBase(inputPipeline.Manifest(), pipelinename, buildPipeline),
inputPipeline: inputPipeline,
filename: "bootable-container.tar",
}
buildPipeline.addDependent(p)
inputPipeline.Manifest().addPipeline(p)
return p
}
func (p OSTreeEncapsulate) Filename() string {
return p.filename
}
func (p *OSTreeEncapsulate) SetFilename(filename string) {
p.filename = filename
}
func (p *OSTreeEncapsulate) serialize() osbuild.Pipeline {
pipeline := p.Base.serialize()
encOptions := &osbuild.OSTreeEncapsulateStageOptions{
Filename: p.Filename(),
}
encStage := osbuild.NewOSTreeEncapsulateStage(encOptions, p.inputPipeline.Name())
pipeline.AddStage(encStage)
return pipeline
}
func (p *OSTreeEncapsulate) getBuildPackages(Distro) []string {
return []string{
"rpm-ostree",
"python3-pyyaml",
}
}
func (p *OSTreeEncapsulate) Export() *artifact.Artifact {
p.Base.export = true
mimeType := "application/x-tar"
return artifact.New(p.Name(), p.Filename(), &mimeType)
}

View file

@ -1,9 +1,9 @@
package manifest
import (
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
)
// A RawImage represents a raw image file which can be booted in a
@ -65,7 +65,7 @@ func (p *RawImage) serialize() osbuild.Pipeline {
}
switch p.treePipeline.platform.GetArch() {
case platform.ARCH_S390X:
case arch.ARCH_S390X:
loopback := osbuild.NewLoopbackDevice(&osbuild.LoopbackDeviceOptions{Filename: p.Filename()})
pipeline.AddStage(osbuild.NewZiplInstStage(osbuild.NewZiplInstStageOptions(p.treePipeline.kernelVer, pt), loopback, copyDevices, copyMounts))
default:

View file

@ -76,7 +76,7 @@ func (p *RawOSTreeImage) serialize() osbuild.Pipeline {
_, bootCopyDevices, bootCopyMounts := osbuild.GenCopyFSTreeOptions(inputName, p.treePipeline.Name(), p.Filename(), pt)
bootCopyOptions := &osbuild.CopyStageOptions{}
commit := p.treePipeline.ostreeSpecs[0]
commit := p.treePipeline.ostreeSpec
commitChecksum := commit.Checksum
bootCopyInputs := osbuild.OSTreeCheckoutInputs{

View file

@ -6,6 +6,7 @@ import (
type ContainersInputReferences interface {
isContainersInputReferences()
Len() int
}
type ContainersInputSourceRef struct {
@ -16,6 +17,10 @@ type ContainersInputSourceMap map[string]ContainersInputSourceRef
func (ContainersInputSourceMap) isContainersInputReferences() {}
func (cism ContainersInputSourceMap) Len() int {
return len(cism)
}
type ContainersInput struct {
inputCommon
References ContainersInputReferences `json:"references"`

View file

@ -0,0 +1,75 @@
package osbuild
import (
"fmt"
"regexp"
)
// adapted from the osbuild stage schema - keep in sync if it ever changes
const ostreeContainerTargetImgrefRegex = "^(ostree-remote-registry|ostree-image-signed|ostree-unverified-registry):.*$"
// Options for the org.osbuild.ostree.deploy.container stage.
type OSTreeDeployContainerStageOptions struct {
// Name of the stateroot to be used in the deployment
OsName string `json:"osname"`
// Additional kernel command line options
KernelOpts []string `json:"kernel_opts,omitempty"`
// Image ref used as the source of truth for updates
TargetImgref string `json:"target_imgref"`
// Identifier to locate the root file system (uuid or label)
Rootfs *Rootfs `json:"rootfs,omitempty"`
// Mount points of the final file system
Mounts []string `json:"mounts,omitempty"`
}
func (OSTreeDeployContainerStageOptions) isStageOptions() {}
func (options OSTreeDeployContainerStageOptions) validate() error {
if options.OsName == "" {
return fmt.Errorf("osname is required")
}
exp := regexp.MustCompile(ostreeContainerTargetImgrefRegex)
if !exp.MatchString(options.TargetImgref) {
return fmt.Errorf("'target_imgref' %q doesn't conform to schema (%s)", options.TargetImgref, exp.String())
}
return nil
}
type OSTreeDeployContainerInputs struct {
Images ContainersInput `json:"images"`
}
func (OSTreeDeployContainerInputs) isStageInputs() {}
func (inputs OSTreeDeployContainerInputs) validate() error {
if inputs.Images.References == nil {
return fmt.Errorf("stage requires exactly 1 input container (got nil References)")
}
if ncontainers := inputs.Images.References.Len(); ncontainers != 1 {
return fmt.Errorf("stage requires exactly 1 input container (got %d)", ncontainers)
}
return nil
}
func NewOSTreeDeployContainerStage(options *OSTreeDeployContainerStageOptions, images ContainersInput) *Stage {
if err := options.validate(); err != nil {
panic(err)
}
inputs := OSTreeDeployContainerInputs{
Images: images,
}
if err := inputs.validate(); err != nil {
panic(err)
}
return &Stage{
Type: "org.osbuild.ostree.deploy.container",
Options: options,
Inputs: inputs,
}
}

View file

@ -0,0 +1,53 @@
package osbuild
type OSTreeEncapsulateStageOptions struct {
// Resulting image filename
Filename string `json:"filename"`
Cmd []string `json:"cmd,omitempty"`
// Propagate an OSTree commit metadata key to container label
CopyMeta []string `json:"copymeta,omitempty"`
// The encapsulated container format version (default 1)
FormatVersion *int `json:"format_version,omitempty"`
// Additional labels for the container
Labels []string `json:"labels,omitempty"`
// Max number of container image layers
MaxLayers *int `json:"max_layers,omitempty"`
}
func (OSTreeEncapsulateStageOptions) isStageOptions() {}
type OSTreeEncapsulateStageInput struct {
inputCommon
References []string `json:"references"`
}
func (OSTreeEncapsulateStageInput) isStageInput() {}
type OSTreeEncapsulateStageInputs struct {
Commit *OSTreeEncapsulateStageInput `json:"commit"`
}
func (OSTreeEncapsulateStageInputs) isStageInputs() {}
func NewOSTreeEncapsulateStage(options *OSTreeEncapsulateStageOptions, inputPipeline string) *Stage {
return &Stage{
Type: "org.osbuild.ostree.encapsulate",
Options: options,
Inputs: NewOSTreeEncapsulateStageInputs(InputOriginPipeline, inputPipeline),
}
}
func NewOSTreeEncapsulateStageInputs(origin, pipeline string) *OSTreeEncapsulateStageInputs {
encStageInput := new(OSTreeEncapsulateStageInput)
encStageInput.Type = "org.osbuild.ostree"
encStageInput.Origin = origin
inputRefs := []string{"name:" + pipeline}
encStageInput.References = inputRefs
return &OSTreeEncapsulateStageInputs{Commit: encStageInput}
}

View file

@ -1,12 +1,16 @@
package platform
import (
"github.com/osbuild/images/pkg/arch"
)
type Aarch64 struct {
BasePlatform
UEFIVendor string
}
func (p *Aarch64) GetArch() Arch {
return ARCH_AARCH64
func (p *Aarch64) GetArch() arch.Arch {
return arch.ARCH_AARCH64
}
func (p *Aarch64) GetUEFIVendor() string {
@ -34,8 +38,8 @@ type Aarch64_Fedora struct {
BootFiles [][2]string
}
func (p *Aarch64_Fedora) GetArch() Arch {
return ARCH_AARCH64
func (p *Aarch64_Fedora) GetArch() arch.Arch {
return arch.ARCH_AARCH64
}
func (p *Aarch64_Fedora) GetUEFIVendor() string {

View file

@ -1,15 +1,11 @@
package platform
type Arch uint64
type ImageFormat uint64
const ( // architecture enum
ARCH_AARCH64 Arch = iota
ARCH_PPC64LE
ARCH_S390X
ARCH_X86_64
import (
"github.com/osbuild/images/pkg/arch"
)
type ImageFormat uint64
const ( // image format enum
FORMAT_UNSET ImageFormat = iota
FORMAT_RAW
@ -21,21 +17,6 @@ const ( // image format enum
FORMAT_OVA
)
func (a Arch) String() string {
switch a {
case ARCH_AARCH64:
return "aarch64"
case ARCH_PPC64LE:
return "ppc64le"
case ARCH_S390X:
return "s390x"
case ARCH_X86_64:
return "x86_64"
default:
panic("invalid architecture")
}
}
func (f ImageFormat) String() string {
switch f {
case FORMAT_RAW:
@ -58,7 +39,7 @@ func (f ImageFormat) String() string {
}
type Platform interface {
GetArch() Arch
GetArch() arch.Arch
GetImageFormat() ImageFormat
GetQCOW2Compat() string
GetBIOSPlatform() string

View file

@ -1,12 +1,16 @@
package platform
import (
"github.com/osbuild/images/pkg/arch"
)
type PPC64LE struct {
BasePlatform
BIOS bool
}
func (p *PPC64LE) GetArch() Arch {
return ARCH_PPC64LE
func (p *PPC64LE) GetArch() arch.Arch {
return arch.ARCH_PPC64LE
}
func (p *PPC64LE) GetBIOSPlatform() string {

View file

@ -1,12 +1,16 @@
package platform
import (
"github.com/osbuild/images/pkg/arch"
)
type S390X struct {
BasePlatform
Zipl bool
}
func (p *S390X) GetArch() Arch {
return ARCH_S390X
func (p *S390X) GetArch() arch.Arch {
return arch.ARCH_S390X
}
func (p *S390X) GetZiplSupport() bool {

View file

@ -1,5 +1,9 @@
package platform
import (
"github.com/osbuild/images/pkg/arch"
)
type X86BootLoader uint64
type X86 struct {
@ -8,8 +12,8 @@ type X86 struct {
UEFIVendor string
}
func (p *X86) GetArch() Arch {
return ARCH_X86_64
func (p *X86) GetArch() arch.Arch {
return arch.ARCH_X86_64
}
func (p *X86) GetBIOSPlatform() string {

View file

@ -137,25 +137,6 @@ func (ps PackageSet) Append(other PackageSet) PackageSet {
return ps
}
// ResolveConflictsExclude resolves conflicting Include and Exclude package lists
// content by deleting packages listed as Excluded from the Include list.
func (ps PackageSet) ResolveConflictsExclude() PackageSet {
excluded := map[string]struct{}{}
for _, pkg := range ps.Exclude {
excluded[pkg] = struct{}{}
}
newInclude := []string{}
for _, pkg := range ps.Include {
_, found := excluded[pkg]
if !found {
newInclude = append(newInclude, pkg)
}
}
ps.Include = newInclude
return ps
}
// TODO: the public API of this package should not be reused for serialization.
type PackageSpec struct {
Name string `json:"name"`