diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6/altboot.txt index 29172875b..61ee018bc 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6/altboot.txt @@ -10,7 +10,6 @@ # * run the regular boot command if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." if test "${active_system}" = "linux_a"; then setenv active_system linux_b part number mmc ${mmcbootdev} linux_b linux_b_index @@ -33,5 +32,6 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then setenv upgrade_available setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi run bootcmd diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/altboot.txt index 3d8abc1cb..18e95f4b6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/altboot.txt @@ -1,16 +1,15 @@ # -# U-Boot bootscript for altbootcmd (dual boot fallback after retries) +# U-Boot bootscript for altbootcmd (boot fallback after N failed boot retries) # -# After an upgrade, active_system has changed. U-Boot tries to boot this system -# for a number of tries. If the limit is reached, altbootcmd is run instead. -# This is the script that it will run. It has to: -# * switch back to previous system -# * reset the firmware update flag -# * run the regular boot command +# U-Boot tries to boot the active system for a number of tries. If the limit +# is reached, altbootcmd is run instead. This is the script that it will run. +# It has to: +# * switch active partitions bank in case of dual boot systems +# * reset the 'bootcount' number +# * reboot the system -if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." +if test "${dualboot}" = "yes"; then if test "${active_system}" = "linux_a"; then setenv active_system linux_b setenv mtdbootpart ${active_system} @@ -22,8 +21,8 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then setenv mtdrootfspart ${rootfsvol_a} setenv rootfsvol ${rootfsvol_a} fi - setenv upgrade_available - setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi -run bootcmd +bootcount reset +reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/boot.txt index fb8232879..41e6489ef 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/boot.txt @@ -2,29 +2,25 @@ # U-Boot bootscript for NAND images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv mtdrootfspart ${rootfsvol_a} + setenv rootfsvol ${rootfsvol_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - setenv mtdbootpart ${active_system} - setenv mtdrootfspart ${rootfsvol_a} - setenv rootfsvol ${rootfsvol_a} - else - echo "Booting from system B" - setenv mtdbootpart ${active_system} - setenv mtdrootfspart ${rootfsvol_b} - setenv rootfsvol ${rootfsvol_b} - fi + echo "Booting from system B (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv mtdrootfspart ${rootfsvol_b} + setenv rootfsvol ${rootfsvol_b} fi else + echo "Booting system (try ${bootcount})" if test "${mtdbootpart}" = "recovery"; then setenv boot_initrd true setenv initrd_file uramdisk-recovery.img diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/boot.txt index dcb054d4b..7219c515e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/boot.txt @@ -2,29 +2,25 @@ # U-Boot bootscript for NAND images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv mtdrootfspart ${rootfsvol_a} + setenv rootfsvol ${rootfsvol_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - setenv mtdbootpart ${active_system} - setenv mtdrootfspart ${rootfsvol_a} - setenv rootfsvol ${rootfsvol_a} - else - echo "Booting from system B" - setenv mtdbootpart ${active_system} - setenv mtdrootfspart ${rootfsvol_b} - setenv rootfsvol ${rootfsvol_b} - fi + echo "Booting from system B (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv mtdrootfspart ${rootfsvol_b} + setenv rootfsvol ${rootfsvol_b} fi else + echo "Booting system (try ${bootcount})" if test "${mtdbootpart}" = "recovery"; then setenv boot_initrd true setenv initrd_file uramdisk-recovery.img diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/altboot.txt index 29172875b..08eed5831 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/altboot.txt @@ -1,16 +1,15 @@ # -# U-Boot bootscript for altbootcmd (dual boot fallback after retries) +# U-Boot bootscript for altbootcmd (boot fallback after N failed boot retries) # -# After an upgrade, active_system has changed. U-Boot tries to boot this system -# for a number of tries. If the limit is reached, altbootcmd is run instead. -# This is the script that it will run. It has to: -# * switch back to previous system -# * reset the firmware update flag -# * run the regular boot command +# U-Boot tries to boot the active system for a number of tries. If the limit +# is reached, altbootcmd is run instead. This is the script that it will run. +# It has to: +# * switch active partitions bank in case of dual boot systems +# * reset the 'bootcount' number +# * reboot the system -if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." +if test "${dualboot}" = "yes"; then if test "${active_system}" = "linux_a"; then setenv active_system linux_b part number mmc ${mmcbootdev} linux_b linux_b_index @@ -30,8 +29,8 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a setenv mmcroot PARTUUID=${mmcroot_a} fi - setenv upgrade_available - setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi -run bootcmd +bootcount reset +reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mm-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mm-dvk/boot.txt index e7d3c933c..398134925 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mm-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mm-dvk/boot.txt @@ -2,37 +2,33 @@ # U-Boot bootscript for EMMC/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + part number mmc ${mmcbootdev} linux_a pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_a_index + part number mmc ${mmcbootdev} rootfs_a rootfs_a_index + # Save the rootfs_a UUID into mmcroot_a + part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a + setenv mmcroot PARTUUID=${mmcroot_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - part number mmc ${mmcbootdev} linux_a pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_a_index - part number mmc ${mmcbootdev} rootfs_a rootfs_a_index - # Save the rootfs_a UUID into mmcroot_a - part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a - setenv mmcroot PARTUUID=${mmcroot_a} - else - echo "Booting from system B" - part number mmc ${mmcbootdev} linux_b pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_b_index - part number mmc ${mmcbootdev} rootfs_b rootfs_b_index - # Save the rootfs_b UUID into mmcroot_b - part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b - setenv mmcroot PARTUUID=${mmcroot_b} - fi + echo "Booting from system B (try ${bootcount})" + part number mmc ${mmcbootdev} linux_b pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_b_index + part number mmc ${mmcbootdev} rootfs_b rootfs_b_index + # Save the rootfs_b UUID into mmcroot_b + part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b + setenv mmcroot PARTUUID=${mmcroot_b} fi else + echo "Booting system (try ${bootcount})" # Get the UUID of the configured boot partition. part uuid mmc ${mmcbootdev}:${mmcpart} bootpart # Check the boot source. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/boot.txt index 3b7011212..a27c3f261 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/boot.txt @@ -2,37 +2,33 @@ # U-Boot bootscript for EMMC/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + part number mmc ${mmcbootdev} linux_a pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_a_index + part number mmc ${mmcbootdev} rootfs_a rootfs_a_index + # Save the rootfs_a UUID into mmcroot_a + part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a + setenv mmcroot PARTUUID=${mmcroot_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - part number mmc ${mmcbootdev} linux_a pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_a_index - part number mmc ${mmcbootdev} rootfs_a rootfs_a_index - # Save the rootfs_a UUID into mmcroot_a - part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a - setenv mmcroot PARTUUID=${mmcroot_a} - else - echo "Booting from system B" - part number mmc ${mmcbootdev} linux_b pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_b_index - part number mmc ${mmcbootdev} rootfs_b rootfs_b_index - # Save the rootfs_b UUID into mmcroot_b - part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b - setenv mmcroot PARTUUID=${mmcroot_b} - fi + echo "Booting from system B (try ${bootcount})" + part number mmc ${mmcbootdev} linux_b pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_b_index + part number mmc ${mmcbootdev} rootfs_b rootfs_b_index + # Save the rootfs_b UUID into mmcroot_b + part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b + setenv mmcroot PARTUUID=${mmcroot_b} fi else + echo "Booting system (try ${bootcount})" # Get the UUID of the configured boot partition. part uuid mmc ${mmcbootdev}:${mmcpart} bootpart # Check the boot source. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/boot.txt index f05730df6..d36752fb9 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/boot.txt @@ -2,37 +2,33 @@ # U-Boot bootscript for EMMC/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + part number mmc ${mmcbootdev} linux_a pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_a_index + part number mmc ${mmcbootdev} rootfs_a rootfs_a_index + # Save the rootfs_a UUID into mmcroot_a + part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a + setenv mmcroot PARTUUID=${mmcroot_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - part number mmc ${mmcbootdev} linux_a pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_a_index - part number mmc ${mmcbootdev} rootfs_a rootfs_a_index - # Save the rootfs_a UUID into mmcroot_a - part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a - setenv mmcroot PARTUUID=${mmcroot_a} - else - echo "Booting from system B" - part number mmc ${mmcbootdev} linux_b pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_b_index - part number mmc ${mmcbootdev} rootfs_b rootfs_b_index - # Save the rootfs_b UUID into mmcroot_b - part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b - setenv mmcroot PARTUUID=${mmcroot_b} - fi + echo "Booting from system B (try ${bootcount})" + part number mmc ${mmcbootdev} linux_b pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_b_index + part number mmc ${mmcbootdev} rootfs_b rootfs_b_index + # Save the rootfs_b UUID into mmcroot_b + part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b + setenv mmcroot PARTUUID=${mmcroot_b} fi else + echo "Booting system (try ${bootcount})" # Get the UUID of the configured boot partition. part uuid mmc ${mmcbootdev}:${mmcpart} bootpart # Check the boot source. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/boot.txt index 86188c350..057bbf1de 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/boot.txt @@ -2,37 +2,33 @@ # U-Boot bootscript for EMMC/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + part number mmc ${mmcbootdev} linux_a pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_a_index + part number mmc ${mmcbootdev} rootfs_a rootfs_a_index + # Save the rootfs_a UUID into mmcroot_a + part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a + setenv mmcroot PARTUUID=${mmcroot_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - part number mmc ${mmcbootdev} linux_a pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_a_index - part number mmc ${mmcbootdev} rootfs_a rootfs_a_index - # Save the rootfs_a UUID into mmcroot_a - part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a - setenv mmcroot PARTUUID=${mmcroot_a} - else - echo "Booting from system B" - part number mmc ${mmcbootdev} linux_b pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_b_index - part number mmc ${mmcbootdev} rootfs_b rootfs_b_index - # Save the rootfs_b UUID into mmcroot_b - part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b - setenv mmcroot PARTUUID=${mmcroot_b} - fi + echo "Booting from system B (try ${bootcount})" + part number mmc ${mmcbootdev} linux_b pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_b_index + part number mmc ${mmcbootdev} rootfs_b rootfs_b_index + # Save the rootfs_b UUID into mmcroot_b + part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b + setenv mmcroot PARTUUID=${mmcroot_b} fi else + echo "Booting system (try ${bootcount})" # Get the UUID of the configured boot partition. part uuid mmc ${mmcbootdev}:${mmcpart} bootpart # Check the boot source. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/altboot.txt index 29172875b..08eed5831 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/altboot.txt @@ -1,16 +1,15 @@ # -# U-Boot bootscript for altbootcmd (dual boot fallback after retries) +# U-Boot bootscript for altbootcmd (boot fallback after N failed boot retries) # -# After an upgrade, active_system has changed. U-Boot tries to boot this system -# for a number of tries. If the limit is reached, altbootcmd is run instead. -# This is the script that it will run. It has to: -# * switch back to previous system -# * reset the firmware update flag -# * run the regular boot command +# U-Boot tries to boot the active system for a number of tries. If the limit +# is reached, altbootcmd is run instead. This is the script that it will run. +# It has to: +# * switch active partitions bank in case of dual boot systems +# * reset the 'bootcount' number +# * reboot the system -if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." +if test "${dualboot}" = "yes"; then if test "${active_system}" = "linux_a"; then setenv active_system linux_b part number mmc ${mmcbootdev} linux_b linux_b_index @@ -30,8 +29,8 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a setenv mmcroot PARTUUID=${mmcroot_a} fi - setenv upgrade_available - setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi -run bootcmd +bootcount reset +reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt index e6c3fc76e..6b6d33b53 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93-dvk/boot.txt @@ -2,41 +2,36 @@ # U-Boot bootscript for EMMC/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. # Pre step: check if we boot from uSD. if test "${mmcbootdev}" = "1"; then # We are booting from the SD card. setenv mmcroot /dev/mmcblk${mmcbootdev}p2 elif test "${dualboot}" = "yes"; then - # Dual boot update verification - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + part number mmc ${mmcbootdev} linux_a pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_a_index + part number mmc ${mmcbootdev} rootfs_a rootfs_a_index + # Save the rootfs_a UUID into mmcroot_a + part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a + setenv mmcroot PARTUUID=${mmcroot_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - part number mmc ${mmcbootdev} linux_a pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_a_index - part number mmc ${mmcbootdev} rootfs_a rootfs_a_index - # Save the rootfs_a UUID into mmcroot_a - part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a - setenv mmcroot PARTUUID=${mmcroot_a} - else - echo "Booting from system B" - part number mmc ${mmcbootdev} linux_b pi - setenv mmcpart ${pi} - # Save the partition index on variable rootfs_b_index - part number mmc ${mmcbootdev} rootfs_b rootfs_b_index - # Save the rootfs_b UUID into mmcroot_b - part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b - setenv mmcroot PARTUUID=${mmcroot_b} - fi + echo "Booting from system B (try ${bootcount})" + part number mmc ${mmcbootdev} linux_b pi + setenv mmcpart ${pi} + # Save the partition index on variable rootfs_b_index + part number mmc ${mmcbootdev} rootfs_b rootfs_b_index + # Save the rootfs_b UUID into mmcroot_b + part uuid mmc ${mmcbootdev}:${rootfs_b_index} mmcroot_b + setenv mmcroot PARTUUID=${mmcroot_b} fi else + echo "Booting system (try ${bootcount})" # Get the UUID of the configured boot partition. part uuid mmc ${mmcbootdev}:${mmcpart} bootpart # Check the boot source. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/altboot.txt index 29172875b..08eed5831 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/altboot.txt @@ -1,16 +1,15 @@ # -# U-Boot bootscript for altbootcmd (dual boot fallback after retries) +# U-Boot bootscript for altbootcmd (boot fallback after N failed boot retries) # -# After an upgrade, active_system has changed. U-Boot tries to boot this system -# for a number of tries. If the limit is reached, altbootcmd is run instead. -# This is the script that it will run. It has to: -# * switch back to previous system -# * reset the firmware update flag -# * run the regular boot command +# U-Boot tries to boot the active system for a number of tries. If the limit +# is reached, altbootcmd is run instead. This is the script that it will run. +# It has to: +# * switch active partitions bank in case of dual boot systems +# * reset the 'bootcount' number +# * reboot the system -if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." +if test "${dualboot}" = "yes"; then if test "${active_system}" = "linux_a"; then setenv active_system linux_b part number mmc ${mmcbootdev} linux_b linux_b_index @@ -30,8 +29,8 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then part uuid mmc ${mmcbootdev}:${rootfs_a_index} mmcroot_a setenv mmcroot PARTUUID=${mmcroot_a} fi - setenv upgrade_available - setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi -run bootcmd +bootcount reset +reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/altboot.txt index 8bd41ca3d..fc7ec1be6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/altboot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/altboot.txt @@ -1,16 +1,15 @@ # -# U-Boot bootscript for altbootcmd (dual boot fallback after retries) +# U-Boot bootscript for altbootcmd (boot fallback after N failed boot retries) # -# After an upgrade, active_system has changed. U-Boot tries to boot this system -# for a number of tries. If the limit is reached, altbootcmd is run instead. -# This is the script that it will run. It has to: -# * switch back to previous system -# * reset the firmware update flag -# * run the regular boot command +# U-Boot tries to boot the active system for a number of tries. If the limit +# is reached, altbootcmd is run instead. This is the script that it will run. +# It has to: +# * switch active partitions bank in case of dual boot systems +# * reset the 'bootcount' number +# * reboot the system -if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then - echo "## Update failed; Rolling back to previous version." +if test "${dualboot}" = "yes"; then if test "${active_system}" = "linux_a"; then setenv active_system linux_b setenv mtdbootpart ${active_system} @@ -20,8 +19,8 @@ if test "${dualboot}" = "yes" && test "${upgrade_available}" = "1"; then setenv mtdbootpart ${active_system} setenv rootfsvol ${rootfsvol_a} fi - setenv upgrade_available - setenv bootcount 0 saveenv + echo "## System boot failed; Switching active partitions bank to ${active_system}..." fi -run bootcmd +bootcount reset +reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt index 3f72cee46..9ff6b0e33 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp13-dvk/boot.txt @@ -2,27 +2,23 @@ # U-Boot bootscript for NAND/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - setenv mtdbootpart ${active_system} - setenv rootfsvol ${rootfsvol_a} - else - echo "Booting from system B" - setenv mtdbootpart ${active_system} - setenv rootfsvol ${rootfsvol_b} - fi + echo "Booting from system B (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_b} fi else + echo "Booting system (try ${bootcount})" # Check the boot source. if test "${mtdbootpart}" = "linux"; then # We are booting from the NAND using 'linux'. diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt index 0bfbc4de6..f62b9eac6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt @@ -2,27 +2,23 @@ # U-Boot bootscript for NAND/SD images created by Yocto. # -# As the first step in the boot script, check if we are using DualBoot and -# if an upgrade is available. This requires the script to change some variables -# and save them, while the rest of the script changes variables only temporarily -# without saving them. +# As the first step in the boot script, check if we are using DualBoot. This +# requires the script to change some variables and save them, while the rest +# of the script changes variables only temporarily without saving them. -# Dual boot update verification +# Dual boot verification if test "${dualboot}" = "yes"; then - if test "${upgrade_available}" = "1"; then - echo "Update detected; Booting new system in ${active_system} (try ${bootcount})" + if test "${active_system}" = "linux_a"; then + echo "Booting from system A (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_a} else - if test "${active_system}" = "linux_a"; then - echo "Booting from system A" - setenv mtdbootpart ${active_system} - setenv rootfsvol ${rootfsvol_a} - else - echo "Booting from system B" - setenv mtdbootpart ${active_system} - setenv rootfsvol ${rootfsvol_b} - fi + echo "Booting from system B (try ${bootcount})" + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_b} fi else + echo "Booting system (try ${bootcount})" # Check the boot source. if test "${mtdbootpart}" = "linux"; then # We are booting from the NAND using 'linux'.