From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] efi: payload: bootm: allow compiling without FIT support
Date: Fri, 7 Nov 2025 22:37:48 +0100 [thread overview]
Message-ID: <20251107213752.3547508-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20251107213752.3547508-1-a.fatoum@pengutronix.de>
There's no particular reason this should always require FIT support, so
make it an optional dependency.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
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
next prev parent reply other threads:[~2025-11-07 21:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 21:37 [PATCH 1/3] bootm: allow custom struct image_handler::check_image callbacks Ahmad Fatoum
2025-11-07 21:37 ` Ahmad Fatoum [this message]
2025-11-07 21:37 ` [PATCH 3/3] efi: payload: x86: make handover vs startimage a runtime decision Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251107213752.3547508-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox