Skip to content

Commit e236f5a

Browse files
committed
image: add OSTreeSimplifiedInstaller.InstallerCustomimzations
The OSTreeSimplifiedInstaller is not an anaconda installer but it still uses some of the anaconda structs. So lets move it to use the same installer customizations. Note that we cannot use the InstallerCustomizations.KernelAppend with it as it will lead to a diff in the rhel-9.x edge-simplified-installer image: ```yaml --- /tmp/tmp07t_j3mj/ref/rhel_9.7-x86_64-edge_simplified_installer-edge_ostree_pull_device.json 2025-08-26 15:10:18.721496181 +0200 +++ /tmp/tmp07t_j3mj/new/rhel_9.7-x86_64-edge_simplified_installer-edge_ostree_pull_device.json 2025-08-26 15:10:21.201572008 +0200 @@ -1100,7 +1100,10 @@ "coreos.inst.isoroot=RHEL-9-7-0-BaseOS-x86_64", "coreos.inst.install_dev=/dev/sda", "coreos.inst.image_file=/run/media/iso/image.raw.xz", - "coreos.inst.insecure" + "coreos.inst.insecure", + "modprobe.blacklist=vc4", + "rw", + "coreos.no_persist_ip" ] }, "isolabel": "RHEL-9-7-0-BaseOS-x86_64", @@ -1259,7 +1262,10 @@ "coreos.inst.isoroot=RHEL-9-7-0-BaseOS-x86_64", "coreos.inst.install_dev=/dev/sda", "coreos.inst.image_file=/run/media/iso/image.raw.xz", - "coreos.inst.insecure" + "coreos.inst.insecure", + "modprobe.blacklist=vc4", + "rw", + "coreos.no_persist_ip" ] } } ``` This is because the edge-simplified-installer for rhel uses the kernel options from the base image type only for the deployed system but does not add it to the ISO kernel commandline. Its unclear if we should unify this or not but this commit errs on the side of caution.
1 parent c844e0d commit e236f5a

3 files changed

Lines changed: 27 additions & 48 deletions

File tree

pkg/distro/generic/images.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -880,28 +880,11 @@ func iotSimplifiedInstallerImage(t *imageType,
880880
}
881881
}
882882
}
883-
884-
installerConfig, err := t.getDefaultInstallerConfig()
883+
img.InstallerCustomizations, err = installerCustomizations(t, bp.Customizations)
885884
if err != nil {
886885
return nil, err
887886
}
888-
889-
if installerConfig != nil {
890-
img.AdditionalDracutModules = append(img.AdditionalDracutModules, installerConfig.AdditionalDracutModules...)
891-
img.AdditionalDrivers = append(img.AdditionalDrivers, installerConfig.AdditionalDrivers...)
892-
}
893-
894-
// XXX: move to use InstallerCustomizations too
895-
d := t.arch.distro
896-
img.Product = d.Product()
897-
img.Variant = t.ImageTypeYAML.Variant
898887
img.OSName = t.OSTree.Name
899-
img.OSVersion = d.OsVersion()
900-
901-
img.ISOLabel, err = t.ISOLabel()
902-
if err != nil {
903-
return nil, err
904-
}
905888

906889
return img, nil
907890
}

pkg/image/ostree_simplified_installer.go

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,15 @@ type OSTreeSimplifiedInstaller struct {
2121
// Raw image that will be created and embedded
2222
rawImage *OSTreeDiskImage
2323

24-
OSCustomizations manifest.OSCustomizations
25-
Environment environment.Environment
24+
OSCustomizations manifest.OSCustomizations
25+
Environment environment.Environment
26+
InstallerCustomizations manifest.InstallerCustomizations
2627

2728
ExtraBasePackages rpmmd.PackageSet
2829

29-
ISOLabel string
30-
3130
// ISO label template (architecture-free)
3231
ISOLabelTmpl string
3332

34-
// Product string for ISO buildstamp
35-
Product string
36-
37-
// OSVersion string for ISO buildstamp
38-
OSVersion string
39-
40-
// Variant string for ISO buildstamp
41-
Variant string
42-
4333
// OSName for ostree deployment
4434
OSName string
4535

@@ -52,9 +42,6 @@ type OSTreeSimplifiedInstaller struct {
5242

5343
// Ignition embedded configuration options
5444
IgnitionEmbedded *ignition.EmbeddedOptions
55-
56-
AdditionalDracutModules []string
57-
AdditionalDrivers []string
5845
}
5946

6047
func NewOSTreeSimplifiedInstaller(platform platform.Platform, filename string, rawImage *OSTreeDiskImage, installDevice string) *OSTreeSimplifiedInstaller {
@@ -83,29 +70,29 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
8370
img.platform,
8471
repos,
8572
"kernel",
86-
img.Product,
87-
img.OSVersion,
73+
img.InstallerCustomizations.Product,
74+
img.InstallerCustomizations.OSVersion,
8875
)
8976
coiPipeline.ExtraPackages = img.ExtraBasePackages.Include
9077
coiPipeline.ExcludePackages = img.ExtraBasePackages.Exclude
9178
coiPipeline.ExtraRepos = img.ExtraBasePackages.Repositories
9279
coiPipeline.FDO = img.FDO
9380
coiPipeline.Ignition = img.IgnitionEmbedded
9481
coiPipeline.Biosdevname = (img.platform.GetArch() == arch.ARCH_X86_64)
95-
coiPipeline.Variant = img.Variant
96-
coiPipeline.AdditionalDracutModules = img.AdditionalDracutModules
97-
coiPipeline.AdditionalDrivers = img.AdditionalDrivers
82+
coiPipeline.Variant = img.InstallerCustomizations.Variant
83+
coiPipeline.AdditionalDracutModules = img.InstallerCustomizations.AdditionalDracutModules
84+
coiPipeline.AdditionalDrivers = img.InstallerCustomizations.AdditionalDrivers
9885

9986
var isoLabel string
10087

101-
if len(img.ISOLabel) > 0 {
102-
isoLabel = img.ISOLabel
88+
if len(img.InstallerCustomizations.ISOLabel) > 0 {
89+
isoLabel = img.InstallerCustomizations.ISOLabel
10390
} else {
10491
// TODO: replace isoLabelTmpl with more high-level properties
10592
isoLabel = fmt.Sprintf(img.ISOLabelTmpl, img.platform.GetArch())
10693
}
10794

108-
bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.Product, img.OSVersion)
95+
bootTreePipeline := manifest.NewEFIBootTree(buildPipeline, img.InstallerCustomizations.Product, img.InstallerCustomizations.OSVersion)
10996
bootTreePipeline.Platform = img.platform
11097
bootTreePipeline.UEFIVendor = img.platform.GetUEFIVendor()
11198
bootTreePipeline.ISOLabel = isoLabel
@@ -136,7 +123,16 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
136123
kernelOpts = append(kernelOpts, "fdo.di_mfg_string_type_mac_iface="+img.FDO.DiMfgStringTypeMacIface)
137124
}
138125
}
139-
126+
// Note that we do not use the
127+
// InstlerCustomizations.KernelOptionsAppend here because
128+
// InstallerCustomizations.KernelOptionsAppend also picks up
129+
// the kernel options from the imageConfig but we only set
130+
// those in the rawImage.OSTreeDeploymentCustomizations and
131+
// not in the bootTreePipeline. Its unclear if we should change
132+
// this or not. Its inconsistent with the other installers but
133+
// then simplifiedInstaler is special.
134+
//
135+
// kernelOpts = append(kernelOpts, img.InstallerCustomizations.KernelOptionsAppend...)
140136
bootTreePipeline.KernelOpts = kernelOpts
141137

142138
// enable ISOLinux on x86_64 only

pkg/image/ostree_simplified_installer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ func TestSimplifiedInstallerDracut(t *testing.T) {
1919
ostreeDiskImage := image.NewOSTreeDiskImageFromCommit(platform, "filename", commit)
2020
ostreeDiskImage.PartitionTable = testdisk.MakeFakePartitionTable("/")
2121
img := image.NewOSTreeSimplifiedInstaller(testPlatform, "filename", ostreeDiskImage, "")
22-
img.Product = product
23-
img.OSVersion = osversion
24-
img.ISOLabel = isolabel
22+
img.InstallerCustomizations.Product = product
23+
img.InstallerCustomizations.OSVersion = osversion
24+
img.InstallerCustomizations.ISOLabel = isolabel
2525

2626
testModules := []string{"test-module"}
2727
testDrivers := []string{"test-driver"}
2828

29-
img.AdditionalDracutModules = testModules
30-
img.AdditionalDrivers = testDrivers
29+
img.InstallerCustomizations.AdditionalDracutModules = testModules
30+
img.InstallerCustomizations.AdditionalDrivers = testDrivers
3131

3232
commitSpec := map[string][]ostree.CommitSpec{
3333
"ostree-deployment": {

0 commit comments

Comments
 (0)