diff mbox series

[U-Boot,3/3] ARM: imx: cm_fx6: env: don't run boot scripts twice

Message ID 014da629-8faa-4e01-92ff-3b87f50b21c3@rwthex-s3-b.rwth-ad.de
State Accepted
Commit 5a6440cac77db8083aa9b7f260e0ff3e994e7834
Delegated to: Stefano Babic
Headers show
Series [U-Boot,1/3] ARM: imx: cm_fx6: env: use standard variables | expand

Commit Message

Christopher Spinrath Dec. 9, 2017, 3:37 p.m. UTC
From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>

Boot scripts located in the root directory of the first partition of
USB, mmc, and SATA drives are executed twice: first by the distro boot
command and then by the legacy boot command. This may have weird side
effects if those scripts only change or extend the environment
(including parts of the boot command itself).

Removing the script execution from the legacy boot command has its own
caveats. For instance, the distro boot command may execute the boot.scr
on the mmc drive, then the boot.scr on the SATA drive, before the
legacy boot command actually boots from the mmc drive. However, the
current behavior would only execute the boot.scr once more before the
actual boot, but it does not prevent the script located on the SATA
drive from being executed, and thus, both scripts from being mixed up.

Considering that the legacy boot command is only in place to boot old
(standard) installations, let's go with the resolution having less
custom code and remove the script execution from the legacy boot
command.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
---
 include/configs/cm_fx6.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Fabio Estevam Dec. 10, 2017, 3:05 p.m. UTC | #1
On Sat, Dec 9, 2017 at 1:37 PM,  <christopher.spinrath@rwth-aachen.de> wrote:
> From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
>
> Boot scripts located in the root directory of the first partition of
> USB, mmc, and SATA drives are executed twice: first by the distro boot
> command and then by the legacy boot command. This may have weird side
> effects if those scripts only change or extend the environment
> (including parts of the boot command itself).
>
> Removing the script execution from the legacy boot command has its own
> caveats. For instance, the distro boot command may execute the boot.scr
> on the mmc drive, then the boot.scr on the SATA drive, before the
> legacy boot command actually boots from the mmc drive. However, the
> current behavior would only execute the boot.scr once more before the
> actual boot, but it does not prevent the script located on the SATA
> drive from being executed, and thus, both scripts from being mixed up.
>
> Considering that the legacy boot command is only in place to boot old
> (standard) installations, let's go with the resolution having less
> custom code and remove the script execution from the legacy boot
> command.
>
> Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
diff mbox series

Patch

diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 2edbc4650e..17fa7eb07c 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -83,7 +83,6 @@ 
 	"uImage=uImage-cm-fx6\0" \
 	"zImage=zImage-cm-fx6\0" \
 	"kernel=uImage-cm-fx6\0" \
-	"script=boot.scr\0" \
 	"dtb=cm-fx6.dtb\0" \
 	"console=ttymxc3,115200\0" \
 	"ethprime=FEC0\0" \
@@ -121,11 +120,8 @@ 
 	"run_eboot=echo Starting EBOOT ...; "\
 		"mmc dev 2 && " \
 		"mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \
-	"loadscript=load ${storagetype} ${storagedev} ${scriptaddr} ${script};\0"\
 	"loadkernel=load ${storagetype} ${storagedev} ${kernel_addr_r} ${kernel};\0"\
 	"loadfdt=load ${storagetype} ${storagedev} ${fdt_addr_r} ${dtb};\0" \
-	"bootscript=echo Running bootscript from ${storagetype} ...;" \
-		   "source ${scriptaddr};\0" \
 	"nandloadkernel=nand read ${kernel_addr_r} 0 780000;\0" \
 	"nandloadfdt=nand read ${fdt_addr_r} 780000 80000;\0" \
 	"setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
@@ -139,9 +135,7 @@ 
 		"fi;" \
 		"run storagebootcmd;" \
 		"fi;\0" \
-	"trybootsmz=if run loadscript; then " \
-			"run bootscript;" \
-		"fi;" \
+	"trybootsmz=" \
 		"run setboottypem;" \
 		"run trybootk;" \
 		"run setboottypez;" \