Skip to content
Libre Computer
Platform

Module 12 · Labs 9–10

A whole system

The final project is a small product: it starts on its own, survives having its power pulled, and can be rebuilt by someone else. And because you know every stage of the boot, a board that will not start is a problem you can solve.

Key ideas

  • Start on boot: the application is a systemd service, with a restart policy and logs.
  • Survive a power cut: a read-only root filesystem with a small writable area, careful writes and journaling keep boot media from being corrupted.
  • Watchdogs restart a system that hangs; thermals decide whether the board keeps its clock speed under load.
  • Security basics: no default passwords, SSH keys, and a plan for updates. For firmware, UEFI's update mechanism is the capsule: the boot menu's Firmware Update entry fetches the board's capsule from boot.libre.computer, checks it against a certificate built into U-Boot, and refuses one older than the running build (module 7; Solitude's capsule is published, Das Frite's not yet).
  • Recovery: the boot ROM can always be reached over USB, so a broken bootloader or boot media is fixed by starting the board over USB and re-writing its storage. When U-Boot still runs, lc bootrom reset at its prompt restarts the board in USB boot mode with no button; when U-Boot does not start, the way in is Solitude's USB boot button, or Das Frite's boot select switch at USB, at power-on.
  • Where next: building a whole image with Buildroot or Yocto, real-time Linux, and contributing upstream.

On the bench

In short, what you do in lab 9, where the steps are given in full:

  1. Build the project you proposed and show one working subsystem at the checkpoint.
  2. On spare boot media, break the boot configuration on purpose, then recover: read the console to see where it stops, start the board over USB from a PC, and restore it.
  3. Write the recovery up as a runbook another student could follow, then demonstrate the finished project in lab 10.

Resources

ResourceUse in this module
U-Boot feature pageWhat each board's bootloader does, including UEFI capsule update
libretech-flash-toolWriting a bootloader or an image to boot media from Linux
The Libre Computer appRecovery over USB from a PC; its Firmware page restores a board's boot firmware
La Frite eMMC flashing steps from LinuxWriting an eMMC module on Das Frite's chip family
Buildroot for Libre Computer boardsBuilding a whole image
Board performance tests and dataWhat to expect under load