← Insights

Secure boot and secure updates on embedded Linux

How a chain of trust from bootloader to application works, and how signed A/B updates with rollback build on it.

19 November 2026 · Wais Abawi

Imagine someone standing next to your machine with a laptop and a serial cable. Can they put their own software on it? And when you roll out an update to your machines in the field, what happens to the one where the update goes wrong?

A machine or device in the field must be able to guarantee two things: that only software you have released yourself runs on it, and that you can update that software securely. Secure boot and signed updates take care of this. Here is how.

Each link checks the next

Secure boot works as a chain. Each step checks the signature of the next step before starting it.

It starts in the hardware, with the root of trust. The processor's boot ROM checks the bootloader's signature against a hash of the public key that is burned into one-time programmable fuses in the chip. The bootloader, for example U-Boot, then checks the kernel and the device tree, often as a single signed FIT image. And while the system runs, dm-verity checks that the root file system has not been modified.

That last link needs anchoring too: put the dm-verity root hash on the kernel command line inside the signed FIT image, or in a signed initramfs. If your application lives in the read-only root file system, it is covered by the chain as well. The check then runs from the boot ROM all the way to the application.

A chain is only as strong as its weakest link. An open bootloader console or a development mode that is still enabled undoes the whole chain. Then the visitor with the laptop has a free run after all.

On i.MX, signatures only count once the device is closed

On NXP i.MX processors the boot ROM mechanism is called HAB (i.MX6, i.MX7 and i.MX8M) or AHAB (i.MX8QM/QXP with SECO, i.MX8ULP and i.MX9 with EdgeLock Secure Enclave). After you burn the key hash, the device is still open. An invalid or missing signature is only logged, and the device boots anyway. Verification is enforced only once you close the device. With HAB you burn the SEC_CONFIG fuse for that; with AHAB you move the lifecycle to OEM closed.

Test the whole chain in that open stage. Check in U-Boot with hab_status or ahab_status that no events are reported, also after an update and after a rollback. Only then do you close the device. A signing error after closing means a device that no longer boots.

You sign with NXP's Code Signing Tool (CST) and your own PKI. Its private keys belong offline or in an HSM. The key table (SRK) holds several keys, and a leaked key can be revoked through fuses. Decide in advance which key you use now and how you switch if it leaks.

Two partitions as a safety net

In an A/B setup, the device has two system partitions. An update is written to the inactive partition after its signature has been checked. The running version stays untouched in the meantime. Only after a successful reboot does the new version become permanent. If the boot fails, the device automatically falls back to the previous version. Tools such as RAUC, SWUpdate and Mender provide this mechanism and integrate with Yocto.

What counts as "fails" is up to you to define. In U-Boot, bootcount counts boot attempts. Once it exceeds bootlimit, U-Boot starts the previous partition. That catches a kernel that does not come up, not an application that fails after boot. So let userspace approve the new version after a health check, with RAUC for example through rauc status mark-good. Only then is the update permanent.

Four places where the chain breaks

The principle is clear. In practice it often goes wrong on these points:

  • Key management. Signing keys sit on a development laptop or in a repository. Keep them offline or in an HSM, and have a plan for when a key leaks.
  • No anti-rollback. If an old version with known vulnerabilities can be installed again, the update does little good. Have the update tool check the version number and reject older versions. If the hardware offers a monotonic counter, for example in fuses, in RPMB via OP-TEE or in a TPM, store the minimum version there.
  • Debug access in production. JTAG, serial console and bootloader shell should be closed or secured in production.
  • No recovery path. What happens when verification fails: does the machine go to a safe state, or is it unusable?

What the chain does not cover

Secure boot proves that the software is genuine. It does not keep secrets secret. Keys for the cloud connection or for encryption should therefore not sit as files in the root file system. Keep them in OP-TEE, as keys wrapped by the i.MX CAAM, or in a TPM.

Data falls outside the chain too. dm-verity protects a read-only file system. A data partition, or containers you update separately from the system, need their own protection, such as encryption, dm-integrity or signed container images.

These points also come back in the Cyber Resilience Act's requirements for integrity and security updates. We assess where your platform stands on each point in the CRA quick scan. More about our approach in Embedded Linux and secure updates.

How does your secure boot hold up?

The CRA quick scan assesses secure boot and updates point by point: green, amber or red.