Table of Contents

03. RAUC

Finally, it comes down to installing RAUC into the Debian partitions.

📄 Our script: rauc-utils/install.sh is already complete. Feel free to read and understand it.

This script will:

  1. Mount both rootfsA and rootfsB
  2. Uses QEMU and chroot to install:
    1. rauc
    2. your ca.cert.pem (certificate used to sign the update images)
    3. system.conf
    4. rauc-mark-good.service
  3. Sets up /etc/fw_env.config, fstab, and enables systemd services

But in order to run it, recursively copy the entire RAUC utils directory from host to somewhere inside the debian rootfs (e.g., /root/rauc-utils/) and run it using chroot-enter.sh (as you've done in the prev. task).

[Re]Generate the disk image

We can now run mk-disk-image2.sh. The disk.img will be updated with 4 partitions (boot, A, B + data), Debian will be copied to the first 2 EXT4 partitions and the bootloader will be installed at 32KB offset (the SoC's BL1/BOOTROM wants it there).

Custom u-boot script

📄 In order to have the A-B partitioning scheme, we'll need to add this script: rauc-utils/boot.cmd.in to our u-boot default environment. Feel free to study it (highly recommended)!

Use the rauc-utils/uboot-modify-bootcmd.sh script to just to this!

Then rebuild uboot (you must delete u-boot/.config and u-boot/flash.bin for our Makefile to trigger the recompilation of UBoot).

Flashing the board

Power up the board and go into u-boot. Let fastboot start and use fastboot flash 0:0 disk.img.

Use your root password (hope you set it!).

Once Debian booted, check:

mount | grep rootfs
cat /etc/rauc/system.conf