diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt index cda1d1379..d0dbb8d78 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_sd.txt @@ -119,6 +119,14 @@ if test $? -eq 1; then exit; fi +# Check if uboot_config volume exists (U-Boot env) +ubi part UBI +ubi check uboot_config +if test $? -eq 1; then + # Create volumes layout (including U-Boot env) + run ubivolscript; +fi + # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults # - Restore 'dualboot' if previously set diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt index fc1b2a7f4..6831b34a7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_usb.txt @@ -119,6 +119,14 @@ if test $? -eq 1; then exit; fi +# Check if uboot_config volume exists (U-Boot env) +ubi part UBI +ubi check uboot_config +if test $? -eq 1; then + # Create volumes layout (including U-Boot env) + run ubivolscript; +fi + # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults # - Restore 'dualboot' if previously set diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh index ddecd9152..46c9d6dd4 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh @@ -27,6 +27,12 @@ getenv() uuu -v fb: ucmd printenv "${1}" | sed -ne "s,^${1}=,,g;T;p" } +check_cmd() +{ + uuu -v fb: acmd ${1} > /dev/null 2> /dev/null + uuu -v fb: ucmd echo retval=\$? | sed -ne "s,^retval=,,g;T;p" +} + show_usage() { echo "Usage: $0 [options]" @@ -93,6 +99,13 @@ if [ "${dualboot}" = "yes" ]; then DUALBOOT=true; fi +# Check if uboot_config volume exists (U-Boot env) +uuu "fb[-t 15000]:" ucmd ubi part UBI +check=$(check_cmd "ubi check uboot_config") +if [ "${check}" = "1" ]; then + RUNVOLS=true +fi + # remove redirect uuu fb: ucmd setenv stdout serial @@ -193,6 +206,11 @@ part_update "fsbl2" "${INSTALL_ATF_FILENAME}" 5000 part_update "fip-a" "${INSTALL_FIP_FILENAME}" 5000 part_update "fip-b" "${INSTALL_FIP_FILENAME}" 5000 +# Environment volume does not exist and needs to be created +if [ "${RUNVOLS}" = true ]; then + # Create UBI volumes + uuu "fb[-t 45000]:" ucmd run ubivolscript +fi # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults @@ -223,7 +241,7 @@ sleep 8 uuu fb: ucmd setenv fastboot_buffer \${loadaddr} # Create UBI volumes -uuu "fb[-t 20000]:" ucmd run ubivolscript +uuu "fb[-t 45000]:" ucmd run ubivolscript if [ "${DUALBOOT}" = true ]; then # Update Linux A