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 <david.escalona@digi.com>
This commit is contained in:
David Escalona 2017-01-20 10:54:16 +01:00
parent 368a3b5990
commit 2771549da3
3 changed files with 66 additions and 29 deletions

View File

@ -62,10 +62,11 @@ fi;
setenv INSTALL_MMCDEV 1 setenv INSTALL_MMCDEV 1
setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.boot.vfat 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 setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.ext4
# Check for presence of firmware files on the SD card # 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 if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}"; echo "ERROR: Could not find file ${install_f}";
install_abort=1; install_abort=1;
@ -105,8 +106,10 @@ fi
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' 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 " setenv bootcmd "
env default -a; env default -a;
saveenv; saveenv;
@ -136,6 +139,18 @@ setenv bootcmd "
fi; fi;
echo \"\"; echo \"\";
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 \">> Installing Linux root file system\";
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -147,14 +162,12 @@ setenv bootcmd "
exit; exit;
fi; fi;
echo \"\"; echo \"\";
echo \"#######################\"; setenv boot_recovery yes
echo \"# Install complete! #\"; setenv recovery_command wipe_update
echo \"#######################\"; saveenv;
echo \"\"; echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
sleep 1; sleep 1;
echo \">> Restarting the system\"; run recoverycmd;
sleep 1;
reset;
" "
saveenv saveenv

View File

@ -22,10 +22,11 @@ fi
setenv INSTALL_MMCDEV 0 setenv INSTALL_MMCDEV 0
setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulsbc.imx setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulsbc.imx
setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.boot.ubifs 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 setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.ubifs
# Check for presence of firmware files on the SD card # 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 if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}"; echo "ERROR: Could not find file ${install_f}";
install_abort=1; install_abort=1;
@ -61,8 +62,10 @@ fi
# - Reset environment to defaults # - Reset environment to defaults
# - Save the environment # - Save the environment
# - Update the 'linux' partition # - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' 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 " setenv bootcmd "
env default -a; env default -a;
saveenv; saveenv;
@ -80,6 +83,18 @@ setenv bootcmd "
fi; fi;
echo \"\"; echo \"\";
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 \">> Installing Linux root file system\";
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -90,16 +105,13 @@ setenv bootcmd "
echo \"Aborted.\"; echo \"Aborted.\";
exit; exit;
fi; fi;
echo \"\";
setenv boot_recovery yes
setenv recovery_command wipe_update
saveenv; saveenv;
echo \"\"; echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
echo \"#######################\";
echo \"# Install complete! #\";
echo \"#######################\";
echo \"\";
sleep 1; sleep 1;
echo \">> Restarting the system\"; run recoverycmd;
sleep 1;
reset;
" "
saveenv saveenv

View File

@ -22,10 +22,11 @@ fi
setenv INSTALL_MMCDEV 0 setenv INSTALL_MMCDEV 0
setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulstarter.imx setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulstarter.imx
setenv INSTALL_LINUX_FILENAME core-image-base-ccimx6ulstarter.boot.ubifs 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 setenv INSTALL_ROOTFS_FILENAME core-image-base-ccimx6ulstarter.ubifs
# Check for presence of firmware files on the SD card # 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 if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}"; echo "ERROR: Could not find file ${install_f}";
install_abort=1; install_abort=1;
@ -61,8 +62,10 @@ fi
# - Reset environment to defaults # - Reset environment to defaults
# - Save the environment # - Save the environment
# - Update the 'linux' partition # - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' 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 " setenv bootcmd "
env default -a; env default -a;
saveenv; saveenv;
@ -80,6 +83,18 @@ setenv bootcmd "
fi; fi;
echo \"\"; echo \"\";
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 \">> Installing Linux root file system\";
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -90,16 +105,13 @@ setenv bootcmd "
echo \"Aborted.\"; echo \"Aborted.\";
exit; exit;
fi; fi;
echo \"\";
setenv boot_recovery yes
setenv recovery_command wipe_update
saveenv; saveenv;
echo \"\"; echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
echo \"#######################\";
echo \"# Install complete! #\";
echo \"#######################\";
echo \"\";
sleep 1; sleep 1;
echo \">> Restarting the system\"; run recoverycmd;
sleep 1;
reset;
" "
saveenv saveenv