From 9ac3bd46caed2062ee807dd46f95a41b7266c0de Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 14 Oct 2021 13:35:46 +0200 Subject: [PATCH] uboot: install-uuu: restore variables on bootcmd after 'env default -a' The variable 'dualboot' (and 'singlemtdsys' for CC6UL) was restored after the bootcmd that runs the first time after programming U-Boot runs fastboot again to resume the script. This is ok for the CC6UL but not for the rest of platforms, that run the partition script on the bootcmd, *before* running fastboot. Restore the variables for all platforms in the bootcmd right after resetting the environment. Signed-off-by: Hector Palacios --- .../u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh | 6 +----- .../u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh | 6 +----- .../u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh | 12 ++---------- .../u-boot-dey/ccimx8m/install_linux_fw_uuu.sh | 6 +----- .../u-boot-dey/ccimx8x/install_linux_fw_uuu.sh | 6 +----- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh index 0f1b6a86f..f743bfbf1 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh @@ -230,6 +230,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # - Update the 'rootfs' partition uuu fb: ucmd setenv bootcmd " env default -a; + setenv dualboot \${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -265,11 +266,6 @@ uuu fb: ucmd setenv fastboot_dev mmc # Set fastboot buffer address to $loadaddr, just in case uuu fb: ucmd setenv fastboot_buffer \${loadaddr} -# Restore dualboot if previously active -if [ "${DUALBOOT}" = true ]; then - uuu fb: ucmd setenv dualboot yes -fi - if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh index ebc509a67..0ca7a02ef 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh @@ -248,6 +248,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # - Update the 'rootfs' partition uuu fb: ucmd setenv bootcmd " env default -a; + setenv dualboot \${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -283,11 +284,6 @@ uuu fb: ucmd setenv fastboot_dev mmc # Set fastboot buffer address to $loadaddr, just in case uuu fb: ucmd setenv fastboot_buffer \${loadaddr} -# Restore dualboot if previously active -if [ "${DUALBOOT}" = true ]; then - uuu fb: ucmd setenv dualboot yes -fi - if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh index 8e664d657..fad0cd070 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh @@ -237,6 +237,8 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 # - Erase the 'update' partition uuu fb: ucmd setenv bootcmd " env default -a; + setenv dualboot \${dualboot}; + setenv singlemtdsys \${singlemtdsys}; saveenv; echo \"\"; echo \"\"; @@ -255,16 +257,6 @@ sleep 3 # Set fastboot buffer address to $loadaddr uuu fb: ucmd setenv fastboot_buffer \${loadaddr} -# Restore dualboot if previously active -if [ "${DUALBOOT}" = true ]; then - uuu fb: ucmd setenv dualboot yes -fi - -# Restore singlemtdsys if previously active -if [ "${SINGLEMTDSYS}" = true ]; then - uuu fb: ucmd setenv singlemtdsys yes -fi - # Create partition table uuu "fb[-t 10000]:" ucmd run partition_nand_linux diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh index a723997f7..d580e5c02 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh @@ -199,6 +199,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # - Update the 'rootfs' partition uuu fb: ucmd setenv bootcmd " env default -a; + setenv dualboot \${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -234,11 +235,6 @@ uuu fb: ucmd setenv fastboot_dev mmc # Set fastboot buffer address to $loadaddr, just in case uuu fb: ucmd setenv fastboot_buffer \${loadaddr} -# Restore dualboot if previously active -if [ "${DUALBOOT}" = true ]; then - uuu fb: ucmd setenv dualboot yes -fi - if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index bae55fc32..3f019fa4e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -255,6 +255,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # - Update the 'rootfs' partition uuu fb: ucmd setenv bootcmd " env default -a; + setenv dualboot \${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -290,11 +291,6 @@ uuu fb: ucmd setenv fastboot_dev mmc # Set fastboot buffer address to $loadaddr, just in case uuu fb: ucmd setenv fastboot_buffer \${loadaddr} -# Restore dualboot if previously active -if [ "${DUALBOOT}" = true ]; then - uuu fb: ucmd setenv dualboot yes -fi - if [ "${DUALBOOT}" = true ]; then # Update Linux A part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}"