Skip to content

Commit

Permalink
bootc-image-builder: set Kickstart options on image
Browse files Browse the repository at this point in the history
The structure of the kickstart-related options on  the BootcDiskImage
type have changed and are now all centralised under a Kickstart struct
with type kickstart.Options.
  • Loading branch information
achilleas-k committed May 30, 2024
1 parent c34d864 commit 840e0ef
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions bib/cmd/bootc-image-builder/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/customizations/kickstart"
"github.com/osbuild/images/pkg/customizations/users"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/image"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/runner"
Expand Down Expand Up @@ -202,16 +204,19 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
customizations = c.Config.Customizations
}

img.Users = users.UsersFromBP(customizations.GetUsers())
img.Groups = users.GroupsFromBP(customizations.GetGroups())
img.Kickstart, err = kickstart.New(customizations)
if err != nil {
return nil, err
}
img.Kickstart.Path = osbuild.KickstartPathOSBuild
if kopts := customizations.GetKernel(); kopts != nil && kopts.Append != "" {
img.KickstartKernelOptionsAppend = append(img.KickstartKernelOptionsAppend, kopts.Append)
img.Kickstart.KernelOptionsAppend = append(img.Kickstart.KernelOptionsAppend, kopts.Append)
}
img.KickstartNetworkOnBoot = true
img.Kickstart.NetworkOnBoot = true
// XXX: this should really be done by images, the consumer should not
// need to know these details. so once images is fixed drop it here
// again.
if len(img.Users) > 0 || len(img.Groups) > 0 {
if len(img.Kickstart.Users) > 0 || len(img.Kickstart.Groups) > 0 {
img.AdditionalAnacondaModules = append(img.AdditionalAnacondaModules, "org.fedoraproject.Anaconda.Modules.Users")
}

Expand All @@ -237,7 +242,9 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
}
}

img.OSName = "default"
img.Kickstart.OSTree = &kickstart.OSTree{
OSName: "default",
}
img.Filename = "install.iso"

mf := manifest.New()
Expand Down

0 comments on commit 840e0ef

Please sign in to comment.