diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_media.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_media.txt index 807a52bc5..3a0bc4120 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_media.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_media.txt @@ -112,7 +112,9 @@ else echo " linux ${INSTALL_LINUX_FILENAME}" echo " recovery ${INSTALL_RECOVERY_FILENAME}" echo " rootfs ${INSTALL_ROOTFS_FILENAME}" + echo " update --format--" fi +echo " data --format--" echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -158,9 +160,8 @@ fi # - Set bootlimit to 3 # - If Normal Boot: # - Update the system partitions: linux, recovery, rootfs -# - Erase the 'update' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - Format the 'update' partition +# - Format the 'data' partition setenv bootcmd " env default -a; setenv singlemtdsys ${singlemtdsys}; @@ -272,19 +273,33 @@ setenv bootcmd " exit; fi; echo \"\"; - if test \"\$\{singlemtdsys\}\" != yes; then + fi; + if test \"\$\{singlemtdsys\}\" != yes; then + if test \"\$\{dualboot\}\" != yes; then + echo \"\"; + echo \"\"; + echo \">> Formatting 'update' partition\"; + echo \"\"; + echo \"\"; nand erase.part update; + if ubi part update; then + ubi createvol update; + fi; + fi; + echo \"\"; + echo \"\"; + echo \">> Formatting 'data' partition\"; + echo \"\"; + echo \"\"; + nand erase.part data; + if ubi part data; then + ubi createvol data; fi; - setenv boot_recovery yes; - setenv recovery_command wipe_update; fi; saveenv; echo \"\"; echo \"\"; echo \">> Firmware installation complete.\"; - if test \"\$\{dualboot\}\" != yes; then - echo \"Rebooting into recovery mode for final deployment.\"; - fi; echo \"\"; echo \"\"; sleep 1; 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 affc09f88..6be65a0d2 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 @@ -100,6 +100,24 @@ part_update() fi } +# Format a partition +# Params: +# 1. partition +# Description: +# - erases a partition +# - creates UBI volume with the same name as the partition +format_part() +{ + echo "\033[36m" + echo "=====================================================================================" + echo "Formatting '${1}' partition" + echo "=====================================================================================" + echo "\033[0m" + + uuu "fb[-t 20000]:" ucmd nand erase.part "${1}" + uuu "fb[-t 20000]:" ucmd if ubi part "${1}"\; then ubi createvol "${1}"\;fi +} + clear echo "############################################################" echo "# Linux firmware install through USB OTG #" @@ -278,6 +296,9 @@ fi LINUX_NAME="linux" RECOVERY_NAME="recovery" ROOTFS_NAME="rootfs" +UPDATE_NAME="update" +DATA_NAME="data" + # Print warning about storage media being deleted if [ "${NOWAIT}" != true ]; then WAIT=10 @@ -305,6 +326,12 @@ if [ "${NOWAIT}" != true ]; then printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n" printf " ${ROOTFS_NAME}\t${INSTALL_ROOTFS_FILENAME}\n" fi + if [ "${SINGLEMTDSYS}" != true ]; then + if [ "${DUALBOOT}" != true ]; then + printf " ${UPDATE_NAME}\t--format--\n" + fi + printf " ${DATA_NAME}\t\t--format--\n" + fi printf "\n" printf " Press CTRL+C now if you wish to abort.\n" printf "\n" @@ -334,7 +361,8 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 "${DEK_FILE}" # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition -# - Erase the 'update' partition +# - Format the 'update' partition +# - Format the 'data' partition uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; @@ -388,15 +416,11 @@ else part_update "${ROOTFS_NAME}" "${INSTALL_ROOTFS_FILENAME}" 120000 fi -if [ "${SINGLEMTDSYS}" != true ] && [ "${DUALBOOT}" != true ]; then - # Erase the 'Update' partition - uuu "fb[-t 20000]:" ucmd nand erase.part update -fi - -if [ "${DUALBOOT}" != true ]; then - # Configure u-boot to boot into recovery mode - uuu fb: ucmd setenv boot_recovery yes - uuu fb: ucmd setenv recovery_command wipe_update +if [ "${SINGLEMTDSYS}" != true ]; then + if [ "${DUALBOOT}" != true ]; then + format_part "${UPDATE_NAME}" + fi + format_part "${DATA_NAME}" fi # Set the rootfstype if squashfs