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 <hector.palacios@digi.com>
This commit is contained in:
Hector Palacios 2021-10-14 13:35:46 +02:00
parent 3ab0340741
commit 9ac3bd46ca
5 changed files with 6 additions and 30 deletions

View File

@ -230,6 +230,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# - Update the 'rootfs' partition # - Update the 'rootfs' partition
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot};
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -265,11 +266,6 @@ uuu fb: ucmd setenv fastboot_dev mmc
# Set fastboot buffer address to $loadaddr, just in case # Set fastboot buffer address to $loadaddr, just in case
uuu fb: ucmd setenv fastboot_buffer \${loadaddr} 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 if [ "${DUALBOOT}" = true ]; then
# Update Linux A # Update Linux A
part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}"

View File

@ -248,6 +248,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# - Update the 'rootfs' partition # - Update the 'rootfs' partition
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot};
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -283,11 +284,6 @@ uuu fb: ucmd setenv fastboot_dev mmc
# Set fastboot buffer address to $loadaddr, just in case # Set fastboot buffer address to $loadaddr, just in case
uuu fb: ucmd setenv fastboot_buffer \${loadaddr} 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 if [ "${DUALBOOT}" = true ]; then
# Update Linux A # Update Linux A
part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}"

View File

@ -237,6 +237,8 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000
# - Erase the 'update' partition # - Erase the 'update' partition
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot};
setenv singlemtdsys \${singlemtdsys};
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -255,16 +257,6 @@ sleep 3
# Set fastboot buffer address to $loadaddr # Set fastboot buffer address to $loadaddr
uuu fb: ucmd setenv fastboot_buffer \${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 # Create partition table
uuu "fb[-t 10000]:" ucmd run partition_nand_linux uuu "fb[-t 10000]:" ucmd run partition_nand_linux

View File

@ -199,6 +199,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# - Update the 'rootfs' partition # - Update the 'rootfs' partition
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot};
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -234,11 +235,6 @@ uuu fb: ucmd setenv fastboot_dev mmc
# Set fastboot buffer address to $loadaddr, just in case # Set fastboot buffer address to $loadaddr, just in case
uuu fb: ucmd setenv fastboot_buffer \${loadaddr} 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 if [ "${DUALBOOT}" = true ]; then
# Update Linux A # Update Linux A
part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}"

View File

@ -255,6 +255,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# - Update the 'rootfs' partition # - Update the 'rootfs' partition
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot};
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -290,11 +291,6 @@ uuu fb: ucmd setenv fastboot_dev mmc
# Set fastboot buffer address to $loadaddr, just in case # Set fastboot buffer address to $loadaddr, just in case
uuu fb: ucmd setenv fastboot_buffer \${loadaddr} 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 if [ "${DUALBOOT}" = true ]; then
# Update Linux A # Update Linux A
part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}"