summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEduard Strehlau <[email protected]>2023-04-26 13:04:53 -0300
committerStefano Babic <[email protected]>2023-05-02 10:57:32 +0200
commit52726d24d6c8e857f40d9125b0bce5f6272b6022 (patch)
tree9eb97c8687e35e0315dc9eea2a0c63b85ff5e6f0 /include
parent440dc0694ba44ed8551f8809f76373f20800987f (diff)
smegw01: Only commit to new partition if update was successful
When performing rootfs update via swupdate, it is convenient to check the 'ustate' variable to decide whether the update succeeded or not. Signed-off-by: Eduard Strehlau <[email protected]> Signed-off-by: Fabio Estevam <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/configs/smegw01.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/configs/smegw01.h b/include/configs/smegw01.h
index 05edaac42f8..277c828d0e0 100644
--- a/include/configs/smegw01.h
+++ b/include/configs/smegw01.h
@@ -30,13 +30,19 @@
"bootm_size=0x10000000\0" \
"mmcdev=0\0" \
"mmcpart=1\0" \
+ "mmcpart_committed=1\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/mmcblk0p${mmcpart} rootwait rw " \
+ "root=/dev/mmcblk0p${mmcpart_committed} rootwait rw " \
__stringify(EXTRA_BOOTPARAMS) "\0" \
+ "commit_mmc=if test \"${ustate}\" = 1 -a \"${mmcpart}\" != \"${mmcpart_committed}\"; then " \
+ "setenv mmcpart_committed ${mmcpart};" \
+ "saveenv;" \
+ "fi;\0" \
"bootlimit=3\0" \
- "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} boot/${image}\0" \
- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} boot/${fdtfile}\0" \
+ "loadimage=load mmc ${mmcdev}:${mmcpart_committed} ${loadaddr} boot/${image}\0" \
+ "loadfdt=load mmc ${mmcdev}:${mmcpart_committed} ${fdt_addr} boot/${fdtfile}\0" \
"mmcboot=echo Booting from mmc ...; " \
+ "run commit_mmc; " \
"run mmcargs; " \
"if run loadfdt; then " \
"if bootz ${loadaddr} - ${fdt_addr}; then " \
@@ -48,10 +54,12 @@
"run altbootcmd; " \
"fi;\0" \
"altbootcmd=echo Performing rollback...; " \
- "if test \"${mmcpart}\" = 1; then " \
+ "if test \"${mmcpart_committed}\" = 1; then " \
"setenv mmcpart 2; " \
+ "setenv mmcpart_committed 2;" \
"else " \
"setenv mmcpart 1; " \
+ "setenv mmcpart_committed 1;" \
"fi; setenv bootcount 0; setenv upgrade_available; setenv ustate 3; saveenv; " \
"run bootcmd;\0"