From 0b3276fede4dee03c5e8b27281d92cef503475aa Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 1 Sep 2021 09:06:17 +1000 Subject: external/mambo: Print more info when the kernel is too big 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 Signed-off-by: Vasant Hegde --- 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 0ecb55a..91617b7 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 -- cgit v1.1