Skip to content

Commit

Permalink
fixup! TRYBOOT WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth committed Dec 1, 2024
1 parent 3ddf6f5 commit 76e8742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions fwup-ops.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ uboot-environment uboot-env {
task factory-reset {
on-init {
info("Erasing all writable data")
# This works better with --enable-trim
# Trim may not work on MicroSD card, so don't rely on it
trim(${APP_PART_OFFSET}, ${APP_PART_COUNT})
raw_memset(${APP_PART_OFFSET}, 256, 0xff)
Expand Down
5 changes: 4 additions & 1 deletion fwup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ task complete {
include("${NERVES_PROVISIONING}")

uboot_setenv(uboot-env, "nerves_fw_active", "a")
uboot_setenv(uboot-env, "nerves_fw_validated", "1")
uboot_setenv(uboot-env, "nerves_fw_devpath", ${NERVES_FW_DEVPATH})
uboot_setenv(uboot-env, "a.nerves_fw_application_part0_devpath", ${NERVES_FW_APPLICATION_PART0_DEVPATH})
uboot_setenv(uboot-env, "a.nerves_fw_application_part0_fstype", ${NERVES_FW_APPLICATION_PART0_FSTYPE})
Expand Down Expand Up @@ -279,14 +280,15 @@ task upgrade.a {

# Switch over to boot the new firmware
uboot_setenv(uboot-env, "nerves_fw_active", "a")
uboot_setenv(uboot-env, "nerves_fw_validated", "0")
}

on-error {
}
}

task upgrade.b {
# This task upgrades the A partition
# This task upgrades the B partition
require-uboot-variable(uboot-env, "nerves_fw_active", "a")

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

# Switch over to boot the new firmware
uboot_setenv(uboot-env, "nerves_fw_active", "b")
uboot_setenv(uboot-env, "nerves_fw_validated", "0")
}

on-error {
Expand Down

0 comments on commit 76e8742

Please sign in to comment.