The build immediately fails if FirmwareVariables=%O/somefile is used, as
the config parser won't be able to find it, so it is not possible to
generate it during the image build itself (e.g: mkosi.postoutput)
in order to add generated keys to MOK. Set required=False.
dest="firmware_variables",
metavar="PATH",
section="Runtime",
- parse=config_make_path_parser(constants=("custom", "microsoft", "microsoft-mok")),
+ parse=config_make_path_parser(constants=("custom", "microsoft", "microsoft-mok"), required=False),
help="Set the path to the firmware variables file to use",
compat_longs=("--qemu-firmware-variables",),
compat_names=("QemuFirmwareVariables",),
if config.firmware_variables == Path("microsoft") or not config.firmware_variables
else config.firmware_variables
)
+ if not vars.exists():
+ die(f"Firmware variables file {vars} does not exist")
shutil.copy(vars, ovmf_vars)
return ovmf_vars, ovmf_vars_format