mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] FIT: fix build with sandbox
@ 2024-05-17  7:48 Ahmad Fatoum
  2024-05-17  7:48 ` [PATCH 2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM Ahmad Fatoum
  2024-05-21  6:23 ` [PATCH 1/2] FIT: fix build with sandbox Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-05-17  7:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

As FIT is built only for ARM so far, this sandbox-related code has
bitrotted. To prepare allowing it to build for other platforms, adjust
the API to the current state.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/image-fit.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index 251fda97b3fc..4a69049abcdf 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -945,21 +945,22 @@ void fit_close(struct fit_handle *handle)
 	free(handle);
 }
 
-#ifdef CONFIG_SANDBOX
 static int do_bootm_sandbox_fit(struct image_data *data)
 {
 	struct fit_handle *handle;
+	void *config;
 	int ret;
-	void *kernel;
-	unsigned long kernel_size;
 
-	handle = fit_open(data->os_file, data->verbose);
+	handle = fit_open(data->os_file, data->verbose, BOOTM_VERIFY_NONE,
+			  FILESIZE_MAX);
 	if (IS_ERR(handle))
 		return PTR_ERR(handle);
 
-	ret = fit_open_configuration(handle, data->os_part);
-	if (ret)
+	config = fit_open_configuration(handle, data->os_part);
+	if (IS_ERR(config)) {
+		ret = PTR_ERR(config);
 		goto out;
+	}
 
 	ret = 0;
 out:
@@ -974,9 +975,10 @@ static struct image_handler sandbox_fit_handler = {
 	.filetype = filetype_oftree,
 };
 
-static int sandbox_fit_register(void)
+static __maybe_unused int sandbox_fit_register(void)
 {
 	return register_image_handler(&sandbox_fit_handler);
 }
+#ifdef CONFIG_SANDBOX
 late_initcall(sandbox_fit_register);
 #endif
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM
  2024-05-17  7:48 [PATCH 1/2] FIT: fix build with sandbox Ahmad Fatoum
@ 2024-05-17  7:48 ` Ahmad Fatoum
  2024-05-21  6:23 ` [PATCH 1/2] FIT: fix build with sandbox Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-05-17  7:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

There's no reason to restrict FIT to ARM. In preparation for adding
fuzzing infrastructure for FIT images, allow its selection on other
architectures as well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 67cbbf5197da..a00bfcf332e5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -650,7 +650,7 @@ config BOOTM_FITIMAGE
 	bool
 	prompt "FIT image support"
 	select FITIMAGE
-	depends on BOOTM && ARM
+	depends on BOOTM
 	help
 	  Support using Flattened Image Tree (FIT) images. FIT is an image
 	  format introduced by U-Boot. A FIT image contains one or multiple
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] FIT: fix build with sandbox
  2024-05-17  7:48 [PATCH 1/2] FIT: fix build with sandbox Ahmad Fatoum
  2024-05-17  7:48 ` [PATCH 2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM Ahmad Fatoum
@ 2024-05-21  6:23 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2024-05-21  6:23 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Fri, 17 May 2024 09:48:34 +0200, Ahmad Fatoum wrote:
> As FIT is built only for ARM so far, this sandbox-related code has
> bitrotted. To prepare allowing it to build for other platforms, adjust
> the API to the current state.
> 
> 

Applied, thanks!

[1/2] FIT: fix build with sandbox
      https://git.pengutronix.de/cgit/barebox/commit/?id=9f82a33c178e (link may not be stable)
[2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM
      https://git.pengutronix.de/cgit/barebox/commit/?id=09201c7dd960 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-21  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17  7:48 [PATCH 1/2] FIT: fix build with sandbox Ahmad Fatoum
2024-05-17  7:48 ` [PATCH 2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM Ahmad Fatoum
2024-05-21  6:23 ` [PATCH 1/2] FIT: fix build with sandbox Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox