There's no particular reason this should always require FIT support, so make it an optional dependency.
Signed-off-by: Ahmad Fatoum <[email protected]> --- efi/payload/Kconfig | 1 - efi/payload/bootm.c | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/efi/payload/Kconfig b/efi/payload/Kconfig index 3b4a16e1e80c..31eab4f3ef88 100644 --- a/efi/payload/Kconfig +++ b/efi/payload/Kconfig @@ -32,7 +32,6 @@ config EFI_HANDOVER_PROTOCOL config EFI_PAYLOAD_BOOTM bool "EFI bootm protocol" - select BOOTM_FITIMAGE default !X86 endif diff --git a/efi/payload/bootm.c b/efi/payload/bootm.c index e205664b3262..da53e3939d26 100644 --- a/efi/payload/bootm.c +++ b/efi/payload/bootm.c @@ -38,6 +38,9 @@ static bool ramdisk_is_fit(struct image_data *data) { struct stat st; + if (!IS_ENABLED(CONFIG_BOOTM_FITIMAGE)) + return false; + if (bootm_signed_images_are_forced()) return true; @@ -54,6 +57,9 @@ static bool fdt_is_fit(struct image_data *data) { struct stat st; + if (!IS_ENABLED(CONFIG_BOOTM_FITIMAGE)) + return false; + if (bootm_signed_images_are_forced()) return true; @@ -66,6 +72,17 @@ static bool fdt_is_fit(struct image_data *data) data->fit_config, "fdt") > 0 : false; } +static bool os_is_fit(struct image_data *data) +{ + if (!IS_ENABLED(CONFIG_BOOTM_FITIMAGE)) + return false; + + if (bootm_signed_images_are_forced()) + return true; + + return data->os_fit; +} + static int efi_load_os(struct image_data *data, struct efi_loaded_image **loaded_image, efi_handle_t *handle) @@ -73,7 +90,7 @@ static int efi_load_os(struct image_data *data, efi_status_t efiret; efi_handle_t h; - if (!data->os_fit) + if (!os_is_fit(data)) return efi_load_image(data->os_file, loaded_image, handle); if (!data->fit_kernel) -- 2.47.3
