distro: add Authconfig to ImageConfig

Add it to all distros (8.6, 9.0) that support using ImageConfig.
This commit is contained in:
Christian Kellner 2022-02-24 15:31:54 +01:00 committed by Achilleas Koutsou
parent 24d8790f9d
commit adfdb2cd39
3 changed files with 12 additions and 0 deletions

View file

@ -37,6 +37,7 @@ type ImageConfig struct {
Sysctld []*osbuild2.SysctldStageOptions
DNFConfig []*osbuild2.DNFConfigStageOptions
SshdConfig *osbuild2.SshdConfigStageOptions
Authconfig *osbuild2.AuthconfigStageOptions
}
// InheritFrom inherits unset values from the provided parent configuration and
@ -110,6 +111,9 @@ func (c *ImageConfig) InheritFrom(parentConfig *ImageConfig) *ImageConfig {
if finalConfig.SshdConfig == nil {
finalConfig.SshdConfig = parentConfig.SshdConfig
}
if finalConfig.Authconfig == nil {
finalConfig.Authconfig = parentConfig.Authconfig
}
}
return &finalConfig
}

View file

@ -537,6 +537,10 @@ func osPipeline(t *imageType,
p.AddStage((osbuild.NewSshdConfigStage(sshdConfig)))
}
if authConfig := imageConfig.Authconfig; authConfig != nil {
p.AddStage(osbuild.NewAuthconfigStage(authConfig))
}
if pt != nil {
p = prependKernelCmdlineStage(p, t, pt)
p.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(pt)))

View file

@ -528,6 +528,10 @@ func osPipeline(t *imageType,
p.AddStage((osbuild.NewSshdConfigStage(sshdConfig)))
}
if authConfig := imageConfig.Authconfig; authConfig != nil {
p.AddStage(osbuild.NewAuthconfigStage(authConfig))
}
if pt != nil {
kernelOptions := osbuild.GenImageKernelOptions(pt)
if t.kernelOptions != "" {