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
2 changes: 0 additions & 2 deletions data/distrodefs/rhel-10/imagetypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion data/distrodefs/rhel-8/imagetypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions data/distrodefs/rhel-9/imagetypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 0 additions & 9 deletions pkg/distro/generic/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion pkg/distro/installer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
31 changes: 7 additions & 24 deletions pkg/image/anaconda_tar_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package image
import (
"fmt"
"math/rand"
"path/filepath"

"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/workload"
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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")
}
Expand All @@ -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
Expand Down
19 changes: 3 additions & 16 deletions pkg/image/installer_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Shouldn't the unit test consider img.Kickstart.Path value? 🤔

}

func TestTarInstallerUnsetKSPath(t *testing.T) {
Expand All @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions pkg/manifest/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
59278204c5c3746167249b767f978f6946ad8e65
1dd6ffe6120a8747305386065af0f58975fa663c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a2590f52cffaefd09dd93419caf0e02d9723f03a
e2beb5d6ea5e8351c4b5817a62c205aaf8aef154
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3a677b06bcf0120cda5f6afdf1f5911c98473221
1c4ad0a176135bbf54e801c53f67b7c186da29ab
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5f44c2a1c57bf92b580ac7b292a5ffc29e690875
e541812a554dd62f020e233984eaefda48990743
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7a9a9222dde120e33053c1f36af606842f7e3eb3
1e29d294be5c3e8f58dd96d776eda1383260988b
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e6acf4e18784027e317087ade1f58221175fa755
88e37d0fcd4211ed0de1a40feb5d1f2f53aacc69
Loading