Skip to content

Commit

Permalink
image: update for latest image API changes
Browse files Browse the repository at this point in the history
Update to accomodate for the changes in the API that got introduced
in osbuild/images#631 (ideally that PR would
have been split into a part that changes the API and one that adds
the new feature. This would have made it slightly easier to see
the API changes in isolation).
  • Loading branch information
mvo5 committed May 27, 2024
1 parent e0d9157 commit 1b29838
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 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,20 @@ 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 = &kickstart.Options{
// XXX: this really should be the default in "images"
Path: osbuild.KickstartPathOSBuild,
Users: users.UsersFromBP(customizations.GetUsers()),
Groups: users.GroupsFromBP(customizations.GetGroups()),
}
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 +243,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 1b29838

Please sign in to comment.