From 2771549da3bdb92cc6e34522d609f880c524d6cc Mon Sep 17 00:00:00 2001 From: David Escalona Date: Fri, 20 Jan 2017 10:54:16 +0100 Subject: [PATCH] uboot: install_script: add recovery image and wipe_update to DEY install script https://jira.digi.com/browse/DEL-3513 Signed-off-by: David Escalona --- .../ccimx6/install_linux_fw_sd.txt | 31 ++++++++++++------ .../ccimx6ulsbc/install_linux_fw_sd.txt | 32 +++++++++++++------ .../ccimx6ulstarter/install_linux_fw_sd.txt | 32 +++++++++++++------ 3 files changed, 66 insertions(+), 29 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt index 6b6cad2cd..828a4fff6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt @@ -62,10 +62,11 @@ fi; setenv INSTALL_MMCDEV 1 setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.boot.vfat +setenv INSTALL_RECOVERY_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.recovery.vfat setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.ext4 # Check for presence of firmware files on the SD card -for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do +for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then echo "ERROR: Could not find file ${install_f}"; install_abort=1; @@ -105,8 +106,10 @@ fi # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition +# - Update the 'recovery' partition # - Update the 'rootfs' partition -# - Reset the system and let it boot +# - Configure recovery to wipe 'update' partition +# - Run 'recovery' and let the system boot after setenv bootcmd " env default -a; saveenv; @@ -136,6 +139,18 @@ setenv bootcmd " fi; echo \"\"; echo \"\"; + echo \">> Installing recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; echo \">> Installing Linux root file system\"; echo \"\"; echo \"\"; @@ -147,14 +162,12 @@ setenv bootcmd " exit; fi; echo \"\"; - echo \"#######################\"; - echo \"# Install complete! #\"; - echo \"#######################\"; - echo \"\"; + setenv boot_recovery yes + setenv recovery_command wipe_update + saveenv; + echo \">> Firmware installation complete. Booting into recovery for final deployment.\"; sleep 1; - echo \">> Restarting the system\"; - sleep 1; - reset; + run recoverycmd; " saveenv diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt index 91eedbc14..6e3bb1555 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt @@ -22,10 +22,11 @@ fi setenv INSTALL_MMCDEV 0 setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulsbc.imx setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.boot.ubifs +setenv INSTALL_RECOVERY_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.recovery.ubifs setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.ubifs # Check for presence of firmware files on the SD card -for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do +for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then echo "ERROR: Could not find file ${install_f}"; install_abort=1; @@ -61,8 +62,10 @@ fi # - Reset environment to defaults # - Save the environment # - Update the 'linux' partition +# - Update the 'recovery' partition # - Update the 'rootfs' partition -# - Reset the system and let it boot +# - Configure recovery to wipe 'update' partition +# - Run 'recovery' and let the system boot after setenv bootcmd " env default -a; saveenv; @@ -80,6 +83,18 @@ setenv bootcmd " fi; echo \"\"; echo \"\"; + echo \">> Installing recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; echo \">> Installing Linux root file system\"; echo \"\"; echo \"\"; @@ -90,16 +105,13 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; + echo \"\"; + setenv boot_recovery yes + setenv recovery_command wipe_update saveenv; - echo \"\"; - echo \"#######################\"; - echo \"# Install complete! #\"; - echo \"#######################\"; - echo \"\"; + echo \">> Firmware installation complete. Booting into recovery for final deployment.\"; sleep 1; - echo \">> Restarting the system\"; - sleep 1; - reset; + run recoverycmd; " saveenv diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt index eaab7a62b..c3e652e8e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt @@ -22,10 +22,11 @@ fi setenv INSTALL_MMCDEV 0 setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulstarter.imx setenv INSTALL_LINUX_FILENAME core-image-base-ccimx6ulstarter.boot.ubifs +setenv INSTALL_RECOVERY_FILENAME core-image-base-ccimx6ulstarter.recovery.ubifs setenv INSTALL_ROOTFS_FILENAME core-image-base-ccimx6ulstarter.ubifs # Check for presence of firmware files on the SD card -for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do +for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then echo "ERROR: Could not find file ${install_f}"; install_abort=1; @@ -61,8 +62,10 @@ fi # - Reset environment to defaults # - Save the environment # - Update the 'linux' partition +# - Update the 'recovery' partition # - Update the 'rootfs' partition -# - Reset the system and let it boot +# - Configure recovery to wipe 'update' partition +# - Run 'recovery' and let the system boot after setenv bootcmd " env default -a; saveenv; @@ -80,6 +83,18 @@ setenv bootcmd " fi; echo \"\"; echo \"\"; + echo \">> Installing recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; echo \">> Installing Linux root file system\"; echo \"\"; echo \"\"; @@ -90,16 +105,13 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; + echo \"\"; + setenv boot_recovery yes + setenv recovery_command wipe_update saveenv; - echo \"\"; - echo \"#######################\"; - echo \"# Install complete! #\"; - echo \"#######################\"; - echo \"\"; + echo \">> Firmware installation complete. Booting into recovery for final deployment.\"; sleep 1; - echo \">> Restarting the system\"; - sleep 1; - reset; + run recoverycmd; " saveenv