Skip to content

Commit

Permalink
fwup.conf cleanup
Browse files Browse the repository at this point in the history
* Remove legacy tags
* Clear out in 128KB chunks since that's the write size anyway
* Verify that the rootfs image fits
  • Loading branch information
fhunleth committed Jul 4, 2017
1 parent e8e23ea commit 9fa3dcc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions fwup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ file-resource w1-gpio-pullup.dtbo {

file-resource rootfs.img {
host-path = ${ROOTFS}

# Error out if the rootfs size exceeds the partition size
assert-size-lte = ${ROOTFS_A_PART_COUNT}
}

mbr mbr-a {
Expand Down Expand Up @@ -170,11 +173,6 @@ task complete {
# Only match if not mounted
require-unmounted-destination = true

# Everything that gets written can be verified on the fly.
# This speeds things up, since we don't care about detecting
# errors before data gets written.
verify-on-the-fly = true

on-init {
mbr_write(mbr-a)

Expand Down Expand Up @@ -214,8 +212,8 @@ task complete {
# Clear out any old data in the B partition that might be mistaken for
# a file system. This is mostly to avoid confusion in humans when
# reprogramming SDCards with unknown contents.
raw_memset(${BOOT_B_PART_OFFSET}, 8, 0xff)
raw_memset(${ROOTFS_B_PART_OFFSET}, 8, 0xff)
raw_memset(${BOOT_B_PART_OFFSET}, 256, 0xff)
raw_memset(${ROOTFS_B_PART_OFFSET}, 256, 0xff)

# Invalidate the application data partition so that it is guaranteed to
# trigger the corrupt filesystem detection code on first boot and get
Expand All @@ -227,7 +225,7 @@ task complete {

task upgrade.a {
# This task upgrades the A partition
require-partition1-offset = ${ROOTFS_B_PART_OFFSET}
require-partition-offset(1, ${ROOTFS_B_PART_OFFSET})

on-init {
info("Upgrading the A partition")
Expand Down Expand Up @@ -278,7 +276,7 @@ task upgrade.a {

task upgrade.b {
# This task upgrades the B partition
require-partition1-offset = ${ROOTFS_A_PART_OFFSET}
require-partition-offset(1, ${ROOTFS_A_PART_OFFSET})

on-init {
info("Upgrading the B partition")
Expand Down

0 comments on commit 9fa3dcc

Please sign in to comment.