manifest: support adding per-distro dracut modules to installers
Different distros and image types have different dracut modules available and enabled. Set these at the distro level and push them down through the appropriate manifests, pipelines, and stages. Added to both anaconda and coreos installers.
This commit is contained in:
parent
9511c76063
commit
bd448edad0
5 changed files with 27 additions and 7 deletions
|
|
@ -283,6 +283,7 @@ func edgeInstallerImage(workload workload.Workload,
|
|||
img.Groups = users.GroupsFromBP(customizations.GetGroups())
|
||||
|
||||
img.SquashfsCompression = "xz"
|
||||
img.AdditionalDracutModules = []string{"prefixdevname", "prefixdevname-tools"}
|
||||
|
||||
img.ISOLabelTempl = d.isolabelTmpl
|
||||
img.Product = d.product
|
||||
|
|
@ -357,6 +358,8 @@ func imageInstallerImage(workload workload.Workload,
|
|||
img.Users = users.UsersFromBP(customizations.GetUsers())
|
||||
img.Groups = users.GroupsFromBP(customizations.GetGroups())
|
||||
|
||||
img.AdditionalDracutModules = []string{"prefixdevname", "prefixdevname-tools"}
|
||||
|
||||
img.SquashfsCompression = "xz"
|
||||
|
||||
// put the kickstart file in the root of the iso
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ type ImageInstaller struct {
|
|||
|
||||
AdditionalKernelOpts []string
|
||||
AdditionalAnacondaModules []string
|
||||
AdditionalDracutModules []string
|
||||
}
|
||||
|
||||
func NewImageInstaller() *ImageInstaller {
|
||||
|
|
@ -77,7 +78,8 @@ func (img *ImageInstaller) InstantiateManifest(m *manifest.Manifest,
|
|||
anacondaPipeline.Groups = img.Groups
|
||||
anacondaPipeline.Variant = img.Variant
|
||||
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
|
||||
anacondaPipeline.AdditionalModules = img.AdditionalAnacondaModules
|
||||
anacondaPipeline.AdditionalAnacondaModules = img.AdditionalAnacondaModules
|
||||
anacondaPipeline.AdditionalDracutModules = img.AdditionalDracutModules
|
||||
|
||||
tarPath := "/liveimg.tar.gz"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ type OSTreeInstaller struct {
|
|||
Commit ostree.CommitSpec
|
||||
|
||||
Filename string
|
||||
|
||||
AdditionalDracutModules []string
|
||||
}
|
||||
|
||||
func NewOSTreeInstaller(commit ostree.CommitSpec) *OSTreeInstaller {
|
||||
|
|
@ -64,6 +66,7 @@ func (img *OSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
|
|||
anacondaPipeline.Variant = img.Variant
|
||||
anacondaPipeline.Biosdevname = (img.Platform.GetArch() == platform.ARCH_X86_64)
|
||||
anacondaPipeline.Checkpoint()
|
||||
anacondaPipeline.AdditionalDracutModules = img.AdditionalDracutModules
|
||||
|
||||
rootfsPartitionTable := &disk.PartitionTable{
|
||||
Size: 20 * common.MebiByte,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@ type Anaconda struct {
|
|||
InteractiveDefaults *AnacondaInteractiveDefaults
|
||||
|
||||
// Additional anaconda modules to enable
|
||||
AdditionalModules []string
|
||||
AdditionalAnacondaModules []string
|
||||
|
||||
// Additional dracut modules to enable
|
||||
AdditionalDracutModules []string
|
||||
}
|
||||
|
||||
// NewAnaconda creates an anaconda pipeline object. repos and packages
|
||||
|
|
@ -195,12 +198,14 @@ func (p *Anaconda) serialize() osbuild.Pipeline {
|
|||
|
||||
pipeline.AddStage(osbuild.NewUsersStage(usersStageOptions))
|
||||
// always enable users module in anaconda
|
||||
pipeline.AddStage(osbuild.NewAnacondaStage(osbuild.NewAnacondaStageOptions(true, p.AdditionalModules)))
|
||||
pipeline.AddStage(osbuild.NewAnacondaStage(osbuild.NewAnacondaStageOptions(true, p.AdditionalAnacondaModules)))
|
||||
pipeline.AddStage(osbuild.NewLoraxScriptStage(&osbuild.LoraxScriptStageOptions{
|
||||
Path: "99-generic/runtime-postinstall.tmpl",
|
||||
BaseArch: p.platform.GetArch().String(),
|
||||
}))
|
||||
pipeline.AddStage(osbuild.NewDracutStage(dracutStageOptions(p.kernelVer, p.Biosdevname, []string{
|
||||
|
||||
dracutModules := append(
|
||||
p.AdditionalDracutModules,
|
||||
"anaconda",
|
||||
"rdma",
|
||||
"rngd",
|
||||
|
|
@ -210,7 +215,8 @@ func (p *Anaconda) serialize() osbuild.Pipeline {
|
|||
"iscsi",
|
||||
"lunmask",
|
||||
"nfs",
|
||||
})))
|
||||
)
|
||||
pipeline.AddStage(osbuild.NewDracutStage(dracutStageOptions(p.kernelVer, p.Biosdevname, dracutModules)))
|
||||
pipeline.AddStage(osbuild.NewSELinuxConfigStage(&osbuild.SELinuxConfigStageOptions{State: osbuild.SELinuxStatePermissive}))
|
||||
|
||||
if p.InteractiveDefaults != nil {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ type CoreOSInstaller struct {
|
|||
Biosdevname bool
|
||||
|
||||
FDO *fdo.Options
|
||||
|
||||
AdditionalDracutModules []string
|
||||
}
|
||||
|
||||
// NewCoreOSInstaller creates an CoreOS installer pipeline object.
|
||||
|
|
@ -144,10 +146,14 @@ func (p *CoreOSInstaller) serialize() osbuild.Pipeline {
|
|||
Final: true,
|
||||
}))
|
||||
pipeline.AddStage(osbuild.NewLocaleStage(&osbuild.LocaleStageOptions{Language: "C.UTF-8"}))
|
||||
dracutStageOptions := dracutStageOptions(p.kernelVer, p.Biosdevname, []string{
|
||||
|
||||
dracutModules := append(
|
||||
p.AdditionalDracutModules,
|
||||
"coreos-installer",
|
||||
"fdo",
|
||||
})
|
||||
)
|
||||
|
||||
dracutStageOptions := dracutStageOptions(p.kernelVer, p.Biosdevname, dracutModules)
|
||||
if p.FDO != nil && p.FDO.DiunPubKeyRootCerts != "" {
|
||||
pipeline.AddStage(osbuild.NewFDOStageForRootCerts(p.FDO.DiunPubKeyRootCerts))
|
||||
dracutStageOptions.Install = []string{"/fdo_diun_pub_key_root_certs.pem"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue