diff --git a/pkg/distro/fedora/distro.go b/pkg/distro/fedora/distro.go index 11dfae0f75..c3f078dd84 100644 --- a/pkg/distro/fedora/distro.go +++ b/pkg/distro/fedora/distro.go @@ -202,7 +202,7 @@ var ( kernelOptions: defaultKernelOptions, bootable: true, defaultSize: 5 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, @@ -230,7 +230,7 @@ var ( kernelOptions: defaultKernelOptions, bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc"}, exports: []string{"vpc"}, @@ -259,7 +259,7 @@ var ( kernelOptions: defaultKernelOptions, bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk"}, exports: []string{"vmdk"}, @@ -277,7 +277,7 @@ var ( kernelOptions: defaultKernelOptions, bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk", "ovf", "archive"}, exports: []string{"archive"}, @@ -341,7 +341,7 @@ var ( kernelOptions: defaultKernelOptions, bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/fedora/images.go b/pkg/distro/fedora/images.go index d4db2e181f..dcec7ed039 100644 --- a/pkg/distro/fedora/images.go +++ b/pkg/distro/fedora/images.go @@ -200,7 +200,7 @@ func osCustomizations( // IMAGES -func liveImage(workload workload.Workload, +func diskImage(workload workload.Workload, t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, @@ -208,7 +208,7 @@ func liveImage(workload workload.Workload, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error) { - img := image.NewLiveImage() + img := image.NewDiskImage() img.Platform = t.platform img.OSCustomizations = osCustomizations(t, packageSets[osPkgsKey], containers, customizations) img.Environment = t.environment diff --git a/pkg/distro/rhel7/azure.go b/pkg/distro/rhel7/azure.go index 5a84edec9b..64112b08a5 100644 --- a/pkg/distro/rhel7/azure.go +++ b/pkg/distro/rhel7/azure.go @@ -25,7 +25,7 @@ var azureRhuiImgType = imageType{ kernelOptions: "ro crashkernel=auto console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300 scsi_mod.use_blk_mq=y", bootable: true, defaultSize: 64 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel7/images.go b/pkg/distro/rhel7/images.go index ae9b158ecf..e3ca6dc209 100644 --- a/pkg/distro/rhel7/images.go +++ b/pkg/distro/rhel7/images.go @@ -216,7 +216,7 @@ func osCustomizations( return osc } -func liveImage(workload workload.Workload, +func diskImage(workload workload.Workload, t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, @@ -224,7 +224,7 @@ func liveImage(workload workload.Workload, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error) { - img := image.NewLiveImage() + img := image.NewDiskImage() img.Platform = t.platform img.OSCustomizations = osCustomizations(t, packageSets[osPkgsKey], options, containers, customizations) img.Environment = t.environment diff --git a/pkg/distro/rhel7/qcow2.go b/pkg/distro/rhel7/qcow2.go index 50c29b56c0..a875fadd76 100644 --- a/pkg/distro/rhel7/qcow2.go +++ b/pkg/distro/rhel7/qcow2.go @@ -19,7 +19,7 @@ var qcow2ImgType = imageType{ defaultImageConfig: qcow2DefaultImgConfig, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, diff --git a/pkg/distro/rhel8/ami.go b/pkg/distro/rhel8/ami.go index 04731577fd..01645cf21f 100644 --- a/pkg/distro/rhel8/ami.go +++ b/pkg/distro/rhel8/ami.go @@ -20,7 +20,7 @@ func amiImgTypeX86_64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image"}, exports: []string{"image"}, @@ -49,7 +49,7 @@ func ec2ImgTypeX86_64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -77,7 +77,7 @@ func ec2HaImgTypeX86_64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -98,7 +98,7 @@ func amiImgTypeAarch64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image"}, exports: []string{"image"}, @@ -126,7 +126,7 @@ func ec2ImgTypeAarch64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -154,7 +154,7 @@ func ec2SapImgTypeX86_64(rd distribution) imageType { kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel8/azure.go b/pkg/distro/rhel8/azure.go index 20996591b1..77a9909518 100644 --- a/pkg/distro/rhel8/azure.go +++ b/pkg/distro/rhel8/azure.go @@ -26,7 +26,7 @@ func azureRhuiImgType() imageType { kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 64 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc", "xz"}, exports: []string{"xz"}, @@ -47,7 +47,7 @@ func azureSapRhuiImgType(rd distribution) imageType { kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 64 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc", "xz"}, exports: []string{"xz"}, @@ -67,7 +67,7 @@ func azureByosImgType() imageType { kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc"}, exports: []string{"vpc"}, @@ -88,7 +88,7 @@ func azureImgType() imageType { kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc"}, exports: []string{"vpc"}, @@ -110,7 +110,7 @@ func azureEap7RhuiImgType() imageType { kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 64 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel8/edge.go b/pkg/distro/rhel8/edge.go index b7e3dca5ca..4fcd6fda2c 100644 --- a/pkg/distro/rhel8/edge.go +++ b/pkg/distro/rhel8/edge.go @@ -152,7 +152,7 @@ func minimalRawImgType(rd distribution) imageType { kernelOptions: "ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0", bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel8/gce.go b/pkg/distro/rhel8/gce.go index 35a2a2f937..98b870df5c 100644 --- a/pkg/distro/rhel8/gce.go +++ b/pkg/distro/rhel8/gce.go @@ -22,7 +22,7 @@ func gceImgType(rd distribution) imageType { kernelOptions: gceKernelOptions, bootable: true, defaultSize: 20 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "archive"}, exports: []string{"archive"}, @@ -43,7 +43,7 @@ func gceRhuiImgType(rd distribution) imageType { kernelOptions: gceKernelOptions, bootable: true, defaultSize: 20 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "archive"}, exports: []string{"archive"}, diff --git a/pkg/distro/rhel8/images.go b/pkg/distro/rhel8/images.go index 31a7190d05..7afbed7341 100644 --- a/pkg/distro/rhel8/images.go +++ b/pkg/distro/rhel8/images.go @@ -227,7 +227,7 @@ func osCustomizations( return osc } -func liveImage(workload workload.Workload, +func diskImage(workload workload.Workload, t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, @@ -235,7 +235,7 @@ func liveImage(workload workload.Workload, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error) { - img := image.NewLiveImage() + img := image.NewDiskImage() img.Platform = t.platform img.OSCustomizations = osCustomizations(t, packageSets[osPkgsKey], options, containers, customizations) img.Environment = t.environment diff --git a/pkg/distro/rhel8/qcow2.go b/pkg/distro/rhel8/qcow2.go index e9c27a9f70..9c924831d1 100644 --- a/pkg/distro/rhel8/qcow2.go +++ b/pkg/distro/rhel8/qcow2.go @@ -22,7 +22,7 @@ func qcow2ImgType(rd distribution) imageType { }, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, @@ -58,7 +58,7 @@ func openstackImgType() imageType { kernelOptions: "ro net.ifnames=0", bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, diff --git a/pkg/distro/rhel8/vmdk.go b/pkg/distro/rhel8/vmdk.go index 71a7b4f90c..785bcac934 100644 --- a/pkg/distro/rhel8/vmdk.go +++ b/pkg/distro/rhel8/vmdk.go @@ -18,7 +18,7 @@ func vmdkImgType() imageType { kernelOptions: vmdkKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk"}, exports: []string{"vmdk"}, @@ -37,7 +37,7 @@ func ovaImgType() imageType { kernelOptions: vmdkKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk", "ovf", "archive"}, exports: []string{"archive"}, diff --git a/pkg/distro/rhel9/ami.go b/pkg/distro/rhel9/ami.go index 3fe5f94d70..94235ce5d7 100644 --- a/pkg/distro/rhel9/ami.go +++ b/pkg/distro/rhel9/ami.go @@ -21,7 +21,7 @@ var ( kernelOptions: amiKernelOptions, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image"}, exports: []string{"image"}, @@ -39,7 +39,7 @@ var ( kernelOptions: amiKernelOptions, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -58,7 +58,7 @@ var ( kernelOptions: amiKernelOptions, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -76,7 +76,7 @@ var ( kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image"}, exports: []string{"image"}, @@ -95,7 +95,7 @@ var ( kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, @@ -114,7 +114,7 @@ var ( kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 processor.max_cstate=1 intel_idle.max_cstate=1", bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel9/azure.go b/pkg/distro/rhel9/azure.go index e88d35c4cf..373642dcf5 100644 --- a/pkg/distro/rhel9/azure.go +++ b/pkg/distro/rhel9/azure.go @@ -23,7 +23,7 @@ var ( kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc"}, exports: []string{"vpc"}, @@ -42,7 +42,7 @@ var ( kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc"}, exports: []string{"vpc"}, @@ -62,7 +62,7 @@ var ( kernelOptions: defaultAzureKernelOptions, bootable: true, defaultSize: 64 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vpc", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel9/edge.go b/pkg/distro/rhel9/edge.go index 15436254b4..e58e117bbb 100644 --- a/pkg/distro/rhel9/edge.go +++ b/pkg/distro/rhel9/edge.go @@ -184,7 +184,7 @@ var ( kernelOptions: "ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0", bootable: true, defaultSize: 2 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "xz"}, exports: []string{"xz"}, diff --git a/pkg/distro/rhel9/gce.go b/pkg/distro/rhel9/gce.go index 2b739b7491..fa9f94b6db 100644 --- a/pkg/distro/rhel9/gce.go +++ b/pkg/distro/rhel9/gce.go @@ -21,7 +21,7 @@ var ( kernelOptions: gceKernelOptions, bootable: true, defaultSize: 20 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "archive"}, exports: []string{"archive"}, @@ -39,7 +39,7 @@ var ( kernelOptions: gceKernelOptions, bootable: true, defaultSize: 20 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "archive"}, exports: []string{"archive"}, diff --git a/pkg/distro/rhel9/images.go b/pkg/distro/rhel9/images.go index 571532cdb5..62d8f6bf29 100644 --- a/pkg/distro/rhel9/images.go +++ b/pkg/distro/rhel9/images.go @@ -224,7 +224,7 @@ func osCustomizations( return osc } -func liveImage(workload workload.Workload, +func diskImage(workload workload.Workload, t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, @@ -232,7 +232,7 @@ func liveImage(workload workload.Workload, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error) { - img := image.NewLiveImage() + img := image.NewDiskImage() img.Platform = t.platform img.OSCustomizations = osCustomizations(t, packageSets[osPkgsKey], options, containers, customizations) img.Environment = t.environment diff --git a/pkg/distro/rhel9/qcow2.go b/pkg/distro/rhel9/qcow2.go index 892aeb23f5..20fd84f5ed 100644 --- a/pkg/distro/rhel9/qcow2.go +++ b/pkg/distro/rhel9/qcow2.go @@ -23,7 +23,7 @@ var ( kernelOptions: "ro net.ifnames=0", bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, @@ -162,7 +162,7 @@ func mkQcow2ImgType(d distribution) imageType { }, bootable: true, defaultSize: 10 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "qcow2"}, exports: []string{"qcow2"}, diff --git a/pkg/distro/rhel9/vmdk.go b/pkg/distro/rhel9/vmdk.go index 10e5972193..d9cc8378a1 100644 --- a/pkg/distro/rhel9/vmdk.go +++ b/pkg/distro/rhel9/vmdk.go @@ -22,7 +22,7 @@ var vmdkImgType = imageType{ kernelOptions: vmdkKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk"}, exports: []string{"vmdk"}, @@ -42,7 +42,7 @@ var ovaImgType = imageType{ kernelOptions: vmdkKernelOptions, bootable: true, defaultSize: 4 * common.GibiByte, - image: liveImage, + image: diskImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "image", "vmdk", "ovf", "archive"}, exports: []string{"archive"}, diff --git a/pkg/image/live.go b/pkg/image/disk.go similarity index 95% rename from pkg/image/live.go rename to pkg/image/disk.go index c7628d2f34..0a3f503143 100644 --- a/pkg/image/live.go +++ b/pkg/image/disk.go @@ -16,7 +16,7 @@ import ( "github.com/osbuild/images/pkg/runner" ) -type LiveImage struct { +type DiskImage struct { Base Platform platform.Platform PartitionTable *disk.PartitionTable @@ -34,14 +34,14 @@ type LiveImage struct { OSNick string } -func NewLiveImage() *LiveImage { - return &LiveImage{ - Base: NewBase("live-image"), +func NewDiskImage() *DiskImage { + return &DiskImage{ + Base: NewBase("disk"), PartTool: osbuild.PTSfdisk, } } -func (img *LiveImage) InstantiateManifest(m *manifest.Manifest, +func (img *DiskImage) InstantiateManifest(m *manifest.Manifest, repos []rpmmd.RepoConfig, runner runner.Runner, rng *rand.Rand) (*artifact.Artifact, error) {