diff --git a/pkg/image/anaconda_container_installer.go b/pkg/image/anaconda_container_installer.go index 6fd279fa44..f2d79b6c69 100644 --- a/pkg/image/anaconda_container_installer.go +++ b/pkg/image/anaconda_container_installer.go @@ -9,7 +9,6 @@ import ( "github.com/osbuild/images/pkg/artifact" "github.com/osbuild/images/pkg/container" "github.com/osbuild/images/pkg/customizations/users" - "github.com/osbuild/images/pkg/disk" "github.com/osbuild/images/pkg/manifest" "github.com/osbuild/images/pkg/platform" "github.com/osbuild/images/pkg/rpmmd" @@ -89,21 +88,6 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest, } anacondaPipeline.AdditionalDrivers = img.AdditionalDrivers - rootfsPartitionTable := &disk.PartitionTable{ - Size: 20 * common.MebiByte, - Partitions: []disk.Partition{ - { - Start: 0, - Size: 20 * common.MebiByte, - Payload: &disk.Filesystem{ - Type: "vfat", - Mountpoint: "/", - UUID: disk.NewVolIDFromRand(rng), - }, - }, - }, - } - // TODO: replace isoLabelTmpl with more high-level properties isoLabel := fmt.Sprintf(img.ISOLabelTempl, img.Platform.GetArch()) @@ -123,7 +107,7 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest, isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64 isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline) - isoTreePipeline.PartitionTable = rootfsPartitionTable + isoTreePipeline.PartitionTable = efiBootPartitionTable(rng) isoTreePipeline.Release = img.Release isoTreePipeline.OSName = img.OSName isoTreePipeline.Users = img.Users diff --git a/pkg/image/anaconda_live_installer.go b/pkg/image/anaconda_live_installer.go index 790f7c9bdf..d153dd7a44 100644 --- a/pkg/image/anaconda_live_installer.go +++ b/pkg/image/anaconda_live_installer.go @@ -9,7 +9,6 @@ import ( "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" "github.com/osbuild/images/pkg/platform" "github.com/osbuild/images/pkg/rpmmd" @@ -67,21 +66,6 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest, livePipeline.Checkpoint() - rootfsPartitionTable := &disk.PartitionTable{ - Size: 20 * common.MebiByte, - Partitions: []disk.Partition{ - { - Start: 0, - Size: 20 * common.MebiByte, - Payload: &disk.Filesystem{ - Type: "vfat", - Mountpoint: "/", - UUID: disk.NewVolIDFromRand(rng), - }, - }, - }, - } - // TODO: replace isoLabelTmpl with more high-level properties isoLabel := fmt.Sprintf(img.ISOLabelTempl, img.Platform.GetArch()) @@ -108,7 +92,7 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest, isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64 isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, livePipeline, rootfsImagePipeline, bootTreePipeline) - isoTreePipeline.PartitionTable = rootfsPartitionTable + isoTreePipeline.PartitionTable = efiBootPartitionTable(rng) isoTreePipeline.Release = img.Release isoTreePipeline.OSName = img.OSName diff --git a/pkg/image/anaconda_ostree_installer.go b/pkg/image/anaconda_ostree_installer.go index c655b59192..9487915e4d 100644 --- a/pkg/image/anaconda_ostree_installer.go +++ b/pkg/image/anaconda_ostree_installer.go @@ -8,7 +8,6 @@ import ( "github.com/osbuild/images/pkg/arch" "github.com/osbuild/images/pkg/artifact" "github.com/osbuild/images/pkg/customizations/users" - "github.com/osbuild/images/pkg/disk" "github.com/osbuild/images/pkg/manifest" "github.com/osbuild/images/pkg/ostree" "github.com/osbuild/images/pkg/platform" @@ -84,21 +83,6 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest, } anacondaPipeline.AdditionalDrivers = img.AdditionalDrivers - rootfsPartitionTable := &disk.PartitionTable{ - Size: 20 * common.MebiByte, - Partitions: []disk.Partition{ - { - Start: 0, - Size: 20 * common.MebiByte, - Payload: &disk.Filesystem{ - Type: "vfat", - Mountpoint: "/", - UUID: disk.NewVolIDFromRand(rng), - }, - }, - }, - } - // TODO: replace isoLabelTmpl with more high-level properties isoLabel := fmt.Sprintf(img.ISOLabelTempl, img.Platform.GetArch()) @@ -118,7 +102,7 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest, isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64 isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline) - isoTreePipeline.PartitionTable = rootfsPartitionTable + isoTreePipeline.PartitionTable = efiBootPartitionTable(rng) isoTreePipeline.Release = img.Release isoTreePipeline.OSName = img.OSName isoTreePipeline.Remote = img.Remote diff --git a/pkg/image/anaconda_tar_installer.go b/pkg/image/anaconda_tar_installer.go index fd94d8c16e..f7fb3da8d2 100644 --- a/pkg/image/anaconda_tar_installer.go +++ b/pkg/image/anaconda_tar_installer.go @@ -20,6 +20,24 @@ import ( const kspath = "/osbuild.ks" +func efiBootPartitionTable(rng *rand.Rand) *disk.PartitionTable { + var efibootImageSize uint64 = 20 * common.MebiByte + return &disk.PartitionTable{ + Size: efibootImageSize, + Partitions: []disk.Partition{ + { + Start: 0, + Size: efibootImageSize, + Payload: &disk.Filesystem{ + Type: "vfat", + Mountpoint: "/", + UUID: disk.NewVolIDFromRand(rng), + }, + }, + }, + } +} + type AnacondaTarInstaller struct { Base Platform platform.Platform @@ -102,21 +120,6 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, anacondaPipeline.Checkpoint() - rootfsPartitionTable := &disk.PartitionTable{ - Size: 20 * common.MebiByte, - Partitions: []disk.Partition{ - { - Start: 0, - Size: 20 * common.MebiByte, - Payload: &disk.Filesystem{ - Type: "vfat", - Mountpoint: "/", - UUID: disk.NewVolIDFromRand(rng), - }, - }, - }, - } - // TODO: replace isoLabelTmpl with more high-level properties isoLabel := fmt.Sprintf(img.ISOLabelTempl, img.Platform.GetArch()) @@ -147,7 +150,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64 isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline) - isoTreePipeline.PartitionTable = rootfsPartitionTable + isoTreePipeline.PartitionTable = efiBootPartitionTable(rng) isoTreePipeline.Release = img.Release isoTreePipeline.OSName = img.OSName isoTreePipeline.Users = img.Users diff --git a/pkg/image/ostree_simplified_installer.go b/pkg/image/ostree_simplified_installer.go index facdd5aa0e..7da59af2e1 100644 --- a/pkg/image/ostree_simplified_installer.go +++ b/pkg/image/ostree_simplified_installer.go @@ -4,14 +4,12 @@ import ( "fmt" "math/rand" - "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/customizations/fdo" "github.com/osbuild/images/pkg/customizations/ignition" - "github.com/osbuild/images/pkg/disk" "github.com/osbuild/images/pkg/manifest" "github.com/osbuild/images/pkg/platform" "github.com/osbuild/images/pkg/rpmmd" @@ -135,27 +133,12 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest, bootTreePipeline.KernelOpts = kernelOpts - rootfsPartitionTable := &disk.PartitionTable{ - Size: 20 * common.MebiByte, - Partitions: []disk.Partition{ - { - Start: 0, - Size: 20 * common.MebiByte, - Payload: &disk.Filesystem{ - Type: "vfat", - Mountpoint: "/", - UUID: disk.NewVolIDFromRand(rng), - }, - }, - }, - } - // enable ISOLinux on x86_64 only isoLinuxEnabled := img.Platform.GetArch() == arch.ARCH_X86_64 isoTreePipeline := manifest.NewCoreOSISOTree(buildPipeline, compressedImage, coiPipeline, bootTreePipeline) isoTreePipeline.KernelOpts = kernelOpts - isoTreePipeline.PartitionTable = rootfsPartitionTable + isoTreePipeline.PartitionTable = efiBootPartitionTable(rng) isoTreePipeline.OSName = img.OSName isoTreePipeline.PayloadPath = fmt.Sprintf("/%s", imageFilename) isoTreePipeline.ISOLinux = isoLinuxEnabled