From b7cd473b395e9f3a7c90418c18378eec83bf539a Mon Sep 17 00:00:00 2001 From: Francisco Gil Date: Mon, 14 Nov 2022 17:43:26 +0100 Subject: [PATCH] dualboot: add missing altboot.txt needed by dualboot Once you enabled dualboot in the ccmp15 you need this file for the altbootcmd. Signed-off-by: Francisco Gil --- .../u-boot/u-boot-dey/ccmp15-dvk/altboot.txt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/altboot.txt diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/altboot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/altboot.txt new file mode 100644 index 000000000..8bd41ca3d --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/altboot.txt @@ -0,0 +1,27 @@ +# +# U-Boot bootscript for altbootcmd (dual boot fallback after 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 + +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 + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_b} + else + setenv active_system linux_a + setenv mtdbootpart ${active_system} + setenv rootfsvol ${rootfsvol_a} + fi + setenv upgrade_available + setenv bootcount 0 + saveenv +fi +run bootcmd