[Skiboot] [PATCH] external/mambo: Print more info when the kernel is too big

Michael Ellerman mpe at ellerman.id.au
Wed Sep 1 09:06:17 AEST 2021


Make it a bit easier to boot large kernels by printing more info when
the kernel is too big, so the user has some idea how much they need to
adjust PAYLOAD_ADDR by.

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
---
 external/mambo/skiboot.tcl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 841b67b0f..05db430c6 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -705,8 +705,10 @@ mysim memory fread $mconf(boot_load) $boot_size $mconf(boot_image)
 set payload_size [file size $mconf(payload)]
 mysim memory fread $mconf(payload_addr) $payload_size $mconf(payload)
 
-if { $payload_size > [expr $mconf(boot_load) - $mconf(payload_addr)] } {
-	error "vmlinux is too large, consider adjusting PAYLOAD_ADDR"
+set available_space [expr $mconf(boot_load) - $mconf(payload_addr)]
+if { $payload_size > $available_space } {
+    set overflow [expr $payload_size - $available_space]
+    error "vmlinux is too large by $overflow bytes ($payload_size > $available_space), consider adjusting PAYLOAD_ADDR"
 }
 
 # Flatten it

base-commit: 6352fa85e23f3c620544edcb3feb971d3babd746
prerequisite-patch-id: 37a0365ad7264def9b2fefa613d086b4600f092d
prerequisite-patch-id: 8f3d1073410ed87a3e3b5c959026438326e82cac
-- 
2.25.1



More information about the Skiboot mailing list