Skip to content

Commit 76e8742

Browse files
committed
fixup! TRYBOOT WIP
1 parent 3ddf6f5 commit 76e8742

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fwup-ops.conf

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ uboot-environment uboot-env {
3535
task factory-reset {
3636
on-init {
3737
info("Erasing all writable data")
38+
# This works better with --enable-trim
3839
# Trim may not work on MicroSD card, so don't rely on it
3940
trim(${APP_PART_OFFSET}, ${APP_PART_COUNT})
4041
raw_memset(${APP_PART_OFFSET}, 256, 0xff)

fwup.conf

+4-1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ task complete {
141141
include("${NERVES_PROVISIONING}")
142142

143143
uboot_setenv(uboot-env, "nerves_fw_active", "a")
144+
uboot_setenv(uboot-env, "nerves_fw_validated", "1")
144145
uboot_setenv(uboot-env, "nerves_fw_devpath", ${NERVES_FW_DEVPATH})
145146
uboot_setenv(uboot-env, "a.nerves_fw_application_part0_devpath", ${NERVES_FW_APPLICATION_PART0_DEVPATH})
146147
uboot_setenv(uboot-env, "a.nerves_fw_application_part0_fstype", ${NERVES_FW_APPLICATION_PART0_FSTYPE})
@@ -279,14 +280,15 @@ task upgrade.a {
279280

280281
# Switch over to boot the new firmware
281282
uboot_setenv(uboot-env, "nerves_fw_active", "a")
283+
uboot_setenv(uboot-env, "nerves_fw_validated", "0")
282284
}
283285

284286
on-error {
285287
}
286288
}
287289

288290
task upgrade.b {
289-
# This task upgrades the A partition
291+
# This task upgrades the B partition
290292
require-uboot-variable(uboot-env, "nerves_fw_active", "a")
291293

292294
# Require that the running version of firmware has been validated.
@@ -362,6 +364,7 @@ task upgrade.b {
362364

363365
# Switch over to boot the new firmware
364366
uboot_setenv(uboot-env, "nerves_fw_active", "b")
367+
uboot_setenv(uboot-env, "nerves_fw_validated", "0")
365368
}
366369

367370
on-error {

0 commit comments

Comments
 (0)