Skip to content

Generate image with robust A/B update using mender.io. #39

Description

@lueschem

Goal

Provide an edi configuration similar to edi-pi (see also this blog post) with full support for mender.io.

The configuration can be used to generate a Debian image for the Raspberry Pi that allows robust A/B updates of a big fleet of devices. Furthermore the configuration shall also produce a cross compilation environment for faster development.

Sub Goals

  • Allow a hybrid update strategy (mender for image based upgrades, apt for package based updates)
  • The hybrid update strategy shall also allow a kernel update (based on edi-boot-shim) using apt
  • Directly build the mender compliant image without making the detour over mender-convert (However: mender-convert is a really great tool!)
  • Vanilla u-boot shall be used as bootloader - the mender specific patches shall get replaced by a specially crafted hush script (boot.scr).
  • Mender client shall be installed as a Debian package (many thanks to Andreas Henriksson!)

Partition Layout

vfat boot partition

The following stuff is on the vfat partition:

  • Pi bootloader
  • u-boot (unpatched)
  • uboot.env (persistent storage of environment variables, gets written on first boot)
  • boot.scr: does the mender glue logic, loads the boot.scr of the active ext4 partition

1x ext4 data partition

The data partition is shared between the A and the B system. The partition has a fixed size.

2x ext4 system partition (A/B)

The system partitions have the following characteristics:

  • Dynamically adjusted size on first boot to make use of the full disk.
  • Contain a full Debian (currently stretch) root file system including kernel
  • Contain a boot.scr that describes how to load the kernel/device-tree/initrd (the boot.scr gets updated by edi-boot-shim)

Design Reasons

  • I would like to keep the possibility of apt based updates to a) speed up updates during development and to b) have reduced network traffic for security updates of an IoT fleet
  • I would like to have an unmodified u-boot in order to get rid of maintaining a forked u-boot (I am a lazy guy where possible)
  • I would like to directly generate mender compliant images to have feature parity with Yocto, shorter build cycles and more flexibility
  • I would like to use Debian kernels directly (without moving around dtbs, kernels and initrds) (see also this blog post)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions