From 126bef50aa08995513ee89d04cb073563eb59626 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Tue, 19 Aug 2025 08:33:00 +0200 Subject: [PATCH] many: drop `ISORootKickstart` Since a while we've had a boolean option that determines if the kickstart file we write for certain image types ends up in the root of an ISO or in the `/usr/share/anaconda/interactive-defaults.ks` path. This changes things only for the `minimal-installer` in Fedora as all other installer adjacent image types had this set to `true`. I've tested the `minimal-installer` to still function. Historically we introduced the `minimal-installer` (then called `image-installer`) to test the Anaconda webui. At that point in time the webui didn't support any kickstarts excepts the one in `interactive-defaults.ks`. Right now it only leads to confusion. I'll likely re-introduce the ability to modify the kickstart path(s) through the installer configs in the image definitions at a later point in time if we need it instead of having a boolean toggle. Signed-off-by: Simon de Vlieger --- data/distrodefs/rhel-10/imagetypes.yaml | 2 -- data/distrodefs/rhel-8/imagetypes.yaml | 1 - data/distrodefs/rhel-9/imagetypes.yaml | 2 -- pkg/distro/generic/images.go | 9 ------ pkg/distro/installer_config.go | 1 - pkg/image/anaconda_tar_installer.go | 31 +++++-------------- pkg/image/installer_image_test.go | 19 ++---------- pkg/manifest/installer.go | 8 ----- ..._41-aarch64-minimal_installer-empty_fedora | 2 +- ...a_41-x86_64-minimal_installer-empty_fedora | 2 +- ..._42-aarch64-minimal_installer-empty_fedora | 2 +- ...a_42-x86_64-minimal_installer-empty_fedora | 2 +- ..._43-aarch64-minimal_installer-empty_fedora | 2 +- ...a_43-x86_64-minimal_installer-empty_fedora | 2 +- 14 files changed, 16 insertions(+), 69 deletions(-) diff --git a/data/distrodefs/rhel-10/imagetypes.yaml b/data/distrodefs/rhel-10/imagetypes.yaml index 352d07d2d3..b256e4b2f5 100644 --- a/data/distrodefs/rhel-10/imagetypes.yaml +++ b/data/distrodefs/rhel-10/imagetypes.yaml @@ -135,8 +135,6 @@ additional_drivers: - "ipmi_devintf" - "ipmi_msghandler" - # see commit c6bfb22f54, controls the kickstart location - iso_root_kickstart: true default_menu: 1 iso_rootfs_type: "squashfs" conditions: diff --git a/data/distrodefs/rhel-8/imagetypes.yaml b/data/distrodefs/rhel-8/imagetypes.yaml index 94d26d326f..0bc7cb57bf 100644 --- a/data/distrodefs/rhel-8/imagetypes.yaml +++ b/data/distrodefs/rhel-8/imagetypes.yaml @@ -868,7 +868,6 @@ - "org.fedoraproject.Anaconda.Modules.Network" - "org.fedoraproject.Anaconda.Modules.Payloads" - "org.fedoraproject.Anaconda.Modules.Storage" - iso_root_kickstart: true additional_dracut_modules: - "ifcfg" default_menu: 1 diff --git a/data/distrodefs/rhel-9/imagetypes.yaml b/data/distrodefs/rhel-9/imagetypes.yaml index 4e8c11664e..7bbac8d83e 100644 --- a/data/distrodefs/rhel-9/imagetypes.yaml +++ b/data/distrodefs/rhel-9/imagetypes.yaml @@ -1157,8 +1157,6 @@ - "org.fedoraproject.Anaconda.Modules.Payloads" - "org.fedoraproject.Anaconda.Modules.Runtime" - "org.fedoraproject.Anaconda.Modules.Storage" - # see commit c6bfb22f54, controls the kickstart location - iso_root_kickstart: true additional_dracut_modules: - "nvdimm" # non-volatile DIMM firmware (provides nfit, cuse, and nd_e820) - "ifcfg" diff --git a/pkg/distro/generic/images.go b/pkg/distro/generic/images.go index 6940578ff0..40a6adb4fa 100644 --- a/pkg/distro/generic/images.go +++ b/pkg/distro/generic/images.go @@ -344,15 +344,6 @@ func installerCustomizations(t *imageType, c *blueprint.Customizations) (manifes if isoboot := installerConfig.ISOBootType; isoboot != nil { isc.ISOBoot = *isoboot } - - // Put the kickstart file in the root of the iso, some image - // types (like rhel10/image-installer) put them there, some - // others (like fedora/image-installer) do not and because - // its not uniform we need to make it configurable. - // XXX: unify with rhel-11 ? or rhel-10.x? - if rootkickstart := installerConfig.ISORootKickstart; rootkickstart != nil { - isc.ISORootKickstart = *rootkickstart - } } installerCust, err := c.GetInstaller() diff --git a/pkg/distro/installer_config.go b/pkg/distro/installer_config.go index fa4bcb4e88..5f9462d62d 100644 --- a/pkg/distro/installer_config.go +++ b/pkg/distro/installer_config.go @@ -16,7 +16,6 @@ type InstallerConfig struct { // XXX: this is really here only for compatibility/because of drift in the "imageInstallerImage" // between fedora/rhel KickstartUnattendedExtraKernelOpts []string `yaml:"kickstart_unattended_extra_kernel_opts"` - ISORootKickstart *bool `yaml:"iso_root_kickstart"` // DefaultMenu will set the grub2 iso menu's default setting DefaultMenu *int `yaml:"default_menu"` diff --git a/pkg/image/anaconda_tar_installer.go b/pkg/image/anaconda_tar_installer.go index ddc0334278..9d535d73bd 100644 --- a/pkg/image/anaconda_tar_installer.go +++ b/pkg/image/anaconda_tar_installer.go @@ -3,7 +3,6 @@ package image import ( "fmt" "math/rand" - "path/filepath" "github.com/osbuild/images/internal/environment" "github.com/osbuild/images/internal/workload" @@ -79,18 +78,8 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, img.Kickstart = &kickstart.Options{} } - if img.Kickstart.Unattended { - // if we're building an unattended installer, override the - // ISORootKickstart option - img.InstallerCustomizations.ISORootKickstart = true - } - - if img.InstallerCustomizations.ISORootKickstart { - // kickstart file will be in the iso root and not interactive-defaults, - // so let's make sure the kickstart path option is set - if img.Kickstart.Path == "" { - img.Kickstart.Path = osbuild.KickstartPathOSBuild - } + if img.Kickstart.Path == "" { + img.Kickstart.Path = osbuild.KickstartPathOSBuild } anacondaPipeline := manifest.NewAnacondaInstaller( @@ -129,11 +118,6 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, tarPath := "/liveimg.tar.gz" - if !img.InstallerCustomizations.ISORootKickstart { - payloadPath := filepath.Join("/run/install/repo/", tarPath) - anacondaPipeline.InteractiveDefaults = manifest.NewAnacondaInteractiveDefaults(fmt.Sprintf("file://%s", payloadPath)) - } - anacondaPipeline.Checkpoint() var rootfsImagePipeline *manifest.ISORootfsImg @@ -150,10 +134,11 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, bootTreePipeline.ISOLabel = img.ISOLabel bootTreePipeline.DefaultMenu = img.InstallerCustomizations.DefaultMenu - kernelOpts := []string{fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.ISOLabel)} - if img.InstallerCustomizations.ISORootKickstart { - kernelOpts = append(kernelOpts, fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", img.ISOLabel, img.Kickstart.Path)) + kernelOpts := []string{ + fmt.Sprintf("inst.stage2=hd:LABEL=%s", img.ISOLabel), + fmt.Sprintf("inst.ks=hd:LABEL=%s:%s", img.ISOLabel, img.Kickstart.Path), } + if img.OSCustomizations.FIPS { kernelOpts = append(kernelOpts, "fips=1") } @@ -172,9 +157,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest, isoTreePipeline.Release = img.Release isoTreePipeline.Kickstart = img.Kickstart isoTreePipeline.PayloadPath = tarPath - if img.InstallerCustomizations.ISORootKickstart { - isoTreePipeline.Kickstart.Path = img.Kickstart.Path - } + isoTreePipeline.Kickstart.Path = img.Kickstart.Path isoTreePipeline.RootfsCompression = img.RootfsCompression isoTreePipeline.RootfsType = img.InstallerCustomizations.ISORootfsType diff --git a/pkg/image/installer_image_test.go b/pkg/image/installer_image_test.go index 634cbe6c6a..7d81a02487 100644 --- a/pkg/image/installer_image_test.go +++ b/pkg/image/installer_image_test.go @@ -13,7 +13,6 @@ import ( "github.com/osbuild/images/pkg/dnfjson" "github.com/osbuild/images/pkg/image" "github.com/osbuild/images/pkg/manifest" - "github.com/osbuild/images/pkg/osbuild" "github.com/osbuild/images/pkg/ostree" "github.com/osbuild/images/pkg/platform" "github.com/osbuild/images/pkg/rpmmd" @@ -251,12 +250,9 @@ func TestTarInstallerUnsetKSOptions(t *testing.T) { img.Platform = testPlatform mfs := instantiateAndSerialize(t, img, mockPackageSets(), nil, nil) - // the tar installer doesn't set a custom kickstart path unless the - // unattended option is enabled, so the inst.ks option isn't set and - // interactive-defaults.ks is used + assert.Contains(t, mfs, fmt.Sprintf(`"inst.stage2=hd:LABEL=%s"`, isolabel)) - assert.Contains(t, mfs, fmt.Sprintf("%q", osbuild.KickstartPathInteractiveDefaults)) - assert.NotContains(t, mfs, "osbuild.ks") // no mention of the default (custom) value + assert.Contains(t, mfs, fmt.Sprintf(`"inst.ks=hd:LABEL=%s:/osbuild.ks"`, isolabel)) } func TestTarInstallerUnsetKSPath(t *testing.T) { @@ -270,18 +266,9 @@ func TestTarInstallerUnsetKSPath(t *testing.T) { img.Kickstart = &kickstart.Options{} mfs := instantiateAndSerialize(t, img, mockPackageSets(), nil, nil) - // the tar installer doesn't set a custom kickstart path unless the - // unattended option is enabled, so the inst.ks option isn't set and - // interactive-defaults.ks is used - assert.Contains(t, mfs, fmt.Sprintf(`"inst.stage2=hd:LABEL=%s"`, isolabel)) - assert.Contains(t, mfs, fmt.Sprintf("%q", osbuild.KickstartPathInteractiveDefaults)) - assert.NotContains(t, mfs, "osbuild.ks") // no mention of the default (custom) value - // enable unattended and retest - img.Kickstart.Unattended = true - mfs = instantiateAndSerialize(t, img, mockPackageSets(), nil, nil) + assert.Contains(t, mfs, fmt.Sprintf(`"inst.stage2=hd:LABEL=%s"`, isolabel)) assert.Contains(t, mfs, fmt.Sprintf(`"inst.ks=hd:LABEL=%s:/osbuild.ks"`, isolabel)) - assert.NotContains(t, mfs, osbuild.KickstartPathInteractiveDefaults) } func TestTarInstallerSetKSPath(t *testing.T) { diff --git a/pkg/manifest/installer.go b/pkg/manifest/installer.go index b1a912cc3e..fefb9d9e5f 100644 --- a/pkg/manifest/installer.go +++ b/pkg/manifest/installer.go @@ -24,12 +24,4 @@ type InstallerCustomizations struct { ISOBoot ISOBootType DefaultMenu int - - // If set, the kickstart file will be added to the bootiso-tree at the - // default path for osbuild, otherwise any kickstart options will be - // configured in the default location for interactive defaults in the - // rootfs. Enabling UnattendedKickstart automatically enables this option - // because automatic installations cannot be configured using interactive - // defaults. - ISORootKickstart bool } diff --git a/test/data/manifest-checksums/fedora_41-aarch64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_41-aarch64-minimal_installer-empty_fedora index 73fe8d322b..355b06b129 100644 --- a/test/data/manifest-checksums/fedora_41-aarch64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_41-aarch64-minimal_installer-empty_fedora @@ -1 +1 @@ -59278204c5c3746167249b767f978f6946ad8e65 +1dd6ffe6120a8747305386065af0f58975fa663c diff --git a/test/data/manifest-checksums/fedora_41-x86_64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_41-x86_64-minimal_installer-empty_fedora index 9e27c24121..ca104a9ffa 100644 --- a/test/data/manifest-checksums/fedora_41-x86_64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_41-x86_64-minimal_installer-empty_fedora @@ -1 +1 @@ -a2590f52cffaefd09dd93419caf0e02d9723f03a +e2beb5d6ea5e8351c4b5817a62c205aaf8aef154 diff --git a/test/data/manifest-checksums/fedora_42-aarch64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_42-aarch64-minimal_installer-empty_fedora index 501a28f6cd..42bb429dcf 100644 --- a/test/data/manifest-checksums/fedora_42-aarch64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_42-aarch64-minimal_installer-empty_fedora @@ -1 +1 @@ -3a677b06bcf0120cda5f6afdf1f5911c98473221 +1c4ad0a176135bbf54e801c53f67b7c186da29ab diff --git a/test/data/manifest-checksums/fedora_42-x86_64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_42-x86_64-minimal_installer-empty_fedora index 87ae9ec5ab..ee2b97d710 100644 --- a/test/data/manifest-checksums/fedora_42-x86_64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_42-x86_64-minimal_installer-empty_fedora @@ -1 +1 @@ -5f44c2a1c57bf92b580ac7b292a5ffc29e690875 +e541812a554dd62f020e233984eaefda48990743 diff --git a/test/data/manifest-checksums/fedora_43-aarch64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_43-aarch64-minimal_installer-empty_fedora index d56206bd3a..552324a7e4 100644 --- a/test/data/manifest-checksums/fedora_43-aarch64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_43-aarch64-minimal_installer-empty_fedora @@ -1 +1 @@ -7a9a9222dde120e33053c1f36af606842f7e3eb3 +1e29d294be5c3e8f58dd96d776eda1383260988b diff --git a/test/data/manifest-checksums/fedora_43-x86_64-minimal_installer-empty_fedora b/test/data/manifest-checksums/fedora_43-x86_64-minimal_installer-empty_fedora index 4b0ce6014b..3a54edf858 100644 --- a/test/data/manifest-checksums/fedora_43-x86_64-minimal_installer-empty_fedora +++ b/test/data/manifest-checksums/fedora_43-x86_64-minimal_installer-empty_fedora @@ -1 +1 @@ -e6acf4e18784027e317087ade1f58221175fa755 +88e37d0fcd4211ed0de1a40feb5d1f2f53aacc69