From f647e6d44254162a135d692fee09a623e911fbd7 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 17 Sep 2021 11:45:32 +0200 Subject: [PATCH] uboot: add dualboot support to fw install script from SD/USB Signed-off-by: Hector Palacios https://onedigi.atlassian.net/browse/DEL-7649 --- .../ccimx6qpsbc/install_linux_fw_sd.txt | 153 ++++++++++---- .../ccimx6qpsbc/install_linux_fw_usb.txt | 155 ++++++++++---- .../ccimx6sbc/install_linux_fw_sd.txt | 153 ++++++++++---- .../ccimx6sbc/install_linux_fw_usb.txt | 155 ++++++++++---- .../ccimx6ul/install_linux_fw_sd.txt | 193 +++++++++++------ .../ccimx6ul/install_linux_fw_usb.txt | 195 ++++++++++++------ .../ccimx8m/install_linux_fw_sd.txt | 154 ++++++++++---- .../ccimx8m/install_linux_fw_usb.txt | 156 +++++++++----- .../ccimx8x/install_linux_fw_sd.txt | 154 ++++++++++---- .../ccimx8x/install_linux_fw_usb.txt | 158 +++++++++----- 10 files changed, 1149 insertions(+), 477 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt index 1b50d223e..95cdb1a8c 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt @@ -77,9 +77,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -116,15 +123,19 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -138,49 +149,103 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - 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 root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx6qpsbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt index e7da89ee7..cb49d84fd 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt @@ -77,9 +77,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -116,15 +123,20 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 +# NOTE: insert some 'usb reset' commands to avoid EHCI timeouts setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -139,49 +151,104 @@ setenv bootcmd " exit; fi; usb start; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux usb ${INSTALL_USBDEV} fat ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery usb ${INSTALL_USBDEV} 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 root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs usb ${INSTALL_USBDEV} fat ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + usb reset; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx6sbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt index 7131e5476..798d0f77a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt @@ -88,9 +88,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -127,15 +134,19 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -149,49 +160,103 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - 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 root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx6sbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt index 5e2614777..42b76cc29 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt @@ -88,9 +88,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -127,15 +134,20 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 +# NOTE: insert some 'usb reset' commands to avoid EHCI timeouts setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; echo \"\"; echo \"\"; @@ -150,49 +162,104 @@ setenv bootcmd " exit; fi; usb start; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux usb ${INSTALL_USBDEV} fat ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery usb ${INSTALL_USBDEV} 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 root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs usb ${INSTALL_USBDEV} fat ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + usb reset; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt index ac0398c4c..e3fa6bad2 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt @@ -81,9 +81,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -121,78 +128,146 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults -# - Restore 'ubisysvols' if previously set +# - Restore 'ubisysvols' and 'dualboot' if previously set # - Run 'partition_nand_linux' script to re-partition the NAND if needed # - Save the environment -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Erase the 'update' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; setenv ubisysvols ${ubisysvols}; + setenv dualboot ${dualboot}; run partition_nand_linux; saveenv; - if test -n \$\{ubisysvols\} && test \$\{ubisysvols\} = yes; then + if test \"\$\{ubisysvols\}\" = yes; then run ubivolscript; fi; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part linux; - fi; - update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part recovery; - fi; - update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part rootfs; - fi; - update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux_a; + fi; + update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux_b; + fi; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs_a; + fi; + update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs_b; + fi; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux; + fi; + update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part recovery; + fi; + update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs; + fi; + update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part update; + fi; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part update; - fi; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt index da5cda0b8..e9e7f4e91 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt @@ -81,9 +81,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -110,7 +117,7 @@ echo "" update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument - update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} + update uboot usb ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then echo "[ERROR] Failed to update U-Boot boot loader!"; echo ""; @@ -121,79 +128,147 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults -# - Restore 'ubisysvols' if previously set +# - Restore 'ubisysvols' and 'dualboot' if previously set # - Run 'partition_nand_linux' script to re-partition the NAND if needed # - Save the environment -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Erase the 'update' partition -# - Configure recovery to wipe 'update' partition -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; setenv ubisysvols ${ubisysvols}; + setenv dualboot ${dualboot}; run partition_nand_linux; saveenv; - if test -n \$\{ubisysvols\} && test \$\{ubisysvols\} = yes; then + if test \"\$\{ubisysvols\}\" = yes; then run ubivolscript; fi; usb start; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part linux; - fi; - update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part recovery; - fi; - update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part rootfs; - fi; - update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux_a; + fi; + update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux_b; + fi; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs_a; + fi; + update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs_b; + fi; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part linux; + fi; + update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part recovery; + fi; + update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part rootfs; + fi; + update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then + nand erase.part update; + fi; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - if test ! -n \$\{ubisysvols\} || test \$\{ubisysvols\} = no; then - nand erase.part update; - fi; - setenv boot_recovery yes; - setenv recovery_command wipe_update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx8m/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt index 0c5fd88e2..59a2851f5 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt @@ -48,9 +48,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -91,17 +98,20 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Force on-the-fly updates to avoid possible verification errors # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Disable on-the-fly updates -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -116,50 +126,104 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; setenv otf-update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx8m/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt index 3da66fdb4..80b87ad27 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt @@ -48,9 +48,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -80,7 +87,7 @@ echo "" update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument - update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} + update uboot usb ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then echo "[ERROR] Failed to update U-Boot boot loader!"; echo ""; @@ -91,17 +98,20 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Force on-the-fly updates to avoid possible verification errors # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Disable on-the-fly updates -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -117,50 +127,104 @@ setenv bootcmd " exit; fi; usb start; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; setenv otf-update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx8x/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt index 921dd2d81..61083e1d6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt @@ -119,9 +119,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -162,17 +169,20 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Force on-the-fly updates to avoid possible verification errors # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Disable on-the-fly updates -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -187,50 +197,104 @@ setenv bootcmd " echo \"Aborted.\"; exit; fi; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; setenv otf-update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; 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/ccimx8x/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt index 39f96a9f1..e7591bfb7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt @@ -119,9 +119,16 @@ echo "" echo " PARTITION FILENAME" echo " --------- --------" echo " bootloader ${INSTALL_UBOOT_FILENAME}" -echo " linux ${INSTALL_LINUX_FILENAME}" -echo " recovery ${INSTALL_RECOVERY_FILENAME}" -echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +if test \"\$\{dualboot\}\" = yes; then + echo " linux_a ${INSTALL_LINUX_FILENAME}" + echo " linux_b ${INSTALL_LINUX_FILENAME}" + echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}" + echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}" +else + echo " linux ${INSTALL_LINUX_FILENAME}" + echo " recovery ${INSTALL_RECOVERY_FILENAME}" + echo " rootfs ${INSTALL_ROOTFS_FILENAME}" +fi echo "" echo " Press CTRL+C now if you wish to abort or wait 10 seconds" echo " to continue." @@ -151,7 +158,7 @@ echo "" update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument - update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} + update uboot usb ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then echo "[ERROR] Failed to update U-Boot boot loader!"; echo ""; @@ -162,17 +169,21 @@ fi # Set 'bootcmd' to the second part of the script that will # - Reset environment to defaults +# - Restore 'dualboot' if previously set # - Save the environment # - Force on-the-fly updates to avoid possible verification errors # - Partition the eMMC user data area for Linux -# - Update the 'linux' partition -# - Update the 'recovery' partition -# - Update the 'rootfs' partition -# - Configure recovery to wipe 'update' partition -# - Disable on-the-fly updates -# - Run 'recovery' and let the system boot after +# - If Dual Boot +# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b +# - 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 +# NOTE: insert some 'usb reset' commands to avoid EHCI timeouts setenv bootcmd " env default -a; + setenv dualboot ${dualboot}; saveenv; setenv otf-update yes; echo \"\"; @@ -188,50 +199,105 @@ setenv bootcmd " exit; fi; usb start; - echo \"\"; - echo \"\"; - echo \">> Installing linux image file ${INSTALL_LINUX_FILENAME}\"; - echo \"\"; - echo \"\"; - update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update linux partition!\"; + if test \"\$\{dualboot\}\" = yes; then echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing recovery file ${INSTALL_RECOVERY_FILENAME}\"; - echo \"\"; - echo \"\"; - update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update recovery partition!\"; echo \"\"; - echo \"Aborted.\"; - exit; - fi; - echo \"\"; - echo \"\"; - echo \">> Installing root file system file ${INSTALL_ROOTFS_FILENAME}\"; - echo \"\"; - echo \"\"; - update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; - if test \$? -eq 1; then - echo \"[ERROR] Failed to update rootfs partition!\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\"; echo \"\"; - echo \"Aborted.\"; - exit; + echo \"\"; + update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_a!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\"; + echo \"\"; + echo \"\"; + update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux_b!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + usb reset; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\"; + echo \"\"; + echo \"\"; + update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_a partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\"; + echo \"\"; + echo \"\"; + update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs_b partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + else + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\"; + echo \"\"; + echo \"\"; + update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\"; + echo \"\"; + echo \"\"; + update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update recovery partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + echo \"\"; + echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\"; + echo \"\"; + echo \"\"; + update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME}; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; + exit; + fi; + echo \"\"; + setenv boot_recovery yes; + setenv recovery_command wipe_update; fi; - echo \"\"; - setenv boot_recovery yes; - setenv recovery_command wipe_update; setenv otf-update; saveenv; echo \"\"; echo \"\"; - echo \">> Firmware installation complete. Rebooting into recovery mode for final deployment.\"; + echo \">> Firmware installation complete.\"; + if test ! -n \$\{dualboot\} || test \$\{dualboot\} = no; then + echo \"Rebooting into recovery mode for final deployment.\"; + fi; echo \"\"; echo \"\"; sleep 1;