if context.config.output_format == OutputFormat.uki:
die("A kernel must be installed in the image to build a UKI")
+ if (
+ context.config.output_format == OutputFormat.esp
+ and context.config.bootable == ConfigFeature.enabled
+ ):
+ die("A kernel must be installed in the image to build a bootable ESP image")
+
return None, None, None, []
kimg = Path(shutil.copy2(context.root / kimg, context.workspace))
if not context.config.architecture.to_efi():
die(f"Architecture {context.config.architecture} does not support UEFI")
- if stub and kver and kimg:
+ if context.config.bootable == ConfigFeature.enabled or (
+ context.config.bootable == ConfigFeature.auto and stub and kver and kimg
+ ):
+ assert stub and kver and kimg
+
token = find_entry_token(context)
uki = context.root / finalize_uki_path(
context, finalize_bootloader_entry_format(context, kver, token)
tarball of the OS image is generated), `cpio` (similar, but a cpio
archive is generated), `disk` (a block device OS image with a GPT
partition table), `uki` (a unified kernel image with the OS image in
- the `.initrd` PE section), `esp` (`uki` but wrapped in a disk image
- with only an ESP partition), `oci` (a directory compatible with the
- OCI image specification), `sysext`, `confext`, `portable`,
- `addon` or `none` (the OS image is solely intended as a build
- image to produce another artifact).
+ the `.initrd` PE section), `esp` (a disk image with only an ESP
+ partition, bootloader and optionally a UKI), `oci` (a directory
+ compatible with the OCI image specification), `sysext`, `confext`,
+ `portable`, `addon` or `none` (the OS image is solely intended as a
+ build image to produce another artifact).
If the `disk` output format is used, the disk image is generated using
**systemd-repart**. The repart partition definition files to use can be
unified kernel images will be generated and no ESP partition will be
added to the image if the disk output format is used.
+ If the `esp` output format is used, an ESP partition and bootloader are
+ always added, and the `Bootable=` option only controls whether a UKI is
+ added to the ESP partition or not.
+
`Bootloader=`, `--bootloader=`
: Takes one of `none`, `systemd-boot`, `uki`, `grub`,
`systemd-boot-signed`, `uki-signed` or `grub-signed`. Defaults to