distro/rhel8: update gce images to new definitions
This commit is contained in:
parent
8443464096
commit
d3369d1c76
2 changed files with 8 additions and 42 deletions
|
|
@ -8,24 +8,25 @@ import (
|
|||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
)
|
||||
|
||||
const gceKernelOptions = "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d"
|
||||
|
||||
func gceImgType(rd distribution) imageType {
|
||||
return imageType{
|
||||
name: "gce",
|
||||
filename: "image.tar.gz",
|
||||
mimeType: "application/gzip",
|
||||
packageSets: map[string]packageSetFunc{
|
||||
buildPkgsKey: distroBuildPackageSet,
|
||||
osPkgsKey: gcePackageSet,
|
||||
osPkgsKey: gcePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultGceByosImageConfig(rd),
|
||||
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.UEFIBootType,
|
||||
defaultSize: 20 * common.GibiByte,
|
||||
pipelines: gcePipelines,
|
||||
image: liveImage,
|
||||
buildPipelines: []string{"build"},
|
||||
payloadPipelines: []string{"os", "image", "archive"},
|
||||
exports: []string{"archive"},
|
||||
|
|
@ -39,18 +40,17 @@ func gceRhuiImgType(rd distribution) imageType {
|
|||
filename: "image.tar.gz",
|
||||
mimeType: "application/gzip",
|
||||
packageSets: map[string]packageSetFunc{
|
||||
buildPkgsKey: distroBuildPackageSet,
|
||||
osPkgsKey: gceRhuiPackageSet,
|
||||
osPkgsKey: gceRhuiPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultGceRhuiImageConfig(rd),
|
||||
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.UEFIBootType,
|
||||
defaultSize: 20 * common.GibiByte,
|
||||
pipelines: gcePipelines,
|
||||
image: liveImage,
|
||||
buildPipelines: []string{"build"},
|
||||
payloadPipelines: []string{"os", "image", "archive"},
|
||||
exports: []string{"archive"},
|
||||
|
|
|
|||
|
|
@ -56,40 +56,6 @@ func vmdkPipelines(t *imageType, customizations *blueprint.Customizations, optio
|
|||
return pipelines, nil
|
||||
}
|
||||
|
||||
func gcePipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, containers []container.Spec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||
pipelines := make([]osbuild.Pipeline, 0)
|
||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey], t.arch.distro.runner.String()))
|
||||
|
||||
partitionTable, err := t.getPartitionTable(customizations.GetFilesystems(), options, rng)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], containers, customizations, options, partitionTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pipelines = append(pipelines, *treePipeline)
|
||||
|
||||
diskfile := "disk.raw"
|
||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||
imagePipeline := liveImagePipeline(treePipeline.Name, diskfile, partitionTable, t.arch, kernelVer)
|
||||
pipelines = append(pipelines, *imagePipeline)
|
||||
|
||||
archivePipeline := tarArchivePipeline("archive", imagePipeline.Name, &osbuild.TarStageOptions{
|
||||
Filename: t.Filename(),
|
||||
Format: osbuild.TarArchiveFormatOldgnu,
|
||||
RootNode: osbuild.TarRootNodeOmit,
|
||||
// import of the image to GCP fails in case the options below are enabled, which is the default
|
||||
ACLs: common.ToPtr(false),
|
||||
SELinux: common.ToPtr(false),
|
||||
Xattrs: common.ToPtr(false),
|
||||
})
|
||||
pipelines = append(pipelines, *archivePipeline)
|
||||
|
||||
return pipelines, nil
|
||||
}
|
||||
|
||||
func tarPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, containers []container.Spec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||
pipelines := make([]osbuild.Pipeline, 0)
|
||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey], t.arch.distro.runner.String()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue