org.osbuild.grub2.legacy
Configure GRUB2 bootloader and set boot options (legacy, i.e. non-BLS)
This stage creates traditional menu entries for systems that are not
capable of using the Booloader Specific (BLS).
Sets the GRUB2 boot/root filesystem to rootfs
. If a separated boot
partition is used it can be specified via bootfs
. The file-systems
can be identified either via
- uuid (
\{"uuid": "\<uuid\>"\}
) - label (
\{"label": "\<label\>"\}
) - device (
\{"device": "\<device\>"\}
, only for the root file system) The kernel boot argument will be composed of the root file system id and additional options specified inconfig.cmdline
, if any. This stage will overwrite/etc/default/grub
,/boot/grub2/grubenv
; leading directories will be created if not present. The stage supports configuring grub for BIOS boot and UEFI systems: If BIOS boot support is requested viabios
this stage will also overwrite/boot/grub2/grub.cfg
and will copy the GRUB2 files from the buildhost into the target tree:
/usr/share/grub/unicode.pf2
->/boot/grub2/fonts/
/usr/lib/grub/$platform/*.\{mod,lst\}
->/boot/grub2/$platform/
- NOTE: skips
fdt.lst
, which is an empty file NB: with bios support enabled, this stage will fail if the buildhost doesn't have/usr/lib/grub/$platform/
and/usr/share/grub/unicode.pf2
. If UEFI support is enabled viauefi: \{"vendor": "\<vendor\>"\}
this stage will also write thegrub.cfg
toboot/efi/EFI/\<vendor\>/grub.cfg
. EFI binaries and accompanying data can be installed from the built root viauefi.install
. Both UEFI and Legacy can be specified at the same time (hybrid boot).
- NOTE: skips
Schema 1
{
"definitions": {
"filesystem": {
"description": "Description of how to locate a file system",
"type": "object",
"oneOf": [
{
"required": [
"uuid"
]
},
{
"required": [
"label"
]
},
{
"required": [
"device"
]
}
],
"properties": {
"device": {
"description": "Identify the file system by device node",
"type": "string"
},
"label": {
"description": "Identify the file system by label",
"type": "string"
},
"uuid": {
"description": "Identify the file system by UUID",
"type": "string",
"oneOf": [
{
"pattern": "^[0-9A-Za-z]{8}(-[0-9A-Za-z]{4}){3}-[0-9A-Za-z]{12}$",
"examples": [
"9c6ae55b-cf88-45b8-84e8-64990759f39d"
]
},
{
"pattern": "^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}$",
"examples": [
"6699-AFB5"
]
}
]
}
}
},
"terminal": {
"description": "Terminal device",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"rootfs",
"entries"
],
"anyOf": [
{
"required": [
"bios"
]
},
{
"required": [
"uefi"
]
}
],
"properties": {
"rootfs": {
"$ref": "#/definitions/filesystem"
},
"bootfs": {
"$ref": "#/definitions/filesystem"
},
"bios": {
"description": "Include bios boot support",
"type": "object",
"required": [
"platform"
],
"properties": {
"platform": {
"type": "string",
"enum": [
"i386-pc",
"powerpc-ieee1275"
]
}
}
},
"uefi": {
"description": "Include UEFI boot support",
"type": "object",
"required": [
"vendor"
],
"properties": {
"vendor": {
"type": "string",
"description": "The vendor of the UEFI binaries (this is us)",
"examples": [
"fedora"
],
"pattern": "^(.+)$"
},
"install": {
"description": "Install EFI binaries and data from the build root",
"type": "boolean",
"default": false
}
}
},
"write_defaults": {
"description": "Whether to write /etc/defaults/grub",
"type": "boolean",
"default": true
},
"entries": {
"description": "List of entries to add to the boot menu",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"product",
"kernel"
],
"properties": {
"default": {
"type": "boolean",
"description": "Make this entry the default entry"
},
"id": {
"description": "UUID for the entry (grub uses the root fs uuid)",
"type": "string"
},
"product": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string"
},
"nick": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"kernel": {
"description": "The kernel (EVRA)",
"type": "string"
}
}
}
},
"config": {
"description": "Configuration options for grub itself",
"type": "object",
"additionalProperties": false,
"properties": {
"cmdline": {
"description": "Additional kernel command line options",
"type": "string"
},
"default": {
"description": "Default boot entry",
"type": "string",
"default": "saved"
},
"disable_recovery": {
"type": "boolean",
"default": true
},
"disable_submenu": {
"type": "boolean",
"default": true
},
"distributor": {
"description": "Name of the distributor",
"type": "string"
},
"terminal": {
"$ref": "#/definitions/terminal"
},
"terminal_input": {
"$ref": "#/definitions/terminal"
},
"terminal_output": {
"$ref": "#/definitions/terminal"
},
"timeout": {
"description": "Timeout in seconds",
"type": "integer",
"minimum": 0,
"default": 0
},
"timeout_style": {
"type": "string",
"enum": [
"hidden",
"menu",
"countdown"
],
"default": "countdown"
},
"serial": {
"description": "The command to configure the serial console",
"type": "string"
}
}
}
}
}
Schema 2
{}