support ignition in edge simplified-installer and raw-image
Signed-off-by: Antonio Murdaca <runcom@linux.com> Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com> Signed-off-by: Irene Diez <idiez@redhat.com> Co-authored-by: Irene Diez <idiez@redhat.com> Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
This commit is contained in:
parent
c2b4caaa66
commit
cca0e773f6
8 changed files with 209 additions and 18 deletions
|
|
@ -37,6 +37,9 @@ type OSTreeDeployment struct {
|
|||
platform platform.Platform
|
||||
|
||||
PartitionTable *disk.PartitionTable
|
||||
|
||||
// Whether ignition is in use or not
|
||||
ignition bool
|
||||
}
|
||||
|
||||
// NewOSTreeDeployment creates a pipeline for an ostree deployment from a
|
||||
|
|
@ -45,6 +48,7 @@ func NewOSTreeDeployment(m *Manifest,
|
|||
buildPipeline *Build,
|
||||
commit ostree.CommitSpec,
|
||||
osName string,
|
||||
ignition bool,
|
||||
platform platform.Platform) *OSTreeDeployment {
|
||||
|
||||
p := &OSTreeDeployment{
|
||||
|
|
@ -52,6 +56,7 @@ func NewOSTreeDeployment(m *Manifest,
|
|||
commit: commit,
|
||||
osName: osName,
|
||||
platform: platform,
|
||||
ignition: ignition,
|
||||
}
|
||||
buildPipeline.addDependent(p)
|
||||
m.addPipeline(p)
|
||||
|
|
@ -95,6 +100,14 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
|
|||
kernelOpts := osbuild.GenImageKernelOptions(p.PartitionTable)
|
||||
kernelOpts = append(kernelOpts, p.KernelOptionsAppend...)
|
||||
|
||||
if p.ignition {
|
||||
kernelOpts = append(kernelOpts,
|
||||
"coreos.no_persist_ip", // users cannot add connections as we don't have a live iso, this prevents connections to bleed into the system from the ign initrd
|
||||
"ignition.platform.id=metal",
|
||||
"$ignition_firstboot",
|
||||
)
|
||||
}
|
||||
|
||||
pipeline.AddStage(osbuild.NewOSTreeDeployStage(
|
||||
&osbuild.OSTreeDeployStageOptions{
|
||||
OsName: p.osName,
|
||||
|
|
@ -170,6 +183,10 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
|
|||
pipeline.AddStage(grpStage)
|
||||
}
|
||||
|
||||
if p.ignition {
|
||||
pipeline.AddStage(osbuild.NewIgnitionStage(&osbuild.IgnitionStageOptions{}))
|
||||
}
|
||||
|
||||
// if no root password is set, lock the root account
|
||||
hasRoot := false
|
||||
for _, user := range p.Users {
|
||||
|
|
@ -216,6 +233,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
|
|||
p.platform.GetBIOSPlatform(),
|
||||
p.platform.GetUEFIVendor(), true)
|
||||
grubOptions.Greenboot = true
|
||||
grubOptions.Ignition = p.ignition
|
||||
grubOptions.Config = &osbuild.GRUB2Config{
|
||||
Default: "saved",
|
||||
Timeout: 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue