From fbde7589ce3049318a0e9495db72472af03704af Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Fri, 12 Jun 2020 15:41:20 +0300 Subject: common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image These cases are typically fatal and are difficult to debug for random users. Add checks for detecting overlapping images and abort if overlap is detected. Signed-off-by: Tero Kristo --- cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/booti.c') diff --git a/cmd/booti.c b/cmd/booti.c index af0603b96e..bfc07428e6 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -93,7 +93,7 @@ static int booti_start(struct cmd_tbl *cmdtp, int flag, int argc, * Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not * have a header that provide this informaiton. */ - if (bootm_find_images(flag, argc, argv)) + if (bootm_find_images(flag, argc, argv, relocated_addr, image_size)) return 1; return 0; -- cgit From 9b83f9c594af6033dd507c3ecad1231421063949 Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Fri, 12 Jun 2020 15:41:21 +0300 Subject: cmd: booti: convert the debug print about image move to printf Moving of the OS image may have some nasty side effects like corrupting DTB. Convert the current debug print to printf so that the relocation of the OS is always obvious to the user. Signed-off-by: Tero Kristo --- cmd/booti.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/booti.c') diff --git a/cmd/booti.c b/cmd/booti.c index bfc07428e6..76d1255ec5 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -79,7 +79,8 @@ static int booti_start(struct cmd_tbl *cmdtp, int flag, int argc, /* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { - debug("Moving Image from 0x%lx to 0x%lx\n", ld, relocated_addr); + printf("Moving Image from 0x%lx to 0x%lx, end=%lx\n", ld, + relocated_addr, relocated_addr + image_size); memmove((void *)relocated_addr, (void *)ld, image_size); } -- cgit