Wed, 08 Apr 2026 09:25:05 +0000

Sharing a simple C program I wrote to modify a U-Boot environment variable from Linux, using libubootenv. That's typically useful to implement A/B update recovery mechanisms.

Using a dedicated executable is safer that using libubootenv's "fw_printenv" and "fw_setenv" commands, which would make it easier for an attacker to modify any U-Boot variable, to disrupt or even hijack normal system boot.