io.systemd.BootControl¶
Boot Loader control APIs
| Property | Value |
|---|---|
| Go package | github.com/rossedman/sdvarlink/systemd/latest/bootcontrol |
| Socket | /run/systemd/io.systemd.BootControl |
| Available since | systemd v257 |
| Methods · types · errors | 7 · 7 · 6 |
Methods¶
ListBootEntries¶
streaming (requires more)
Enumerates boot entries. Method call must be called with 'more' flag set. Each response returns one entry. If no entries are defined returns the NoSuchBootEntry error.
Reply
| Field | Type | Description |
|---|---|---|
entry |
BootEntry |
A boot menu entry structure |
SetRebootToFirmware¶
Sets the reboot-to-firmware-UI flag of the firmware, if this concept exists. Returns the RebootToFirmwareNotSupported error if not.
Parameters
| Field | Type | Description |
|---|---|---|
state |
bool |
The new value of the reboot-to-firmware-UI flag |
GetRebootToFirmware¶
Gets the current state of the reboot-to-firmware-UI flag of the firmware, if this concept exists. Returns the RebootToFirmwareNotSupported error if not.
Reply
| Field | Type | Description |
|---|---|---|
state |
bool |
The current state of the reboot-to-firmware-UI flag |
Install¶
since v260 · passes file descriptors
Install the boot loader on the ESP.
Parameters
| Field | Type | Description |
|---|---|---|
operation |
Operation |
Operation, either 'new' or 'update' |
graceful |
?bool |
If true, continue on various failures |
rootFileDescriptor |
?int |
Index into array of file descriptors passed along with this message, pointing to file descriptor to root file system to operate on |
rootDirectory |
?string |
Root directory to operate relative to. If both this and rootFileDescriptor is specified, this is purely informational. If only this is specified, it is what will be used. |
espPath |
?string |
Path to the EFI System Partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the ESP is auto-discovered. |
xbootldrPath |
?string |
Path to the XBOOTLDR partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the XBOOTLDR partition is auto-discovered. |
bootEntryTokenType |
?BootEntryTokenType |
Selects how to identify boot entries |
makeEntryDirectory |
?bool |
Whether to create the '$BOOT/ENTRY-TOKEN/' directory for Boot Loader Specification Type #1 snippets. If not specified this is decided automatically. |
touchVariables |
?bool |
If true the boot loader will be registered in an EFI boot entry via EFI variables, otherwise this is omitted |
Unlink¶
since v262 · passes file descriptors
Unlink a boot menu item
Parameters
| Field | Type | Description |
|---|---|---|
rootFileDescriptor |
?int |
Index into array of file descriptors passed along with this message, pointing to file descriptor to root file system to operate on |
rootDirectory |
?string |
Root directory to operate relative to. If both this and rootFileDescriptor is specified, this is purely informational. If only this is specified, it is what will be used. |
espPath |
?string |
Path to the EFI System Partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the ESP is auto-discovered. |
xbootldrPath |
?string |
Path to the XBOOTLDR partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the XBOOTLDR partition is auto-discovered. |
bootEntryTokenType |
?BootEntryTokenType |
Selects how to identify boot entries |
id |
?string |
The ID of the boot loader entry to remove. |
oldest |
?bool |
If true, remove the oldest entry. |
Link¶
since v262 · passes file descriptors
Install a kernel as boot menu item
Parameters
| Field | Type | Description |
|---|---|---|
rootFileDescriptor |
?int |
Index into array of file descriptors passed along with this message, pointing to file descriptor to root file system to operate on |
rootDirectory |
?string |
Root directory to operate relative to. If both this and rootFileDescriptor is specified, this is purely informational. If only this is specified, it is what will be used. |
espPath |
?string |
Path to the EFI System Partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the ESP is auto-discovered. |
xbootldrPath |
?string |
Path to the XBOOTLDR partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the XBOOTLDR partition is auto-discovered. |
bootEntryTokenType |
?BootEntryTokenType |
Selects how to identify boot entries |
entryTitle |
?string |
The entry title for the newly created boot menu entry |
entryVersion |
?string |
The entry version for the newly created boot menu entry |
entryCommit |
?int |
The commit number for the newly created boot menu entry |
kernelFilename |
string |
Target filename for the kernel image (UKI) in the $BOOT partition |
kernelFileDescriptor |
int |
Index into array of file descriptors passed along with this message, pointing to file descriptor to the kernel image to copy |
extraFiles |
?[]BootEntryExtraFile |
An array of 'extra' files for this entry, i.e. credentials, confexts, sysexts, addons. |
triesLeft |
?int |
What to set the triesLeft counter of the boot menu entry to initially. |
keepFree |
?int |
How much space to always keep free on ESP/XBOOTLDR. Defaults to 1 MiB |
Reply
| Field | Type | Description |
|---|---|---|
ids |
[]string |
The IDs of the created boot loader entries. |
LinkAuto¶
since v262 · passes file descriptors
Like Link(), but automatically discovers the UKI and extra resources staged below /var/lib/systemd/uki/
Parameters
| Field | Type | Description |
|---|---|---|
rootFileDescriptor |
?int |
Index into array of file descriptors passed along with this message, pointing to file descriptor to root file system to operate on |
rootDirectory |
?string |
Root directory to operate relative to. If both this and rootFileDescriptor is specified, this is purely informational. If only this is specified, it is what will be used. |
espPath |
?string |
Path to the EFI System Partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the ESP is auto-discovered. |
xbootldrPath |
?string |
Path to the XBOOTLDR partition mount point, resolved relative to rootDirectory/rootFileDescriptor if either is set. If not specified the XBOOTLDR partition is auto-discovered. |
bootEntryTokenType |
?BootEntryTokenType |
Selects how to identify boot entries |
entryTitle |
?string |
The entry title for the newly created boot menu entry |
entryVersion |
?string |
The entry version for the newly created boot menu entry |
entryCommit |
?int |
The commit number for the newly created boot menu entry |
triesLeft |
?int |
What to set the triesLeft counter of the boot menu entry to initially. |
keepFree |
?int |
How much space to always keep free on ESP/XBOOTLDR. Defaults to 1 MiB |
Reply
| Field | Type | Description |
|---|---|---|
ids |
[]string |
The IDs of the created boot loader entries. |
Types¶
BootEntryType¶
The type of a boot entry
| Value | Description |
|---|---|
type1 |
Boot Loader Specification Type #1 entries (.conf files) |
type2 |
Boot Loader Specification Type #2 entries (UKIs) |
loader |
Additional entries reported by boot loader |
auto |
Automatically generated entries |
BootEntrySource¶
The source of a boot entry
| Value | Description |
|---|---|
esp |
Boot entry found in EFI system partition (ESP) |
xbootldr |
Boot entry found in XBOOTLDR partition |
Operation¶
The operation to execute
| Value | Description |
|---|---|
new |
Install the boot loader afresh, creating everything it needs |
update |
Just update existing boot loader binaries |
BootEntryTokenType¶
The boot entry token type to use.
| Value | Description |
|---|---|
machine_id |
Pick identifiers for type #1 boot entries based on /etc/machine-id |
os_image_id |
Pick identifiers for type #1 boot entries based on the IMAGE_ID= field from /etc/os-release |
os_id |
Pick identifiers for type #1 boot entries based on the ID= field from /etc/os-release |
literal |
Pick identifiers for type #1 boot entries based on a manually chosen string |
auto |
Choose automatically how to pick identifiers for type #1 boot entries |
BootEntryAddon¶
A structure encapsulating an addon of a boot entry
| Field | Type | Description |
|---|---|---|
globalAddon |
?string |
The location of the global addon. |
localAddon |
?string |
The location of the local addon. |
options |
?string |
The command line options by the addon. |
BootEntryExtraFile¶
An additional file to install
| Field | Type | Description |
|---|---|---|
filename |
string |
The name of the extra file |
fileDescriptor |
?int |
Index into array of file descriptors, pointing to a file descriptor referencing the extra file to copy in. Either this or the 'data' field below must be set – not both, not neither. |
data |
?string |
Literal data to place in the extra file. |
BootEntry¶
A structure encapsulating a boot entry
| Field | Type | Description |
|---|---|---|
type |
BootEntryType |
|
source |
BootEntrySource |
The source of the entry |
id |
?string |
The string identifier of the entry |
path |
?string |
Path to the primary definition file for the entry |
root |
?string |
Directory path of the file system root the entry was found on |
title |
?string |
The entry's title string |
showTitle |
?string |
The possibly mangled/augmented title to show for the entry |
sortKey |
?string |
An explicitly configured sorting key for the enry |
version |
?string |
The version of the entry |
uname |
?string |
The kernel version from the UKI's .uname section |
machineId |
?string |
Machine ID of the OS installation belonging to the entry, if known |
architecture |
?string |
EFI architecture name for this entry |
options |
?string |
Command line options to pass to the invoked kernel or EFI binary |
linux |
?string |
Path to the Linux kernel to invoke, relative to the root directory of the file system containing the entry file |
efi |
?string |
Path to the EFI binary to invoke, relative to the root directory of the file system containing the entry file |
uki |
?string |
Path to an UKI EFI binary to invoke, relative to the root directory of the file system containing the entry file |
profile |
?int |
An UKI profile index to invoke. If not specified defaults to the first profile. |
initrd |
?[]string |
Path to the initrd image to pass to the invoked kernel, relative to the root directory of the file system containing the entry file |
devicetree |
?string |
Devicetree file to pass to the invoked kernel, relative to the root directory of the file system containing the entry file |
devicetreeOverlay |
?[]string |
Devicetree overlay file to pass to the invoked kernel, relative to the root directory of the file system containing the entry file |
isReported |
bool |
Indicates whether the boot loader reported this entry on the current boot |
triesLeft |
?int |
Indicates the number of tries left for this boot entry before it is assumed to be not working. |
triesDone |
?int |
Indicates the number of unsuccessful tries already made for this boot entry. |
isDefault |
?bool |
Indicates whether this entry is the default entry. |
isSelected |
?bool |
Indicates whether this entry has been booted. |
addons |
?[]BootEntryAddon |
Addon images of the entry. |
extras |
?[]string |
Extra files associated with the entry. |
cmdline |
?string |
Command line options of the entry. |
Errors¶
| Error | Go type | Description |
|---|---|---|
RebootToFirmwareNotSupported |
RebootToFirmwareNotSupportedError |
SetRebootToFirmware() and GetRebootToFirmware() return this if the firmware does not actually support the reboot-to-firmware-UI concept. |
NoSuchBootEntry |
NoSuchBootEntryError |
No boot entry defined. |
NoESPFound |
NoESPFoundError |
No EFI System Partition (ESP) found. |
NoDollarBootFound |
NoDollarBootFoundError |
Neither ESP nor XBOOTLDR found, hence no $BOOT location identified. |
BootEntryTokenUnavailable |
BootEntryTokenUnavailableError |
The selected boot entry token could not be determined. |
InvalidKernelImage |
InvalidKernelImageError |
The specified kernel image is not valid. |