manifest: add grub config for OSTreeDeployment
These are based on the official Fedora IoT Raw Image but are added to the base OSTreeDeployment manifest. For now, let's add them to all ostree deployments that will use these new types and we can extract the values to make them configurable when we need to.
This commit is contained in:
parent
a505defad3
commit
ccbf15878b
7 changed files with 149 additions and 15 deletions
|
|
@ -2,6 +2,7 @@ package manifest
|
|||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/disk"
|
||||
|
|
@ -188,13 +189,20 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
|
|||
// TODO: Add users?
|
||||
// NOTE: Users can be embedded in a commit, but we should also support adding them at deploy time.
|
||||
|
||||
options := osbuild.NewGrub2StageOptionsUnified(p.PartitionTable,
|
||||
grubOptions := osbuild.NewGrub2StageOptionsUnified(p.PartitionTable,
|
||||
"",
|
||||
p.platform.GetUEFIVendor() != "",
|
||||
p.platform.GetBIOSPlatform(),
|
||||
p.platform.GetUEFIVendor(), true)
|
||||
options.Greenboot = true
|
||||
bootloader := osbuild.NewGRUB2Stage(options)
|
||||
grubOptions.Greenboot = true
|
||||
grubOptions.Config = &osbuild.GRUB2Config{
|
||||
Default: "saved",
|
||||
Timeout: 1,
|
||||
TerminalOutput: []string{"console"},
|
||||
}
|
||||
grubOptions.KernelOptions = strings.Join(kernelOpts, ",")
|
||||
bootloader := osbuild.NewGRUB2Stage(grubOptions)
|
||||
bootloader.MountOSTree(p.osName, p.osTreeRef, 0)
|
||||
pipeline.AddStage(bootloader)
|
||||
|
||||
pipeline.AddStage(osbuild.NewOSTreeSelinuxStage(
|
||||
|
|
|
|||
|
|
@ -1970,14 +1970,35 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
"install": true,
|
||||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
|
|
@ -1994,6 +1994,7 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"legacy": "i386-pc",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
|
|
@ -2001,8 +2002,28 @@
|
|||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
|
|
@ -2218,14 +2218,35 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
"install": true,
|
||||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
|
|
@ -2242,6 +2242,7 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"legacy": "i386-pc",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
|
|
@ -2249,8 +2250,28 @@
|
|||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
|
|
@ -2226,14 +2226,35 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
"install": true,
|
||||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
|
|
@ -2250,6 +2250,7 @@
|
|||
"options": {
|
||||
"root_fs_uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
|
||||
"boot_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
|
||||
"kernel_opts": "modprobe.blacklist=vc4",
|
||||
"legacy": "i386-pc",
|
||||
"uefi": {
|
||||
"vendor": "fedora",
|
||||
|
|
@ -2257,8 +2258,28 @@
|
|||
"unified": true
|
||||
},
|
||||
"greenboot": true,
|
||||
"write_cmdline": false
|
||||
}
|
||||
"write_cmdline": false,
|
||||
"config": {
|
||||
"default": "saved",
|
||||
"terminal_output": [
|
||||
"console"
|
||||
],
|
||||
"timeout": 1
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"name": "ostree-test/fedora/iot",
|
||||
"type": "org.osbuild.ostree.deployment",
|
||||
"options": {
|
||||
"deployment": {
|
||||
"osname": "fedora-iot",
|
||||
"ref": "test/fedora/iot",
|
||||
"serial": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.selinux",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue