[PATCH v2 5/5] boot: Don't allow kernel_noload with compression

Simon Glass sjg at chromium.org
Sun Nov 12 04:49:57 CET 2023


It is not possible to execute the kernel in-place without loading it.
Detect this and show an error, to avoid a crash.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Add a 'success' case to the cover letter
- Redo how the arm64 support is implemented

 boot/bootm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/bootm.c b/boot/bootm.c
index 4c150e895f2f..e3f5f81becd7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -248,6 +248,10 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
 	}
 
 	if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
+		if (images.os.comp != IH_COMP_NONE) {
+			puts("Cannot use kernel_noload with compression\n");
+			return 1;
+		}
 		images.os.load = images.os.image_start;
 		images.ep += images.os.image_start;
 	}
-- 
2.42.0.869.gea05f2083d-goog



More information about the U-Boot mailing list