From 41bccae7d2ab9a8209a929945323784f5461386b Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Wed, 20 Dec 2023 11:44:47 +0100 Subject: [PATCH] anaconda: kickstart stage for container-installer Let's do what we *can* do with the kickstart stage and leave the options that are not yet supported in a custom kickstart file. I'll then transfer the options into the kickstart stage. --- pkg/manifest/anaconda_installer_iso_tree.go | 25 +++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkg/manifest/anaconda_installer_iso_tree.go b/pkg/manifest/anaconda_installer_iso_tree.go index bcd2ce4e42..ff808de9c6 100644 --- a/pkg/manifest/anaconda_installer_iso_tree.go +++ b/pkg/manifest/anaconda_installer_iso_tree.go @@ -338,18 +338,39 @@ func (p *AnacondaInstallerISOTree) serialize() osbuild.Pipeline { images, manifests)) + // do what we can in our kickstart stage + kickstartOptions, err := osbuild.NewKickstartStageOptionsWithOSTreeContainer( + "/osbuild-base.ks", + p.Users, + p.Groups, + path.Join("/run/install/repo", p.PayloadPath), + "oci", + "", + "") + + if err != nil { + panic("failed to create kickstartstage options") + } + + pipeline.AddStage(osbuild.NewKickstartStage(kickstartOptions)) + + // and what we can't do in a separate kickstart that we include + kickstartFile, err := fsnode.NewFile(p.KSPath, nil, nil, nil, []byte(` -ostreecontainer --url=/run/install/repo/container --transport=oci --no-signature-verification +%include /run/install/repo/osbuild-base.ks + rootpw --lock -user --name fedora --groups wheel + lang en_US.UTF-8 keyboard us timezone UTC + clearpart --all part /boot/efi --fstype=efi --size=512 --fsoptions="umask=0077" part /boot --fstype=ext2 --size=1024 --label=boot part swap --fstype=swap --size=1024 part / --fstype=ext4 --grow + reboot --eject `))