Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/distrodefs/fedora/imagetypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,7 @@ image_types:
boot_iso: true
image_func: "live_installer"
iso_label: "Workstation"
variant: "Workstation"
exports: ["bootiso"]
required_partition_sizes: *default_required_dir_sizes
installer_config:
Expand Down
77 changes: 18 additions & 59 deletions pkg/distro/generic/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,22 @@ func osCustomizations(t *imageType, osPackageSet rpmmd.PackageSet, options distr
}

func installerCustomizations(t *imageType, c *blueprint.Customizations) (manifest.InstallerCustomizations, error) {
isc := manifest.InstallerCustomizations{}
isc.FIPS = c.GetFIPS()
isc.UseLegacyAnacondaConfig = t.ImageTypeYAML.UseLegacyAnacondaConfig
d := t.arch.distro
isoLabel, err := t.ISOLabel()
if err != nil {
return manifest.InstallerCustomizations{}, err
}

isc := manifest.InstallerCustomizations{
FIPS: c.GetFIPS(),
UseLegacyAnacondaConfig: t.ImageTypeYAML.UseLegacyAnacondaConfig,
Product: d.Product(),
OSVersion: d.OsVersion(),
Release: fmt.Sprintf("%s %s", d.Product(), d.OsVersion()),
Preview: d.DistroYAML.Preview,
ISOLabel: isoLabel,
Variant: t.Variant,
}

installerConfig, err := t.getDefaultInstallerConfig()
if err != nil {
Expand Down Expand Up @@ -540,27 +553,14 @@ func liveInstallerImage(t *imageType,
img := image.NewAnacondaLiveInstaller(t.platform, t.Filename())

img.ExtraBasePackages = packageSets[installerPkgsKey]
d := t.arch.distro

img.Product = d.Product()
img.Variant = "Workstation"
img.OSVersion = d.OsVersion()
img.Release = fmt.Sprintf("%s %s", d.Product(), d.OsVersion())
img.Preview = d.DistroYAML.Preview

var err error
img.ISOLabel, err = t.ISOLabel()
if err != nil {
return nil, err
}

imgConfig := t.getDefaultImageConfig()
if locale := imgConfig.Locale; locale != nil {
img.Locale = *locale
}

var err error
img.InstallerCustomizations, err = installerCustomizations(t, bp.Customizations)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -615,20 +615,6 @@ func imageInstallerImage(t *imageType,
img.InstallerCustomizations.AdditionalKernelOpts = append(img.InstallerCustomizations.AdditionalKernelOpts, installerConfig.KickstartUnattendedExtraKernelOpts...)
}

d := t.arch.distro

img.Product = d.Product()

img.OSVersion = d.OsVersion()
img.Release = fmt.Sprintf("%s %s", d.Product(), d.OsVersion())
img.Variant = t.Variant
img.Preview = d.DistroYAML.Preview

img.ISOLabel, err = t.ISOLabel()
if err != nil {
return nil, err
}

img.RootfsCompression = "xz" // This also triggers using the bcj filter

return img, nil
Expand Down Expand Up @@ -746,8 +732,6 @@ func iotInstallerImage(t *imageType,
containers []container.SourceSpec,
rng *rand.Rand) (image.ImageKind, error) {

d := t.arch.distro

commit, err := makeOSTreePayloadCommit(options.OSTree, t.OSTreeRef())
if err != nil {
return nil, fmt.Errorf("%s: %s", t.Name(), err.Error())
Expand Down Expand Up @@ -784,17 +768,6 @@ func iotInstallerImage(t *imageType,
img.InstallerCustomizations.EnabledAnacondaModules = append(img.InstallerCustomizations.EnabledAnacondaModules, anaconda.ModuleUsers)
}

img.Product = d.Product()
img.Variant = t.ImageTypeYAML.Variant
img.OSVersion = d.OsVersion()
img.Release = fmt.Sprintf("%s %s", d.Product(), d.OsVersion())
img.Preview = d.DistroYAML.Preview

img.ISOLabel, err = t.ISOLabel()
if err != nil {
return nil, err
}

img.RootfsCompression = "xz" // This also triggers using the bcj filter
imgConfig := t.getDefaultImageConfig()
if locale := imgConfig.Locale; locale != nil {
Expand Down Expand Up @@ -914,6 +887,7 @@ func iotSimplifiedInstallerImage(t *imageType,
img.AdditionalDrivers = append(img.AdditionalDrivers, installerConfig.AdditionalDrivers...)
}

// XXX: move to use InstallerCustomizations too
d := t.arch.distro
img.Product = d.Product()
img.Variant = t.ImageTypeYAML.Variant
Expand Down Expand Up @@ -948,22 +922,7 @@ func netinstImage(t *imageType,
img.ExtraBasePackages = packageSets[installerPkgsKey]

var err error

img.InstallerCustomizations, err = installerCustomizations(t, bp.Customizations)

if err != nil {
return nil, err
}

d := t.arch.distro

img.Product = d.Product()
img.Variant = t.Variant
img.OSVersion = d.OsVersion()
img.Release = fmt.Sprintf("%s %s", d.Product(), d.OsVersion())
img.Preview = d.DistroYAML.Preview

img.ISOLabel, err = t.ISOLabel()
if err != nil {
return nil, err
}
Expand Down
24 changes: 7 additions & 17 deletions pkg/image/anaconda_container_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ type AnacondaContainerInstaller struct {

RootfsCompression string

ISOLabel string
Product string
Variant string
Ref string
OSVersion string
Release string
Preview bool
Ref string

ContainerSource container.SourceSpec
ContainerRemoveSignatures bool
Expand Down Expand Up @@ -68,18 +62,14 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest,
img.platform,
repos,
"kernel",
img.Product,
img.OSVersion,
img.Preview,
img.InstallerCustomizations,
)

anacondaPipeline.ExtraPackages = img.ExtraBasePackages.Include
anacondaPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
anacondaPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
anacondaPipeline.Variant = img.Variant
anacondaPipeline.Biosdevname = (img.platform.GetArch() == arch.ARCH_X86_64)
anacondaPipeline.Checkpoint()
anacondaPipeline.InstallerCustomizations = img.InstallerCustomizations

if anacondaPipeline.InstallerCustomizations.FIPS {
anacondaPipeline.InstallerCustomizations.EnabledAnacondaModules = append(
Expand All @@ -98,10 +88,10 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest,
default:
}

bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.Product, img.OSVersion)
bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.InstallerCustomizations.Product, img.InstallerCustomizations.OSVersion)
bootTreePipeline.Platform = img.platform
bootTreePipeline.UEFIVendor = img.platform.GetUEFIVendor()
bootTreePipeline.ISOLabel = img.ISOLabel
bootTreePipeline.ISOLabel = img.InstallerCustomizations.ISOLabel

if img.Kickstart == nil {
img.Kickstart = &kickstart.Options{}
Expand All @@ -110,14 +100,14 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest,
img.Kickstart.Path = osbuild.KickstartPathOSBuild
}

bootTreePipeline.KernelOpts = []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.ISOLabel), fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", img.ISOLabel, img.Kickstart.Path)}
bootTreePipeline.KernelOpts = []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.InstallerCustomizations.ISOLabel), fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", img.InstallerCustomizations.ISOLabel, img.Kickstart.Path)}
if anacondaPipeline.InstallerCustomizations.FIPS {
bootTreePipeline.KernelOpts = append(bootTreePipeline.KernelOpts, "fips=1")
}

isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline)
isoTreePipeline.PartitionTable = efiBootPartitionTable(rng)
isoTreePipeline.Release = img.Release
isoTreePipeline.Release = img.InstallerCustomizations.Release
isoTreePipeline.Kickstart = img.Kickstart

isoTreePipeline.RootfsCompression = img.RootfsCompression
Expand All @@ -135,7 +125,7 @@ func (img *AnacondaContainerInstaller) InstantiateManifest(m *manifest.Manifest,

isoTreePipeline.InstallRootfsType = img.InstallRootfsType

isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.ISOLabel)
isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.InstallerCustomizations.ISOLabel)
isoPipeline.SetFilename(img.filename)
isoPipeline.ISOBoot = img.InstallerCustomizations.ISOBoot
artifact := isoPipeline.Export()
Expand Down
23 changes: 6 additions & 17 deletions pkg/image/anaconda_live_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ type AnacondaLiveInstaller struct {

RootfsCompression string

ISOLabel string
Product string
Variant string
OSVersion string
Release string
Preview bool

// Locale for the installer. This should be set to the same locale as the
// ISO OS payload, if known.
Locale string
Expand Down Expand Up @@ -57,18 +50,14 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
img.platform,
repos,
"kernel",
img.Product,
img.OSVersion,
img.Preview,
img.InstallerCustomizations,
)

livePipeline.ExtraPackages = img.ExtraBasePackages.Include
livePipeline.ExcludePackages = img.ExtraBasePackages.Exclude

livePipeline.Variant = img.Variant
livePipeline.Biosdevname = (img.platform.GetArch() == arch.ARCH_X86_64)
livePipeline.Locale = img.Locale
livePipeline.InstallerCustomizations = img.InstallerCustomizations

// The live installer has SELinux enabled and targeted
livePipeline.SELinux = "targeted"
Expand All @@ -83,14 +72,14 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
default:
}

bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.Product, img.OSVersion)
bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.InstallerCustomizations.Product, img.InstallerCustomizations.OSVersion)
bootTreePipeline.Platform = img.platform
bootTreePipeline.UEFIVendor = img.platform.GetUEFIVendor()
bootTreePipeline.ISOLabel = img.ISOLabel
bootTreePipeline.ISOLabel = img.InstallerCustomizations.ISOLabel
bootTreePipeline.DefaultMenu = img.InstallerCustomizations.DefaultMenu

kernelOpts := []string{
fmt.Sprintf("root=live:CDLABEL=%s", img.ISOLabel),
fmt.Sprintf("root=live:CDLABEL=%s", img.InstallerCustomizations.ISOLabel),
"rd.live.image",
"quiet",
"rhgb",
Expand All @@ -102,15 +91,15 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,

isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, livePipeline, rootfsImagePipeline, bootTreePipeline)
isoTreePipeline.PartitionTable = efiBootPartitionTable(rng)
isoTreePipeline.Release = img.Release
isoTreePipeline.Release = img.InstallerCustomizations.Release

isoTreePipeline.KernelOpts = kernelOpts
isoTreePipeline.ISOBoot = img.InstallerCustomizations.ISOBoot

isoTreePipeline.RootfsCompression = img.RootfsCompression
isoTreePipeline.RootfsType = img.InstallerCustomizations.ISORootfsType

isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.ISOLabel)
isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.InstallerCustomizations.ISOLabel)
isoPipeline.SetFilename(img.filename)
isoPipeline.ISOBoot = img.InstallerCustomizations.ISOBoot

Expand Down
24 changes: 6 additions & 18 deletions pkg/image/anaconda_net_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ type AnacondaNetInstaller struct {

RootfsCompression string

ISOLabel string
Product string
Variant string
OSVersion string
Release string
Preview bool

Language string
}

Expand All @@ -54,19 +47,14 @@ func (img *AnacondaNetInstaller) InstantiateManifest(m *manifest.Manifest,
img.platform,
repos,
"kernel",
img.Product,
img.OSVersion,
img.Preview,
img.InstallerCustomizations,
)

anacondaPipeline.ExtraPackages = img.ExtraBasePackages.Include
anacondaPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
anacondaPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
anacondaPipeline.Variant = img.Variant
anacondaPipeline.Biosdevname = (img.platform.GetArch() == arch.ARCH_X86_64)

anacondaPipeline.InstallerCustomizations = img.InstallerCustomizations

if anacondaPipeline.InstallerCustomizations.FIPS {
anacondaPipeline.InstallerCustomizations.EnabledAnacondaModules = append(
anacondaPipeline.InstallerCustomizations.EnabledAnacondaModules,
Expand All @@ -86,13 +74,13 @@ func (img *AnacondaNetInstaller) InstantiateManifest(m *manifest.Manifest,
default:
}

bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.Product, img.OSVersion)
bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.InstallerCustomizations.Product, img.InstallerCustomizations.OSVersion)
bootTreePipeline.Platform = img.platform
bootTreePipeline.UEFIVendor = img.platform.GetUEFIVendor()
bootTreePipeline.ISOLabel = img.ISOLabel
bootTreePipeline.ISOLabel = img.InstallerCustomizations.ISOLabel
bootTreePipeline.DefaultMenu = img.InstallerCustomizations.DefaultMenu

kernelOpts := []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.ISOLabel)}
kernelOpts := []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.InstallerCustomizations.ISOLabel)}
if anacondaPipeline.InstallerCustomizations.FIPS {
kernelOpts = append(kernelOpts, "fips=1")
}
Expand All @@ -102,7 +90,7 @@ func (img *AnacondaNetInstaller) InstantiateManifest(m *manifest.Manifest,
isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline)
// TODO: the partition table is required - make it a ctor arg or set a default one in the pipeline
isoTreePipeline.PartitionTable = efiBootPartitionTable(rng)
isoTreePipeline.Release = img.Release
isoTreePipeline.Release = img.InstallerCustomizations.Release

isoTreePipeline.RootfsCompression = img.RootfsCompression
isoTreePipeline.RootfsType = img.InstallerCustomizations.ISORootfsType
Expand All @@ -114,7 +102,7 @@ func (img *AnacondaNetInstaller) InstantiateManifest(m *manifest.Manifest,

isoTreePipeline.ISOBoot = img.InstallerCustomizations.ISOBoot

isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.ISOLabel)
isoPipeline := manifest.NewISO(buildPipeline, isoTreePipeline, img.InstallerCustomizations.ISOLabel)
isoPipeline.SetFilename(img.filename)
isoPipeline.ISOBoot = img.InstallerCustomizations.ISOBoot

Expand Down
Loading
Loading