From 567f9013855787c3eb5d4a4683b9e739deebd79b Mon Sep 17 00:00:00 2001 From: mtriSE Date: Tue, 27 Oct 2026 18:36:35 +0700 Subject: [PATCH 01/61] docs: record the boot baseline for beaglebone_black Capture boot evidence and a timing baseline for the single-rootfs image before the A/B OTA work in specs/002-ab-ota-rauc/ changes the storage layout and the boot path. Three grabserial runs give 11.50 s from the U-Boot SPL banner to the login prompt, with 1.2% spread, so the figure is precise enough to detect the 10% regression the boot-time budget allows. /proc/uptime cannot produce this number because it starts counting only when the kernel does, leaving out the bootloader entirely. The raw serial logs are kept exactly as captured, including one NUL byte in run 3 that makes git treat that file as binary; the document says to grep it with -a and explains the clock reset in its first two lines. Reading the logs also turned up five facts that feed the A/B work: the U-Boot environment is a FAT file that does not exist yet, booting goes through extlinux.conf and never reads uEnv.txt, 2.08 s of the 11.50 s is the autoboot countdown, a hardware watchdog is already running and the kernel takes it over, and the boot partition needs only the two bootloader stages once the kernel moves into the OS slot. README records the figure and the method. The constitution's PERF_BASELINES note loses its time-to-login item, which is now recorded, and keeps the incremental build time still to be measured. Documentation only: no script, defconfig, Makefile or image input changed, so none of the checks in Principle IV's table applies. Co-Authored-By: Claude Opus 5 --- .specify/memory/constitution.md | 4 +- README.md | 7 + docs/boot-baseline-beaglebone-black.md | 140 ++++++++++++ docs/logs/boot-baseline-run1.log | 301 +++++++++++++++++++++++++ docs/logs/boot-baseline-run2.log | 300 ++++++++++++++++++++++++ docs/logs/boot-baseline-run3.log | Bin 0 -> 26978 bytes 6 files changed, 750 insertions(+), 2 deletions(-) create mode 100644 docs/boot-baseline-beaglebone-black.md create mode 100644 docs/logs/boot-baseline-run1.log create mode 100644 docs/logs/boot-baseline-run2.log create mode 100644 docs/logs/boot-baseline-run3.log diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index c61a724..2b903f5 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -161,8 +161,8 @@ every change and MUST NOT regress without justification. cache size, `rootfs.ext4` and boot partition usage, artifact size) are recorded in README.md under "Checks and CI" and are the reference for the thresholds above. Both partitions are currently below the 80% limit. -- TODO(PERF_BASELINES): still to record in the README: time-to-login and a local incremental - build time. +- TODO(PERF_BASELINES): still to record in the README: a local incremental build time. + Time-to-login is recorded (`docs/boot-baseline-beaglebone-black.md`, measured 2026-10-27). Rationale: embedded targets are resource-constrained and a one-hour build makes needless rebuilds expensive. diff --git a/README.md b/README.md index c672a3e..e51a874 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,13 @@ artifact `sdcard.img.xz` is about 14.7 MB (`sdcard.img` is 76 MiB). Footprint of that image: `rootfs.ext4` is a 60 MiB filesystem (512 MiB partition) with about 39 MiB used (65%); the FAT16 boot partition has about 9.0 MiB of its 16 MiB used (56%). +Boot time on hardware: **11.50 s** from the U-Boot SPL banner to the login prompt (mean of three +runs, spread 1.2%), about 12.0 s from power-on. Of that, 2.08 s is the `bootdelay` countdown and +5.89 s is kernel plus init. Method, per-phase breakdown and the serial logs are in +[docs/boot-baseline-beaglebone-black.md](docs/boot-baseline-beaglebone-black.md); reproduce it with +`grabserial` as documented there before and after any change that touches the kernel, bootloader, +device tree, bootargs, partition layout or init. + ## Flashing and booting the BeagleBone Black ```bash diff --git a/docs/boot-baseline-beaglebone-black.md b/docs/boot-baseline-beaglebone-black.md new file mode 100644 index 0000000..3cebf0f --- /dev/null +++ b/docs/boot-baseline-beaglebone-black.md @@ -0,0 +1,140 @@ +# Boot baseline: BeagleBone Black (single-slot image) + +Boot evidence and timing baseline for the single-rootfs `beaglebone_black` image, captured before +the A/B OTA work in `specs/002-ab-ota-rauc/` changes the storage layout and the boot path. + +It serves two purposes: + +- the boot smoke test the constitution requires for any change touching the kernel, bootloader, + device tree, bootargs, partition layout or init (Principle IV); +- the "before" half of the boot-time budget that the same work must not regress by more than 10% + (Principle VI, and SC-008 of feature 002). + +## What was booted + +| | | +|---|---| +| Image | `output/beaglebone_black/images/sdcard.img`, 76 MiB | +| Source revision | `6255255` ("Record the paused state of the CI/CD pipeline feature"), clean tree | +| Buildroot | `2026.08-274-gd6061d653d` | +| Kernel | 6.18.38, in-tree `omap2plus` defconfig, `ti/omap/am335x-boneblack` device tree | +| U-Boot | 2026.07, `am335x_evm` defconfig, built 2026-10-26 | +| Medium | SD card, S2 (BOOT) held at power-on | +| Console | serial on header J1, 115200 8N1 | + +The image identified itself on the device exactly as built: + +``` +OTA embedded Linux beaglebone-black /dev/console +beaglebone-black login: root +# uname -r +6.18.38 +# cat /etc/build-info +BOARD=beaglebone_black +VERSION=6255255 +BUILDROOT=2026.08-274-gd6061d653d +``` + +That confirms the whole provenance chain end to end: a running device names the commit it was +built from, the kernel version the defconfig pins, and the Buildroot submodule commit. It also +confirms both overlay layers reached the image, `/etc/issue` from `board/ota/common/` and +`/etc/hostname` from `board/ota/beaglebone_black/`. + +## Method + +Captured with `grabserial`, which timestamps each serial line, so the measurement covers the +bootloader as well — `/proc/uptime` on the device cannot, because it only starts counting when the +kernel does: + +```bash +grabserial -d /dev/ttyUSB0 -b 115200 -t -m "U-Boot SPL" -q "login:" \ + -o docs/logs/boot-baseline-runN.log +# power on the board (holding S2) only after grabserial is running +``` + +`-m "U-Boot SPL"` puts t=0 at the SPL banner and `-q "login:"` stops at the login prompt, so the +figure below is **SPL banner to login prompt**. Three runs, raw logs in `docs/logs/`. + +Notes on the raw logs, which are kept exactly as captured: + +- `boot-baseline-run3.log` shows the first two lines at 0.000007 and 0.502264 before the clock + resets at the SPL match. That 0.50 s is ROM to SPL banner, i.e. the part the other two runs do + not include. Add it for a power-on figure. +- The same file contains one NUL byte emitted by the serial line, so git treats it as binary. + Grep it with `grep -a`. +- Each line carries `[absolute delta]`; kernel messages add their own `[seconds]` in a second + bracket, which runs about 4.8 s behind the serial clock because the kernel clock starts at + handover. + +## Result + +| Run | SPL banner to login prompt | +|---|---| +| 1 | 11.58 s | +| 2 | 11.45 s | +| 3 | 11.47 s | +| **mean** | **11.50 s** | + +Spread is 0.13 s (1.2%), well inside the 10% budget the boot-time rule allows, so the method is +precise enough to detect a real regression. Adding the 0.50 s of ROM time gives **about 12.0 s from +power-on to login prompt**. + +### Where the time goes (run 1) + +| Phase | Seconds | Note | +|---|---|---| +| ROM to SPL banner | 0.50 | measured in run 3 only | +| SPL loads U-Boot | 0.66 | | +| U-Boot init | 0.67 | DRAM, 164 devices, MMC, Ethernet, watchdog | +| `bootdelay` countdown | **2.08** | pure wait: "Hit any key to stop autoboot: 2 1 0" | +| Scan FAT, load `zImage` + dtb | 0.57 | `/extlinux/extlinux.conf`, then 7.3 MiB `zImage` in 0.49 s | +| "Starting kernel ..." to first kernel message | 1.69 | decompression and pre-console init, no output | +| Kernel and init to login prompt | 5.89 | | +| **Total from SPL banner** | **11.58** | | + +## Footprint of the same image + +| | Used | Capacity | % | +|---|---|---|---| +| Root filesystem contents | 29.5 MiB (`target/`), 31.9 MiB as a tar | | | +| `rootfs.ext4` | ~39 MiB | 60 MiB filesystem | 65% | +| `rootfs.ext4` inside its partition | 60 MiB | 512 MiB partition | 12% | +| FAT16 boot partition | 9.0 MiB | 16 MiB | 56% | +| `sdcard.img` | 76 MiB | | | + +`zImage` alone is 7.29 MiB of the 9.0 MiB used in the boot partition. The 60 MiB filesystem comes +from `BR2_TARGET_ROOTFS_EXT2_SIZE="60M"` and does not grow into the 512 MiB partition that +`genimage.cfg` gives it. + +## Findings that feed feature 002 + +These came out of reading the logs, and each one is a concrete input to `plan.md`: + +1. **The U-Boot environment is a FAT file and does not exist yet**: + `Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1`. U-Boot is therefore + running its built-in default environment. This matters because A/B slot selection keeps its + state in that environment and the running system has to write it; `fw_setenv` from + `uboot-tools` handles raw block-device and MTD environments, not a file inside a FAT + filesystem. Deciding where the environment lives — and making `/etc/fw_env.config` agree with + it byte for byte — is the first task of feature 002, because getting it wrong makes every + update roll back even when the image is perfect. +2. **Booting goes through `extlinux.conf`, not `uEnv.txt`**: the log shows + `Found /extlinux/extlinux.conf` and no use of `uEnv.txt` at all. The board currently ships two + boot configurations and uses one. The A/B boot script replaces this path, and `uEnv.txt` can go. +3. **2.08 s of the 11.50 s is the autoboot countdown.** Setting `bootdelay` low in the new + environment pays for the slot-selection logic several times over, which is worth knowing before + measuring feature 002 against SC-008. +4. **U-Boot already starts the watchdog** (`WDT: Started wdt@44e35000 ... 60s timeout`) and the + kernel takes it over (`omap_wdt ... initial timeout 60 sec`). A hardware watchdog plus a boot + attempt counter is exactly what catches a slot that hangs instead of failing cleanly, so this is + an asset for the rollback story rather than a detail to ignore. +5. **Slot sizing is not the 512 MiB it looks like.** With the kernel moving inside the OS slot, slot + contents become about 37 MiB, while the filesystem built into the slot is fixed at 60 MiB and the + slot partition is 512 MiB. The read-only OS slot that feature 002 settled on also makes a + compressed read-only filesystem an option, which would shrink both the slot and every update + bundle. The boot partition, by contrast, only needs the two bootloader stages (about 1.7 MiB) + once the kernel leaves it. +6. Two benign messages to expect in any future comparison, both present here and unrelated to this + work: `PM: Cannot get wkup_m3_ipc handle` and + `PM: bootloader does not support rtc-only!`. The CM3 power-management firmware itself loads + correctly (`CM3 Firmware Version = 0x192`). diff --git a/docs/logs/boot-baseline-run1.log b/docs/logs/boot-baseline-run1.log new file mode 100644 index 0000000..0a7b4cf --- /dev/null +++ b/docs/logs/boot-baseline-run1.log @@ -0,0 +1,301 @@ +[0.000004 0.000004] +[0.004127 0.004123] U-Boot SPL 2026.07 (Oct 26 2026 - 08:28:14 +0000) +[0.004319 0.004319] Trying to boot from MMC1 +[0.666237 0.661918] +[0.666946 0.000710] +[0.667858 0.000912] U-Boot 2026.07 (Oct 26 2026 - 08:28:14 +0000) +[0.672983 0.005125] +[0.673017 0.000034] CPU : AM335X-GP rev 2.1 +[0.673679 0.000662] Model: TI AM335x BeagleBone Black +[0.674702 0.001023] DRAM: 512 MiB +[0.754269 0.079567] Core: 164 devices, 19 uclasses, devicetree: separate +[0.768983 0.014714] WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) +[0.777521 0.008538] NAND: 0 MiB +[1.176245 0.398724] MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 +[1.194918 0.018673] Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... +[1.293999 0.099081] not set. Validating first E-fuse MAC +[1.298411 0.004413] Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in +[1.328372 0.029960] MAC de:ad:be:ef:00:01 +[1.330907 0.002535] HOST MAC de:ad:be:ef:00:00 +[1.331959 0.001051] RNDIS ready +[1.338160 0.006201] , eth3: usb_ether +[1.341137 0.002977] Hit any key to stop autoboot: 2Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0 +[3.419117 2.077981] switch to partitions #0, OK +[3.419664 0.000546] mmc0 is current device +[3.426841 0.007177] Scanning mmc 0:1... +[3.429736 0.002896] Found /extlinux/extlinux.conf +[3.430472 0.000736] Retrieving file: /extlinux/extlinux.conf +[3.438185 0.007713] 1: beaglebone-buildroot +[3.438647 0.000462] Retrieving file: /zImage +[3.931937 0.493291] append: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait +[3.939316 0.007378] Retrieving file: /am335x-boneblack.dtb +[3.955382 0.016066] Kernel image @ 0x82000000 [ 0x000000 - 0x749870 ] +[3.960008 0.004626] ## Flattened Device Tree blob at 88000000 +[3.963524 0.003516] Booting using the fdt blob at 0x88000000 +[3.968124 0.004601] Working FDT set to 88000000 +[3.971561 0.003436] Loading Device Tree to 8ffeb000, end 8ffff2fb ... OK +[3.978425 0.006864] Working FDT set to 8ffeb000 +[3.991741 0.013317] +[3.991822 0.000081] Starting kernel ... +[3.992057 0.000235] +[5.685354 1.693297] [ 0.000000] Booting Linux on physical CPU 0x0 +[5.691394 0.006040] [ 0.000000] Linux version 6.18.38 (br@9f842b185103) (arm-linux-gcc.br_real (Buildroot 2021.11-18033-g83947c7bb6) 14.3.0, GNU ld (GNU Binutils) 2.43.1) #1 SMP Mon Oct 26 08:48:41 UTC 2026 +[5.704529 0.013135] [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d +[5.712569 0.008040] [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache +[5.718681 0.006112] [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black +[5.724126 0.005444] [ 0.000000] Memory policy: Data cache writeback +[5.732558 0.008432] [ 0.000000] cma: Reserved 16 MiB at 0x9e800000 +[5.735228 0.002670] [ 0.000000] Zone ranges: +[5.737660 0.002432] [ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff] +[5.743641 0.005981] [ 0.000000] HighMem empty +[5.746724 0.003083] [ 0.000000] Movable zone start for each node +[5.749207 0.002483] [ 0.000000] Early memory node ranges +[5.754863 0.005656] [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff] +[5.760471 0.005608] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff] +[5.767819 0.007348] [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges +[5.774024 0.006205] [ 0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT +[5.780192 0.006168] [ 0.000000] CPU: All CPU(s) started in SVC mode. +[5.785504 0.005312] [ 0.000000] AM335X ES2.1 (sgx neon) +[5.788825 0.003321] [ 0.000000] percpu: Embedded 17 pages/cpu s40396 r8192 d21044 u69632 +[5.794399 0.005574] [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait +[5.804958 0.010558] [ 0.000000] printk: log buffer data + meta data: 65536 + 204800 = 270336 bytes +[5.811110 0.006152] [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) +[5.819381 0.008271] [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) +[5.827451 0.008070] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130560 +[5.834849 0.007398] [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off +[5.841531 0.006681] [ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[5.847536 0.006006] [ 0.000000] rcu: Hierarchical RCU implementation. +[5.852639 0.005103] [ 0.000000] rcu: RCU event tracing is enabled. +[5.856145 0.003506] [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. +[5.863788 0.007643] [ 0.000000] Tracing variant of Tasks RCU enabled. +[5.869313 0.005525] [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. +[5.875080 0.005766] [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 +[5.883399 0.008319] [ 0.000000] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1. +[5.891905 0.008506] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 +[5.899642 0.007737] [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts +[5.905569 0.005927] [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[5.912259 0.006690] [ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000 +[5.922619 0.010360] [ 0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns +[5.928369 0.005749] [ 0.000027] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns +[5.939600 0.011231] [ 0.000483] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000 +[5.948094 0.008494] [ 0.001931] Console: colour dummy device 80x30 +[5.953348 0.005253] [ 0.002031] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736) +[5.959028 0.005680] [ 0.090527] CPU: Testing write buffer coherency: ok +[5.965774 0.006746] [ 0.090637] CPU0: Spectre v2: using BPIALL workaround +[5.970155 0.004382] [ 0.090648] pid_max: default: 32768 minimum: 301 +[5.973230 0.003074] [ 0.090827] LSM: initializing lsm=capability +[5.979830 0.006600] [ 0.090989] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[5.984382 0.004553] [ 0.091009] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[5.992909 0.008527] [ 0.092638] CPU0: thread -1, cpu 0, socket -1, mpidr 0 +[5.998343 0.005433] [ 0.092697] cacheinfo: Unable to detect cache hierarchy for CPU 0 +[6.003943 0.005600] [ 0.094728] Setting up static identity map for 0x80100000 - 0x80100078 +[6.012185 0.008242] [ 0.095061] rcu: Hierarchical SRCU implementation. +[6.015358 0.003173] [ 0.095071] rcu: Max phase no-delay instances is 1000. +[6.021157 0.005799] [ 0.096125] smp: Bringing up secondary CPUs ... +[6.026218 0.005061] [ 0.096171] smp: Brought up 1 node, 1 CPU +[6.029413 0.003195] [ 0.096184] SMP: Total of 1 processors activated (996.14 BogoMIPS). +[6.034825 0.005412] [ 0.096196] CPU: All CPU(s) started in SVC mode. +[6.040349 0.005523] [ 0.096442] Memory: 480868K/522240K available (11264K kernel code, 1171K rwdata, 2832K rodata, 1024K init, 255K bss, 23220K reserved, 16384K cma-reserved, 0K highmem) +[6.059596 0.019248] [ 0.097267] devtmpfs: initialized +[6.060208 0.000612] [ 0.112821] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 +[6.066294 0.006086] [ 0.113489] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns +[6.076578 0.010284] [ 0.113548] posixtimers hash table entries: 512 (order: 0, 4096 bytes, linear) +[6.084706 0.008128] [ 0.113574] futex hash table entries: 256 (16384 bytes on 1 NUMA nodes, total 16 KiB, linear). +[6.093282 0.008576] [ 0.114707] pinctrl core: initialized pinctrl subsystem +[6.096681 0.003399] [ 0.116811] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[6.104508 0.007827] [ 0.119666] DMA: preallocated 256 KiB pool for atomic coherent allocations +[6.110497 0.005989] [ 0.120269] audit: initializing netlink subsys (disabled) +[6.116248 0.005750] [ 0.121873] thermal_sys: Registered thermal governor 'fair_share' +[6.121681 0.005433] [ 0.121889] thermal_sys: Registered thermal governor 'step_wise' +[6.127324 0.005643] [ 0.121899] thermal_sys: Registered thermal governor 'user_space' +[6.135519 0.008195] [ 0.122013] audit: type=2000 audit(0.120:1): state=initialized audit_enabled=0 res=1 +[6.141146 0.005626] [ 0.122083] cpuidle: using governor menu +[6.146606 0.005461] [ 0.143341] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.163502 0.016896] [ 0.144308] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.182178 0.018675] [ 0.146388] No ATAGs? +[6.183169 0.000991] [ 0.146425] hw-breakpoint: debug architecture 0x4 unsupported. +[6.188654 0.005485] [ 0.149141] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[6.197290 0.008636] [ 0.153879] iommu: Default domain type: Translated +[6.202474 0.005184] [ 0.153903] iommu: DMA domain TLB invalidation policy: strict mode +[6.211097 0.008622] [ 0.162075] SCSI subsystem initialized +[6.212427 0.001330] [ 0.162931] pps_core: LinuxPPS API ver. 1 registered +[6.216870 0.004443] [ 0.162944] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[6.225514 0.008645] [ 0.162969] PTP clock support registered +[6.230385 0.004870] [ 0.170887] vgaarb: loaded +[6.233354 0.002970] [ 0.171267] clocksource: Switched to clocksource dmtimer +[6.238662 0.005308] [ 0.171970] VFS: Disk quotas dquot_6.6.0 +[6.243300 0.004639] [ 0.172031] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) +[6.249834 0.006533] [ 0.202508] NET: Registered PF_INET protocol family +[6.253047 0.003213] [ 0.202849] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) +[6.261329 0.008282] [ 0.204295] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) +[6.269846 0.008517] [ 0.204334] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[6.279482 0.009636] [ 0.204352] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) +[6.284070 0.004588] [ 0.204398] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) +[6.292314 0.008244] [ 0.204499] TCP: Hash tables configured (established 4096 bind 4096) +[6.298148 0.005833] [ 0.204621] UDP hash table entries: 256 (order: 2, 14336 bytes, linear) +[6.306172 0.008024] [ 0.204658] UDP-Lite hash table entries: 256 (order: 2, 14336 bytes, linear) +[6.314571 0.008399] [ 0.204860] NET: Registered PF_UNIX/PF_LOCAL protocol family +[6.317807 0.003236] [ 0.206165] RPC: Registered named UNIX socket transport module. +[6.323788 0.005981] [ 0.206185] RPC: Registered udp transport module. +[6.328774 0.004987] [ 0.206191] RPC: Registered tcp transport module. +[6.334087 0.005313] [ 0.206196] RPC: Registered tcp-with-tls transport module. +[6.339542 0.005455] [ 0.206201] RPC: Registered tcp NFSv4.1 backchannel transport module. +[6.345706 0.006164] [ 0.206228] PCI: CLS 0 bytes, default 64 +[6.348439 0.002733] [ 0.207628] Initialise system trusted keyrings +[6.353793 0.005354] [ 0.208800] workingset: timestamp_bits=14 max_order=17 bucket_order=3 +[6.359720 0.005927] [ 0.210238] NFS: Registering the id_resolver key type +[6.365276 0.005556] [ 0.210317] Key type id_resolver registered +[6.370480 0.005203] [ 0.210325] Key type id_legacy registered +[6.373325 0.002846] [ 0.210435] jffs2: version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc. +[6.381795 0.008470] [ 0.212003] Key type asymmetric registered +[6.384582 0.002787] [ 0.212026] Asymmetric key parser 'x509' registered +[6.390062 0.005480] [ 0.212096] io scheduler mq-deadline registered +[6.393369 0.003308] [ 0.212113] io scheduler kyber registered +[6.398402 0.005032] [ 0.212197] io scheduler bfq registered +[6.401912 0.003510] [ 0.214040] target-module@4b000000:target-module@140000:pmu@0:fck: device ID is greater than 24 +[6.411247 0.009335] [ 0.221489] ledtrig-cpu: registered to indicate activity on CPUs +[6.417879 0.006633] [ 0.232247] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled +[6.423866 0.005986] [ 0.279652] brd: module loaded +[6.426591 0.002725] [ 0.292117] loop: module loaded +[6.429526 0.002935] [ 0.293117] mtdoops: mtd device (mtddev=name/number) must be supplied +[6.436488 0.006963] [ 0.296206] i2c_dev: i2c /dev entries driver +[6.440472 0.003984] [ 0.297204] cpuidle: enable-method property 'ti,am3352' found operations +[6.447864 0.007392] [ 0.297657] sdhci: Secure Digital Host Controller Interface driver +[6.452186 0.004323] [ 0.297668] sdhci: Copyright(c) Pierre Ossman +[6.457536 0.005349] [ 0.297849] sdhci-pltfm: SDHCI platform and OF driver helper +[6.463081 0.005545] [ 0.314966] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 (8000000f) counters available +[6.471789 0.008708] [ 0.315529] Initializing XFRM netlink socket +[6.477136 0.005347] [ 0.315709] NET: Registered PF_INET6 protocol family +[6.482289 0.005153] [ 0.317750] Segment Routing with IPv6 +[6.485743 0.003454] [ 0.317839] In-situ OAM (IOAM) with IPv6 +[6.488447 0.002704] [ 0.317938] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver +[6.494117 0.005671] [ 0.318898] NET: Registered PF_PACKET protocol family +[6.499623 0.005506] [ 0.318928] NET: Registered PF_KEY protocol family +[6.505075 0.005451] [ 0.319043] Key type dns_resolver registered +[6.510203 0.005128] [ 0.319255] ThumbEE CPU extension supported. +[6.514125 0.003922] [ 0.319277] Registering SWP/SWPB emulation handler +[6.518783 0.004658] [ 0.319731] omap_voltage_late_init: Voltage driver support not added +[6.526321 0.007538] [ 0.320361] SmartReflex Class3 initialized +[6.529836 0.003515] [ 0.351620] Loading compiled-in X.509 certificates +[6.533336 0.003500] [ 0.395962] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.550873 0.017537] [ 0.402149] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.567034 0.016162] [ 0.442414] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.585916 0.018881] [ 0.443319] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.602659 0.016743] [ 0.446748] /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins +[6.621278 0.018619] [ 0.447341] pinctrl-single 44e10800.pinmux: 142 pins, size 568 +[6.627977 0.006698] [ 0.479275] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.644576 0.016599] [ 0.525398] OMAP GPIO hardware version 0.1 +[6.647705 0.003129] [ 0.560473] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz +[6.655502 0.007797] [ 0.594278] 48000000.interconnect:segment@200000:target-module@0:mpu@0:fck: device ID is greater than 24 +[6.665273 0.009771] [ 0.595197] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.681093 0.015820] [ 0.597934] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.697855 0.016763] [ 0.598613] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.714835 0.016980] [ 0.598787] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.731515 0.016680] [ 0.606448] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[6.739864 0.008348] [ 0.606937] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[6.746264 0.006400] [ 0.688894] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 +[6.753970 0.007707] [ 0.836615] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 +[6.764286 0.010316] [ 0.837220] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4 +[6.770559 0.006273] [ 0.837242] cpsw-switch 4a100000.switch: ALE Table size 1024, Policers 0 +[6.776633 0.006074] [ 0.837422] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies) +[6.784793 0.008161] [ 0.837441] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec +[6.795821 0.011027] [ 0.837543] cpsw-switch 4a100000.switch: Detected MACID = 00:35:ff:9a:3f:14 +[6.801930 0.006110] [ 0.839403] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0) +[6.812666 0.010735] [ 0.850603] debugfs: '49000000.dma' already exists in 'dmaengine' +[6.818542 0.005877] [ 0.850649] edma 49000000.dma: TI EDMA DMA engine driver +[6.824414 0.005872] [ 0.887778] ti-sysc 44e31000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@44c00000/segment@200000/target-module@31000/timer@0 +[6.840830 0.016416] [ 0.887835] ti-sysc 48040000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@48000000/segment@0/target-module@40000/timer@0 +[6.854666 0.013836] [ 0.917442] printk: legacy console [ttyS0] disabled +[6.860177 0.005511] [ 0.918387] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 34, base_baud = 3000000) is a 8250 +[6.868599 0.008423] [ 0.918475] printk: legacy console [ttyS0] enabled +[7.188191 0.319592] [ 2.422224] tps65217-pmic: Failed to locate of_node [id: -1] +[7.194198 0.006007] [ 2.428315] tps65217-bl: Failed to locate of_node [id: -1] +[7.203727 0.009528] [ 2.435794] platform tps65217-charger: DMA mask not set +[7.209246 0.005519] [ 2.443191] platform tps65217-pwrbutton: DMA mask not set +[7.216702 0.007456] [ 2.450574] tps65217 0-0024: TPS65217 ID 0xe version 1.2 +[7.221012 0.004310] [ 2.456680] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[7.240232 0.019220] [ 2.474091] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[7.256995 0.016763] [ 2.491482] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz +[7.265302 0.008307] [ 2.499427] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) +[7.275559 0.010256] [ 2.508310] sdhci-omap 48060000.mmc: Got CD GPIO +[7.277136 0.001577] [ 2.513353] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator +[7.289234 0.012098] [ 2.523515] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator +[7.296660 0.007426] [ 2.532138] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[7.305128 0.008468] [ 2.540130] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[7.321868 0.016740] [ 2.556098] clk: Disabling unused clocks +[7.325013 0.003145] [ 2.560279] PM: genpd: Disabling unused power domains +[7.333806 0.008793] [ 2.567763] check access for rdinit=/init failed: -2, ignoring +[7.345769 0.011963] [ 2.579527] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA +[7.352966 0.007197] [ 2.588660] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA +[7.362405 0.009439] [ 2.597546] Waiting for root device /dev/mmcblk0p2... +[7.406339 0.043935] [ 2.640418] mmc0: new high speed SDXC card at address 0001 +[7.410944 0.004605] [ 2.647389] mmcblk0: mmc0:0001 SD16G 58.7 GiB +[7.420886 0.009942] [ 2.655201] mmcblk0: p1 p2 +[7.461868 0.040982] [ 2.695767] mmc1: new high speed MMC card at address 0001 +[7.466854 0.004986] [ 2.703011] mmcblk1: mmc1:0001 M62704 3.56 GiB +[7.478426 0.011572] [ 2.711486] mmcblk1: p1 +[7.479002 0.000576] [ 2.715225] mmcblk1boot0: mmc1:0001 M62704 2.00 MiB +[7.499480 0.020479] [ 2.733684] mmcblk1boot1: mmc1:0001 M62704 2.00 MiB +[7.509926 0.010445] [ 2.744162] mmcblk1rpmb: mmc1:0001 M62704 512 KiB, chardev (249:0) +[7.620991 0.111065] [ 2.854351] EXT4-fs (mmcblk0p2): recovery complete +[7.627756 0.006766] [ 2.861210] EXT4-fs (mmcblk0p2): mounted filesystem 3b9f6655-d935-48f0-a7b6-8126f50010fb r/w with ordered data mode. Quota mode: none. +[7.638976 0.011220] [ 2.873659] VFS: Mounted root (ext4 filesystem) on device 179:2. +[7.646043 0.007067] [ 2.881153] devtmpfs: mounted +[7.651829 0.005786] [ 2.885983] Freeing unused kernel image (initmem) memory: 1024K +[7.657787 0.005957] [ 2.892651] Run /sbin/init as init process +[7.827411 0.169624] [ 3.061377] EXT4-fs (mmcblk0p2): re-mounted 3b9f6655-d935-48f0-a7b6-8126f50010fb. +[7.967943 0.140532] Seeding 256 bits without crediting +[7.970849 0.002906] Saving 256 bits of non-creditable seed for next boot +[7.980868 0.010019] Starting syslogd: OK +[8.003979 0.023110] Starting klogd: OK +[8.033961 0.029983] Running sysctl: OK +[8.115439 0.081478] Starting mdev... OK +[9.442613 1.327174] [ 4.676780] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 +[9.459845 0.017231] [ 4.694064] omap-aes 53500000.aes: will run requests pump with realtime priority +[9.513191 0.053347] [ 4.747574] remoteproc remoteproc0: wkup_m3 is available +[9.590468 0.077277] [ 4.824798] at24 2-0054: supply vcc not found, using dummy regulator +[9.629316 0.038848] [ 4.863672] at24 2-0055: supply vcc not found, using dummy regulator +[9.660093 0.030777] [ 4.894373] at24 2-0056: supply vcc not found, using dummy regulator +[9.690498 0.030405] [ 4.924911] at24 2-0057: supply vcc not found, using dummy regulator +[9.733036 0.042538] [ 4.967488] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write +[10.030465 0.297429] [ 5.263120] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 +[10.290444 0.259979] [ 5.524601] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +[10.355381 0.064937] [ 5.589634] omap_rng 48310000.rng: Random Number Generator ver. 20 +[10.367255 0.011874] [ 5.597770] random: crng init done +[10.390221 0.022966] [ 5.624417] omap_rtc 44e3e000.rtc: registered as rtc0 +[10.393366 0.003145] [ 5.629614] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[10.464815 0.071449] [ 5.699016] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 +[10.470785 0.005970] [ 5.705440] omap-sham 53100000.sham: will run requests pump with realtime priority +[10.720561 0.249776] [ 5.953979] tda998x 0-0070: found TDA19988 +[10.741725 0.021164] [ 5.973574] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops [tda998x]) +[10.755760 0.014035] [ 5.987596] [drm] Initialized tilcdc 1.0.0 for 4830e000.lcdc on minor 0 +[10.765177 0.009418] [ 5.997200] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[10.772748 0.007571] [ 6.007040] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[10.779574 0.006826] [ 6.013891] gpio-537 (nxp,calib): gpiod_direction_output_nonotify: tried to set a GPIO tied to an IRQ as output +[10.821756 0.042181] [ 6.056122] tda9950 0-0034: TDA9950 CEC interface, hardware version 3.3 +[10.849122 0.027366] [ 6.083572] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[10.880104 0.030982] [ 6.114568] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[10.974646 0.094542] [ 6.208025] usbcore: registered new interface driver usbfs +[10.980591 0.005945] [ 6.213892] usbcore: registered new interface driver hub +[10.982826 0.002235] [ 6.219350] usbcore: registered new device driver usb +[11.087779 0.104954] [ 6.321497] musb-hdrc musb-hdrc.1: MUSB HDRC host driver +[11.093493 0.005714] [ 6.326921] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 +[11.115874 0.022381] [ 6.350268] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18 +[11.122346 0.006472] [ 6.358819] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 +[11.130437 0.008090] [ 6.366159] usb usb1: Product: MUSB HDRC host driver +[11.135840 0.005404] [ 6.371156] usb usb1: Manufacturer: Linux 6.18.38 musb-hcd +[11.141620 0.005780] [ 6.376711] usb usb1: SerialNumber: musb-hdrc.1 +[11.149486 0.007865] [ 6.384002] hub 1-0:1.0: USB hub found +[11.167206 0.017721] [ 6.401646] hub 1-0:1.0: 1 port detected +[11.197494 0.030288] [ 6.431542] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[11.228645 0.031150] [ 6.463128] remoteproc remoteproc0: powering up wkup_m3 +[11.266784 0.038140] [ 6.501113] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 118004 +[11.273631 0.006846] [ 6.509796] remoteproc remoteproc0: remote processor wkup_m3 is now up +[11.281385 0.007754] [ 6.509825] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 +[11.292227 0.010842] [ 6.526642] PM: Cannot get wkup_m3_ipc handle +[11.362203 0.069976] Starting network: OK +[11.444775 0.082572] Starting crond: OK +[11.573126 0.128351] +[11.575560 0.002434] OTA embedded Linux beaglebone-black /dev/console +[11.582497 0.006937] +[11.582524 0.000027] beaglebone-black login: [ 17.124304] PM: bootloader does not support rtc-only! diff --git a/docs/logs/boot-baseline-run2.log b/docs/logs/boot-baseline-run2.log new file mode 100644 index 0000000..ea7a33d --- /dev/null +++ b/docs/logs/boot-baseline-run2.log @@ -0,0 +1,300 @@ +[0.000004 0.000004] +[0.001616 0.001612] U-Boot SPL 2026.07 (Oct 26 2026 - 08:28:14 +0000) +[0.005164 0.005164] Trying to boot from MMC1 +[0.664359 0.659195] +[0.664583 0.000224] +[0.664659 0.000077] U-Boot 2026.07 (Oct 26 2026 - 08:28:14 +0000) +[0.668258 0.003598] +[0.668330 0.000072] CPU : AM335X-GP rev 2.1 +[0.670444 0.002115] Model: TI AM335x BeagleBone Black +[0.673111 0.002667] DRAM: 512 MiB +[0.753393 0.080281] Core: 164 devices, 19 uclasses, devicetree: separate +[0.767732 0.014339] WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) +[0.773834 0.006103] NAND: 0 MiB +[1.174920 0.401086] MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 +[1.190150 0.015230] Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... +[1.293095 0.102945] not set. Validating first E-fuse MAC +[1.297637 0.004543] Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in +[1.326750 0.029113] MAC de:ad:be:ef:00:01 +[1.329676 0.002926] HOST MAC de:ad:be:ef:00:00 +[1.331849 0.002173] RNDIS ready +[1.335814 0.003965] , eth3: usb_ether +[1.339673 0.003859] Hit any key to stop autoboot: 2Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0 +[3.418009 2.078336] switch to partitions #0, OK +[3.418385 0.000376] mmc0 is current device +[3.426883 0.008498] Scanning mmc 0:1... +[3.427197 0.000314] Found /extlinux/extlinux.conf +[3.429841 0.002644] Retrieving file: /extlinux/extlinux.conf +[3.437121 0.007280] 1: beaglebone-buildroot +[3.437575 0.000453] Retrieving file: /zImage +[3.929949 0.492374] append: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait +[3.935931 0.005982] Retrieving file: /am335x-boneblack.dtb +[3.953455 0.017524] Kernel image @ 0x82000000 [ 0x000000 - 0x749870 ] +[3.957985 0.004529] ## Flattened Device Tree blob at 88000000 +[3.960697 0.002712] Booting using the fdt blob at 0x88000000 +[3.966749 0.006052] Working FDT set to 88000000 +[3.969836 0.003087] Loading Device Tree to 8ffeb000, end 8ffff2fb ... OK +[3.978148 0.008312] Working FDT set to 8ffeb000 +[3.990450 0.012302] +[3.990579 0.000129] Starting kernel ... +[3.990952 0.000373] +[5.638345 1.647393] [ 0.000000] Booting Linux on physical CPU 0x0 +[5.647381 0.009037] [ 0.000000] Linux version 6.18.38 (br@9f842b185103) (arm-linux-gcc.br_real (Buildroot 2021.11-18033-g83947c7bb6) 14.3.0, GNU ld (GNU Binutils) 2.43.1) #1 SMP Mon Oct 26 08:48:41 UTC 2026 +[5.657701 0.010320] [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d +[5.677481 0.019780] [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache +[5.679377 0.001895] [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black +[5.680060 0.000684] [ cy: Data cache writeback +[5.682024 0.001964] [ 0.000000] cma: Reserved 16 MiB at 0x9e800000 +[5.691451 0.009427] [ 0.000000] Zone ranges: +[5.691965 0.000514] [ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff] +[5.695557 0.003592] [ 0.000000] HighMem empty +[5.698611 0.003055] [ 0.000000] Movable zone start for each node +[5.703622 0.005011] [ 0.000000] Early memory node ranges +[5.706692 0.003070] [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff] +[5.712368 0.005676] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff] +[5.720612 0.008244] [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges +[5.726333 0.005721] [ 0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT +[5.734528 0.008194] [ 0.000000] CPU: All CPU(s) started in SVC mode. +[5.737644 0.003117] [ 0.000000] AM335X ES2.1 (sgx neon) +[5.740680 0.003035] [ 0.000000] percpu: Embedded 17 pages/cpu s40396 r8192 d21044 u69632 +[5.748758 0.008079] [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait +[5.757150 0.008392] [ 0.000000] printk: log buffer data + meta data: 65536 + 204800 = 270336 bytes +[5.765546 0.008396] [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) +[5.771562 0.006016] [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) +[5.779789 0.008227] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130560 +[5.787758 0.007969] [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off +[5.793407 0.005649] [ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[5.799408 0.006001] [ 0.000000] rcu: Hierarchical RCU implementation. +[5.804662 0.005255] [ 0.000000] rcu: RCU event tracing is enabled. +[5.810579 0.005917] [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. +[5.816318 0.005739] [ 0.000000] Tracing variant of Tasks RCU enabled. +[5.821414 0.005096] [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. +[5.830777 0.009363] [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 +[5.835610 0.004833] [ 0.000000] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1. +[5.844827 0.009217] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 +[5.850666 0.005840] [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts +[5.857952 0.007286] [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[5.863783 0.005831] [ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000 +[5.874621 0.010838] [ 0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns +[5.883254 0.008633] [ 0.000026] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns +[5.892185 0.008931] [ 0.000479] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000 +[5.900610 0.008425] [ 0.001924] Console: colour dummy device 80x30 +[5.905482 0.004873] [ 0.002024] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736) +[5.911395 0.005912] [ 0.090588] CPU: Testing write buffer coherency: ok +[5.917069 0.005674] [ 0.090676] CPU0: Spectre v2: using BPIALL workaround +[5.922184 0.005115] [ 0.090687] pid_max: default: 32768 minimum: 301 +[5.928978 0.006794] [ 0.090866] LSM: initializing lsm=capability +[5.930708 0.001730] [ 0.091019] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[5.939378 0.008670] [ 0.091041] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[5.947058 0.007680] [ 0.092649] CPU0: thread -1, cpu 0, socket -1, mpidr 0 +[5.950751 0.003693] [ 0.092708] cacheinfo: Unable to detect cache hierarchy for CPU 0 +[5.956075 0.005324] [ 0.094738] Setting up static identity map for 0x80100000 - 0x80100078 +[5.964329 0.008255] [ 0.095064] rcu: Hierarchical SRCU implementation. +[5.969833 0.005504] [ 0.095074] rcu: Max phase no-delay instances is 1000. +[5.973186 0.003353] [ 0.096117] smp: Bringing up secondary CPUs ... +[5.979508 0.006322] [ 0.096162] smp: Brought up 1 node, 1 CPU +[5.981524 0.002016] [ 0.096172] SMP: Total of 1 processors activated (996.14 BogoMIPS). +[5.990404 0.008880] [ 0.096183] CPU: All CPU(s) started in SVC mode. +[5.992544 0.002140] [ 0.096429] Memory: 480868K/522240K available (11264K kernel code, 1171K rwdata, 2832K rodata, 1024K init, 255K bss, 23220K reserved, 16384K cma-reserved, 0K highmem) +[6.008931 0.016387] [ 0.097234] devtmpfs: initialized +[6.012122 0.003191] [ 0.112763] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 +[6.022040 0.009917] [ 0.113421] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns +[6.028759 0.006720] [ 0.113478] posixtimers hash table entries: 512 (order: 0, 4096 bytes, linear) +[6.036881 0.008122] [ 0.113504] futex hash table entries: 256 (16384 bytes on 1 NUMA nodes, total 16 KiB, linear). +[6.045452 0.008571] [ 0.114624] pinctrl core: initialized pinctrl subsystem +[6.050941 0.005489] [ 0.116732] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[6.056661 0.005720] [ 0.119573] DMA: preallocated 256 KiB pool for atomic coherent allocations +[6.062603 0.005942] [ 0.120179] audit: initializing netlink subsys (disabled) +[6.067936 0.005333] [ 0.121765] thermal_sys: Registered thermal governor 'fair_share' +[6.073915 0.005979] [ 0.121781] thermal_sys: Registered thermal governor 'step_wise' +[6.082171 0.008256] [ 0.121793] thermal_sys: Registered thermal governor 'user_space' +[6.088316 0.006145] [ 0.121907] audit: type=2000 audit(0.120:1): state=initialized audit_enabled=0 res=1 +[6.095670 0.007354] [ 0.121978] cpuidle: using governor menu +[6.099188 0.003518] [ 0.143232] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.115503 0.016314] [ 0.144199] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.133131 0.017629] [ 0.146271] No ATAGs? +[6.135025 0.001894] [ 0.146308] hw-breakpoint: debug architecture 0x4 unsupported. +[6.140711 0.005686] [ 0.149010] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[6.149130 0.008419] [ 0.153850] iommu: Default domain type: Translated +[6.154790 0.005660] [ 0.153872] iommu: DMA domain TLB invalidation policy: strict mode +[6.160444 0.005654] [ 0.162415] SCSI subsystem initialized +[6.165640 0.005196] [ 0.163265] pps_core: LinuxPPS API ver. 1 registered +[6.169465 0.003825] [ 0.163277] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[6.179851 0.010386] [ 0.163302] PTP clock support registered +[6.182877 0.003026] [ 0.171416] vgaarb: loaded +[6.185466 0.002589] [ 0.171778] clocksource: Switched to clocksource dmtimer +[6.190859 0.005393] [ 0.172471] VFS: Disk quotas dquot_6.6.0 +[6.194165 0.003306] [ 0.172532] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) +[6.202639 0.008474] [ 0.195333] NET: Registered PF_INET protocol family +[6.207676 0.005037] [ 0.195675] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) +[6.213850 0.006174] [ 0.197140] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) +[6.221830 0.007981] [ 0.197182] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[6.230134 0.008303] [ 0.197201] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) +[6.238548 0.008415] [ 0.197246] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) +[6.244411 0.005863] [ 0.197346] TCP: Hash tables configured (established 4096 bind 4096) +[6.252280 0.007870] [ 0.197472] UDP hash table entries: 256 (order: 2, 14336 bytes, linear) +[6.259065 0.006784] [ 0.197509] UDP-Lite hash table entries: 256 (order: 2, 14336 bytes, linear) +[6.264171 0.005106] [ 0.197721] NET: Registered PF_UNIX/PF_LOCAL protocol family +[6.270728 0.006557] [ 0.202936] RPC: Registered named UNIX socket transport module. +[6.277813 0.007085] [ 0.202960] RPC: Registered udp transport module. +[6.281338 0.003525] [ 0.202966] RPC: Registered tcp transport module. +[6.286419 0.005081] [ 0.202971] RPC: Registered tcp-with-tls transport module. +[6.291922 0.005504] [ 0.202976] RPC: Registered tcp NFSv4.1 backchannel transport module. +[6.297950 0.006028] [ 0.203002] PCI: CLS 0 bytes, default 64 +[6.304342 0.006392] [ 0.204416] Initialise system trusted keyrings +[6.305913 0.001571] [ 0.212525] workingset: timestamp_bits=14 max_order=17 bucket_order=3 +[6.314728 0.008816] [ 0.213999] NFS: Registering the id_resolver key type +[6.317320 0.002591] [ 0.214068] Key type id_resolver registered +[6.322775 0.005455] [ 0.214078] Key type id_legacy registered +[6.325987 0.003212] [ 0.214186] jffs2: version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc. +[6.335012 0.009025] [ 0.214672] Key type asymmetric registered +[6.337060 0.002048] [ 0.214690] Asymmetric key parser 'x509' registered +[6.342227 0.005167] [ 0.214758] io scheduler mq-deadline registered +[6.347793 0.005566] [ 0.214773] io scheduler kyber registered +[6.350728 0.002935] [ 0.214858] io scheduler bfq registered +[6.357444 0.006716] [ 0.216726] target-module@4b000000:target-module@140000:pmu@0:fck: device ID is greater than 24 +[6.366180 0.008737] [ 0.222233] ledtrig-cpu: registered to indicate activity on CPUs +[6.370800 0.004619] [ 0.232667] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled +[6.375903 0.005103] [ 0.268812] brd: module loaded +[6.378659 0.002756] [ 0.287983] loop: module loaded +[6.381618 0.002959] [ 0.288971] mtdoops: mtd device (mtddev=name/number) must be supplied +[6.389696 0.008079] [ 0.292206] i2c_dev: i2c /dev entries driver +[6.393823 0.004127] [ 0.293214] cpuidle: enable-method property 'ti,am3352' found operations +[6.400869 0.007046] [ 0.293665] sdhci: Secure Digital Host Controller Interface driver +[6.408477 0.007608] [ 0.293675] sdhci: Copyright(c) Pierre Ossman +[6.409504 0.001027] [ 0.293860] sdhci-pltfm: SDHCI platform and OF driver helper +[6.415159 0.005655] [ 0.302170] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 (8000000f) counters available +[6.426333 0.011174] [ 0.302726] Initializing XFRM netlink socket +[6.429145 0.002811] [ 0.302902] NET: Registered PF_INET6 protocol family +[6.437019 0.007874] [ 0.304898] Segment Routing with IPv6 +[6.437940 0.000921] [ 0.304981] In-situ OAM (IOAM) with IPv6 +[6.442725 0.004785] [ 0.305077] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver +[6.448490 0.005765] [ 0.306040] NET: Registered PF_PACKET protocol family +[6.453953 0.005463] [ 0.306070] NET: Registered PF_KEY protocol family +[6.457070 0.003117] [ 0.306195] Key type dns_resolver registered +[6.462507 0.005437] [ 0.306404] ThumbEE CPU extension supported. +[6.465553 0.003046] [ 0.306428] Registering SWP/SWPB emulation handler +[6.471220 0.005667] [ 0.306879] omap_voltage_late_init: Voltage driver support not added +[6.476701 0.005481] [ 0.307508] SmartReflex Class3 initialized +[6.482169 0.005468] [ 0.343484] Loading compiled-in X.509 certificates +[6.487543 0.005374] [ 0.373745] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.504355 0.016813] [ 0.379747] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.522287 0.017932] [ 0.421940] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.538031 0.015743] [ 0.422882] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.554780 0.016750] [ 0.426320] /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins +[6.575177 0.020397] [ 0.426911] pinctrl-single 44e10800.pinmux: 142 pins, size 568 +[6.579953 0.004776] [ 0.467950] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.597184 0.017231] [ 0.512619] OMAP GPIO hardware version 0.1 +[6.600137 0.002953] [ 0.526531] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz +[6.605563 0.005426] [ 0.563251] 48000000.interconnect:segment@200000:target-module@0:mpu@0:fck: device ID is greater than 24 +[6.616753 0.011190] [ 0.564178] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.633376 0.016623] [ 0.566956] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.650854 0.017478] [ 0.567645] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.667233 0.016379] [ 0.567815] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.683967 0.016734] [ 0.575672] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[6.691977 0.008010] [ 0.576153] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[6.701953 0.009977] [ 0.667226] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 +[6.706596 0.004643] [ 0.823974] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 +[6.716862 0.010266] [ 0.824605] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4 +[6.723577 0.006716] [ 0.824626] cpsw-switch 4a100000.switch: ALE Table size 1024, Policers 0 +[6.728496 0.004919] [ 0.824794] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies) +[6.737160 0.008664] [ 0.824811] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec +[6.748305 0.011145] [ 0.824912] cpsw-switch 4a100000.switch: Detected MACID = 00:35:ff:9a:3f:14 +[6.758332 0.010027] [ 0.826747] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0) +[6.765342 0.007010] [ 0.837769] debugfs: '49000000.dma' already exists in 'dmaengine' +[6.771157 0.005815] [ 0.837813] edma 49000000.dma: TI EDMA DMA engine driver +[6.776356 0.005199] [ 0.865677] ti-sysc 44e31000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@44c00000/segment@200000/target-module@31000/timer@0 +[6.792624 0.016268] [ 0.865736] ti-sysc 48040000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@48000000/segment@0/target-module@40000/timer@0 +[6.806748 0.014124] [ 0.873061] printk: legacy console [ttyS0] disabled +[6.812696 0.005949] [ 0.873996] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 34, base_baud = 3000000) is a 8250 +[6.820862 0.008165] [ 0.874084] printk: legacy console [ttyS0] enabled +[7.196614 0.375752] [ 2.422725] tps65217-pmic: Failed to locate of_node [id: -1] +[7.201596 0.004982] [ 2.428811] tps65217-bl: Failed to locate of_node [id: -1] +[7.204312 0.002716] 2.436224] platform tps65217-charger: DMA mask not set +[7.206845 0.002533] [ 2.443587] platform tps65217-pwrbutton: DMA mask not set +[7.214007 0.007162] [ 2.450980] tps65217 0-0024: TPS65217 ID 0xe version 1.2 +[7.218040 0.004033] [ 2.457084] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[7.237355 0.019315] [ 2.474490] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[7.254899 0.017544] [ 2.491884] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz +[7.263054 0.008155] [ 2.499826] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) +[7.271616 0.008562] [ 2.508723] sdhci-omap 48060000.mmc: Got CD GPIO +[7.274941 0.003324] [ 2.513751] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator +[7.286737 0.011797] [ 2.523882] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator +[7.294173 0.007435] [ 2.532291] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[7.303231 0.009059] [ 2.540279] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[7.319644 0.016413] [ 2.556465] clk: Disabling unused clocks +[7.322933 0.003289] [ 2.560644] PM: genpd: Disabling unused power domains +[7.331423 0.008490] [ 2.568185] check access for rdinit=/init failed: -2, ignoring +[7.343666 0.012243] [ 2.580770] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA +[7.350582 0.006916] [ 2.589073] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA +[7.359690 0.009109] [ 2.597840] Waiting for root device /dev/mmcblk0p2... +[7.405740 0.046050] [ 2.642735] mmc0: new high speed SDXC card at address 0001 +[7.410599 0.004858] [ 2.649624] mmcblk0: mmc0:0001 SD16G 58.7 GiB +[7.421214 0.010615] [ 2.657496] mmcblk0: p1 p2 +[7.447849 0.026635] [ 2.684277] EXT4-fs (mmcblk0p2): recovery complete +[7.451013 0.003165] [ 2.689392] EXT4-fs (mmcblk0p2): mounted filesystem 3b9f6655-d935-48f0-a7b6-8126f50010fb r/w with ordered data mode. Quota mode: none. +[7.464880 0.013866] [ 2.701932] VFS: Mounted root (ext4 filesystem) on device 179:2. +[7.471985 0.007106] [ 2.709446] devtmpfs: mounted +[7.477324 0.005339] [ 2.714380] Freeing unused kernel image (initmem) memory: 1024K +[7.483848 0.006524] [ 2.720993] Run /sbin/init as init process +[7.493730 0.009882] [ 2.730636] mmc1: new high speed MMC card at address 0001 +[7.501258 0.007528] [ 2.738088] mmcblk1: mmc1:0001 M62704 3.56 GiB +[7.513527 0.012269] [ 2.747274] mmcblk1: p1 +[7.515240 0.001713] [ 2.751313] mmcblk1boot0: mmc1:0001 M62704 2.00 MiB +[7.539080 0.023841] [ 2.775822] mmcblk1boot1: mmc1:0001 M62704 2.00 MiB +[7.551747 0.012666] [ 2.788602] mmcblk1rpmb: mmc1:0001 M62704 512 KiB, chardev (249:0) +[7.684969 0.133222] [ 2.921927] EXT4-fs (mmcblk0p2): re-mounted 3b9f6655-d935-48f0-a7b6-8126f50010fb. +[7.817117 0.132148] Saving 256 bits of non-creditable seed for next boot +[7.829420 0.012303] Starting syslogd: OK +[7.853793 0.024373] Starting klogd: OK +[7.887276 0.033483] Running sysctl: OK +[7.961627 0.074351] Starting mdev... OK +[9.313792 1.352165] [ 4.550887] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 +[9.330394 0.016602] [ 4.567239] omap-aes 53500000.aes: will run requests pump with realtime priority +[9.374300 0.043906] [ 4.611425] remoteproc remoteproc0: wkup_m3 is available +[9.458645 0.084345] [ 4.695764] at24 2-0054: supply vcc not found, using dummy regulator +[9.497311 0.038666] [ 4.734188] at24 2-0055: supply vcc not found, using dummy regulator +[9.528008 0.030697] [ 4.764871] at24 2-0056: supply vcc not found, using dummy regulator +[9.558292 0.030284] [ 4.795369] at24 2-0057: supply vcc not found, using dummy regulator +[9.600809 0.042516] [ 4.837908] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write +[9.906753 0.305944] [ 5.142560] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 +[10.159541 0.252788] [ 5.395161] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +[10.222545 0.063004] [ 5.459603] omap_rng 48310000.rng: Random Number Generator ver. 20 +[10.230562 0.008017] [ 5.467729] random: crng init done +[10.266861 0.036299] [ 5.503731] omap_rtc 44e3e000.rtc: registered as rtc0 +[10.269726 0.002865] [ 5.508920] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[10.331887 0.062161] [ 5.568918] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 +[10.340067 0.008180] [ 5.575327] omap-sham 53100000.sham: will run requests pump with realtime priority +[10.577347 0.237280] [ 5.814500] tda998x 0-0070: found TDA19988 +[10.597011 0.019665] [ 5.834174] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops [tda998x]) +[10.610211 0.013200] [ 5.847417] [drm] Initialized tilcdc 1.0.0 for 4830e000.lcdc on minor 0 +[10.617464 0.007252] [ 5.855574] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[10.627267 0.009803] [ 5.864459] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[10.648782 0.021516] [ 5.885697] gpio-537 (nxp,calib): gpiod_direction_output_nonotify: tried to set a GPIO tied to an IRQ as output +[10.678053 0.029270] [ 5.915280] tda9950 0-0034: TDA9950 CEC interface, hardware version 3.3 +[10.710547 0.032495] [ 5.947729] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[10.746741 0.036193] [ 5.983911] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[10.834213 0.087472] [ 6.071447] usbcore: registered new interface driver usbfs +[10.837994 0.003781] [ 6.077309] usbcore: registered new interface driver hub +[10.843764 0.005769] [ 6.082909] usbcore: registered new device driver usb +[10.939962 0.096198] [ 6.177139] musb-hdrc musb-hdrc.1: MUSB HDRC host driver +[10.943274 0.003312] [ 6.182708] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 +[10.975178 0.031905] [ 6.212415] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18 +[10.981716 0.006538] [ 6.220780] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 +[10.989782 0.008065] [ 6.228183] usb usb1: Product: MUSB HDRC host driver +[10.995357 0.005575] [ 6.233231] usb usb1: Manufacturer: Linux 6.18.38 musb-hcd +[11.000957 0.005600] [ 6.238749] usb usb1: SerialNumber: musb-hdrc.1 +[11.009888 0.008931] [ 6.247053] hub 1-0:1.0: USB hub found +[11.024906 0.015018] [ 6.262113] hub 1-0:1.0: 1 port detected +[11.068269 0.043363] [ 6.305456] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[11.098702 0.030433] [ 6.335907] remoteproc remoteproc0: powering up wkup_m3 +[11.122586 0.023884] [ 6.359841] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 118004 +[11.128988 0.006402] [ 6.368431] remoteproc remoteproc0: remote processor wkup_m3 is now up +[11.138282 0.009295] [ 6.368460] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 +[11.161186 0.022904] [ 6.398305] PM: bootloader does not support rtc-only! +[11.236228 0.075042] Starting network: OK +[11.313957 0.077729] Starting crond: OK +[11.441061 0.127104] +[11.445282 0.004220] OTA embedded Linux beaglebone-black /dev/console +[11.449814 0.004532] +[11.449860 0.000046] beaglebone-black login: \ No newline at end of file diff --git a/docs/logs/boot-baseline-run3.log b/docs/logs/boot-baseline-run3.log new file mode 100644 index 0000000000000000000000000000000000000000..1cd71460eb0592c202c58d8ef2341959856893f5 GIT binary patch literal 26978 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 literal 0 HcmV?d00001 From 8a5e8629f267cd1c70bbd525f418d31a6e306d30 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Tue, 27 Oct 2026 18:36:46 +0700 Subject: [PATCH 02/61] specs: specify A/B atomic OTA updates with automatic rollback Add the Spec Kit artifacts for feature 002: two redundant OS slots, an update that only ever writes the slot that is not running, a slot that must prove itself healthy before it is recorded as good, and a bootloader that returns to the last good slot on its own when it does not. Six decisions are recorded in the spec rather than left to the implementation, because each one changes what has to be built: - the kernel, device tree and modules travel inside the OS slot, so a rollback can never pair a new kernel with an old userspace; - the running slot is mounted read-only, which makes "the running slot is never modified" enforceable instead of conventional; - the health confirmation is four local conditions and no network, so a board on a bench with no uplink can still confirm a good update; - the layout is fixed at build time and never resized on the device; - the development certificate is committed but its private key is not, which keeps Principle VII intact, and a documented command generates the key with the build naming that command when it is missing; - the boot-selection state gets a region of its own, in no filesystem and outside the bootloader area, with the choice between an unpartitioned region and a partition of its own left to research because the four MBR primary partitions are already spoken for. The spec also requires that a slot which hangs after booting is reset by hardware so the attempt counter can retire it, that the failure record outlives the reboot which reveals it, and that exactly one boot counter is active, since the counter inherited from the board's bootloader configuration lives in an RTC register this board loses on power removal. The boot-time criterion names the 11.50 s baseline measured in the previous commit and the method behind it. Four clarifications were answered during specification and five amendments after reviewing the baseline; both are logged in the spec. FR-025 states that it is verified by review rather than by test until a second board exists. No code yet: spec, quality checklist and clarification log only. Co-Authored-By: Claude Opus 5 --- .../checklists/requirements.md | 54 +++ specs/002-ab-ota-rauc/spec.md | 449 ++++++++++++++++++ 2 files changed, 503 insertions(+) create mode 100644 specs/002-ab-ota-rauc/checklists/requirements.md create mode 100644 specs/002-ab-ota-rauc/spec.md diff --git a/specs/002-ab-ota-rauc/checklists/requirements.md b/specs/002-ab-ota-rauc/checklists/requirements.md new file mode 100644 index 0000000..45c46bd --- /dev/null +++ b/specs/002-ab-ota-rauc/checklists/requirements.md @@ -0,0 +1,54 @@ +# Specification Quality Checklist: A/B Atomic OTA Update with Automatic Rollback + +**Purpose**: Validate specification completeness and quality before proceeding to planning +**Created**: 2026-10-27 +**Feature**: [spec.md](../spec.md) + +## Content Quality + +- [x] No implementation details (languages, frameworks, APIs) +- [x] Focused on user value and business needs +- [x] Written for non-technical stakeholders +- [x] All mandatory sections completed + +## Requirement Completeness + +- [x] No [NEEDS CLARIFICATION] markers remain +- [x] Requirements are testable and unambiguous +- [x] Success criteria are measurable +- [x] Success criteria are technology-agnostic (no implementation details) +- [x] All acceptance scenarios are defined +- [x] Edge cases are identified +- [x] Scope is clearly bounded +- [x] Dependencies and assumptions identified + +## Feature Readiness + +- [x] All functional requirements have clear acceptance criteria +- [x] User scenarios cover primary flows +- [x] Feature meets measurable outcomes defined in Success Criteria +- [x] No implementation details leak into specification + +## Notes + +- Items marked incomplete require spec updates before `/speckit-clarify` or `/speckit-plan` +- **Resolved 2026-10-27** (`/speckit-clarify`, 4 questions): the FR-020 conflict between the + feature request and Constitution Principle VII was settled by committing only the public + development certificate and generating the private key locally. Three further ambiguities were + closed in the same session: a read-only OS slot, the four local conditions of the health + confirmation, and a fixed partition layout with no on-device resize. No [NEEDS CLARIFICATION] + markers remain. +- Two scope decisions that the request left open were resolved by informed guess and recorded in + Clarifications and Assumptions rather than as open markers: the kernel travels inside each OS + slot, and the A/B layout replaces the single-slot layout for `beaglebone_black` in place. +- Named technologies (the update framework, the bootloader, the board) appear only in the verbatim + Input, the Clarifications log and the Assumptions, never in Requirements or Success Criteria, so + the requirements stay implementation-free while the decided direction is still on record for + `/speckit-plan`. +- **Review round 2026-10-27** (after the boot baseline was measured): five amendments, none of which + reopened a checklist item. FR-032 and SC-014 cover a slot that hangs after booting; FR-014 and + FR-028 place the failure record in the persistent data area, where it survives the reboot that + reveals it; SC-008 now names the measured baseline and the method that produced it, because + power-on is not observable on a serial line; FR-001 reserves a region for the boot-selection + state and FR-003 forbids a second boot counter; FR-025 states that it is verified by review + rather than by test until a second board exists. Checklist remains 16/16. diff --git a/specs/002-ab-ota-rauc/spec.md b/specs/002-ab-ota-rauc/spec.md new file mode 100644 index 0000000..1d239ae --- /dev/null +++ b/specs/002-ab-ota-rauc/spec.md @@ -0,0 +1,449 @@ +# Feature Specification: A/B Atomic OTA Update with Automatic Rollback + +**Feature Branch**: `002-ab-ota-rauc` + +**Created**: 2026-10-27 + +**Status**: Draft + +**Input**: User description: "A/B atomic OTA update for board images using RAUC. A device running an image built from this repo can be updated to a new image in the field, atomically, with automatic rollback if the new image fails to boot, and the update bundle is produced by the normal build. Two redundant rootfs slots; bootloader tracks boot attempts and falls back without human intervention; a booted slot must be explicitly marked good; bundles are signed and an untrusted bundle is refused; persistent data survives an update; the build produces both a factory image and an update bundle; an operator can query booted slot, slot health and installed version. Decided direction: RAUC (BR2_PACKAGE_RAUC), first board beaglebone_black on removable SD card, GPT layout boot (FAT ~32M) + rootfs.A (512M) + rootfs.B (512M) + data (remaining), U-Boot bootcount/altbootcmd slot selection with RAUC's U-Boot environment backend, boot logic in the external tree only, generic enough for a second board to adopt later. Out of scope: OTA server / fleet management, delta updates, secure boot, flashing to eMMC." + +## Clarifications + +### Session 2026-10-27 + +- Q: Does an update replace the kernel and device tree as well as userspace? → A: Yes. Kernel, device tree and modules live inside each rootfs slot and are updated with it; the bootloader loads them from the active slot. The shared FAT partition holds only the bootloader stages, which OTA never writes. +- Q: Does the A/B layout replace the current single-rootfs image for `beaglebone_black`, or become a variant? → A: It replaces it in place. `beaglebone_black` becomes A/B-capable and there is one flashable artifact per board; the single-slot layout is not kept. +- Q: Is the running slot's root filesystem mounted read-only, or writable as in the current image? → A: Read-only. Temporary files, runtime state and logs go to volatile storage; the separate persistent data area is the only writable storage that survives a reboot. This makes "the running slot is never modified" enforceable rather than a convention, and keeps the running slot identical to the signed bundle it came from. +- Q: Where do the development signing key and certificate live? → A: The development certificate is committed, because it is public and is what the device trusts. The matching private key is never committed: it is generated locally by a documented project command into a version-control-ignored location, and a build that needs it but cannot find it fails with a message naming that command. +- Q: Where does the boot-selection state live on the medium, and does the spec reserve space for it? → A: The layout gains a fifth component: a dedicated region, in no filesystem, outside the bootloader area, that nothing but the boot-selection state writes. The spec stays neutral on whether that is an unpartitioned reserved region or a partition of its own, because the MBR four-primary-partition limit is already reached by the four areas above, so a partition of its own depends on whether this board's ROM can boot from a GPT medium. Research decides; the implementation documents the choice and proves no overlap. The upstream RAUC integration guide takes the same position: its own example uses a dedicated raw area and states the state need not be on an actual MBR/GPT partition, while insisting it live outside the bootloader partition. +- Q: Which boot attempt counter is authoritative, given the board's bootloader config already enables a second one? → A: Exactly one counter, in the boot-selection state, and it must survive power loss. The inherited SoC bootcount keeps its counter in an RTC scratch register, which this board loses on power removal because it has no RTC battery, so it must not be left active alongside the first. +- Q: What stops a slot that boots and then hangs, since the boot attempt counter only acts at boot? → A: Such a slot must be reset automatically within a bounded time, and whatever prevents that reset must depend on the system actually working. Otherwise a hang leaves the device running forever with boot attempts still unspent, which is the exact failure this feature exists to prevent. Added as FR-032 and SC-014 after review. +- Q: Where does the failure reason required by FR-014 live, given that volatile state is discarded at reboot? → A: In the persistent data area. A failed slot is always discovered after a reboot, and the slot itself is overwritten by the next update, so neither volatile storage nor the slot can hold the record. Clarified in FR-014 and FR-028 after review. +- Q: How is the boot-time budget of SC-008 measured? → A: From the bootloader's first serial output to the login prompt, by the method recorded in `docs/boot-baseline-beaglebone-black.md`, against a measured baseline of 11.50 s. Power-on cannot be observed on the serial line, so the earlier "from power-on" wording was not reproducible. +- Q: Does the factory image use a fixed layout, or grow the data area to fill the medium on first boot? → A: Fixed, with no growing: bootloader area 32 MB, two OS slots of 512 MB, data area 256 MB, giving an image of roughly 1.3 GB and a documented minimum medium of 2 GB. Space beyond that on a larger medium is left unused. Growing the data area on first boot would put partition-table surgery at the riskiest moment of the device's life and would make a resize bug indistinguishable from an update bug while the update path is still being brought up; it can be added later once A/B is proven. +- Q: What must the freshly booted system check before it confirms the new slot is good? → A: Four local conditions, no network: the init sequence completed, the running slot is the slot that was pending, the persistent data area is mounted and writable, and the boot-selection state is readable and writable. All four must hold; anything else leaves the slot unconfirmed and therefore subject to rollback. + +## User Scenarios & Testing *(mandatory)* + +### User Story 1 - Flash and boot a device with redundant slots (Priority: P1) + +An operator writes the factory image for a board to blank media, powers the device, and it boots +to a login prompt from the first of its two redundant OS slots. The device reports which slot it +booted and that the slot is healthy. The second slot is present but empty, and persistent storage +is available and empty. Nothing about the day-to-day build, flash and boot workflow changes for +someone who does not care about updating. + +**Why this priority**: The redundant layout, slot selection and health bookkeeping are the +foundation every later story stands on, and they are the part that can brick a device. Delivered +alone this is already a viable product: a board that boots exactly as before, on a layout that is +ready to be updated. + +**Independent Test**: Write the factory image to blank media, boot the device, confirm a login +prompt on the serial console, and confirm the on-device status command names the booted slot and +reports it good. + +**Acceptance Scenarios**: + +1. **Given** blank media and the factory image for a board, **When** the image is written and the + device powered on, **Then** the device boots to a login prompt from the first OS slot. +2. **Given** a freshly flashed device, **When** the operator asks for slot status, **Then** the + booted slot is named, reported as good, and the second slot is reported as present and unused. +3. **Given** a freshly flashed device, **When** it boots, **Then** persistent storage is mounted + and writable, and survives a power cycle. +4. **Given** a freshly flashed device, **When** the operator reads the on-device build + information, **Then** it states the board, the source version and the build environment + version of the running slot. + +--- + +### User Story 2 - Update a running device to a new image (Priority: P2) + +A maintainer builds a newer image, which also produces an update bundle. The bundle is placed on +the device by any available means, and a single operator command installs it. The installation +writes only the slot that is not running, so the running system stays usable throughout and a +failure during installation leaves the device exactly as it was. After a reboot the device runs +the new image, and once it has proven itself healthy the new slot is recorded as good and becomes +the one the device falls back to in future. + +**Why this priority**: This is the feature's reason to exist, and it is the first story that +delivers field value. It depends on Story 1 but adds the whole installation path. + +**Independent Test**: On a device flashed from Story 1, install a bundle built from a visibly +different source revision, reboot, and confirm the device now runs the new revision from the other +slot while the first slot still holds the previous one. + +**Acceptance Scenarios**: + +1. **Given** a device running slot A and a trusted bundle on local storage, **When** the operator + installs it, **Then** the bundle is written to slot B, slot A is untouched, and the command + reports success. +2. **Given** a completed installation, **When** the device reboots, **Then** it boots the newly + written slot and the on-device build information shows the new source version. +3. **Given** the newly booted slot has proven healthy, **When** the health bookkeeping runs, + **Then** that slot is recorded as good and the previous slot is retained as the fallback. +4. **Given** an installation is in progress, **When** it is interrupted by power loss, **Then** on + the next boot the device still runs the previously good slot, unchanged and healthy. +5. **Given** a device whose last update has not yet been confirmed healthy, **When** another + installation is attempted, **Then** the attempt is refused with a message naming the pending + state, and nothing is written. + +--- + +### User Story 3 - Automatic rollback when the new image fails (Priority: P3) + +A maintainer installs an update that turns out to be broken: it does not reach a working system, or +it reaches one that fails its own health check. Without anybody touching the device, it returns to +the image it was running before and stays there, reporting that the attempted slot is bad. The +field device is never lost to a bad update. + +**Why this priority**: It is the safety property that makes updating acceptable at all, but it can +only be demonstrated once installation works. + +**Independent Test**: Install a bundle deliberately built to fail to boot (or to fail its health +check), reboot, and confirm the device returns on its own to the previous image within a bounded +number of attempts and reports the attempted slot as bad. + +**Acceptance Scenarios**: + +1. **Given** a device with a newly installed slot that cannot boot, **When** it is powered on, + **Then** after at most a bounded, documented number of attempts it boots the previously good + slot without operator action. +2. **Given** a device whose newly booted slot never confirms its health, **When** it is rebooted, + **Then** the previously good slot is selected and the unconfirmed slot is marked bad. +3. **Given** a rolled-back device, **When** the operator asks for slot status, **Then** the + running slot is reported good and the failed slot is reported bad with the reason available. +4. **Given** a slot marked bad, **When** a later trusted bundle is installed, **Then** it is + written to that slot and the slot becomes eligible again. +5. **Given** both slots are marked bad, **When** the device is powered on, **Then** it still + attempts to boot a documented slot rather than halting with no attempt, and the situation is + visible on the serial console. + +--- + +### User Story 4 - Only trusted, intact bundles are accepted (Priority: P4) + +A device is handed a bundle that was not produced by the project, was signed with an unknown key, +or was corrupted in transit. The device refuses it, says why, and leaves both slots as they were. +A bundle built for a different board is likewise refused. + +**Why this priority**: Required before any image travels outside a lab, but testable only once +installation exists. + +**Independent Test**: Attempt to install, in turn, an unsigned bundle, one signed by an untrusted +key, one whose payload has been altered after signing, and one built for a different board; confirm +each is refused, with distinct messages, and that slot contents are unchanged after each attempt. + +**Acceptance Scenarios**: + +1. **Given** a bundle with no signature or a signature from an untrusted key, **When** installation + is attempted, **Then** it is refused before anything is written and the message names the trust + failure. +2. **Given** a bundle whose payload was altered after signing, **When** installation is attempted, + **Then** it is refused and the message names the integrity failure. +3. **Given** a bundle built for a different board, **When** installation is attempted on this + board, **Then** it is refused and the message names the mismatch. +4. **Given** any refused bundle, **When** the operator inspects the device afterwards, **Then** + both slots and the boot selection are exactly as before the attempt. + +--- + +### User Story 5 - Inspect and reason about update state (Priority: P5) + +Someone holding a device, or reading a support report from the field, can tell which slot is +running, what version it holds, what the other slot holds, which slots are good or bad, and whether +an update is awaiting confirmation. The same information is obtainable from the serial console +during boot. + +**Why this priority**: Pure observability. It makes the other stories supportable, but none of them +depend on it. + +**Independent Test**: On a device that has been updated once, read the status output and confirm it +reports both slots with their versions and health, and the pending/confirmed state of the last +update. + +**Acceptance Scenarios**: + +1. **Given** a device in any state, **When** the operator runs the documented status command, + **Then** the booted slot, both slots' versions and health, and any pending confirmation are + reported in one output. +2. **Given** a device booting, **When** an operator watches the serial console, **Then** the + selected slot is identifiable from the boot output. +3. **Given** a device that has rolled back, **When** the status is read, **Then** the output makes + the rollback evident rather than looking like a normal boot. + +--- + +### Edge Cases + +- **Power loss during installation**: the inactive slot is left partially written; the device must + still boot the active slot and the partial slot must not become bootable. +- **Power loss between installation and first boot of the new slot**: the pending-but-unconfirmed + state must survive and still be subject to rollback. +- **Both slots bad**: documented, deterministic behaviour and a visible message, not a silent + hang. +- **Bundle too large for a slot**: refused before writing, naming the size limit. +- **Media smaller than the layout requires**: flashing or first boot on a medium under the + documented 2 GB minimum fails with a message naming the required size, rather than producing a + half-working device. +- **No room to stage the bundle**: the persistent area must hold at least one update bundle, and an + installation that cannot be staged must be refused with a message naming the space needed. +- **Persistent storage full or corrupt**: must not prevent the device booting or updating. +- **Same or older version installed**: permitted (it is a normal recovery action) and not treated + as an error. +- **Bootloader environment corrupt or missing**: the device must still boot a documented slot. +- **Boot-selection state readable but not writable from the running system**: every update would + then roll back even though the image is sound, so the health confirmation must treat this as a + failure and the condition must be visible rather than silent. +- **First boot after flashing, with the second slot empty**: the empty slot must never be selected. +- **Clock far from real time on a device checking a certificate validity window**: must not make a + legitimate bundle unusable without a clear message. +- **Installation attempted while another is running**: the second attempt is refused, not + interleaved. +- **Signing key absent on a fresh clone**: the build must stop with a message naming the command + that generates the development key, rather than producing an unsigned or unusable bundle. +- **Something on the device needs to write outside the persistent area**: with a read-only OS slot + this must fail visibly during integration, rather than appearing to work and then losing the data + at the next update. + +## Requirements *(mandatory)* + +### Functional Requirements + +**Layout and boot selection** + +- **FR-001**: Each A/B-capable board MUST provide two redundant OS slots of equal size on its + storage medium, plus a separate persistent data area, a bootloader area, and a dedicated region + for the boot-selection state. That state region MUST NOT be part of any filesystem, MUST lie + outside the bootloader area so that it is unaffected by anything written there, and MUST NOT be + writable by any update other than the boot-selection state itself. Whether it is an + unpartitioned reserved region or a partition of its own is left to the implementation, which + MUST document the choice and MUST ensure no other partition overlaps it. +- **FR-002**: An OS slot MUST contain everything needed to run that version of the system, + including kernel, device tree and kernel modules, so that one slot is updated as a single unit. +- **FR-003**: The bootloader MUST select the OS slot to boot from recorded state, MUST count boot + attempts per slot, and MUST stop selecting a slot that exceeds a documented attempt limit. There + MUST be exactly one such counter: a second, independent boot counter MUST NOT be left active, + because two sources of truth for "how many attempts are left" cannot be reasoned about. The + counter MUST survive loss of power, so a counter held only in volatile or battery-backed storage + that this board does not have is not acceptable. +- **FR-004**: The bootloader area MUST NOT be written by any update; the bootloader stages are + established only at flashing time. This limitation MUST be documented. +- **FR-005**: Slot selection logic MUST live in this repository's external tree; the upstream + bootloader source MUST NOT be modified. + +**Installing an update** + +- **FR-006**: The system MUST install an update bundle to the slot that is not currently running, + and MUST NOT modify the running slot. The running slot's root filesystem MUST be mounted + read-only, so that it cannot diverge from the signed bundle it was installed from and so that an + unclean power loss cannot corrupt it. +- **FR-007**: An installation MUST be atomic from the device's point of view: until it completes + and the boot selection is switched, the device MUST still boot the previously good slot. +- **FR-008**: After a successful installation the system MUST mark the newly written slot as the + next slot to boot, in a pending state that has not yet been confirmed. +- **FR-009**: The system MUST refuse to start an installation when an earlier update is still + pending confirmation, or when another installation is in progress, and MUST say which condition + applies. +- **FR-010**: Installation MUST be startable by a single documented operator command on the + device, given a bundle already present on local storage. + +**Health confirmation and rollback** + +- **FR-011**: A slot booted from a pending update MUST be confirmed healthy by the running system + before it is recorded as good; a slot that is never confirmed MUST be treated as failed. +- **FR-012**: The health confirmation MUST run automatically on boot and MUST record the slot as + good only when all of the following hold: the init sequence completed; the running slot is the + slot that was pending; the persistent data area is mounted and writable; and the boot-selection + state is both readable and writable. It MUST NOT depend on network reachability, so that a device + with no uplink can still confirm a good update. +- **FR-013**: When the pending slot fails to boot, or boots without confirming health, the + bootloader MUST return to the last slot recorded good, without operator action. +- **FR-014**: A slot that failed MUST be recorded as bad, and the reason MUST be retrievable on the + device afterwards. That record MUST live in the persistent data area, because a failed slot is + only ever discovered after a reboot and the slot itself is overwritten by the next update; it MUST + NOT live only in volatile storage, nor inside either OS slot. +- **FR-015**: A slot recorded bad MUST become eligible again when a later trusted bundle is + installed to it. +- **FR-032**: A slot that boots and then stops working MUST be reset automatically within a + bounded, documented time, so that the boot attempt counter can retire it. A hang MUST NOT leave + the device running indefinitely with boot attempts still unspent. Whatever prevents that reset + MUST depend on the system actually working, so that a system which can no longer confirm its own + health also stops keeping itself alive. + +**Trust and integrity** + +- **FR-016**: Update bundles MUST be signed, and a device MUST refuse any bundle that is not signed + by a key it trusts. +- **FR-017**: A device MUST verify bundle integrity and refuse a bundle whose contents changed + after signing. +- **FR-018**: A bundle MUST identify the board or hardware variant it is built for, and a device + MUST refuse a bundle that does not match it. +- **FR-019**: Verification MUST happen before anything is written to the inactive slot. +- **FR-020**: Development signing material MUST be unmistakably identified as development-only and + MUST NOT be usable as a production trust root by accident. The development certificate MAY be + committed to the repository, because it is public and is exactly what a device must trust; the + matching private key MUST NOT be committed. The project MUST provide a documented command that + generates the development private key locally into a version-control-ignored location, and a + build that requires the key but cannot find it MUST fail with a message naming that command. + +**Build outputs** + +- **FR-021**: A build of an A/B-capable board MUST produce a flashable factory image for blank + media, with the first OS slot populated, the second empty, and the persistent area empty. The + layout MUST be fixed at build time (32 MB bootloader area, two 512 MB OS slots, 256 MB persistent + data area) and MUST NOT be resized on the device; space beyond the layout on a larger medium is + left unused and this MUST be documented. The factory image MUST ship the boot-selection state + already populated, so that a freshly flashed device boots without needing a first write to it. +- **FR-022**: The same build MUST produce a signed update bundle for that board. +- **FR-023**: Both artifacts MUST be produced by the project's normal documented build command, + with no manual post-processing step. +- **FR-024**: Both artifacts MUST carry an identifiable version derived from the source revision, + matching the version the device reports once running. +- **FR-025**: A board that does not opt into A/B MUST continue to build and produce its existing + artifacts unchanged. Until a second board exists, this requirement is verified by review of the + shared layer rather than by test, and that limitation is stated rather than implied: no success + criterion claims to demonstrate it. + +**Observability** + +- **FR-026**: The device MUST provide a single command reporting the booted slot, both slots' + versions and health state, and whether an update awaits confirmation. +- **FR-027**: The selected slot MUST be identifiable from the serial console output during boot. +- **FR-028**: Persistent data MUST survive an update, a rollback and a power cycle, and MUST NOT + live inside either OS slot. Volatile runtime state (temporary files, runtime state, logs) MUST + live on storage that is discarded at reboot and is part of neither OS slot, so that a read-only + OS slot does not prevent normal operation. Records that must outlive a reboot, such as the slot + health and failure reason of FR-014, belong to the persistent data area and MUST NOT be kept in + volatile storage. + +**Project constraints** + +- **FR-029**: The board-independent parts of the mechanism MUST live in the shared layer, so a + second board can adopt A/B by adding only board-local files. +- **FR-030**: Documentation MUST be updated in the same change: flashing procedure, update + procedure, rollback demonstration, the new storage layout, and the minimum media size. +- **FR-031**: The project's existing static checks MUST continue to pass, and MUST be extended to + cover the new layout and scripts. + +### Key Entities + +- **OS slot**: one of two interchangeable, equally sized homes for a complete bootable system + (kernel, device tree, modules, userspace). Identified by a stable name, has a health state + (good, bad, or pending confirmation), a version, and at most one of the two is running. +- **Update bundle**: a single signed, board-targeted file holding one OS slot's contents plus the + metadata needed to verify it (signature, target board identifier, version). +- **Boot selection state**: the small, persistent record the bootloader and the running system both + read and write: preferred slot order, remaining attempts per slot, and health marks. It survives + power loss and lives outside both OS slots. +- **Trust anchor**: the certificate material on the device that decides which bundles are + acceptable. Development and production anchors are distinct and distinguishable. +- **Persistent data area**: storage for configuration and application state that updates and + rollbacks never touch. +- **Version stamp**: the identifier written into an image at build time from the source revision, + reported by the running device and carried in the bundle. + +## Success Criteria *(mandatory)* + +### Measurable Outcomes + +- **SC-001**: An operator with a bundle on the device can complete an update with one command plus + one reboot, and the device runs the new version within 5 minutes of starting, unattended. +- **SC-002**: In 5 of 5 trials, cutting power at an arbitrary point during installation leaves the + device booting its previous version to a login prompt, with its previous version reported. +- **SC-003**: A deliberately broken update rolls back to the previous working version with no + operator action, within a bounded and documented number of boot attempts, in 5 of 5 trials. +- **SC-004**: 100% of bundles that are unsigned, signed by an untrusted key, altered after signing, + or built for another board are refused, with no change to either slot. +- **SC-005**: Anyone holding the device can determine the booted slot, both slots' versions, both + slots' health, and any pending confirmation, from a single command, without consulting the build + tree. +- **SC-006**: Data written to the persistent area before an update is byte-identical after the + update, and again after a rollback. +- **SC-007**: The factory image fits on commonly available 2 GB media, neither OS slot nor the + bootloader area exceeds 80% usage, and the persistent area holds at least one update bundle with + room to spare; the figures are recorded in the project documentation. +- **SC-008**: Time from the bootloader's first serial output to the login prompt grows by no more + than 10% against the recorded single-slot baseline of 11.50 s for `beaglebone_black`, measured by + the method in `docs/boot-baseline-beaglebone-black.md`, or the regression is justified in writing. + Power-on itself is not observable on the serial line, so it is not the reference point. +- **SC-009**: A reviewer can describe, from the documentation alone, what a second board must add + to become A/B-capable, and the list contains no changes to shared files. +- **SC-010**: The end-to-end update and the rollback are each demonstrated on physical hardware and + the serial evidence is recorded in the repository. +- **SC-011**: A developer starting from a fresh clone can produce a signed update bundle after + running one documented command, and the build tells them that command if they have not run it. +- **SC-012**: A write to the running OS slot is rejected on a running device, and no documented + boot, update, rollback or status operation requires such a write. +- **SC-013**: A device that cannot write its boot-selection state never reports an update as good: + it rolls back instead, and an operator reading the console or the status output can tell that + this is what happened. +- **SC-014**: A slot that is made to hang after booting returns the device to the previous working + version with no operator action, within a documented time, in 3 of 3 trials. + +## Assumptions + +- **Kernel inside the slot**: an OS slot contains its own kernel, device tree and modules, so an + update replaces the whole OS atomically. Chosen over separate redundant boot areas because it + keeps one unit of redundancy and avoids a kernel/userspace mismatch after a rollback. +- **The bootloader is not field-updatable**: the first-stage and second-stage bootloader are + written once at flashing time. Updating them in the field is the largest bricking risk and buys + little here; it is explicitly out of scope and documented as a limitation. +- **In-place replacement of the layout**: `beaglebone_black` moves to the A/B layout rather than + gaining a parallel single-slot variant, so there is one artifact per board and one layout to + verify. The documented size baselines are re-measured as part of this change. +- **Bundle delivery is the operator's problem**: the bundle arrives on the device by whatever means + exist (removable media, network copy, a mounted share). No download client, server, scheduler or + fleet management is part of this feature. +- **Health confirmation is a conservative, local check**: the four conditions in FR-012 and nothing + more. It does not reach the network, because a device in a lab with no uplink must still be able + to confirm a good update. Waiting for an application to declare itself ready is the right check + once this project has an application to wait for; today there is none, so it would only add a + meaningless timeout. +- **First board and medium**: `beaglebone_black` on removable SD card. On-board eMMC is untouched. +- **Development images stay as they are otherwise**: passwordless root and the existing package set + are unchanged by this feature; hardening remains the job of a future production variant. The one + deliberate behavioural change is the read-only OS slot, which is a correctness requirement of + A/B updating rather than hardening. +- **Fixed layout and sizes**: 32 MB bootloader area, 512 MB per OS slot, 256 MB persistent data + area, about 1.3 GB of image in total and a 2 GB minimum medium. 512 MB per slot is generous + against a current rootfs well under 100 MB plus a kernel; 256 MB of data comfortably stages one + update bundle, which is the real driver of that number. Growing the data area to fill a larger + medium is deliberately deferred until the update path is proven. +- **Attempt limit**: three boot attempts before the bootloader gives up on a slot, unless + measurement during implementation shows a different number is warranted. +- **Boot-selection state is written far more often than anything else**: it changes on every boot + attempt and on every update, so where it lives decides what an interrupted write can destroy. + Keeping it out of any filesystem, and out of the area holding the bootloader, is what stops a + half-finished write from costing the device its ability to boot at all. An atomic update of that + state (for instance a second copy with a way to tell which is current) is what SC-002 demands in + practice, even though an update framework need not require it in general. +- **One writer, one reader, one agreed location**: the most commonly reported failure in this class + of system is a mismatch between where the bootloader keeps the state and where the running system + looks for it. Nothing detects it by itself; every update simply rolls back. That is why FR-012 + makes writing the state a health condition rather than assuming it works. +- **A hang is caught by hardware, not by software goodwill**: the board already runs a hardware + watchdog that the bootloader starts and the kernel takes over, so FR-032 asks for a mechanism that + exists rather than new invention. The measured baseline in + `docs/boot-baseline-beaglebone-black.md` records both. +- **Existing verification duties apply**: this change alters the partition layout, bootloader + environment and init path, so the constitution's manual boot smoke test on hardware is mandatory + and a green automated check run is not sufficient evidence. + +## Dependencies + +- The update framework must be available and buildable from the pinned upstream Buildroot + submodule for this board's architecture, together with the bootloader-environment access tools + the device needs to read and write boot selection state. +- Physical hardware, serial console access and removable media are required to satisfy SC-010; + no automated boot test exists in this project yet. +- Documentation and the static-check script are part of this feature's scope, not follow-up work. + +## Out of Scope + +- Any OTA server, update distribution service, fleet management, scheduling or telemetry. +- Delta or incremental updates; a bundle carries a whole OS slot. +- Secure boot or a verified boot chain rooted in hardware. +- Flashing to or updating on the board's on-board eMMC. +- Field updates of the bootloader itself. +- A production-hardened image variant (root login policy, package trimming, service exposure). From 74ece96505cb4f682422ec3caf2ae54d2f20c449 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 12:09:17 +0700 Subject: [PATCH 03/61] specs: plan A/B OTA, with a two-tier development CA Phase 0 and Phase 1 artifacts for feature 002. Seven questions had to be settled before any of this could be written, and four of the answers came out of reading the boot baseline rather than documentation: - MBR, not GPT: the AM335x ROM looks through MBR entries for a bootable FAT partition and finds nothing on a GPT medium. That spends all four primary partitions, so the boot-selection state becomes a reserved region rather than a partition of its own, closing the choice FR-001 deliberately left open. - The U-Boot environment leaves FAT for raw offsets 0x80000 and 0xA0000 with a redundant copy. Not because fw_setenv cannot address a FAT file -- it can, there is a VFAT example in U-Boot's own fw_env.config -- but because every boot attempt writes that environment, and in FAT an interrupted write endangers the filesystem holding MLO and u-boot.img. ENV_OFFSET must be set explicitly: its ARCH_OMAP2PLUS default of 0x260000 lands inside partition 1. - ext4 mounted read-only for the OS slot, 128 MiB inside 512 MiB. Squashfs is deferred, not rejected: the kernel lacks CONFIG_SQUASHFS, but the real cost is changing the image pipeline and slot type in the same breath as the layout and the rollback path. - One attempt counter. The board's inherited U-Boot configuration already enables CONFIG_BOOTCOUNT_AM33XX, which counts in an RTC register this board loses on power removal, so it is switched off rather than left one grep away from being enabled. - A custom kernel configuration turns out to be unavoidable: CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y with an open timeout of 0 makes the kernel ping the bootloader's watchdog forever, so a hung slot is never reset. The watchdog looks like protection and provides none, and FR-032 cannot be met without changing that. - Development signing material is a two-tier CA, not a single self-signed key. The keyring holds the CA, so a lost or compromised signing key is answered by issuing a new certificate; with a single key, RAUC states you cannot replace an expired certificate or revoke a compromised one without updating the keyring, which lives in the rootfs and therefore means reflashing. That structure cannot be retrofitted, so it belongs in this feature even though only one environment exists. The plan records two configuration files this feature has to introduce and why nothing smaller would do, and the constitution check passes all seven principles with obligations noted against IV, V and VI. contracts/ fixes the numbers five files must agree on, the environment variables and device commands, and the signing chain. quickstart.md has nine hardware scenarios, each naming the success criterion it discharges. No code yet. Co-Authored-By: Claude Opus 5 --- .../contracts/boot-interface.md | 92 ++++++ .../contracts/signing-chain.md | 119 ++++++++ .../contracts/storage-layout.md | 67 +++++ specs/002-ab-ota-rauc/data-model.md | 117 ++++++++ specs/002-ab-ota-rauc/plan.md | 156 ++++++++++ specs/002-ab-ota-rauc/quickstart.md | 150 ++++++++++ specs/002-ab-ota-rauc/research.md | 266 ++++++++++++++++++ 7 files changed, 967 insertions(+) create mode 100644 specs/002-ab-ota-rauc/contracts/boot-interface.md create mode 100644 specs/002-ab-ota-rauc/contracts/signing-chain.md create mode 100644 specs/002-ab-ota-rauc/contracts/storage-layout.md create mode 100644 specs/002-ab-ota-rauc/data-model.md create mode 100644 specs/002-ab-ota-rauc/plan.md create mode 100644 specs/002-ab-ota-rauc/quickstart.md create mode 100644 specs/002-ab-ota-rauc/research.md diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md new file mode 100644 index 0000000..fe51bfc --- /dev/null +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -0,0 +1,92 @@ +# Contract: boot interface, device commands and make surface + +What the bootloader, the running system, the operator and the build agree on. The storage numbers +live in [storage-layout.md](storage-layout.md). + +## U-Boot: the slot-selection script + +Lives in `board/ota/beaglebone_black/uboot-env.txt`, compiled into U-Boot's default environment +through `CONFIG_ENV_SOURCE_FILE`, so the logic is a reviewable text file in this repository and +upstream U-Boot source stays untouched (FR-005). + +Behaviour, in order: + +1. Read `BOOT_ORDER`. For each boot name in it, in order: + - if `BOOT__LEFT` is 0, skip this slot; + - otherwise decrement it, `saveenv`, announce the chosen slot on the console (FR-027), load + `/boot/zImage` and the device tree from that slot's partition with `ext4load`, set `bootargs` + with that slot as `root=`, mounted read-only, and boot. +2. If every slot is exhausted: announce it on the console, restore one attempt to the first slot in + `BOOT_ORDER` and try it, rather than halting at a prompt (the "both slots bad" edge case). + +`bootdelay` is reduced from the measured 2 s; see the boot-time budget in [plan.md](../plan.md). +`CONFIG_BOOTCOUNT_LIMIT` and `CONFIG_BOOTCOUNT_AM33XX` are off, so `BOOT__LEFT` is the only +counter (FR-003). + +## Linux: environment access + +`/etc/fw_env.config` points `fw_printenv`/`fw_setenv` at the same two offsets. RAUC's `uboot` +bootloader backend reads and writes `BOOT_ORDER` and `BOOT__LEFT` through them. + +## Operator commands on the device + +| Command | Purpose | Requirement | +|---|---|---| +| `rauc status` | booted slot, both slots' version and health, pending confirmation | FR-026, SC-005 | +| `rauc install /data/.raucb` | verify, then write the slot that is not running | FR-006, FR-010 | +| `rauc status mark-good` | record the running slot good and restore its counter | FR-011 | +| `rauc status mark-bad` | force the running slot bad, for testing rollback | SC-003 | +| `fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT` | see the raw state | debugging | +| `cat /etc/build-info` | board, revision, Buildroot version of the running slot | FR-024 | + +## Health confirmation + +`board/ota/common/rootfs_overlay/etc/init.d/S99ota-health`, board-independent (FR-029), runs late in +the BusyBox init sequence and checks the four conditions of FR-012 in this order: + +1. the init sequence reached this script; +2. the running slot is the slot that was pending — RAUC's own view, not a guess; +3. `/data` is mounted and a write to it succeeds; +4. `fw_printenv` reads the state and `fw_setenv` writes it back. + +All four hold → `rauc status mark-good`, then start the watchdog feeder. Any fail → log the reason +to `/data`, leave the slot unconfirmed, and do **not** start the feeder, so the device is reset and +the attempt counter retires the slot (FR-032). + +## Watchdog + +| Layer | Behaviour | +|---|---| +| U-Boot | starts the watchdog, 60 s timeout, as the baseline log shows | +| Kernel | watchdog core and `omap_wdt` built in, not modules, so the early window is covered; `CONFIG_WATCHDOG_OPEN_TIMEOUT` non-zero so the kernel stops covering an unopened watchdog | +| Userspace | the BusyBox `watchdog` applet, started **only** by a successful health check | + +The point of the ordering: keeping the device alive depends on userspace that proved itself. Today +`CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 means the kernel pings forever +and a hung device is never reset. + +## Build surface + +| Command | Behaviour | +|---|---| +| `make ota-dev-keys` | generate the development CA and bundle-signing material into `keys/dev/` (gitignored), via `scripts/gen-dev-keys.sh`. Refuses to overwrite an existing CA, because a new CA invalidates every image already flashed with the old one. | +| `make build` | produces `sdcard.img` **and** `beaglebone_black-.raucb`, with no manual step (FR-023). Checks for the signing key *before* invoking Buildroot and fails with a message naming `make ota-dev-keys`, so a missing key costs three milliseconds rather than an hour of building (FR-020, SC-011). | +| `make check` | additionally lints the new scripts and asserts the layout agreement described in [storage-layout.md](storage-layout.md) | + +Three variables resolve the signing material, so a later feature can point them at staging or +production material, or at PKCS#11 URLs, without editing a script: + +| Variable | Default | Read by | +|---|---|---| +| `OTA_KEYRING` | `keys/dev/dev-ca.cert.pem` | `post-build.sh`, installed as `/etc/rauc/keyring.pem` | +| `OTA_SIGNING_CERT` | `keys/dev/dev-signing.cert.pem` | `post-image.sh`, passed to `rauc bundle --cert` | +| `OTA_SIGNING_KEY` | `keys/dev/dev-signing.key.pem` | `post-image.sh`, passed to `rauc bundle --key` | + +`rauc bundle` takes no `--intermediate` argument here: the chain is two levels and `--cert` already +embeds the signing certificate in the CMS signature. See +[signing-chain.md](signing-chain.md) for the whole chain. + +Adding `ota-dev-keys` changes the documented make surface, so `README.md`, `CLAUDE.md` and +`make help` change with it (Principle V). The `openssl` command line becomes a build-environment +dependency and is added to the `Dockerfile` explicitly rather than relied on as a transitive +dependency of `ca-certificates`. diff --git a/specs/002-ab-ota-rauc/contracts/signing-chain.md b/specs/002-ab-ota-rauc/contracts/signing-chain.md new file mode 100644 index 0000000..0e2e834 --- /dev/null +++ b/specs/002-ab-ota-rauc/contracts/signing-chain.md @@ -0,0 +1,119 @@ +# Contract: the signing chain + +Four files in the gitignored `keys/dev/` directory, two certificate/key pairs. The first pair +decides **who is trusted**; the second **signs each bundle**. They are separate so that the second +can be replaced without reflashing a single device. + +Produced once by `make ota-dev-keys` (`scripts/gen-dev-keys.sh`). The build never generates +signing material: generating it per build would create a new trust domain each time and strand +every card already flashed. + +## The two pairs + +| File | Key size | Certificate | Signs | Secret | +|---|---|---|---|---| +| `dev-ca.key.pem` | RSA 4096 | — | the signing certificate, once, at generation time | **yes, never leaves `keys/`** | +| `dev-ca.cert.pem` | — | `CA:TRUE`, `pathlen:0`, `keyCertSign,cRLSign`, 10 years | — | no, it is the trust anchor | +| `dev-signing.key.pem` | RSA 2048 | — | every update bundle | **yes, never leaves `keys/`** | +| `dev-signing.cert.pem` | — | `CA:FALSE`, `codeSigning`, 5 years, issued by the CA | — | no, it ships inside each bundle | + +`dev-signing.csr.pem` is an intermediate artefact of generation. It can be deleted, or kept to +issue a replacement certificate from the same signing key. + +Both certificate subjects state `NOT FOR PRODUCTION` in their common name, so the development +origin of a bundle is visible in `rauc info` and `openssl x509 -text` (FR-020). + +## Phase 1 — generation, once per project + +``` +make ota-dev-keys + │ + ├─ openssl req -x509 ──▶ dev-ca.key.pem + dev-ca.cert.pem + │ the CA pair, self-signed + │ + ├─ openssl req ──▶ dev-signing.key.pem + dev-signing.csr.pem + │ the bundle-signing key, and a request to certify it + │ + └─ openssl x509 -req ──▶ dev-signing.cert.pem + dev-ca.key.pem signs the request. + This is the only time the CA key is ever used. +``` + +## Phase 2 — build, two lanes that never meet + +``` +LANE A — trust anchor into the image LANE B — signature onto the bundle +$OTA_KEYRING $OTA_SIGNING_KEY $OTA_SIGNING_CERT + │ │ +dev-ca.cert.pem dev-signing.key.pem + │ dev-signing.cert.pem + │ board/ota/common/post-build.sh │ + │ install -m 0644 -D │ board/ota//post-image.sh + ▼ │ $HOST_DIR/bin/rauc bundle --cert --key +target/etc/rauc/keyring.pem ▼ + │ -.raucb + ▼ ├── manifest.raucm compatible, version +rootfs.ext4 ──▶ sdcard.img ├── rootfs.ext4 + └── CMS signature + └─ carries dev-signing.cert.pem +``` + +Invariant: **no private key enters the image, and the CA certificate never enters a bundle.** Each +file has exactly one path, which is why pointing the three `OTA_*` variables elsewhere is enough to +sign with staging or production material. + +No `--intermediate` argument is used. The chain is two levels, `--cert` already embeds the signing +certificate in the CMS signature, and the keyring is for trust anchors only. + +## Phase 3 — verification on the device, before any write + +``` +rauc install /data/.raucb /etc/rauc/keyring.pem (= dev-ca.cert.pem) + │ │ + ▼ │ + 1. unwrap the CMS signature, taking │ + dev-signing.cert.pem out of it │ + 2. chain that certificate to the keyring ─────────┘ FR-016 + issued by this CA? still valid? + 3. digest of rootfs.ext4 == the digest in the signed manifest FR-017 + 4. compatible == ota-beaglebone-black FR-018 + │ + ├── all four pass ──▶ write the slot that is not running, + │ then flip BOOT_ORDER and refill the counter + └── any one fails ──▶ refuse with a reason, write nothing, FR-019 + both slots exactly as before +``` + +## Who may see which file + +| File | Leaves `keys/` | Into the image | Into a bundle | +|---|---|---|---| +| `dev-ca.key.pem` | no | no | no | +| `dev-ca.cert.pem` | yes | **yes** | no | +| `dev-signing.key.pem` | no | no | no | +| `dev-signing.cert.pem` | yes | no | **yes** | +| `dev-signing.csr.pem` | no | no | no | + +## What a loss or a leak costs + +This table is the whole reason for splitting the pairs. With a single self-signed key, every row +below would read "reflash every device". + +| Event | Consequence | Reflash? | +|---|---|---| +| `dev-signing.key.pem` lost | issue a new certificate from the CA and carry on signing | no | +| `dev-signing.key.pem` leaked | someone else can sign bundles the devices accept; revoke through a CRL, or issue a new certificate | no | +| `dev-ca.key.pem` lost | no new certificates can be issued; devices keep working until the signing certificate expires | yes, within 5 years | +| `dev-ca.key.pem` leaked | the trust domain is gone | yes, all of them | +| either `.cert.pem` lost or leaked | nothing; they are public | no | + +## Beyond development + +Staging and production get their own CA each, following RAUC's "Separate CAs" strategy: a device +carries exactly one CA in its keyring, so a bundle from one environment cannot install on a device +from another. Their private keys do not live in this repository — a secret store for staging, and a +PKCS#11 token or cloud KMS for production, which RAUC supports by accepting PKCS#11 URLs in place +of filenames for `--cert` and `--key`. Two problems belong to that work rather than this one: this +board has no RTC battery, so its clock starts in 1970 and certificate validity windows need +deciding, and a CMS signature is not byte-reproducible, so two builds of the same commit produce +different bundles. diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md new file mode 100644 index 0000000..e1ea4b3 --- /dev/null +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -0,0 +1,67 @@ +# Contract: SD card storage layout + +The byte-level contract between `genimage.cfg`, U-Boot, `/etc/fw_env.config`, `/etc/fstab` and +RAUC's `system.conf`. Five files have to agree on these numbers; a disagreement in any one of them +is silent until a device rolls back or stops booting. + +## Layout + +``` +offset size what written by +────────────────────────────────────────────────────────────────────────────────────────── +0x000000 512 B MBR: four primary entries, 0xAA55 signature flashing only +0x000200 ~511 KiB unused. The ROM inspects 0x0, 0x20000, nobody + 0x40000 and 0x60000 for a raw boot image, + so nothing of ours may live there +0x080000 128 KiB boot-selection state, primary copy U-Boot, fw_setenv, flashing +0x0A0000 128 KiB boot-selection state, redundant copy U-Boot, fw_setenv, flashing +0x0C0000 256 KiB headroom, unused nobody +0x100000 32 MiB p1 boot, FAT16, bootable, type 0x0C flashing only + MLO, u-boot.img + 512 MiB p2 rootfs.A, ext4 (128 MiB filesystem) flashing, rauc install + 512 MiB p3 rootfs.B, ext4 (128 MiB filesystem) flashing, rauc install + 256 MiB p4 data, ext4, mounted rw at /data the running system +────────────────────────────────────────────────────────────────────────────────────────── +total ~1.3 GB minimum medium 2 GB; extra space is unused +``` + +## Rules + +1. **MBR, not GPT.** The AM335x ROM reads the MBR and looks for a bootable FAT partition; on a GPT + medium it finds only the protective 0xEE entry and never loads `MLO`. This is why the + boot-selection state is a reserved region and not a fifth partition: the four primaries are + spoken for. See [research.md](../research.md) R1. +2. **Partition 1 starts at 1 MiB.** Anything earlier would collide with the state region. +3. **`ENV_OFFSET` is set explicitly.** Its `ARCH_OMAP2PLUS` default is `0x260000`, which is inside + partition 1. Enabling `ENV_IS_IN_MMC` without overriding it corrupts the boot partition. +4. **The state region is in the factory image.** `genimage` places it outside the partition table + (`in-partition-table = false`), filled with an image built by `mkenvimage` from + `uboot-env.txt`, so a freshly flashed device boots with `BOOT_ORDER="A B"` and full counters and + never needs a first write. +5. **The boot partition is written only by flashing.** No update touches `MLO` or `u-boot.img` + (FR-004). The state region is not part of it, so writing the state never risks the bootloader. +6. **The slot filesystem is smaller than the slot.** 128 MiB of ext4 inside a 512 MiB partition. + RAUC writes the filesystem image; the remainder of the partition is unused headroom for a larger + filesystem later. + +## The five files that must agree + +| File | What it fixes | +|---|---| +| `board/ota/beaglebone_black/genimage.cfg` | every offset and size above, and the reserved region | +| `board/ota/beaglebone_black/uboot.config` | `ENV_OFFSET=0x80000`, `ENV_OFFSET_REDUND=0xA0000`, `ENV_SIZE=0x20000`, `ENV_MMC_DEVICE_INDEX=0` | +| `board/ota/beaglebone_black/fw_env.config` | the same two offsets and size, as seen from Linux | +| `board/ota/beaglebone_black/rauc-system.conf` | `/dev/mmcblk0p2` and `/dev/mmcblk0p3` as the two slots | +| `board/ota/beaglebone_black/rootfs_overlay/etc/fstab` | `/dev/mmcblk0p4` at `/data`, root read-only, tmpfs for volatile state | + +`scripts/check.sh` asserts what it can without hardware: that the offsets in `genimage.cfg`, +`uboot.config` and `fw_env.config` are the same numbers, and that the kernel is inside the slot +rather than listed among the boot partition's files. + +## Known risk: device naming + +`/dev/mmcblk0` is the SD card when the board boots from SD, but SD and eMMC enumeration can swap. +`fw_env.config`, `fstab` and `system.conf` all name `mmcblk0` literally. If enumeration ever +changes, the health check of FR-012 fails on its fourth condition — the state is not writable — and +the device rolls back rather than silently misbehaving. That is the designed failure mode, not a +mitigation; a mitigation would generate these files from the actual root device at boot. diff --git a/specs/002-ab-ota-rauc/data-model.md b/specs/002-ab-ota-rauc/data-model.md new file mode 100644 index 0000000..db3a0ee --- /dev/null +++ b/specs/002-ab-ota-rauc/data-model.md @@ -0,0 +1,117 @@ +# Phase 1 Data Model: A/B Atomic OTA Update + +The six entities of the spec, as they exist concretely on this board. Nothing here is a database: +these are regions of an SD card, a handful of environment variables and one file per record. + +## OS slot + +Two of them, interchangeable, identical in size. + +| Property | Slot A | Slot B | +|---|---|---| +| Boot name (what the environment and RAUC call it) | `A` | `B` | +| RAUC slot name | `rootfs.0` | `rootfs.1` | +| Device | `/dev/mmcblk0p2` | `/dev/mmcblk0p3` | +| Partition size | 512 MiB | 512 MiB | +| Filesystem | ext4, 128 MiB, mounted read-only | same | +| Contents | `/boot/zImage`, `/boot/am335x-boneblack.dtb`, `/lib/modules/6.18.38/`, the whole userspace | same | + +Health state is one of **good**, **bad** or **pending** confirmation. Exactly one slot is running +at any moment; the other is the install target. A freshly flashed card has A populated and good, +B empty and never eligible (FR-021 and the "empty slot must never be selected" edge case). + +## Boot-selection state + +Three variables in the U-Boot environment, the only state both the bootloader and the running +system write. Stored in the reserved region, redundantly — see +[contracts/storage-layout.md](contracts/storage-layout.md). + +| Variable | Meaning | Values | +|---|---|---| +| `BOOT_ORDER` | slot boot names in the order to try | `"A B"` or `"B A"` | +| `BOOT_A_LEFT` | attempts remaining for slot A | 0–3 | +| `BOOT_B_LEFT` | attempts remaining for slot B | 0–3 | + +Rules that make the whole feature work: + +- U-Boot spends one attempt from the slot it is about to boot, writes the environment, then boots. +- A slot at 0 attempts is skipped. +- `rauc status mark-good` restores the running slot's counter to 3. +- Installing a bundle puts the written slot first in `BOOT_ORDER` and sets its counter to 3. +- A slot whose counter reaches 0 is what "bad" means to the bootloader. + +## Update bundle + +One file, `beaglebone_black-.raucb`: a signed squashfs holding one slot's filesystem image +plus a manifest. Produced by `host-rauc` during the build, never assembled by hand. + +| Field | Source | Checked against | +|---|---|---| +| `compatible` | fixed per board: `ota-beaglebone-black` | the device's own `compatible` (FR-018) | +| `version` | `git describe --always --dirty`, the same string as `/etc/build-info` | nothing; downgrades are allowed | +| image | the slot's ext4 filesystem | its hash in the signed manifest (FR-017) | +| signature | the development key, detached CMS over the bundle | the device keyring (FR-016) | + +## Trust anchor + +Two certificate/key pairs, generated once into the ignored `keys/dev/` directory and detailed in +[contracts/signing-chain.md](contracts/signing-chain.md): + +| File | Role | Where it goes | Secret | +|---|---|---|---| +| `dev-ca.key.pem` | certifies the signing key, once; never signs a bundle | nowhere | yes | +| `dev-ca.cert.pem` | the trust anchor | `/etc/rauc/keyring.pem` in the image | no | +| `dev-signing.key.pem` | signs every bundle | nowhere | yes | +| `dev-signing.cert.pem` | proves the signature chains to the CA | inside each bundle's CMS signature | no | + +Neither private key is committed or leaves the build host. The keyring holds the **CA** +certificate, not the signing certificate, so a lost or compromised signing key is answered by +issuing a new certificate instead of reflashing every device. A bundle is installable only on an +image built with the same CA, which is what a trust domain means; staging and production would each +have their own CA. + +## Persistent data area + +`/dev/mmcblk0p4`, 256 MiB ext4, mounted read-write at `/data`. Holds two kinds of thing: + +- RAUC's own slot status, including which slot is bad and why (FR-014) — it must outlive the reboot + that reveals the failure and the overwriting of the failed slot, so it cannot live in a slot or + in volatile storage; +- anything a future application wants to keep. + +Volatile state (`/tmp`, `/run`, `/var`) is tmpfs and is gone at reboot (FR-028). + +## Version stamp + +`/etc/build-info`, already written by `board/ota/common/post-build.sh` and already proven on +hardware (`VERSION=6255255` resolved to a real commit in the boot baseline). The bundle manifest +carries the same string, so a device can be asked which revision each slot holds. + +## State transitions + +``` + rauc install bundle.raucb + ┌───────────────────────────────────────────────────────────────┐ + │ verify signature, compatible, integrity ──fail──> refused, │ + │ write the slot that is not running nothing │ + │ BOOT_ORDER="B A", BOOT_B_LEFT=3 written │ + └───────────────────────────────────────────────────────────────┘ + │ + A good, running ▼ B pending + B bad/empty ──> reboot: U-Boot spends one attempt from B + │ + ┌───────────────┴────────────────┐ + │ │ + boots and the four fails to boot, or hangs + FR-012 checks pass (watchdog resets it), or + │ checks fail + ▼ │ + rauc status mark-good ▼ + BOOT_B_LEFT=3 BOOT_B_LEFT reaches 0 + B good, A kept as fallback U-Boot skips B, boots A + B recorded bad, reason in /data +``` + +The invariant behind every arrow: **until `BOOT_ORDER` is rewritten at the end of a successful +install, the device still boots the last slot recorded good.** That is what makes an interrupted +install a non-event. diff --git a/specs/002-ab-ota-rauc/plan.md b/specs/002-ab-ota-rauc/plan.md new file mode 100644 index 0000000..3a79a49 --- /dev/null +++ b/specs/002-ab-ota-rauc/plan.md @@ -0,0 +1,156 @@ +# Implementation Plan: A/B Atomic OTA Update with Automatic Rollback + +**Branch**: `002-ab-ota-rauc` | **Date**: 2026-10-27 | **Spec**: [spec.md](spec.md) + +**Input**: Feature specification from `/specs/002-ab-ota-rauc/spec.md` + +## Summary + +Turn `beaglebone_black` into a device that can be updated in the field without being lost to a bad +update. The SD card gains two interchangeable 512 MiB OS slots, each holding its own kernel, device +tree and modules, plus a 256 MiB persistent data area and a reserved region holding the +boot-selection state. U-Boot picks a slot from `BOOT_ORDER`, spends one attempt from +`BOOT__LEFT` per try, and falls back on its own when a slot runs out. RAUC writes update +bundles only into the slot that is not running; an init script late in boot checks four local +conditions and marks the new slot good, and the hardware watchdog — today pinged forever by the +kernel and therefore useless — is reconfigured so a slot that hangs is reset and retired by the +attempt counter. Every build produces both a flashable factory image and a signed bundle. + +Phase 0 settled seven questions ([research.md](research.md)): MBR rather than GPT, which forces the +state into a reserved region; the environment moves out of FAT to raw offsets 0x80000/0xA0000 with +a redundant copy; ext4 mounted read-only now with squashfs deferred; one attempt counter, not the +two currently configured; mark-good and watchdog arming under BusyBox init; `plain` bundles built +by `host-rauc`; and a two-tier development CA rather than a single self-signed key, because that +choice is the one that cannot be changed later without reflashing every device. + +## Technical Context + +**Language/Version**: POSIX `sh` (init script, `post-image.sh`, check additions), GNU Make, U-Boot +environment script (`ENV_SOURCE_FILE` text file), Kconfig-format board configs; Buildroot +2026.08.x and the Debian bookworm build container, both unchanged + +**Primary Dependencies**: `rauc` 1.15.2 and `host-rauc` from the pinned Buildroot tree (pulls +`libglib2`, `openssl`, `squashfs`); `uboot-tools` with `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV`; +`host-uboot-tools` for `mkenvimage`; `genimage`, `dosfstools`, `e2fsprogs`, `mtools` already +present. BusyBox `watchdog` applet already enabled. The `openssl` command line becomes a +build-environment dependency and is added to the `Dockerfile` explicitly, rather than relied on as +a transitive dependency of `ca-certificates`. No internal package, no new `.hash` file: kernel +6.18.38 and U-Boot 2026.07 keep their versions. + +**Storage**: one SD card, MBR, four primaries plus a reserved region — +`reserved env 0x80000+0xA0000` / `p1 boot FAT 32 MiB` / `p2 rootfs.A 512 MiB` / +`p3 rootfs.B 512 MiB` / `p4 data 256 MiB`; about 1.3 GB of image, 2 GB minimum medium. Slot +filesystem is a 128 MiB read-only ext4. See [contracts/storage-layout.md](contracts/storage-layout.md). + +**Testing**: no unit framework (Principle IV). Verification is `make check` extended to the new +layout and scripts, plus the hardware scenarios in [quickstart.md](quickstart.md): a flash-and-boot +run, an update, five power cuts mid-install, a deliberately broken bundle, a deliberately hung +slot, and four rejected bundles. + +**Target Platform**: BeagleBone Black (AM335x, Cortex-A8), SD card, serial console on J1 at +115200 8N1. On-board eMMC untouched. + +**Project Type**: embedded Linux build system — Buildroot `BR2_EXTERNAL` tree, no application code + +**Performance Goals**: boot no slower than 11.50 s + 10% = **12.65 s** from the U-Boot SPL banner to +the login prompt, measured as in `docs/boot-baseline-beaglebone-black.md` (SC-008); update complete +within 5 minutes of one command plus one reboot (SC-001). Dropping `bootdelay` from the measured +2.08 s is available as headroom if slot selection costs anything. + +**Constraints**: the ROM boots only from an MBR medium with a FAT partition, so GPT is unavailable +and all four primaries are spoken for; `ENV_OFFSET` must be set explicitly because its +`ARCH_OMAP2PLUS` default of 0x260000 lands inside partition 1; the running slot is read-only; +exactly one attempt counter may be active; the bootloader area is never written by an update; no +private key in the repository; `/workspace` stays a single mount; build as the unprivileged `br` +user. + +**Scale/Scope**: one board adopts A/B; the shared layer must let a second board adopt it by adding +board-local files only (FR-029), verified by review until a second board exists (FR-025). + +## Constitution Check + +*GATE: must pass before Phase 0 research. Re-checked after Phase 1 design — still passing.* + +| Principle | Verdict | Notes | +|---|---|---| +| I — Upstream immutable | **PASS** | No change under `buildroot/`. U-Boot and kernel are customised through `BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG` and `BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG` with files under `board/ota/beaglebone_black/`, generated by `make uboot-update-defconfig` and `make linux-update-defconfig`, not by hand-written fragments. Slot-selection logic is a text environment file in the external tree (FR-005). | +| II — Reproducible, integrity-checked | **PASS** | Every new dependency is an upstream Buildroot package carrying its own hash; kernel and U-Boot versions are unchanged so `patches/*/*.hash` needs no edit. `BR2_DOWNLOAD_FORCE_CHECK_HASHES` stays on. Versions stay pinned. Single `/workspace` mount unchanged. | +| III — Small, declarative, idiomatic | **PASS** | Defconfig changes go through `menuconfig` and `savedefconfig`; scripts are POSIX `sh` with `set -eu`, quoted expansions and Buildroot-exported variables; no speculative abstraction — one init script, one post-image step, one make target. | +| IV — Verification (non-negotiable) | **PASS with obligations** | This change touches partition layout, bootloader environment, kernel configuration, bootargs and init, so the hardware boot smoke test is mandatory and a green `make check` is explicitly not sufficient. `make check` must also grow: new scripts linted, the four-partition-plus-reserved-region layout asserted, the kernel inside the slot rather than the boot partition asserted. Evidence goes in the PR. | +| V — Consistent developer and operator experience | **PASS with obligations** | A new `make ota-dev-keys` target extends the documented make surface, so `README.md`, `CLAUDE.md` and `make help` change in the same commit. Board parity holds: the board keeps `genimage.cfg`, `post-image.sh` and `rootfs_overlay/`, still reuses `board/ota/common/`, still produces one flashable artifact, and the README gains the update and rollback procedures. `/etc/build-info` and `/etc/issue` stay. | +| VI — Performance and footprint budgets | **PASS with obligations** | Partition sizes change, so every figure in the README's footprint paragraph is re-measured: both slots, the boot partition, the data area, `sdcard.img`, the bundle. Boot time is re-measured against 11.50 s. The environment is now written on every boot attempt; that cost is part of the boot-time measurement. | +| VII — Secure and safe defaults | **PASS** | Nothing in the repository is a credential: `make ota-dev-keys` generates a development CA and a bundle-signing pair into the gitignored `keys/dev/`, and neither private key nor either certificate is committed (research R7, [contracts/signing-chain.md](contracts/signing-chain.md)). The keyring holds the CA, so a compromised signing key is answered by issuing a new certificate instead of reflashing. Both certificate subjects say `NOT FOR PRODUCTION`. Bundles are signed and verified before anything is written. `dd` instructions keep their device warning. Passwordless root is unchanged and remains a development-image property; a hardened variant stays out of scope. | + +No gate is violated, so the Complexity Tracking table below records only the two configuration +files this feature has to introduce and why nothing smaller would do. + +## Project Structure + +### Documentation (this feature) + +```text +specs/002-ab-ota-rauc/ +├── plan.md # This file +├── spec.md # Frozen specification +├── research.md # Phase 0: six decisions +├── data-model.md # Phase 1: entities and state transitions +├── quickstart.md # Phase 1: validation scenarios +├── contracts/ +│ ├── storage-layout.md # Byte-level layout, who writes what +│ ├── boot-interface.md # Environment variables, device commands, make surface +│ └── signing-chain.md # The two key/certificate pairs and their three phases +├── checklists/requirements.md # Spec quality checklist +└── tasks.md # Created by /speckit-tasks, not here +``` + +### Repository changes + +```text +configs/beaglebone_black_defconfig A/B packages, read-only rootfs, custom U-Boot and + kernel configs, 128 MiB slot filesystem + +board/ota/common/ +├── post-build.sh unchanged +└── rootfs_overlay/ + ├── etc/issue unchanged + └── etc/init.d/S99ota-health NEW, board-independent: four FR-012 checks, + rauc status mark-good, then start the watchdog feeder + +board/ota/beaglebone_black/ +├── genimage.cfg REWRITTEN: four primaries + reserved env region +├── post-image.sh REWRITTEN: mkenvimage, genimage, then host-rauc bundle +├── uboot.config NEW: env in raw MMC, redundant, second counter off +├── uboot-env.txt NEW: default environment and the slot-selection script +├── linux.config NEW: watchdog built in, bounded open timeout +├── rauc-system.conf NEW: compatible string, keyring path, two slots +├── fw_env.config NEW: the same two offsets, for the running system +├── rootfs_overlay/etc/ +│ ├── hostname unchanged +│ └── fstab NEW: read-only root, persistent data, volatile state +├── uEnv.txt DELETED: the baseline proves it is never read +└── extlinux.conf DELETED: replaced by the slot-selection script + +Makefile NEW target ota-dev-keys, the three OTA_* variables, + and a check_keys guard on build +scripts/gen-dev-keys.sh NEW: generates the development CA and signing pair +scripts/check.sh extended: new scripts, new layout assertions +Dockerfile openssl added explicitly, not inherited from + ca-certificates +keys/dev/ NEW, gitignored: CA and bundle-signing material +.gitignore /keys/ +README.md, CLAUDE.md update, flash, rollback, layout, make surface +``` + +**Structure Decision**: nothing moves outside the existing `BR2_EXTERNAL` layout. The only +board-independent new file is the health init script, which belongs in `board/ota/common/` because +FR-029 requires a second board to adopt A/B by adding board-local files only; everything that names +a device, an offset or a slot is board-local. The two deletions are not cleanup for its own sake: +the baseline log shows the board boots through `extlinux.conf` and never reads `uEnv.txt`, and both +are replaced by the slot-selection script. + +## Complexity Tracking + +| Violation | Why Needed | Simpler Alternative Rejected Because | +|-----------|------------|-------------------------------------| +| A custom U-Boot configuration file (`uboot.config`) replacing the plain `am335x_evm` defconfig | The environment must leave FAT for raw redundant storage, the slot-selection script must be the default environment, and the inherited second boot counter must be switched off. None of that is expressible without changing U-Boot's configuration. | A config *fragment* would be shorter, and `BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES` exists, but the constitution's Technical Constraints require `*_USE_CUSTOM_CONFIG` with a generated file rather than hand-edited fragments. | +| A custom kernel configuration file (`linux.config`) replacing the plain `omap2plus` defconfig | `CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the bootloader's watchdog forever, so a hung slot is never reset and FR-032 cannot be met. The driver is also a module, leaving the early boot window uncovered. | Leaving the kernel alone was the plan until the baseline showed the watchdog is decorative. Relying on the attempt counter alone fails, because nothing reboots a hung device for the counter to act on. | diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md new file mode 100644 index 0000000..ef75309 --- /dev/null +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -0,0 +1,150 @@ +# Quickstart: validating A/B OTA on hardware + +How to prove the feature works. Nine scenarios, each naming the success criterion it discharges. +Scenarios 1–3 need one SD card and a serial console; 4 onwards need the ability to cut power. + +Record every serial capture under `docs/logs/` and summarise the results in the PR: Principle IV +makes the hardware evidence mandatory, and a green `make check` is explicitly not a boot test. + +## Prerequisites + +```bash +# host, once +make docker-build +make docker-shell + +# inside the container +make beaglebone_black_defconfig +make ota-dev-keys # once: CA + signing pair into keys/dev/ ; the build names this + # command if the key is missing, before it starts building +make build # produces sdcard.img and beaglebone_black-.raucb +``` + +Flashing and serial are unchanged from the README, including holding **S2** at power-on and the +`grabserial` invocation from `docs/boot-baseline-beaglebone-black.md`. + +## 1. Flash and boot with redundant slots — SC-005, FR-021 + +```bash +sudo dd if=output/beaglebone_black/images/sdcard.img of=/dev/sdX bs=4M conv=fsync # check sdX +``` + +On the device: + +```sh +rauc status # booted: rootfs.0 (A), good; rootfs.1 (B) inactive +cat /etc/build-info # BOARD, VERSION, BUILDROOT of the running slot +mount | grep ' / ' # ro +touch /mnt-test 2>&1 # must fail: read-only root -> SC-012 +touch /data/keep && sync # must succeed +fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +``` + +Expected: `BOOT_ORDER="A B"`, both counters at 3, and the console line from the slot-selection +script naming A during boot (FR-027). + +## 2. Boot time has not regressed — SC-008 + +Three `grabserial` runs, same method as the baseline. Mean from the SPL banner to the login prompt +must be **≤ 12.65 s** (11.50 s + 10%), or the regression is justified in writing. + +## 3. Install an update and confirm it — SC-001, SC-006, FR-006..FR-012 + +Build a second, visibly different revision (any commit changes `VERSION`), copy its bundle to +`/data`, then: + +```sh +rauc install /data/beaglebone_black-.raucb +fw_printenv BOOT_ORDER # "B A" +rauc status # rootfs.1 pending +reboot +# after reboot +cat /etc/build-info # the new VERSION +rauc status # booted rootfs.1, good; rootfs.0 still holds the old version +cat /data/keep # unchanged -> SC-006 +``` + +Also confirm FR-009: attempt a second `rauc install` between install and reboot; it must be refused +with a message naming the pending state, and `rauc status` must be unchanged afterwards. + +## 4. Power loss during install never costs the device — SC-002 + +Five trials. Start `rauc install`, cut power at a different point each time (early, mid-write, +near the end), then power on normally: + +```sh +cat /etc/build-info # the PREVIOUS version, every time +rauc status # booted the previously good slot, good +mount | grep ' / ' # ro, intact +``` + +Five out of five must pass. Record the point of interruption per trial. + +## 5. A broken update rolls back by itself — SC-003, FR-013..FR-015 + +Build a bundle that cannot boot — the simplest honest break is a bundle whose kernel is replaced +with garbage, so U-Boot loads nothing. Install it, reboot, and watch the console without touching +the board: + +``` +expect: slot B chosen, BOOT_B_LEFT counts 3 -> 2 -> 1 -> 0 across attempts, + then slot A chosen and booted +``` + +On the device afterwards: `rauc status` shows A good and running, B bad, and the reason is readable +from `/data`. Three trials. + +## 6. A hung slot is reset and retired — SC-014, FR-032 + +Install a bundle whose health script is made to hang (or whose init stops before `S99ota-health`). +Reboot and leave the board alone: + +``` +expect: the watchdog resets the board within the documented window, + each reset spends one attempt, and the device ends on the previous good slot +``` + +Three trials. This is the scenario the current image cannot pass at all, because +`CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the +watchdog forever — worth capturing a "before" run on the unmodified image to show the difference. + +## 7. Untrusted and broken bundles are refused — SC-004, FR-016..FR-019 + +Four attempts, each must be refused *before* anything is written, with a distinct message, and +`rauc status` plus both slots unchanged afterwards: + +| Bundle | Expected refusal | +|---|---| +| unsigned | no valid signature | +| signed by a second CA and signing pair, generated into a scratch directory with `OTA_SIGNING_*` pointed at it | the chain does not reach the CA in the device keyring | +| a trusted bundle with a byte flipped after signing | integrity failure | +| built with a different `compatible` string | wrong board | + +## 8. State written where it cannot be lost — SC-013, FR-014 + +Make `fw_setenv` fail (point `/etc/fw_env.config` at a wrong offset on a test image). The health +check must fail its fourth condition, the slot must never be marked good, the device must roll +back, and the reason must survive the reboot in `/data`. + +## 9. Footprint re-measured — SC-007 + +From the build host and the device, and then into the README: + +```bash +ls -l output/beaglebone_black/images/{sdcard.img,*.raucb} +du -sh output/beaglebone_black/target +``` + +```sh +df -h /; df -h /data +``` + +Neither slot nor the boot partition above 80%; `/data` holds at least one bundle with room to +spare; the image still fits a 2 GB card. + +## What `make check` covers, and what it cannot + +`make check` lints the new scripts, asserts that `genimage.cfg`, `uboot.config` and +`fw_env.config` carry the same offsets, and asserts the kernel lives in the slot rather than the +boot partition. It cannot boot anything. Scenarios 1–9 are manual until this project has an +emulated board, which is the obvious next feature. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md new file mode 100644 index 0000000..40a95b4 --- /dev/null +++ b/specs/002-ab-ota-rauc/research.md @@ -0,0 +1,266 @@ +# Phase 0 Research: A/B Atomic OTA Update + +Six questions had to be settled before the design could be written. Every finding below was +checked against the pinned sources in this tree (`buildroot/`, `output/beaglebone_black/build/`) +or against the measured baseline in `docs/boot-baseline-beaglebone-black.md`, not against memory. + +## R1. Partition table: MBR or GPT, and where the boot-selection state lives + +**Decision**: MBR with four primary partitions, and the boot-selection state in an **unpartitioned +reserved region** before the first partition, not in a partition of its own. + +**Rationale**: the AM335x boot ROM reads the MBR, checks the 0xAA55 signature and then looks +through the partition entries for a bootable FAT partition. A GPT medium presents only a +protective MBR with a single 0xEE entry, so the ROM finds no FAT partition and never loads `MLO`. +That closes the door FR-001 left open: with GPT unavailable and all four MBR primaries spoken for +by boot, rootfs.A, rootfs.B and data, the state cannot be a partition, so it becomes a reserved +region and `genimage` must be told to keep it out of the partition table. + +**Alternatives considered**: + +- *GPT with a state partition*: semantically the nicest (every tool sees the region is taken, which + is how Android's `misc` partition works) but it costs the ability to boot. +- *ROM raw boot mode plus GPT*: the ROM's raw mode does boot from a GPT medium, since it ignores + the partition table and reads the image from a fixed offset. Rejected: it moves `MLO` to a raw + offset, abandons the FAT boot partition the board already uses, and those same fixed offsets are + where the state region would want to live. +- *An extended/logical partition for the state*: a path almost nobody walks with this ROM and this + bootloader, for no gain over a reserved region. + +**Follow-up**: the exact reserved offsets depend on where the ROM looks for a raw image, which is +R2. One caveat worth carrying into implementation: a FAT volume-size field written by some +`mkfs.fat` versions has been reported to stop an AM335x from booting. The current image boots, so +the container's `dosfstools` is fine today; if the boot partition stops being found after a +`dosfstools` bump, look there first. + +## R2. Relocating the U-Boot environment out of FAT + +**Decision**: `ENV_IS_IN_MMC` on device 0 with a redundant copy, primary at **0x80000** and +redundant at **0xA0000**, each `ENV_SIZE` 0x20000 (the value already configured); the first +partition starts at 1 MiB. `/etc/fw_env.config` names the same two offsets. The factory image +ships this region already populated. + +``` +0x000000 MBR (sector 0) +0x000000 ┐ +0x020000 │ offsets where the ROM looks for a raw boot image: 0, 128K, 256K, 384K +0x040000 │ (secondary source; verify against the AM335x TRM during implementation) +0x060000 ┘ +0x080000 environment, primary 128 KiB +0x0A0000 environment, redundant copy 128 KiB +0x0C0000 unused headroom 256 KiB +0x100000 partition 1 (boot, FAT) begins at 1 MiB / sector 2048 +``` + +**Rationale**: the baseline log shows the board running +`CONFIG_ENV_IS_IN_FAT` with `uboot.env` on `mmc 0:1`, a file that does not exist yet, so U-Boot is +using its built-in default environment. Two reasons to move it: + +1. Every boot attempt decrements `BOOT__LEFT` and writes the environment. In FAT that write + lands in the same filesystem as `MLO` and `u-boot.img`, and vfat has no journal, so an + interrupted write can cost the device its bootloader. SC-002 requires surviving five power cuts. + A raw redundant environment is the mechanism designed for exactly that. +2. Writing it from Linux would otherwise require mounting the boot partition read-write, which + contradicts a read-only OS slot and opens the bootloader's filesystem to every process. + +0x80000 sits past all four offsets the ROM inspects for a raw image, which is why it is the +conventional choice on this SoC, and it is comfortably inside the 1 MiB gap before partition 1. + +**Correction to an earlier claim in this feature's discussion**: `fw_setenv` *can* address an +environment stored as a file in a FAT filesystem — `tools/env/fw_env.config` in U-Boot 2026.07 +carries a "VFAT example". The reason to move the environment is power-fail atomicity, not tool +support. + +**Symbol names**: RAUC's integration guide still names `CONFIG_SYS_REDUNDAND_ENVIRONMENT`, which no +longer exists. The symbols actually present in `output/beaglebone_black/build/uboot-2026.07/env/Kconfig` +are `ENV_IS_IN_MMC`, `ENV_OFFSET`, `ENV_OFFSET_REDUND`, `ENV_REDUNDANT`, `ENV_MMC_DEVICE_INDEX` and +`ENV_SOURCE_FILE`. Copying configuration out of the RAUC docs will not work. + +**A trap to avoid**: `ENV_OFFSET` defaults to `0x260000` for `ARCH_OMAP2PLUS`. That is 2.5 MiB, +which lands *inside* partition 1 in this layout. Enabling `ENV_IS_IN_MMC` without setting the +offset explicitly would silently corrupt the boot partition after a few updates. + +**Alternatives considered**: + +- *Environment at the end of the medium* (`ENV_OFFSET_REDUND_RELATIVE_END`, negative offsets): + avoids the gap arithmetic, but the region then falls outside the 1.3 GB factory image, so a + freshly flashed device has no environment and its absolute position changes with the size of the + card. +- *Leaving the environment in FAT*: cheapest, and upstream RAUC does list `CONFIG_ENV_IS_IN_FAT` as + a legal choice, but it fails the power-cut requirement above. +- *An eMMC hardware boot partition*: out of scope, this board boots from SD. + +## R3. Filesystem for the read-only OS slot + +**Decision**: **ext4, mounted read-only**, as a 128 MiB filesystem inside each 512 MiB slot. RAUC +slot type `ext4`. + +**Rationale**: the obvious companion to a read-only slot is a read-only filesystem, but +`output/beaglebone_black/build/linux-6.18.38/.config` has `# CONFIG_SQUASHFS is not set`. The +kernel support is only the smallest part of that cost: squashfs also changes the rootfs image +produced by Buildroot, the slot type RAUC writes, and how the slot's size relates to its contents. +Doing it in the same change as the layout, the bootloader environment and the rollback path would +make a failure hard to attribute. ext4 mounted read-only satisfies FR-006 today. + +Sizing: the measured rootfs content is 29.5 MiB and `zImage` is 7.29 MiB, so a slot holds about +37 MiB once the kernel moves in. The current `BR2_TARGET_ROOTFS_EXT2_SIZE` of 60 MiB would be at +62% — under the 80% ceiling but with little room for the data a real feature would add. 128 MiB +puts it near 30% and still writes in seconds. + +**Alternatives considered**: + +- *squashfs now*: smaller slots, smaller bundles, and read-only by construction rather than by + mount option. Deferred, not rejected: worth doing once A/B is proven, and it becomes cheaper + because this feature already introduces a custom kernel configuration (R5). +- *A 512 MiB filesystem filling the slot*: no benefit, and every install would write 512 MiB. +- *dm-verity on the slot*: needs kernel device-mapper support this configuration lacks, and + verified boot is explicitly out of scope. + +## R4. One boot counter, not two + +**Decision**: count attempts only in `BOOT__LEFT` in the environment. Turn off the inherited +`CONFIG_BOOTCOUNT_LIMIT` and `CONFIG_BOOTCOUNT_AM33XX` in the board's U-Boot configuration. + +**Rationale**: the board's current U-Boot configuration already has `CONFIG_BOOTCOUNT_LIMIT=y` and +`CONFIG_BOOTCOUNT_AM33XX=y`, inherited from `am335x_evm`, held harmless only because +`CONFIG_BOOTCOUNT_BOOTLIMIT=0`. That counter lives in an RTC scratch register, and this board has +no RTC backup battery, so it is lost on power removal — the very event SC-002 exercises five times. +Leaving a second counter configured invites someone to enable it later and produce a device with +two disagreeing answers to "how many attempts are left". FR-003 forbids it. + +**Alternatives considered**: using the SoC counter as the primary mechanism (rejected: not +power-fail safe here, and RAUC's U-Boot interface does not read it); leaving it configured but +disabled (rejected: FR-003, and it is one grep away from being switched on by accident). + +## R5. Marking a slot good, and catching a hang, under BusyBox init + +**Decision**: one init script late in the BusyBox sequence checks the four conditions of FR-012, +calls `rauc status mark-good`, and only then starts the watchdog feeder. The kernel is configured +to stop covering an already-running watchdog after a bounded grace period, so the window before +that script runs is covered too. + +**Rationale**: RAUC's documentation assumes systemd — *"It is a good idea to wait for the system to +be fully started before marking it as successfully booted"*, implemented as a service ordered after +the others. This image uses BusyBox init, so the equivalent is an `S99` script; the principle +survives, only the mechanism changes. + +The hang half needs a kernel change, and the baseline explains why. +`output/beaglebone_black/build/linux-6.18.38/.config` has: + +``` +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_CORE=m +CONFIG_OMAP_WATCHDOG=m +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +CONFIG_WATCHDOG_OPEN_TIMEOUT=0 +``` + +U-Boot starts the watchdog with a 60 s timeout, as the baseline log shows. With +`HANDLE_BOOT_ENABLED=y` and an open timeout of 0, the kernel takes over an already-running +watchdog and pings it **indefinitely** while no userspace process has opened `/dev/watchdog`. A +device that boots and then hangs is therefore never reset, which is precisely the failure FR-032 +rules out. The watchdog looks like protection and provides none. + +The configuration this feature needs: the core and the driver built in rather than modules, so the +window between kernel start and module loading is not a gap, and a non-zero +`CONFIG_WATCHDOG_OPEN_TIMEOUT` so the kernel's courtesy pings stop if userspace never claims the +device. After the health script claims it, keeping the device alive depends on a userspace process +continuing to run, which is what FR-032 asks for. + +The feeder itself is the BusyBox `watchdog` applet, already enabled in this image's BusyBox +configuration, so no new package is needed. + +**Alternatives considered**: + +- *The `watchdog` package* (in Buildroot, supports test and repair scripts): a better fit once there + is an application whose health is worth testing. Today it would only wrap the same checks the + init script already makes. +- *Feeding the watchdog from early init*: rejected, it restores exactly the "looks like protection" + situation above. +- *No watchdog, rely on the attempt counter alone*: rejected by FR-032; the counter only acts at + boot, so nothing would ever reboot a hung device. + +## R6. Bundle format and the tools around it + +**Decision**: RAUC 1.15.2 from the pinned Buildroot tree, `plain` bundle format, bundles produced +at build time by `host-rauc`, environment access on the device through `fw_printenv`/`fw_setenv` +from `uboot-tools`. + +**Rationale**: `buildroot/package/rauc/` carries RAUC 1.15.2 with a `host-rauc` variant for +creating bundles, selects `squashfs` as a runtime dependency (a bundle *is* a signed squashfs), and +its help text states plainly that *"The U-Boot bootloader support requires fw_getenv / fw_setenv +from uboot-tools"*, so `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV` is the matching option. No internal +package has to be written and no new hash file is needed: every new dependency is an upstream +Buildroot package with its own hash, and the kernel and U-Boot versions do not change. + +`plain` is chosen because it needs nothing from the kernel. The `verity` format and streaming +installs want device-mapper support this configuration does not enable, and streaming is pointless +while bundle delivery is out of scope. + +**To verify during implementation** (cheap, and wrong assumptions here are expensive): + +1. Which binary names RAUC 1.15.2 actually invokes for the environment, and that `uboot-tools` + installs all of them — `fw_getenv` may need a symlink. +2. The ROM's raw-image offsets against the AM335x TRM, before trusting 0x80000 (R2). +3. That `genimage` in this tree supports a region outside the partition table + (`in-partition-table = false`), which is how the environment region gets into the factory image. + +## R7. Development signing material: a two-tier CA, not a single self-signed key + +**Decision**: `make ota-dev-keys` generates **two** pairs into the ignored `keys/dev/` directory — +a CA (`dev-ca.key.pem`, `dev-ca.cert.pem`, `CA:TRUE`, ten years) that only ever certifies other +keys, and a bundle-signing pair (`dev-signing.key.pem`, `dev-signing.cert.pem`, `CA:FALSE`, +`codeSigning`, five years) certified by that CA. The device keyring holds the **CA** certificate; +the signing certificate travels inside each bundle's CMS signature. Neither private key is +committed, and the certificates are generated rather than committed. See +[contracts/signing-chain.md](contracts/signing-chain.md). + +**Rationale**: RAUC documents three PKI strategies, and the difference between them is whether a +key can ever be replaced without reflashing every device. With a single self-signed key, the +certificate in the keyring *is* the signing certificate, and RAUC states plainly that you then +"can't replace expired certificates without updating the keyring" and "can't revoke a compromised +key". The keyring lives in the rootfs, so updating it means reflashing. With a CA in the keyring, +a lost or compromised signing key is answered by issuing a new certificate, and the devices do not +change. That difference cannot be retrofitted: moving from a single key to a CA later invalidates +every card already flashed, so the structure has to be right in this feature even though only one +environment exists today. + +No `--intermediate` argument is needed. The chain is two levels, and `rauc bundle --cert` already +embeds the signing certificate in the CMS signature; `--intermediate` is for closing a chain that +has a CA *between* the signing certificate and the trust anchor. RAUC is explicit that +intermediates "should not be added to the keyring", which is only for trust anchors. + +**Alternatives considered**: + +- *One self-signed key, certificate committed*: the shortest path, and what this feature's + clarification log originally pictured. It cannot work as described: a committed certificate is + only useful if every developer shares the matching private key, which FR-020 forbids, so an image + built from the committed certificate would reject the bundles of the developer who generated + their own key. +- *One self-signed key, nothing committed*: coherent, and what the plan said before this round. + Rejected because of the reflash trap above. +- *A three-tier chain (root, per-environment CA, signing certificate)*: the right shape if several + environments shared one root, but RAUC's "Separate CAs" strategy is the opposite — each device + carries only its own environment's CA, which is exactly the isolation wanted — so a third tier + buys nothing here. + +**Build-time plumbing**: three variables resolve the material, defaulting to `keys/dev/`, so a +later feature can point them at staging or production material, or at PKCS#11 URLs for an HSM, +without touching a script: `OTA_KEYRING` (read by `post-build.sh`, installed as +`/etc/rauc/keyring.pem`), `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` (read by `post-image.sh`). RAUC +accepts PKCS#11 URLs in place of filenames for `--cert` and `--key`, so that path needs no new code. + +**Consequence to document**: a bundle installs only on an image built with the same key. That is +what a trust domain means, and it is the behaviour staging and production separation relies on. + +## Consequences for the spec + +Two items in the spec are affected and are handled in `plan.md` rather than silently: + +- **FR-001's open choice is now closed**: the boot-selection state is a reserved region, because + GPT is unavailable (R1). The spec's neutral wording stands; the implementation records the choice. +- **FR-020's "the development certificate MAY be committed"**: nothing is committed. One documented + command generates a CA and a signing certificate into an ignored directory, and the build copies + the CA certificate into the image's keyring (R7). FR-020 permits this: it requires only that the + private key is not committed and that the material is unmistakably development-only, which the + certificate subjects state in words. From 07b06ca1afee5ea749c85e155400be841449187e Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 12:24:09 +0700 Subject: [PATCH 04/61] specs: break A/B OTA into 45 dependency-ordered tasks Phase 2 output for feature 002, plus four corrections to the plan that writing the tasks forced. The task list is ordered so the single most expensive mistake is caught first. T016 proves that fw_printenv in Linux and printenv at the U-Boot prompt see the same boot-selection state, and that fw_setenv writes reach the bootloader. If that is wrong, every update rolls back while every image is sound, and it is the most commonly reported failure in systems of this shape. It sits at the end of the foundational phase, before any user story, and the strategy section says not to batch the hardware verifications to the end for exactly this reason. User Story 1 is the MVP and carries the brick risk: a board that boots as before on the new layout, with rauc status answering and the boot-time budget proven. The remaining stories add updating, rollback, trust and observability in that order. Fifteen tasks need the board, which is not a formality: this feature changes the partition layout, the bootloader environment, the kernel configuration, the bootargs and init, and the constitution requires a boot smoke test for every one of those. Three tasks exist only because the boot baseline contradicted an assumption: one disables a second boot counter nobody knew was enabled, one fixes a watchdog that looks like protection and provides none, and one deletes a boot configuration file the board never reads. The plan corrections, all in the same direction -- prefer an upstream Buildroot mechanism over scripting of ours: - CONFIG_ENV_SOURCE_FILE cannot carry the slot-selection script. U-Boot requires that file to live inside its own source tree with a .env extension and errors out when it is absent, so pointing it at the external tree is impossible and using it would mean shipping the boot logic inside a patch. - BR2_TARGET_UBOOT_DEFAULT_ENV_FILE does the job properly: Buildroot resolves the path and sets CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE and CONFIG_ENV_DEFAULT_ENV_TEXT_FILE, both of which exist in U-Boot 2026.07. - BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE turns the same text file into uboot-env.bin, so post-image.sh no longer calls mkenvimage itself. Note there is no BR2_TARGET_UBOOT_ENVIMAGE; the option lives under host-uboot-tools. - Both mechanisms are needed, because they fail differently. The built-in default is what boots the board if the reserved region is unreadable; the seeded region is what the running system reads, since fw_printenv has no access to the built-in default. An unseeded region fails the fourth health condition on the first boot. No code yet. Co-Authored-By: Claude Opus 5 --- .../contracts/boot-interface.md | 20 +- .../contracts/storage-layout.md | 8 +- specs/002-ab-ota-rauc/plan.md | 9 +- specs/002-ab-ota-rauc/research.md | 25 ++ specs/002-ab-ota-rauc/tasks.md | 377 ++++++++++++++++++ 5 files changed, 430 insertions(+), 9 deletions(-) create mode 100644 specs/002-ab-ota-rauc/tasks.md diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index fe51bfc..e710c88 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -5,9 +5,23 @@ live in [storage-layout.md](storage-layout.md). ## U-Boot: the slot-selection script -Lives in `board/ota/beaglebone_black/uboot-env.txt`, compiled into U-Boot's default environment -through `CONFIG_ENV_SOURCE_FILE`, so the logic is a reviewable text file in this repository and -upstream U-Boot source stays untouched (FR-005). +Lives in `board/ota/beaglebone_black/uboot-env.txt`, a `key=value` text file in this repository. +Buildroot wires that one file in twice, so neither a custom script nor a U-Boot patch is needed +(FR-005): + +| Option | Effect | +|---|---| +| `BR2_TARGET_UBOOT_DEFAULT_ENV_FILE` | the file becomes U-Boot's **built-in default** environment. Buildroot resolves the path and sets `CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE` and `CONFIG_ENV_DEFAULT_ENV_TEXT_FILE`, both present in U-Boot 2026.07 | +| `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE`, `_SOURCE` set to the same file, `_SIZE=0x20000`, `_REDUNDANT=y` | the same file becomes `uboot-env.bin` in `BINARIES_DIR`, which `genimage` writes into the reserved region at both offsets | + +Both are needed, for different failures. The built-in default is what boots the board if the +reserved region is ever unreadable. The seeded region is what `fw_printenv` reads: the running +system cannot see U-Boot's built-in default at all, so without the seed the health check of FR-012 +fails on its fourth condition on the very first boot, and every update would roll back. + +U-Boot's own `CONFIG_ENV_SOURCE_FILE` is not usable here. It requires the file to sit inside the +U-Boot source tree as `board///.env` and errors out when it is absent, which +would mean carrying the boot logic in a patch instead of in a reviewable file. Behaviour, in order: diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index e1ea4b3..ce58a56 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -35,9 +35,11 @@ total ~1.3 GB minimum medium 2 GB; extra space is unused 3. **`ENV_OFFSET` is set explicitly.** Its `ARCH_OMAP2PLUS` default is `0x260000`, which is inside partition 1. Enabling `ENV_IS_IN_MMC` without overriding it corrupts the boot partition. 4. **The state region is in the factory image.** `genimage` places it outside the partition table - (`in-partition-table = false`), filled with an image built by `mkenvimage` from - `uboot-env.txt`, so a freshly flashed device boots with `BOOT_ORDER="A B"` and full counters and - never needs a first write. + (`in-partition-table = false`) and writes `uboot-env.bin` at both offsets. That file is built by + `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE` from `uboot-env.txt`, so a freshly flashed device boots + with `BOOT_ORDER="A B"` and full counters, and `fw_printenv` can read the state on the first + boot. Seeding is not a nicety: `fw_printenv` cannot see U-Boot's built-in default environment, + so an unseeded region fails the health check of FR-012 immediately. 5. **The boot partition is written only by flashing.** No update touches `MLO` or `u-boot.img` (FR-004). The state region is not part of it, so writing the state never risks the bootloader. 6. **The slot filesystem is smaller than the slot.** 128 MiB of ext4 inside a 512 MiB partition. diff --git a/specs/002-ab-ota-rauc/plan.md b/specs/002-ab-ota-rauc/plan.md index 3a79a49..e82203a 100644 --- a/specs/002-ab-ota-rauc/plan.md +++ b/specs/002-ab-ota-rauc/plan.md @@ -31,7 +31,8 @@ environment script (`ENV_SOURCE_FILE` text file), Kconfig-format board configs; **Primary Dependencies**: `rauc` 1.15.2 and `host-rauc` from the pinned Buildroot tree (pulls `libglib2`, `openssl`, `squashfs`); `uboot-tools` with `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV`; -`host-uboot-tools` for `mkenvimage`; `genimage`, `dosfstools`, `e2fsprogs`, `mtools` already +`host-uboot-tools` with its environment-image option, which turns the board's environment text file +into `uboot-env.bin` without any scripting of ours; `genimage`, `dosfstools`, `e2fsprogs`, `mtools` already present. BusyBox `watchdog` applet already enabled. The `openssl` command line becomes a build-environment dependency and is added to the `Dockerfile` explicitly, rather than relied on as a transitive dependency of `ca-certificates`. No internal package, no new `.hash` file: kernel @@ -118,9 +119,11 @@ board/ota/common/ board/ota/beaglebone_black/ ├── genimage.cfg REWRITTEN: four primaries + reserved env region -├── post-image.sh REWRITTEN: mkenvimage, genimage, then host-rauc bundle +├── post-image.sh REWRITTEN: genimage, then the host-rauc bundle ├── uboot.config NEW: env in raw MMC, redundant, second counter off -├── uboot-env.txt NEW: default environment and the slot-selection script +├── uboot-env.txt NEW: default environment and the slot-selection script. + Buildroot feeds it to U-Boot's built-in default and to + the env image that seeds the reserved region ├── linux.config NEW: watchdog built in, bounded open timeout ├── rauc-system.conf NEW: compatible string, keyring path, two slots ├── fw_env.config NEW: the same two offsets, for the running system diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 40a95b4..457f3f1 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -80,6 +80,31 @@ are `ENV_IS_IN_MMC`, `ENV_OFFSET`, `ENV_OFFSET_REDUND`, `ENV_REDUNDANT`, `ENV_MM which lands *inside* partition 1 in this layout. Enabling `ENV_IS_IN_MMC` without setting the offset explicitly would silently corrupt the boot partition after a few updates. +**How the environment text file reaches both places, without a script**: Buildroot has two options +for this and neither was in the first draft of this plan, which proposed hand-rolling `mkenvimage` +in `post-image.sh`. Principle III prefers an upstream mechanism over custom scripting, and here +there are two: + +- `BR2_TARGET_UBOOT_DEFAULT_ENV_FILE` takes a path to the text file, resolves it, and sets + `CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE` plus `CONFIG_ENV_DEFAULT_ENV_TEXT_FILE` — both of which + exist in U-Boot 2026.07 (`env/Kconfig` lines 800 and 810). The file becomes U-Boot's built-in + default environment. +- `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE`, with `_SOURCE` pointing at the same file, `_SIZE` at + `0x20000` and `_REDUNDANT` enabled, produces `uboot-env.bin` in `BINARIES_DIR` for `genimage` to + write into the reserved region. + +Note that there is no `BR2_TARGET_UBOOT_ENVIMAGE`; the option lives under `host-uboot-tools`. + +U-Boot's own `CONFIG_ENV_SOURCE_FILE` cannot be used: its help states the file "must be in the +board directory and have a .env extension", inside the U-Boot source tree, and that "if the file +is not present, an error is produced". Pointing it at the external tree is not possible, so using +it would mean shipping the boot logic inside a patch instead of as a reviewable file. + +Both mechanisms are needed, because they fail differently. The built-in default is what boots the +board when the reserved region is unreadable. The seeded region is what the running system reads: +`fw_printenv` has no access to U-Boot's built-in default, so an unseeded region fails the fourth +condition of FR-012 on the first boot and every update would roll back. + **Alternatives considered**: - *Environment at the end of the medium* (`ENV_OFFSET_REDUND_RELATIVE_END`, negative offsets): diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md new file mode 100644 index 0000000..1017e19 --- /dev/null +++ b/specs/002-ab-ota-rauc/tasks.md @@ -0,0 +1,377 @@ +--- + +description: "Task list for the A/B Atomic OTA Update feature" +--- + +# Tasks: A/B Atomic OTA Update with Automatic Rollback + +**Input**: Design documents from `/specs/002-ab-ota-rauc/` + +**Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/storage-layout.md, +contracts/boot-interface.md, contracts/signing-chain.md, quickstart.md + +**Tests**: No unit-test framework exists (Principle IV) and none was requested. Tasks marked +"Verify" run the checks the constitution requires; those marked "Verify (hardware)" need the board +and produce the serial evidence that goes in the PR. A green `make check` is not a boot test. + +**Organization**: Grouped by user story so each can be implemented and verified independently. + +## Format: `[ID] [P?] [Story] Description` + +- **[P]**: Can run in parallel (different files, no dependency on an incomplete task) +- **[Story]**: US1 flash and boot, US2 update, US3 rollback, US4 trust, US5 observability +- All shell is POSIX `sh`, `set -eu`, quoted expansions, one-line header comment (Principle III) +- Every defconfig change is made with `make menuconfig` and written back with `make savedefconfig`; + never hand-edited (Principle III) +- Everything committed is English + +--- + +## Phase 1: Setup (Shared Infrastructure) + +**Purpose**: the build environment and the signing material, both of which everything else needs. + +- [ ] T001 Add `openssl` to the `apt-get install` list in `Dockerfile`, explicitly rather than + relying on it arriving as a dependency of `ca-certificates`, then rebuild the image with + `make docker-build` (Principle II forbids `apt-get` inside a running container) +- [ ] T002 [P] Add `/keys/` to `.gitignore`, in the same group as `/output/` and `/dl/`, with a + one-line comment saying it holds development signing material +- [ ] T003 [P] Create `scripts/gen-dev-keys.sh`: POSIX `sh`, `set -eu`, `umask 077` **before** + `mkdir`, generating into `$1` the four files of contracts/signing-chain.md — `dev-ca.key.pem` + (RSA 4096), `dev-ca.cert.pem` (`basicConstraints=critical,CA:TRUE,pathlen:0`, + `keyUsage=critical,keyCertSign,cRLSign`, 3650 days), `dev-signing.key.pem` (RSA 2048) and + `dev-signing.cert.pem` (`CA:FALSE`, `keyUsage=critical,digitalSignature`, + `extendedKeyUsage=codeSigning`, 1825 days, issued by the CA). Both subjects carry + `NOT FOR PRODUCTION` in the common name (FR-020). Extensions go through a `mktemp` file with a + `trap ... EXIT`, never bash process substitution. Refuse to run when + `dev-ca.key.pem` already exists, with a message saying that replacing the CA invalidates every + image already flashed and naming `rm -rf` as the deliberate way out. End with `chmod 600` on + the keys and `644` on the certificates +- [ ] T004 In `Makefile`: add `KEYS_DIR ?= $(ROOT_DIR)/keys/dev`; add and `export` `OTA_KEYRING`, + `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` with the defaults in contracts/boot-interface.md; add + a `check_keys` macro that passes when the selected board's defconfig has no + `BR2_PACKAGE_RAUC=y` and otherwise requires `$(OTA_SIGNING_KEY)` to exist, failing to stderr + with `make ota-dev-keys` named; add the `ota-dev-keys` target guarded by `$(check_env)` and + calling `scripts/gen-dev-keys.sh $(KEYS_DIR)`; add it to `.PHONY` so the catch-all `%:` rule + cannot forward it to Buildroot; add one line for it to `help` +- [ ] T005 Verify: `make ota-dev-keys` creates the four files with the documented modes; + `openssl verify -CAfile keys/dev/dev-ca.cert.pem keys/dev/dev-signing.cert.pem` passes; + `openssl x509 -noout -text` shows `CA:TRUE` on the CA, `CA:FALSE` plus `Code Signing` on the + signing certificate, and `NOT FOR PRODUCTION` in both subjects; a second run refuses and + changes nothing + +--- + +## Phase 2: Foundational (Blocking Prerequisites) + +**Purpose**: the three research items that must be confirmed before committing to offsets, and the +U-Boot and kernel configuration switchover. **Nothing in any user story can be trusted until T016 +passes**: if the running system and the bootloader disagree about where the boot-selection state +lives, every update rolls back while every image is sound. + +- [ ] T006 [P] Verify the AM335x boot ROM's raw-image offsets against the current TRM and confirm + that 0x80000 is clear of all of them; the 0 / 128K / 256K / 384K list in research.md R2 comes + from a secondary source. Record the finding and its reference in `research.md` R2 +- [ ] T007 [P] Verify that the `genimage` in this tree supports a region outside the partition + table (`in-partition-table = false`) by reading its documentation in + `output/beaglebone_black/build/genimage-*/`; record the exact syntax in + `contracts/storage-layout.md` +- [ ] T008 [P] Verify which environment binaries RAUC 1.15.2 invokes, by reading the U-Boot + bootloader backend in `output/beaglebone_black/build/rauc-1.15.2/src/`, and confirm + `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV` installs all of them; note in `research.md` R6 whether + `fw_getenv` needs a symlink +- [ ] T009 In `configs/beaglebone_black_defconfig`, switch U-Boot to a custom configuration: + `BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y` with + `BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot.config"`, + and point `BR2_TARGET_UBOOT_DEFAULT_ENV_FILE` at + `$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot-env.txt`. A config fragment would be + shorter but the constitution's Technical Constraints require a generated custom config +- [ ] T010 Create `board/ota/beaglebone_black/uboot-env.txt` with the defaults and the + slot-selection script of contracts/boot-interface.md: `BOOT_ORDER="A B"`, `BOOT_A_LEFT=3`, + `BOOT_B_LEFT=3`, and a `bootcmd` that walks `BOOT_ORDER`, skips a slot whose counter is 0, + otherwise decrements it, runs `saveenv`, announces the chosen slot on the console (FR-027), + loads `/boot/zImage` and the device tree from that slot with `ext4load`, and boots it with + `root=` pointing at that slot mounted read-only +- [ ] T011 Generate `board/ota/beaglebone_black/uboot.config` with `make uboot-menuconfig` followed + by `make uboot-update-defconfig`: enable `ENV_IS_IN_MMC` and disable `ENV_IS_IN_FAT`; set + `ENV_OFFSET=0x80000`, `ENV_OFFSET_REDUND=0xA0000`, `ENV_SIZE=0x20000`, + `ENV_MMC_DEVICE_INDEX=0` and `ENV_REDUNDANT=y`; disable `BOOTCOUNT_LIMIT` and + `BOOTCOUNT_AM33XX` so exactly one attempt counter is active (FR-003); lower `BOOTDELAY` from + the measured 2 s. `ENV_OFFSET` must be set explicitly: its `ARCH_OMAP2PLUS` default of + 0x260000 lands inside partition 1 +- [ ] T012 In `configs/beaglebone_black_defconfig`, enable + `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE` with `_SOURCE` set to the same `uboot-env.txt`, + `_SIZE="0x20000"` and `_REDUNDANT=y`, producing `uboot-env.bin` in `BINARIES_DIR` for + `genimage` to write into the reserved region. Same file as T009, so run them in sequence +- [ ] T013 Create `board/ota/beaglebone_black/fw_env.config` with the two lines of + contracts/storage-layout.md — `/dev/mmcblk0 0x80000 0x20000` and `/dev/mmcblk0 0xa0000 + 0x20000` — and install it to `/etc/fw_env.config` through the board's `rootfs_overlay/` +- [ ] T014 In `configs/beaglebone_black_defconfig`, switch the kernel to a custom configuration + (`BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG` with + `board/ota/beaglebone_black/linux.config`), then generate that file with + `make linux-menuconfig` and `make linux-update-defconfig`: build `WATCHDOG_CORE` and + `OMAP_WATCHDOG` in rather than as modules, and set a non-zero + `CONFIG_WATCHDOG_OPEN_TIMEOUT` so the kernel stops covering an unopened watchdog. Today + `CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the + bootloader's watchdog forever, so a hung slot is never reset and FR-032 cannot be met +- [ ] T015 In `configs/beaglebone_black_defconfig`, add the packages and sizes: `BR2_PACKAGE_RAUC`, + `BR2_PACKAGE_HOST_RAUC`, `BR2_PACKAGE_UBOOT_TOOLS` with + `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV`, `BR2_PACKAGE_HOST_UBOOT_TOOLS`, + `BR2_TARGET_ROOTFS_EXT2_SIZE="128M"` (29.5 MiB of content plus a 7.3 MiB kernel, about 30% of + the filesystem), and the kernel image plus device tree installed into `/boot` of the rootfs so + a slot is self-contained (FR-002); confirm the device tree lands there and copy it in + `post-build.sh` if it does not +- [ ] T016 Verify (hardware): build and flash, then prove the running system and the bootloader + agree on the state. `fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT` in Linux must print what + `printenv` prints at the U-Boot prompt; `fw_setenv BOOT_A_LEFT 2` followed by a reboot must be + visible to U-Boot. This is the single most expensive thing to get wrong in this feature, and + the most commonly reported failure in systems of this kind + +--- + +## Phase 3: User Story 1 - Flash and boot a device with redundant slots (Priority: P1) 🎯 MVP + +**Goal**: a card written from the factory image boots to a login prompt from slot A on the new +four-partition layout, reports its slot as good, and has a writable persistent area — while the +day-to-day build, flash and boot workflow is unchanged for anyone who does not care about updating. + +**Independent Test**: write `sdcard.img` to a blank card, boot, confirm a login prompt on the serial +console, and confirm `rauc status` names the booted slot and reports it good with slot B unused. + +- [ ] T017 [US1] Rewrite `board/ota/beaglebone_black/genimage.cfg` to the layout of + contracts/storage-layout.md: MBR; `uboot-env.bin` written at 0x80000 and 0xA0000 outside the + partition table; `p1` boot FAT16 32 MiB bootable type 0x0C starting at 1 MiB holding only + `MLO` and `u-boot.img`; `p2` and `p3` 512 MiB each from `rootfs.ext4`; `p4` 256 MiB ext4 for + data. `p3` and `p4` are empty in the factory image +- [ ] T018 [P] [US1] Create `board/ota/beaglebone_black/rootfs_overlay/etc/fstab`: root read-only, + `/dev/mmcblk0p4` at `/data` read-write, and tmpfs for `/tmp`, `/run` and `/var` so a read-only + slot does not prevent normal operation (FR-028) +- [ ] T019 [P] [US1] Create `board/ota/beaglebone_black/rauc-system.conf` with + `compatible=ota-beaglebone-black`, `bootloader=uboot`, the keyring at `/etc/rauc/keyring.pem`, + the slot status file on `/data` so a failure record outlives the reboot that reveals it + (FR-014), and the two slots of data-model.md — `rootfs.0` on `/dev/mmcblk0p2` with + `bootname=A` and `rootfs.1` on `/dev/mmcblk0p3` with `bootname=B`, both type `ext4`. Install + it to `/etc/rauc/system.conf` through the board's `rootfs_overlay/` +- [ ] T020 [US1] Extend `board/ota/common/post-build.sh`: when the board's configuration has + `BR2_PACKAGE_RAUC=y`, install `$OTA_KEYRING` to `${TARGET_DIR}/etc/rauc/keyring.pem` with mode + 0644, failing with a message naming `make ota-dev-keys` when it is missing. This is the + backstop for build paths that do not go through the `build` target; keep it board-independent + (FR-029) +- [ ] T021 [US1] Rewrite `board/ota/beaglebone_black/post-image.sh`: drop the `uEnv.txt` and + `extlinux.conf` copying, keep the `genimage.sh` call, and keep `set -eu` with the one-line + header comment stating the working directory assumption +- [ ] T022 [US1] Delete `board/ota/beaglebone_black/uEnv.txt` and + `board/ota/beaglebone_black/extlinux.conf`. The boot baseline proves the board boots through + `extlinux.conf` and never reads `uEnv.txt`; both are replaced by the slot-selection script +- [ ] T023 [US1] In `configs/beaglebone_black_defconfig`, stop remounting the root filesystem + read-write, so the running slot cannot diverge from the bundle it came from (FR-006) +- [ ] T024 [US1] Verify (hardware): quickstart scenario 1 — flash, boot to a login prompt, + `rauc status` shows slot A booted and good with B unused, `BOOT_ORDER="A B"` with both + counters at 3, a write to `/` fails, a write to `/data` succeeds and survives a power cycle, + and the console names slot A during boot +- [ ] T025 [US1] Verify (hardware): quickstart scenario 2 — three `grabserial` runs by the method in + `docs/boot-baseline-beaglebone-black.md`; the mean from the SPL banner to the login prompt + must be at most 12.65 s, which is the measured 11.50 s plus 10% (SC-008) + +--- + +## Phase 4: User Story 2 - Update a running device to a new image (Priority: P2) + +**Goal**: one operator command installs a signed bundle into the slot that is not running, a reboot +brings the new slot up, and the system confirms its own health before that slot is recorded good. + +**Independent Test**: on a device from US1, install a bundle built from a visibly different revision, +reboot, and confirm the device runs the new revision from the other slot while the first slot still +holds the previous one. + +- [ ] T026 [US2] Extend `board/ota/beaglebone_black/post-image.sh` to build the bundle: stage + `rootfs.ext4` and a `manifest.raucm` carrying `compatible=ota-beaglebone-black` and the + `version` from `git describe --always --dirty` (the same string `post-build.sh` writes to + `/etc/build-info`, so FR-024 holds), then call `$HOST_DIR/bin/rauc bundle` with + `--cert "$OTA_SIGNING_CERT"` and `--key "$OTA_SIGNING_KEY"` to produce + `beaglebone_black-.raucb` in `BINARIES_DIR`. No `--intermediate`: the chain is two + levels and `--cert` already embeds the signing certificate in the CMS signature +- [ ] T027 [US2] Create `board/ota/common/rootfs_overlay/etc/init.d/S99ota-health`, + board-independent (FR-029), running the four conditions of FR-012 in order — the init sequence + reached this script; the running slot is the slot that was pending, according to RAUC rather + than a guess; `/data` is mounted and a write to it succeeds; `fw_printenv` reads the state and + `fw_setenv` writes it back — and calling `rauc status mark-good` only when all four hold. No + network check: a board on a bench with no uplink must still be able to confirm a good update +- [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is + refused with a message naming the pending state and `rauc status` is unchanged afterwards + (FR-009) +- [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — install, `BOOT_ORDER` becomes `"B A"`, + reboot, `/etc/build-info` shows the new version, `rauc status` shows the new slot good and the + old slot still holding the previous version, and the file written to `/data` in US1 is + unchanged (SC-006) +- [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different + point of the installation; every trial must boot the previous version to a login prompt with + the previous version reported and the root filesystem intact (SC-002). Record the point of + interruption per trial + +--- + +## Phase 5: User Story 3 - Automatic rollback when the new image fails (Priority: P3) + +**Goal**: a broken or hanging update returns the device to the last good slot with no operator +action, and the failure is recorded where it survives. + +**Independent Test**: install a bundle that cannot boot, reboot, and watch the device return to the +previous slot on its own within the documented number of attempts. + +- [ ] T031 [US3] Extend `board/ota/beaglebone_black/uboot-env.txt` with the exhausted-slots path: + when every slot is at 0 attempts, announce it on the console, restore one attempt to the first + slot in `BOOT_ORDER` and try it, rather than halting at a prompt +- [ ] T032 [US3] Extend `S99ota-health` to start the BusyBox `watchdog` feeder **only** after + `rauc status mark-good` succeeds, and to log the reason to `/data` and leave the feeder stopped + when any condition fails, so an unhealthy slot is reset and retired by the attempt counter + (FR-032) +- [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel + is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must + then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the + reason readable from `/data` (SC-003, FR-014) +- [ ] T034 [US3] Verify (hardware): quickstart scenario 6 — three trials with a slot made to hang + after boot; the watchdog must reset the board within the documented window and the device must + end on the previous good slot (SC-014). Capture a "before" run on the unmodified image too: + it cannot pass this at all, which is the clearest evidence the kernel change was necessary +- [ ] T035 [US3] Verify (hardware): quickstart scenario 8 — with `/etc/fw_env.config` pointed at a + wrong offset on a test image, the health check must fail its fourth condition, the slot must + never be marked good, the device must roll back, and the reason must survive the reboot in + `/data` (SC-013) + +--- + +## Phase 6: User Story 4 - Only trusted, intact bundles are accepted (Priority: P4) + +**Goal**: a bundle that is unsigned, signed outside the device's trust domain, altered after +signing, or built for another board is refused before anything is written. + +**Independent Test**: attempt all four and confirm each is refused with a distinct message and both +slots are untouched afterwards. + +- [ ] T036 [US4] Document in `quickstart.md` the exact commands for the untrusted-bundle case: + generate a second CA and signing pair into a scratch directory with `scripts/gen-dev-keys.sh`, + then build a bundle with `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` pointed at it, so the + refusal under test is a chain that does not reach the device's CA +- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 — four refusals, each with a distinct + message, nothing written, `rauc status` and both slots unchanged after every attempt (SC-004, + FR-016 to FR-019) + +--- + +## Phase 7: User Story 5 - Inspect and reason about update state (Priority: P5) + +**Goal**: anyone holding the device, or reading a report from one, can tell which slot is running, +what each slot holds, which are good or bad, and whether an update awaits confirmation. + +**Independent Test**: on a device that has been updated once and rolled back once, read the status +output and confirm it answers all of that in one command. + +- [ ] T038 [US5] Make the failure record the health script writes to `/data` readable on its own: + which slot, which condition failed, and when, in a single documented file path named in + `contracts/boot-interface.md` +- [ ] T039 [US5] Verify (hardware): `rauc status` in one invocation reports the booted slot, both + slots' versions and health, and any pending confirmation (FR-026, SC-005); the boot console + identifies the selected slot (FR-027); and a rolled-back device is distinguishable from a + normal boot (SC-013) + +--- + +## Phase 8: Polish & Cross-Cutting Concerns + +- [ ] T040 Extend `scripts/check.sh`: lint the new scripts with `sh -n` and `shellcheck`; assert + that the offsets in `genimage.cfg`, `uboot.config` and `fw_env.config` are the same numbers; + assert the kernel is inside the OS slot rather than listed among the boot partition's files; + keep the existing device-tree and board-parity assertions working with the new layout (FR-031) +- [ ] T041 [P] Update `README.md`: the four-partition layout with its reserved region, the 2 GB + minimum card and the unused space beyond the layout, the update and rollback procedures, the + `make ota-dev-keys` step, and the limitation that the bootloader is never updated in the field + (FR-004, FR-030) +- [ ] T042 [P] Update `CLAUDE.md` with the same facts an agent needs: the new layout, the reserved + region, the custom U-Boot and kernel configurations, the three `OTA_*` variables, and the one + counter rule +- [ ] T043 Re-measure and record in `README.md` every figure the layout change invalidates: both + slots' and the boot partition's usage, the data area, `sdcard.img`, the bundle size, and the + boot time against the 11.50 s baseline (Principle VI, SC-007, SC-008) +- [ ] T044 Record the hardware evidence from T016, T024, T025, T029, T030, T033, T034, T035, T037 + and T039 under `docs/logs/` and summarise it in the PR; Principle IV requires the evidence to + be stated, and a green check run is explicitly not a boot test +- [ ] T045 Verify: `make docker-check` is green from a clean checkout, and + `make beaglebone_black_defconfig && make savedefconfig` leaves no diff + +--- + +## Dependencies & Execution Order + +### Phase Dependencies + +- **Phase 1 (Setup)** has no dependencies. T005 depends on T003 and T004. +- **Phase 2 (Foundational)** depends on Phase 1 for the signing material, since a build of an A/B + board refuses to start without it. **It blocks every user story.** +- **Phase 3 (US1)** depends on all of Phase 2, T016 included. +- **Phase 4 (US2)** depends on US1: there is nothing to update until a device boots from a slot. +- **Phase 5 (US3)** depends on US2: rollback is observed by installing something and letting it + fail. +- **Phase 6 (US4)** depends on US2 for the install path; independent of US3. +- **Phase 7 (US5)** depends on US2 and US3 for something to report, but its implementation task + T038 can be written any time after T027. +- **Phase 8 (Polish)** comes last, except that T040 can be written as soon as the layout of T017 is + fixed. + +### Within Phase 2 + +T006, T007 and T008 are independent of everything and of each other. T009 → T010 → T011 → T012 → +T013 is a chain: the defconfig must point at the files before they can be generated, and T009 and +T012 edit the same defconfig. T014 and T015 also edit that defconfig, so they follow T012 rather +than running beside it. T016 needs all of them. + +### Parallel Opportunities + +- T002, T003 in Phase 1 +- T006, T007, T008 at the start of Phase 2 — all three are reading, not writing +- T018, T019 in US1 (different new files) +- T041, T042 in Phase 8 +- Nothing that edits `configs/beaglebone_black_defconfig` is ever parallel: T009, T012, T014, T015 + and T023 share one file, and each ends with `make savedefconfig` + +## Parallel Example: Phase 2 research + +``` +# Three readers, no writers in common: +T006 AM335x TRM raw-image offsets -> research.md R2 +T007 genimage in-partition-table support -> contracts/storage-layout.md +T008 which fw_* binaries RAUC invokes -> research.md R6 +``` + +## Implementation Strategy + +### MVP first (User Story 1 only) + +Phase 1 → Phase 2 → Phase 3, then stop and evaluate. That is already a shippable state: a board +that boots exactly as before, on a layout that is ready to be updated, with `rauc status` answering +and the boot-time budget proven. It is also where the brick risk lives, so it deserves its own +commit and its own serial capture before anything else starts. + +### Incremental delivery + +1. Phases 1–3 → a device on the A/B layout (US1) +2. Phase 4 → it can be updated (US2) +3. Phase 5 → a bad update cannot keep it (US3) +4. Phase 6 → only trusted bundles get in (US4) +5. Phase 7 → its state is legible (US5) +6. Phase 8 → documentation, checks and re-measured budgets + +Each step is a commit with its hardware evidence. Do not batch the hardware verifications to the +end: T016 in particular tells you whether the whole design works, and finding out after Phase 5 +means unpicking five phases. + +## Notes + +- 45 tasks: 5 setup, 11 foundational, 9 for US1, 5 for US2, 5 for US3, 2 for US4, 2 for US5, + 6 polish. +- 15 tasks need the board. They are the deliverable evidence, not a formality: this feature changes + the partition layout, the bootloader environment, the kernel configuration, the bootargs and init, + every one of which the constitution lists as requiring a boot smoke test. +- Three tasks exist only because reading the boot baseline contradicted an assumption: T011 disables + a second boot counter nobody knew was enabled, T014 fixes a watchdog that looks like protection + and provides none, and T022 deletes a boot configuration file the board never reads. From 894b8e4dffaf377ef5e0ff073afd402447aaf92f Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 13:00:37 +0700 Subject: [PATCH 05/61] build: add the development signing material and its make target Phase 1 of feature 002. `make ota-dev-keys` generates a development CA and a bundle-signing pair into the gitignored keys/dev/, and nothing in the repository becomes a credential: neither private key nor either certificate is committed. Two tiers rather than one self-signed key, because that choice cannot be changed later without reflashing every device. The keyring on a device holds the CA, so a lost or compromised signing key is answered by issuing a new certificate; with a single key, RAUC cannot replace an expired certificate or revoke a compromised one without updating the keyring, which lives in the rootfs. The generator refuses to overwrite an existing CA. Replacing it is not an ordinary regeneration: every image already flashed with the old CA would be unable to install any bundle, so the way out has to be deliberate. Both certificate subjects carry NOT FOR PRODUCTION, which shows up in `rauc info` and `openssl x509 -text`. `check_keys` runs on the build target rather than in post-build.sh, so a missing key costs three milliseconds instead of an hour of building, and the three OTA_* variables are exported so a later feature can point the build at staging or production material, or at a PKCS#11 URL, without editing a script. The Dockerfile gains openssl explicitly rather than inheriting it as a dependency of ca-certificates. It also gains a .dockerignore: the Dockerfile never COPYs anything from the repo, which is bind-mounted at run time, so output/ and dl/ were being uploaded to the daemon on every `make docker-build` and never read. Verified in the container: shellcheck clean; `openssl verify` accepts the chain; the CA shows CA:TRUE with pathlen:0 and keyCertSign, the signing certificate CA:FALSE with codeSigning; modes are 600 on keys and 644 on certificates; a second run refuses and changes nothing. Co-Authored-By: Claude Opus 5 --- .dockerignore | 7 +++++ .gitignore | 3 ++ Dockerfile | 2 ++ Makefile | 27 ++++++++++++++++-- scripts/gen-dev-keys.sh | 63 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100755 scripts/gen-dev-keys.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..de4ceed --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# The Dockerfile only installs packages: it never COPYs anything from the repo, +# which is bind-mounted at /workspace when the container runs. Everything here is +# therefore context the daemon would upload and never read. +/output/ +/dl/ +/keys/ +/.git/ diff --git a/.gitignore b/.gitignore index 94faeb8..0d69d03 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ # Board selected by the last `make _defconfig` /.current_board +# Development signing material, generated by `make ota-dev-keys` +/keys/ + # Local editor / OS noise .vscode/ .idea/ diff --git a/Dockerfile b/Dockerfile index ac43d1c..79f63a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils \ # --- Static checks (make check) --- shellcheck \ + # --- Update bundle signing (make ota-dev-keys) --- + openssl \ && apt-get clean && rm -rf /var/lib/apt/lists/* # 'which' and 'awk' must resolve; /usr/bin/file is required by Buildroot diff --git a/Makefile b/Makefile index bd5aaa8..b68c283 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,16 @@ BUILDROOT_DIR := $(ROOT_DIR)/buildroot DL_DIR := $(ROOT_DIR)/dl BOARDS := $(patsubst configs/%_defconfig,%,$(wildcard configs/*_defconfig)) +# Signing material for OTA update bundles, read by the post-build and post-image +# scripts. Overriding these points a build at other material (staging, +# production, a PKCS#11 URL) without editing a script. Generated, never +# committed: see scripts/gen-dev-keys.sh. +KEYS_DIR ?= $(ROOT_DIR)/keys/dev +OTA_KEYRING ?= $(KEYS_DIR)/dev-ca.cert.pem +OTA_SIGNING_CERT ?= $(KEYS_DIR)/dev-signing.cert.pem +OTA_SIGNING_KEY ?= $(KEYS_DIR)/dev-signing.key.pem +export OTA_KEYRING OTA_SIGNING_CERT OTA_SIGNING_KEY + # BOARD=, written by _defconfig; `make BOARD=x ...` overrides it -include .current_board @@ -23,8 +33,15 @@ check_env = @test -f /.dockerenv || { \ echo "No Buildroot tree: 'git submodule update --init' first." >&2; exit 1; } check_board = @test -n "$(BOARD)" || { \ echo "No board selected: 'make _defconfig' first (boards: $(BOARDS))." >&2; exit 1; } - -.PHONY: help list-boards build check docker-build docker-check docker-shell +# Boards that sign update bundles cannot build without a signing key. Checked +# here rather than in post-build.sh so a missing key costs no build time. +check_keys = @! grep -q '^BR2_PACKAGE_RAUC=y' configs/$(BOARD)_defconfig 2>/dev/null \ + || test -f $(OTA_SIGNING_KEY) \ + || { echo "Board $(BOARD) signs update bundles, but this key is missing:" >&2; \ + echo " $(OTA_SIGNING_KEY)" >&2; \ + echo "Generate the development material first: make ota-dev-keys" >&2; exit 1; } + +.PHONY: help list-boards build check ota-dev-keys docker-build docker-check docker-shell .NOTPARALLEL: help: @@ -39,6 +56,7 @@ help: @echo " savedefconfig, -rebuild, clean" @echo " make list-boards - list boards in configs/" @echo " make check - static checks: shell lint, defconfig round-trip, image layout" + @echo " make ota-dev-keys - generate the development signing CA and key (once)" @echo "Current board: $(or $(BOARD),)" list-boards: @@ -68,6 +86,10 @@ check: $(check_env) @sh scripts/check.sh +ota-dev-keys: + $(check_env) + @sh scripts/gen-dev-keys.sh $(KEYS_DIR) + %_defconfig: $(check_env) @echo "BOARD=$*" > .current_board @@ -76,6 +98,7 @@ check: build: $(check_env) $(check_board) + $(check_keys) $(call br,$(BOARD)) # Keep the catch-all below from trying to remake these diff --git a/scripts/gen-dev-keys.sh b/scripts/gen-dev-keys.sh new file mode 100755 index 0000000..e92bc99 --- /dev/null +++ b/scripts/gen-dev-keys.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# Generates the development CA and bundle-signing material for OTA update bundles. +# Runs in the build container; writes only into the directory given as $1. +set -eu + +KEYS_DIR="${1:?usage: gen-dev-keys.sh }" + +CA_DAYS=3650 +SIGN_DAYS=1825 +SUBJ_O="OTA development" + +# Replacing the CA is not an ordinary regeneration: every image already flashed +# trusts it, and a new CA leaves those devices unable to install any bundle. +if [ -e "${KEYS_DIR}/dev-ca.key.pem" ]; then + echo "A development CA already exists in ${KEYS_DIR}." >&2 + echo "Replacing it would leave every image already flashed with it unable to" >&2 + echo "install any bundle. To start over deliberately: rm -rf ${KEYS_DIR}" >&2 + exit 1 +fi + +# Before mkdir, so the directory itself is not created world-readable. +umask 077 +mkdir -p "${KEYS_DIR}" + +# The CA certifies the signing key and nothing else. Keeping it out of the +# bundle path is what lets a signing key be replaced without reflashing. +openssl req -x509 -newkey rsa:4096 -noenc \ + -keyout "${KEYS_DIR}/dev-ca.key.pem" \ + -out "${KEYS_DIR}/dev-ca.cert.pem" \ + -days "${CA_DAYS}" \ + -subj "/O=${SUBJ_O}/CN=OTA development CA - NOT FOR PRODUCTION" \ + -addext "basicConstraints=critical,CA:TRUE,pathlen:0" \ + -addext "keyUsage=critical,keyCertSign,cRLSign" + +openssl req -newkey rsa:2048 -noenc \ + -keyout "${KEYS_DIR}/dev-signing.key.pem" \ + -out "${KEYS_DIR}/dev-signing.csr.pem" \ + -subj "/O=${SUBJ_O}/CN=OTA development bundle signing - NOT FOR PRODUCTION" + +# POSIX sh has no process substitution, so the extensions need a real file. +EXT_FILE="$(mktemp)" +trap 'rm -f "${EXT_FILE}"' EXIT +cat > "${EXT_FILE}" <<-EXT + basicConstraints=critical,CA:FALSE + keyUsage=critical,digitalSignature + extendedKeyUsage=codeSigning +EXT + +openssl x509 -req -in "${KEYS_DIR}/dev-signing.csr.pem" \ + -CA "${KEYS_DIR}/dev-ca.cert.pem" \ + -CAkey "${KEYS_DIR}/dev-ca.key.pem" \ + -days "${SIGN_DAYS}" \ + -extfile "${EXT_FILE}" \ + -out "${KEYS_DIR}/dev-signing.cert.pem" + +chmod 600 "${KEYS_DIR}"/dev-ca.key.pem "${KEYS_DIR}"/dev-signing.key.pem +chmod 644 "${KEYS_DIR}"/dev-ca.cert.pem "${KEYS_DIR}"/dev-signing.cert.pem + +echo "Development signing material written to ${KEYS_DIR}:" +echo " dev-ca.cert.pem trust anchor, installed as /etc/rauc/keyring.pem" +echo " dev-signing.cert.pem signs bundles, travels inside each bundle" +echo "Development only: a bundle signed with this material installs only on an" +echo "image built with the same CA." From 0af248aecc86b83d937f3eddf18eec703a1ef8f4 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 13:01:00 +0700 Subject: [PATCH 06/61] board: move the U-Boot environment to raw MMC and arm the watchdog Phase 2 of feature 002: the boot-selection state leaves the FAT boot partition, the slot-selection script becomes a reviewable text file, the kernel moves into the OS slot, and the watchdog starts being a watchdog. No layout change yet, so this builds and `make check` passes. The environment moves to raw sectors 0x80000 and 0xA0000 with a redundant copy. Not because fw_setenv cannot address a FAT file -- U-Boot's own fw_env.config documents a VFAT form -- but because every boot attempt writes that environment, and in FAT an interrupted write endangers the filesystem that holds MLO and u-boot.img. ENV_OFFSET is set explicitly: its ARCH_OMAP2PLUS default of 0x260000 would land inside partition 1. board/ota/beaglebone_black/uboot-env.txt is used twice by Buildroot, as U-Boot's compiled-in default environment and as the image that seeds the reserved region. Both are needed: the compiled-in default is what boots the board if that region is unreadable, and the seeded region is what fw_printenv reads, since it cannot see the compiled-in default. Three things found by building rather than by reading, each recorded in research.md: - The compiled-in default environment also lands in the SPL, and the AM335x SPL has a hard SRAM ceiling. 2916 bytes of boot script overflow it by 512 bytes. Two controlled builds isolate it: upstream's configuration links cleanly, the same configuration plus the environment file does not, and bisecting every option this feature adds left the failure in place. CONFIG_SPL_NET goes: the SPL was compiling TFTP, NFS and Ethernet for a board that boots from an SD card. MLO drops from 110928 to 79008 bytes, which also leaves headroom for the script to grow. - am335x_evm disables CMD_SETEXPR, which the script needs to decrement the attempt counter, and CMD_TEST, so the script uses itest. - RAUC's U-Boot backend runs only fw_printenv and fw_setenv; there is no fw_getenv anywhere in it, so no symlink is needed. It stores BOOT__LEFT as a hexadecimal string, and marking a slot bad removes it from BOOT_ORDER as well as zeroing the counter -- so the exhausted-slots path handles BOOT_ORDER being empty, not merely every counter being zero. The second attempt counter goes with CONFIG_BOOTCOUNT_LIMIT. The one it inherited from am335x_evm keeps its count in an RTC register this board loses on power removal, which is the event the power-cut criterion exercises five times. The kernel configuration exists for one reason: with CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y and an open timeout of 0, the kernel pings the bootloader's watchdog forever while no userspace process has claimed it, so a slot that boots and then hangs is never reset. The watchdog looked like protection and provided none. It is now built in rather than a module, with a 60 second open timeout. tasks.md carries the ticks for both phases and one ordering correction: T016 cannot run until T017 puts uboot-env.bin into the image, because an unseeded region fails its CRC check and the test would prove nothing. Verified: `make check` passes all nine checks including the defconfig round-trip; uboot-env.bin is exactly 0x20000 bytes; zImage and the device tree are installed inside the rootfs; rauc, fw_printenv and fw_setenv are on the target and host-rauc and mkenvimage on the host; rootfs.ext4 is 128 MiB. No hardware test yet: that is T016. Co-Authored-By: Claude Opus 5 --- board/ota/beaglebone_black/linux.config | 699 ++++++++++++++++++ .../rootfs_overlay/etc/fw_env.config | 10 + board/ota/beaglebone_black/uboot-env.txt | 49 ++ board/ota/beaglebone_black/uboot.config | 119 +++ configs/beaglebone_black_defconfig | 17 +- .../contracts/boot-interface.md | 7 + .../contracts/storage-layout.md | 20 +- specs/002-ab-ota-rauc/plan.md | 1 + specs/002-ab-ota-rauc/research.md | 67 +- specs/002-ab-ota-rauc/tasks.md | 35 +- 10 files changed, 997 insertions(+), 27 deletions(-) create mode 100644 board/ota/beaglebone_black/linux.config create mode 100644 board/ota/beaglebone_black/rootfs_overlay/etc/fw_env.config create mode 100644 board/ota/beaglebone_black/uboot-env.txt create mode 100644 board/ota/beaglebone_black/uboot.config diff --git a/board/ota/beaglebone_black/linux.config b/board/ota/beaglebone_black/linux.config new file mode 100644 index 0000000..7ea6230 --- /dev/null +++ b/board/ota/beaglebone_black/linux.config @@ -0,0 +1,699 @@ +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_AUDIT=y +CONFIG_NO_HZ_IDLE=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=16 +CONFIG_CGROUPS=y +CONFIG_MEMCG=y +CONFIG_BLK_CGROUP=y +CONFIG_CGROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_CGROUP_PERF=y +CONFIG_NAMESPACES=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_EXPERT=y +CONFIG_PROFILING=y +CONFIG_KEXEC=y +CONFIG_ARCH_MULTI_V6=y +CONFIG_ARCH_OMAP2=y +CONFIG_ARCH_OMAP3=y +CONFIG_ARCH_OMAP4=y +CONFIG_SOC_OMAP5=y +CONFIG_SOC_AM33XX=y +CONFIG_SOC_AM43XX=y +CONFIG_SOC_DRA7XX=y +CONFIG_POWER_AVS_OMAP=y +CONFIG_POWER_AVS_OMAP_CLASS3=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_ERRATA_411920=y +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200" +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPUFREQ_DT=m +# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set +CONFIG_CPU_IDLE=y +CONFIG_ARM_CPUIDLE=y +CONFIG_KERNEL_MODE_NEON=y +CONFIG_PM_DEBUG=y +CONFIG_KPROBES=y +# CONFIG_GCC_PLUGINS is not set +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_PARTITION_ADVANCED=y +CONFIG_BINFMT_MISC=y +CONFIG_CMA=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM_USER=y +CONFIG_NET_KEY=y +CONFIG_NET_KEY_MIGRATE=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +CONFIG_NETFILTER=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_ZONES=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CONNTRACK_TIMEOUT=y +CONFIG_NF_CONNTRACK_TIMESTAMP=y +CONFIG_NF_CT_NETLINK=m +CONFIG_NF_CT_NETLINK_TIMEOUT=m +CONFIG_NF_CT_NETLINK_HELPER=m +CONFIG_NETFILTER_NETLINK_GLUE_CT=y +CONFIG_NF_TABLES=m +CONFIG_NF_TABLES_INET=y +CONFIG_NF_TABLES_NETDEV=y +CONFIG_NFT_NUMGEN=m +CONFIG_NFT_CT=m +CONFIG_NFT_CONNLIMIT=m +CONFIG_NFT_LOG=m +CONFIG_NFT_LIMIT=m +CONFIG_NFT_MASQ=m +CONFIG_NFT_REDIR=m +CONFIG_NFT_NAT=m +CONFIG_NFT_TUNNEL=m +CONFIG_NFT_QUEUE=m +CONFIG_NFT_QUOTA=m +CONFIG_NFT_REJECT=m +CONFIG_NFT_COMPAT=m +CONFIG_NFT_HASH=m +CONFIG_NFT_FIB_INET=m +CONFIG_NFT_XFRM=m +CONFIG_NFT_SOCKET=m +CONFIG_NFT_OSF=m +CONFIG_NFT_TPROXY=m +CONFIG_NFT_SYNPROXY=m +CONFIG_NFT_DUP_NETDEV=m +CONFIG_NFT_FWD_NETDEV=m +CONFIG_NFT_FIB_NETDEV=m +CONFIG_NFT_REJECT_NETDEV=m +CONFIG_NF_FLOW_TABLE_INET=m +CONFIG_NF_FLOW_TABLE=m +CONFIG_NETFILTER_XT_TARGET_AUDIT=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CT=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_HMARK=m +CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m +CONFIG_NETFILTER_XT_TARGET_LED=m +CONFIG_NETFILTER_XT_TARGET_LOG=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_TEE=m +CONFIG_NETFILTER_XT_TARGET_TPROXY=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_BPF=m +CONFIG_NETFILTER_XT_MATCH_CGROUP=m +CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_CPU=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_IPCOMP=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_L2TP=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_NFACCT=m +CONFIG_NETFILTER_XT_MATCH_OSF=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_RECENT=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_SOCKET=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NFT_DUP_IPV4=m +CONFIG_NFT_FIB_IPV4=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_RPFILTER=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_SYNPROXY=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_NFT_DUP_IPV6=m +CONFIG_NFT_FIB_IPV6=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_RPFILTER=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_SRH=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_TARGET_SYNPROXY=m +CONFIG_IP6_NF_TARGET_NPT=m +CONFIG_NF_TABLES_BRIDGE=m +CONFIG_NFT_BRIDGE_META=m +CONFIG_NFT_BRIDGE_REJECT=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_VLAN_FILTERING=y +CONFIG_VLAN_8021Q=m +CONFIG_PHONET=m +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_CLS_U32=m +CONFIG_NET_CLS_FLOWER=m +CONFIG_NET_CLS_MATCHALL=m +CONFIG_NET_CLS_ACT=y +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_GACT=m +CONFIG_NET_SWITCHDEV=y +CONFIG_CAN=m +CONFIG_BT=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m +CONFIG_BT_HCIBTUSB=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_NOKIA=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUART_3WIRE=y +CONFIG_BT_HCIUART_BCM=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +CONFIG_BT_MRVL=m +CONFIG_BT_MRVL_SDIO=m +CONFIG_AF_RXRPC=m +CONFIG_RXKAD=y +CONFIG_CFG80211=m +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=m +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_DRA7XX_EP=y +CONFIG_PCI_ENDPOINT=y +CONFIG_PCI_ENDPOINT_CONFIGFS=y +CONFIG_PCI_EPF_TEST=m +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_OMAP_OCP2SCP=y +CONFIG_CONNECTOR=m +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_OOPS=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_ONENAND=y +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_ONENAND_OMAP2=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_NAND_OMAP2=y +CONFIG_MTD_NAND_OMAP_BCH=y +CONFIG_MTD_NAND_ECC_SW_BCH=y +CONFIG_MTD_SPI_NOR=m +CONFIG_MTD_UBI=y +CONFIG_ZRAM=m +CONFIG_ZRAM_WRITEBACK=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_SENSORS_TSL2550=m +CONFIG_SRAM=y +CONFIG_PCI_ENDPOINT_TEST=m +CONFIG_EEPROM_AT24=m +CONFIG_EEPROM_AT25=m +CONFIG_BLK_DEV_SD=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_ATA=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_AHCI_DM816=m +CONFIG_NETDEVICES=y +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +CONFIG_DM9000=y +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_HISILICON is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +CONFIG_KS8851=y +CONFIG_KS8851_MLL=y +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_SMC91X=y +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_STMICRO is not set +CONFIG_TI_DAVINCI_EMAC=y +CONFIG_TI_CPSW=y +CONFIG_TI_CPSW_SWITCHDEV=y +CONFIG_TI_CPTS=y +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_AT803X_PHY=y +CONFIG_SMSC_PHY=y +CONFIG_DP83848_PHY=y +CONFIG_DP83867_PHY=y +CONFIG_CAN_C_CAN=m +CONFIG_CAN_C_CAN_PLATFORM=m +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_QMI_WWAN=m +CONFIG_USB_CDC_PHONET=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_DEBUG=y +CONFIG_MWIFIEX=m +CONFIG_MWIFIEX_SDIO=m +CONFIG_MWIFIEX_USB=m +CONFIG_WL1251=m +CONFIG_WL1251_SPI=m +CONFIG_WL12XX=m +CONFIG_WL18XX=m +CONFIG_WLCORE_SPI=m +CONFIG_WLCORE_SDIO=m +CONFIG_INPUT_MOUSEDEV=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_KEYBOARD_ATKBD=m +CONFIG_KEYBOARD_GPIO=m +CONFIG_KEYBOARD_MATRIX=m +CONFIG_KEYBOARD_OMAP4=m +CONFIG_KEYBOARD_TWL4030=m +# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ATMEL_MXT=m +CONFIG_TOUCHSCREEN_EDT_FT5X06=m +CONFIG_TOUCHSCREEN_TI_AM335X_TSC=m +CONFIG_TOUCHSCREEN_PIXCIR=m +CONFIG_TOUCHSCREEN_TSC2004=m +CONFIG_TOUCHSCREEN_TSC2005=m +CONFIG_TOUCHSCREEN_TSC2007=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_CPCAP_PWRBUTTON=m +CONFIG_INPUT_TPS65218_PWRBUTTON=m +CONFIG_INPUT_TPS65219_PWRBUTTON=m +CONFIG_INPUT_TWL4030_PWRBUTTON=m +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_PALMAS_PWRBUTTON=m +CONFIG_INPUT_PWM_VIBRA=m +CONFIG_SERIO=m +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=32 +CONFIG_SERIAL_8250_RUNTIME_UARTS=6 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_OMAP=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_DEV_BUS=y +CONFIG_I2C_CHARDEV=y +CONFIG_SPI=y +CONFIG_SPI_GPIO=m +CONFIG_SPI_OMAP24XX=y +CONFIG_SPI_TI_QSPI=m +CONFIG_HSI=m +CONFIG_OMAP_SSI=m +CONFIG_SSI_PROTOCOL=m +CONFIG_PINCTRL_SINGLE=y +CONFIG_DEBUG_GPIO=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_PCA953X=m +CONFIG_GPIO_PCF857X=y +CONFIG_GPIO_LP87565=y +CONFIG_GPIO_PALMAS=y +CONFIG_GPIO_TWL4030=y +CONFIG_W1=m +CONFIG_HDQ_MASTER_OMAP=m +CONFIG_W1_SLAVE_DS250X=m +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_BATTERY_BQ27XXX=m +CONFIG_CHARGER_ISP1704=m +CONFIG_CHARGER_TWL4030=m +CONFIG_CHARGER_TWL6030=m +CONFIG_CHARGER_BQ2415X=m +CONFIG_CHARGER_BQ24190=m +CONFIG_CHARGER_BQ24735=m +CONFIG_HWMON=m +CONFIG_SENSORS_GPIO_FAN=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_TMP102=m +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_CPU_THERMAL=y +CONFIG_TI_THERMAL=y +CONFIG_OMAP3_THERMAL=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_THERMAL=y +CONFIG_DRA752_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_OPEN_TIMEOUT=60 +CONFIG_OMAP_WATCHDOG=y +CONFIG_TWL4030_WATCHDOG=m +CONFIG_MFD_CPCAP=y +CONFIG_MFD_TI_AM335X_TSCADC=m +CONFIG_MFD_TI_LMU=m +CONFIG_MFD_PALMAS=y +CONFIG_MFD_TPS65217=y +CONFIG_MFD_TI_LP873X=y +CONFIG_MFD_TI_LP87565=y +CONFIG_MFD_TPS65218=y +CONFIG_MFD_TPS65219=y +CONFIG_MFD_TPS65910=y +CONFIG_TWL6040_CORE=y +CONFIG_REGULATOR_CPCAP=y +CONFIG_REGULATOR_GPIO=y +CONFIG_REGULATOR_LM363X=m +CONFIG_REGULATOR_LP872X=y +CONFIG_REGULATOR_LP873X=y +CONFIG_REGULATOR_LP87565=y +CONFIG_REGULATOR_PALMAS=y +CONFIG_REGULATOR_PBIAS=y +CONFIG_REGULATOR_TI_ABB=y +CONFIG_REGULATOR_TPS62360=m +CONFIG_REGULATOR_TPS65023=y +CONFIG_REGULATOR_TPS6507X=y +CONFIG_REGULATOR_TPS65217=y +CONFIG_REGULATOR_TPS65218=y +CONFIG_REGULATOR_TPS65219=y +CONFIG_REGULATOR_TPS65910=y +CONFIG_REGULATOR_TWL4030=y +CONFIG_RC_CORE=m +CONFIG_LIRC=y +CONFIG_RC_DEVICES=y +CONFIG_IR_GPIO_TX=m +CONFIG_IR_PWM_TX=m +CONFIG_IR_SPI=m +CONFIG_MEDIA_SUPPORT=m +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VIDEO_OMAP3=m +CONFIG_VIDEO_MT9P031=m +CONFIG_VIDEO_TVP5150=m +CONFIG_DRM=m +CONFIG_DRM_OMAP=m +CONFIG_OMAP5_DSS_HDMI=y +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_DSI=y +CONFIG_DRM_TILCDC=m +CONFIG_DRM_PANEL_DSI_CM=m +CONFIG_DRM_PANEL_LG_LB035Q02=m +CONFIG_DRM_PANEL_NEC_NL8048HL11=m +CONFIG_DRM_PANEL_SHARP_LS037V7DW01=m +CONFIG_DRM_PANEL_SONY_ACX565AKM=m +CONFIG_DRM_PANEL_EDP=m +CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_TPO_TD028TTEC1=m +CONFIG_DRM_PANEL_TPO_TD043MTEA1=m +CONFIG_DRM_DISPLAY_CONNECTOR=m +CONFIG_DRM_SIMPLE_BRIDGE=m +CONFIG_DRM_TI_TFP410=m +CONFIG_DRM_TI_TPD12S015=m +CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_PLATFORM=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_PWM=m +CONFIG_BACKLIGHT_PANDORA=m +CONFIG_BACKLIGHT_GPIO=m +CONFIG_BACKLIGHT_LED=m +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y +CONFIG_LOGO=y +CONFIG_SOUND=m +CONFIG_SND=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_DEBUG=y +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_SOC=m +CONFIG_SND_SOC_DAVINCI_MCASP=m +CONFIG_SND_SOC_NOKIA_RX51=m +CONFIG_SND_SOC_OMAP3_PANDORA=m +CONFIG_SND_SOC_OMAP3_TWL4030=m +CONFIG_SND_SOC_OMAP_ABE_TWL6040=m +CONFIG_SND_SOC_OMAP_HDMI=m +CONFIG_SND_SOC_CPCAP=m +CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SOC_TLV320AIC3X_I2C=m +CONFIG_SND_SIMPLE_CARD=m +CONFIG_SND_AUDIO_GRAPH_CARD=m +CONFIG_HID_GENERIC=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB=m +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_MON=m +CONFIG_USB_XHCI_HCD=m +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_ACM=m +CONFIG_USB_STORAGE=m +CONFIG_USB_MUSB_HDRC=m +CONFIG_USB_MUSB_TUSB6010=m +CONFIG_USB_MUSB_OMAP2PLUS=m +CONFIG_USB_MUSB_DSPS=m +CONFIG_USB_INVENTRA_DMA=y +CONFIG_USB_TI_CPPI41_DMA=y +CONFIG_USB_TUSB_OMAP_DMA=y +CONFIG_USB_DWC3=m +CONFIG_USB_ISP1760=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_SIMPLE=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_TEST=m +CONFIG_NOP_USB_XCEIV=m +CONFIG_AM335X_PHY_USB=m +CONFIG_TWL6030_USB=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGET_DEBUG=y +CONFIG_USB_GADGET_DEBUG_FILES=y +CONFIG_USB_GADGET_DEBUG_FS=y +CONFIG_USB_CONFIGFS=m +CONFIG_USB_CONFIGFS_SERIAL=y +CONFIG_USB_CONFIGFS_ACM=y +CONFIG_USB_CONFIGFS_OBEX=y +CONFIG_USB_CONFIGFS_NCM=y +CONFIG_USB_CONFIGFS_ECM=y +CONFIG_USB_CONFIGFS_ECM_SUBSET=y +CONFIG_USB_CONFIGFS_RNDIS=y +CONFIG_USB_CONFIGFS_EEM=y +CONFIG_USB_CONFIGFS_PHONET=y +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +CONFIG_USB_CONFIGFS_F_LB_SS=y +CONFIG_USB_CONFIGFS_F_FS=y +CONFIG_USB_CONFIGFS_F_UAC1=y +CONFIG_USB_CONFIGFS_F_UAC2=y +CONFIG_USB_CONFIGFS_F_MIDI=y +CONFIG_USB_CONFIGFS_F_HID=y +CONFIG_USB_ZERO=m +CONFIG_USB_G_NOKIA=m +CONFIG_MMC=y +CONFIG_SDIO_UART=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_OMAP=y +CONFIG_MMC_OMAP_HS=y +CONFIG_MMC_SDHCI_OMAP=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_CPCAP=m +CONFIG_LEDS_LM3532=m +CONFIG_LEDS_GPIO=m +CONFIG_LEDS_PCA963X=m +CONFIG_LEDS_PWM=m +CONFIG_LEDS_BD2606MVV=m +CONFIG_LEDS_TCA6507=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_ONESHOT=m +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_BACKLIGHT=m +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=m +CONFIG_LEDS_TRIGGER_DEFAULT_ON=m +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_TWL92330=y +CONFIG_RTC_DRV_TWL4030=m +CONFIG_RTC_DRV_PALMAS=m +CONFIG_RTC_DRV_OMAP=m +CONFIG_RTC_DRV_CPCAP=m +CONFIG_DMADEVICES=y +CONFIG_CLK_TWL=m +CONFIG_CLK_TWL6040=m +CONFIG_COMMON_CLK_PALMAS=m +CONFIG_OMAP_IOMMU=y +CONFIG_REMOTEPROC=y +CONFIG_OMAP_REMOTEPROC=m +CONFIG_WKUP_M3_RPROC=m +CONFIG_SOC_TI=y +CONFIG_AMX3_PM=m +CONFIG_WKUP_M3_IPC=m +CONFIG_EXTCON_PALMAS=m +CONFIG_EXTCON_USB_GPIO=m +CONFIG_TI_EMIF=m +CONFIG_TI_EMIF_SRAM=m +CONFIG_IIO=m +CONFIG_IIO_SW_DEVICE=m +CONFIG_IIO_SW_TRIGGER=m +CONFIG_BMA180=m +CONFIG_BMC150_ACCEL=m +CONFIG_IIO_ST_ACCEL_3AXIS=m +CONFIG_KXCJK1013=m +CONFIG_CPCAP_ADC=m +CONFIG_INA2XX_ADC=m +CONFIG_TI_AM335X_ADC=m +CONFIG_TWL4030_MADC=m +CONFIG_TWL6030_GPADC=m +CONFIG_BMG160=m +CONFIG_MPU3050_I2C=m +CONFIG_ITG3200=m +CONFIG_BOSCH_BNO055_I2C=m +CONFIG_INV_MPU6050_I2C=m +CONFIG_SENSORS_ISL29028=m +CONFIG_AK8975=m +CONFIG_BMC150_MAGN_I2C=m +CONFIG_SENSORS_HMC5843_I2C=m +CONFIG_BMP280=m +CONFIG_PWM=y +CONFIG_PWM_OMAP_DMTIMER=m +CONFIG_PWM_TIECAP=m +CONFIG_PWM_TIEHRPWM=m +CONFIG_PWM_TWL=m +CONFIG_PWM_TWL_LED=m +CONFIG_PHY_CPCAP_USB=m +CONFIG_PHY_MAPPHONE_MDM6600=m +CONFIG_PHY_DM816X_USB=m +CONFIG_OMAP_USB2=m +CONFIG_TI_PIPE3=y +CONFIG_TWL4030_USB=m +CONFIG_COUNTER=m +CONFIG_TI_EQEP=m +CONFIG_EXT2_FS=y +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_SECURITY=y +CONFIG_FANOTIFY=y +CONFIG_QUOTA=y +CONFIG_QFMT_V2=y +CONFIG_AUTOFS_FS=m +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_SUMMARY=y +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RUBIN=y +CONFIG_UBIFS_FS=y +CONFIG_CRAMFS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_SECURITY=y +CONFIG_CRYPTO_MICHAEL_MIC=y +CONFIG_CRYPTO_GHASH_ARM_CE=m +CONFIG_CRYPTO_AES_ARM_BS=m +CONFIG_CRYPTO_DEV_OMAP=m +CONFIG_CRYPTO_DEV_OMAP_SHAM=m +CONFIG_CRYPTO_DEV_OMAP_AES=m +CONFIG_CRYPTO_DEV_OMAP_DES=m +CONFIG_DMA_CMA=y +CONFIG_FONTS=y +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_PRINTK_TIME=y +# CONFIG_DEBUG_BUGVERBOSE is not set +CONFIG_DEBUG_INFO_DWARF4=y +CONFIG_DEBUG_INFO_SPLIT=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_FS=y +CONFIG_SCHEDSTATS=y diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/fw_env.config b/board/ota/beaglebone_black/rootfs_overlay/etc/fw_env.config new file mode 100644 index 0000000..bb2d51c --- /dev/null +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/fw_env.config @@ -0,0 +1,10 @@ +# Where the running system finds the U-Boot environment, which holds the +# boot-selection state RAUC reads and writes. These two offsets and the size must +# match CONFIG_ENV_OFFSET, CONFIG_ENV_OFFSET_REDUND and CONFIG_ENV_SIZE in +# board/ota/beaglebone_black/uboot.config exactly; a mismatch is silent and makes +# every update roll back. The region lies in the gap before the first partition and +# belongs to no filesystem. +# +# Device Primary offset Size +/dev/mmcblk0 0x80000 0x20000 +/dev/mmcblk0 0xa0000 0x20000 diff --git a/board/ota/beaglebone_black/uboot-env.txt b/board/ota/beaglebone_black/uboot-env.txt new file mode 100644 index 0000000..b16e6de --- /dev/null +++ b/board/ota/beaglebone_black/uboot-env.txt @@ -0,0 +1,49 @@ +# Default environment for the A/B OTA boot flow. +# +# Buildroot uses this one file twice: BR2_TARGET_UBOOT_DEFAULT_ENV_FILE compiles it +# into U-Boot as the built-in default environment, and +# BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE turns it into uboot-env.bin, which genimage +# writes into the reserved region of the factory image. Both are needed: the built-in +# default is what boots the board if that region is unreadable, and the seeded region +# is what fw_printenv reads, since it cannot see the built-in default. +# +# RAUC owns BOOT_ORDER and BOOT__LEFT and rewrites them through +# fw_printenv/fw_setenv. Everything else here belongs to the boot script. +# Format: one key=value per line, '#' and blank lines ignored (mkenvimage). + +console=ttyS0,115200n8 +loadaddr=0x82000000 +fdtaddr=0x88000000 +fdtfile=am335x-boneblack.dtb +bootdelay=1 + +# Boot-selection state. A slot is eligible while it is listed in BOOT_ORDER and its +# counter is above zero; marking a slot bad removes it from BOOT_ORDER as well as +# zeroing its counter. RAUC stores the counters as hexadecimal strings. +BOOT_ORDER=A B +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 + +# Partition number of each OS slot on the boot medium. +ota_part_A=2 +ota_part_B=3 + +# Load and boot the slot named by ota_slot/ota_part. No counter logic here, so the +# last-resort path can reuse it without spending an attempt. +ota_load_boot=setenv bootargs console=${console} root=/dev/mmcblk0p${ota_part} ro rootfstype=ext4 rootwait; ext4load mmc 0:${ota_part} ${loadaddr} /boot/zImage && ext4load mmc 0:${ota_part} ${fdtaddr} /boot/${fdtfile} && bootz ${loadaddr} - ${fdtaddr} + +# Spend one attempt, persist it, then boot. The attempt is saved before the kernel is +# loaded, so a slot that hangs after handover has still paid for the try. +ota_boot_slot=setexpr ota_left ${ota_left} - 1; setenv BOOT_${ota_slot}_LEFT ${ota_left}; saveenv; echo OTA: booting slot ${ota_slot}, ${ota_left} attempts left; run ota_load_boot + +ota_try_A=setenv ota_slot A; setenv ota_part ${ota_part_A}; setenv ota_left ${BOOT_A_LEFT}; if itest ${ota_left} -gt 0; then run ota_boot_slot; fi +ota_try_B=setenv ota_slot B; setenv ota_part ${ota_part_B}; setenv ota_left ${BOOT_B_LEFT}; if itest ${ota_left} -gt 0; then run ota_boot_slot; fi + +# Try every slot named in BOOT_ORDER, in order. Falling out of the loop means each +# listed slot is out of attempts, or BOOT_ORDER is empty because both were marked +# bad. Say so on the console, then try slot A once without touching any counter, +# rather than halting with no attempt at all. If that fails too, the U-Boot prompt is +# the right place to be: no automatic recovery can help from there. +ota_select=for s in ${BOOT_ORDER}; do run ota_try_${s}; done; echo OTA: no eligible slot, BOOT_ORDER=${BOOT_ORDER}; echo OTA: last resort, booting slot A without spending an attempt; setenv ota_slot A; setenv ota_part ${ota_part_A}; run ota_load_boot + +bootcmd=run ota_select diff --git a/board/ota/beaglebone_black/uboot.config b/board/ota/beaglebone_black/uboot.config new file mode 100644 index 0000000..948175a --- /dev/null +++ b/board/ota/beaglebone_black/uboot.config @@ -0,0 +1,119 @@ +CONFIG_ARM=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_ARCH_OMAP2PLUS=y +CONFIG_TI_COMMON_CMD_OPTIONS=y +CONFIG_SF_DEFAULT_SPEED=24000000 +CONFIG_ENV_OFFSET=0x80000 +CONFIG_DEFAULT_DEVICE_TREE="am335x-evm" +CONFIG_AM33XX=y +CONFIG_CLOCK_SYNTHESIZER=y +CONFIG_AM335X_USB0=y +CONFIG_AM335X_USB0_PERIPHERAL=y +CONFIG_AM335X_USB1=y +CONFIG_SYS_BOOTM_LEN=0x1000000 +CONFIG_SPL=y +CONFIG_ENV_OFFSET_REDUND=0xA0000 +CONFIG_TIMESTAMP=y +CONFIG_FIT_SIGNATURE=y +CONFIG_FIT_VERBOSE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTDELAY=1 +CONFIG_OF_BOARD_SETUP=y +CONFIG_LOGLEVEL=3 +CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_SPL_SYS_MALLOC=y +CONFIG_SPL_SYS_MALLOC_SIZE=0x800000 +CONFIG_SPL_FIT_IMAGE_TINY=y +# CONFIG_SPL_FS_EXT4 is not set +CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" +CONFIG_SPL_MTD=y +CONFIG_SPL_MUSB_NEW=y +CONFIG_SPL_NAND_DRIVERS=y +CONFIG_SPL_NAND_ECC=y +CONFIG_SPL_NAND_BASE=y +CONFIG_SPL_OS_BOOT=y +CONFIG_SYS_NAND_SPL_KERNEL_OFFS=0x200000 +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 +CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x1500 +CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x200 +CONFIG_CMD_EXTENSION=y +CONFIG_CMD_SPL_NAND_OFS=0x00080000 +CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2 +CONFIG_CMD_NAND=y +CONFIG_BOOTP_DNS2=y +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nand0=nand.0" +CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)" +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_OF_LIST="am335x-evm am335x-bone am335x-sancloud-bbe am335x-sancloud-bbe-lite am335x-sancloud-bbe-extended-wifi am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle am335x-bonegreen-eco" +CONFIG_ENV_OVERWRITE=y +# CONFIG_ENV_IS_IN_FAT is not set +CONFIG_ENV_IS_IN_MMC=y +CONFIG_ENV_REDUNDANT=y +CONFIG_ENV_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y +CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="/workspace/board/ota/beaglebone_black/uboot-env.txt" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_SPL_ENV_IS_NOWHERE=y +CONFIG_VERSION_VARIABLE=y +CONFIG_NET_RETRY_COUNT=10 +CONFIG_BOOTP_SEND_HOSTNAME=y +CONFIG_CLK_CDCE9XX=y +CONFIG_CLK_TI_CTRL=y +CONFIG_DFU_TFTP=y +CONFIG_DFU_MMC=y +CONFIG_DFU_NAND=y +CONFIG_DFU_RAM=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=1 +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_EEPROM_ADDR=0x50 +# CONFIG_MMC_HW_PARTITIONING is not set +CONFIG_MMC_OMAP_HS=y +CONFIG_MTD=y +CONFIG_MTD_RAW_NAND=y +CONFIG_SYS_NAND_BLOCK_SIZE=0x20000 +CONFIG_SYS_NAND_ONFI_DETECTION=y +CONFIG_SYS_NAND_PAGE_SIZE=0x800 +CONFIG_SYS_NAND_OOBSIZE=0x40 +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y +CONFIG_SYS_NAND_U_BOOT_OFFS=0xc0000 +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_PHY_GIGE=y +CONFIG_MII=y +CONFIG_DRIVER_TI_CPSW=y +CONFIG_PHY_ATHEROS=y +CONFIG_PHY_SMSC=y +CONFIG_PHY_TI_DP83867=y +CONFIG_DM_PMIC=y +# CONFIG_SPL_DM_PMIC is not set +CONFIG_PMIC_TPS65217=y +CONFIG_SPL_POWER_TPS65910=y +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_OMAP3_SPI=y +CONFIG_TIMER=y +CONFIG_OMAP_TIMER=y +CONFIG_USB=y +CONFIG_DM_USB_GADGET=y +CONFIG_SPL_DM_USB_GADGET=y +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_TI=y +CONFIG_USB_GADGET=y +CONFIG_SPL_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments" +CONFIG_USB_GADGET_VENDOR_NUM=0x0451 +CONFIG_USB_GADGET_PRODUCT_NUM=0xd022 +CONFIG_USB_ETHER=y +CONFIG_WDT=y +# CONFIG_SPL_WDT is not set +CONFIG_DYNAMIC_CRC_TABLE=y +CONFIG_LZO=y diff --git a/configs/beaglebone_black_defconfig b/configs/beaglebone_black_defconfig index 4b71b69..52ba7f0 100644 --- a/configs/beaglebone_black_defconfig +++ b/configs/beaglebone_black_defconfig @@ -13,22 +13,29 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_blac BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.38" -BR2_LINUX_KERNEL_DEFCONFIG="omap2plus" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/linux.config" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/omap/am335x-boneblack" +BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y BR2_PACKAGE_XZ=y BR2_PACKAGE_AM33X_CM3=y +BR2_PACKAGE_UBOOT_TOOLS=y BR2_PACKAGE_KMOD=y BR2_PACKAGE_KMOD_TOOLS=y +BR2_PACKAGE_RAUC=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="128M" BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2026.07" -BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm" +BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot.config" +BR2_TARGET_UBOOT_DEFAULT_ENV_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot-env.txt" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_GNUTLS=y @@ -40,3 +47,9 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_KMOD_XZ=y BR2_PACKAGE_HOST_MTOOLS=y +BR2_PACKAGE_HOST_RAUC=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot-env.txt" +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="0x20000" +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT=y diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index e710c88..4637fae 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -19,6 +19,13 @@ reserved region is ever unreadable. The seeded region is what `fw_printenv` read system cannot see U-Boot's built-in default at all, so without the seed the health check of FR-012 fails on its fourth condition on the very first boot, and every update would roll back. +**Size limit on this file.** Its contents are compiled into the SPL as well as U-Boot proper, and +the AM335x SPL runs from internal SRAM with a hard ceiling. At 2916 bytes it already requires +`# CONFIG_SPL_NET is not set` in `uboot.config` to fit; growing it much further will break the link +with `region '.sram' overflowed`, not with a message about the environment. The failure is loud, so +the rule is simply to expect it: if a change here stops U-Boot linking, trim the SPL rather than the +script (`SPL_NAND_*`, `SPL_USB_ETHER`, `SPL_YMODEM_SUPPORT` are all unused on this board). + U-Boot's own `CONFIG_ENV_SOURCE_FILE` is not usable here. It requires the file to sit inside the U-Boot source tree as `board///.env` and errors out when it is absent, which would mean carrying the boot logic in a patch instead of in a reviewable file. diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index ce58a56..46c463b 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -35,7 +35,25 @@ total ~1.3 GB minimum medium 2 GB; extra space is unused 3. **`ENV_OFFSET` is set explicitly.** Its `ARCH_OMAP2PLUS` default is `0x260000`, which is inside partition 1. Enabling `ENV_IS_IN_MMC` without overriding it corrupts the boot partition. 4. **The state region is in the factory image.** `genimage` places it outside the partition table - (`in-partition-table = false`) and writes `uboot-env.bin` at both offsets. That file is built by + and writes `uboot-env.bin` at both offsets. Verified against `genimage` 20 in this tree + (`README.rst`): a partition takes `in-partition-table = false`, and because that option defaults + to true while `offset` defaults to 0, **a region outside the partition table must state its + `offset` explicitly** — at most one such region may rely on the default. Both copies therefore + carry their offsets: + + ``` + partition env { + in-partition-table = false + offset = 0x80000 + image = "uboot-env.bin" + } + partition env-redund { + in-partition-table = false + offset = 0xa0000 + image = "uboot-env.bin" + } + ``` + That file is built by `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE` from `uboot-env.txt`, so a freshly flashed device boots with `BOOT_ORDER="A B"` and full counters, and `fw_printenv` can read the state on the first boot. Seeding is not a nicety: `fw_printenv` cannot see U-Boot's built-in default environment, diff --git a/specs/002-ab-ota-rauc/plan.md b/specs/002-ab-ota-rauc/plan.md index e82203a..0398604 100644 --- a/specs/002-ab-ota-rauc/plan.md +++ b/specs/002-ab-ota-rauc/plan.md @@ -156,4 +156,5 @@ are replaced by the slot-selection script. | Violation | Why Needed | Simpler Alternative Rejected Because | |-----------|------------|-------------------------------------| | A custom U-Boot configuration file (`uboot.config`) replacing the plain `am335x_evm` defconfig | The environment must leave FAT for raw redundant storage, the slot-selection script must be the default environment, and the inherited second boot counter must be switched off. None of that is expressible without changing U-Boot's configuration. | A config *fragment* would be shorter, and `BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES` exists, but the constitution's Technical Constraints require `*_USE_CUSTOM_CONFIG` with a generated file rather than hand-edited fragments. | +| Dropping `CONFIG_SPL_NET` from the board's U-Boot configuration | The default environment is compiled into the SPL, and 2916 bytes of boot script overflow the AM335x SPL's SRAM region by 512 bytes. The SPL was carrying TFTP, NFS and Ethernet for a board that boots from SD. | Shrinking the boot script to fit would break again, silently in design terms and loudly at link time, the next time it grows. Dropping the compiled-in default environment instead would give up the "environment corrupt or missing" edge case. | | A custom kernel configuration file (`linux.config`) replacing the plain `omap2plus` defconfig | `CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the bootloader's watchdog forever, so a hung slot is never reset and FR-032 cannot be met. The driver is also a module, leaving the early boot window uncovered. | Leaving the kernel alone was the plan until the baseline showed the watchdog is decorative. Relying on the attempt counter alone fails, because nothing reboots a hung device for the counter to act on. | diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 457f3f1..45bc34a 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -44,7 +44,7 @@ ships this region already populated. 0x000000 MBR (sector 0) 0x000000 ┐ 0x020000 │ offsets where the ROM looks for a raw boot image: 0, 128K, 256K, 384K -0x040000 │ (secondary source; verify against the AM335x TRM during implementation) +0x040000 │ (corroborated below, not read from the TRM directly) 0x060000 ┘ 0x080000 environment, primary 128 KiB 0x0A0000 environment, redundant copy 128 KiB @@ -66,6 +66,12 @@ using its built-in default environment. Two reasons to move it: 0x80000 sits past all four offsets the ROM inspects for a raw image, which is why it is the conventional choice on this SoC, and it is comfortably inside the 1 MiB gap before partition 1. +**Confirmation status of those four offsets** (T006): four independent secondary sources agree on +0x0, 0x20000, 0x40000 and 0x60000, each 128 KiB, and one quotes the TRM section for raw-mode MMC/SD +boot (SPRUH73 section 26.1.8.5.5). The TRM itself has still not been read, so this is corroboration +rather than proof. The only thing this design needs from it is that 0x80000 sits past all four, +which it does by 128 KiB, and nothing of ours is placed below 0x80000. + **Correction to an earlier claim in this feature's discussion**: `fw_setenv` *can* address an environment stored as a file in a FAT filesystem — `tools/env/fw_env.config` in U-Boot 2026.07 carries a "VFAT example". The reason to move the environment is power-fail atomicity, not tool @@ -100,6 +106,35 @@ board directory and have a .env extension", inside the U-Boot source tree, and t is not present, an error is produced". Pointing it at the external tree is not possible, so using it would mean shipping the boot logic inside a patch instead of as a reviewable file. +**The default environment is compiled into the SPL too, and the SPL has a hard ceiling** (found by +building, not by reading). On this board `BR2_TARGET_UBOOT_DEFAULT_ENV_FILE` alone breaks the link: + +``` +arm-linux-ld: u-boot-spl section `__u_boot_list' will not fit in region `.sram' +arm-linux-ld: region `.sram' overflowed by 512 bytes +``` + +Two controlled builds isolate it: the upstream `am335x_evm` configuration links cleanly as a custom +config, and the same configuration with a 2916-byte environment text file does not. None of the +environment or command options added for this feature is responsible; bisecting them all left the +failure in place. + +The fix is to stop the SPL carrying what this board cannot use: `# CONFIG_SPL_NET is not set`. The +SPL was compiling TFTP, NFS and Ethernet support for a board that boots from an SD card. `MLO` +drops from 110928 to 79008 bytes, which both makes room for the environment and leaves headroom for +the boot script to grow. Principle VI asks for exactly this — enable only what the board needs. + +Rejected alternatives: shrinking the environment text to fit, which would break again the next time +the boot script grows, and at a moment nobody is watching; dropping the compiled-in default +environment and seeding only the region, which gives up the "environment corrupt or missing" edge +case because U-Boot would fall back to an upstream default that looks for the `extlinux.conf` this +feature deletes; and moving the logic into a `boot.scr` on the FAT partition, which still needs a +built-in environment to find and run it. + +If more SPL room is ever needed, `SPL_NAND_*` (the boot log records `NAND: 0 MiB` on this board), +`SPL_USB_ETHER`/`SPL_USB_ETH_RNDIS` and `SPL_YMODEM_SUPPORT` are all unused here. They were left +alone because nothing needs them removed yet. + Both mechanisms are needed, because they fail differently. The built-in default is what boots the board when the reserved region is unreadable. The seeded region is what the running system reads: `fw_printenv` has no access to U-Boot's built-in default, so an unseeded region fails the fourth @@ -222,13 +257,29 @@ Buildroot package with its own hash, and the kernel and U-Boot versions do not c installs want device-mapper support this configuration does not enable, and streaming is pointless while bundle delivery is out of scope. -**To verify during implementation** (cheap, and wrong assumptions here are expensive): - -1. Which binary names RAUC 1.15.2 actually invokes for the environment, and that `uboot-tools` - installs all of them — `fw_getenv` may need a symlink. -2. The ROM's raw-image offsets against the AM335x TRM, before trusting 0x80000 (R2). -3. That `genimage` in this tree supports a region outside the partition table - (`in-partition-table = false`), which is how the environment region gets into the factory image. +**What the U-Boot backend actually does** (T008, read from `src/bootloaders/uboot.c` at the 1.15.2 +tag). Two of these change the boot script and one removes a packaging worry: + +- It runs exactly two binaries, `fw_printenv` with a variable name and `fw_setenv` with a name and + value, through `r_subprocess_new()`. There is no `fw_getenv` in the backend at all, so + `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV` is sufficient and no symlink is needed. Buildroot's package + help, which says "fw_getenv / fw_setenv", is imprecise. +- **`BOOT__LEFT` is stored as a hexadecimal string.** The boot script and the seeded + environment must agree with that reading. It makes no difference for a single-digit counter and + would for a limit above 9. +- **Marking a slot bad removes it from `BOOT_ORDER`** as well as setting its counter to 0, and a + slot counts as good only when it is *listed in* `BOOT_ORDER` with a counter above zero. The + exhausted-slots path in the boot script therefore has to handle `BOOT_ORDER` being short or + empty, not merely every counter being zero. +- Marking good restores the counter to the configured attempts, defaulting to 3 + (`UBOOT_DEFAULT_ATTEMPTS`), and making a slot primary moves it to the front of `BOOT_ORDER` with + the same default. The attempt limit assumed in the spec is RAUC's own default. + +**Still to verify during implementation**: nothing from this list remains. The ROM offsets (R2) are +corroborated, `genimage` support for a region outside the partition table is confirmed against +version 20 in this tree and recorded with its exact syntax in +[contracts/storage-layout.md](contracts/storage-layout.md), and the environment binaries are settled +above. ## R7. Development signing material: a two-tier CA, not a single self-signed key diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 1017e19..35054fe 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -31,12 +31,12 @@ and produce the serial evidence that goes in the PR. A green `make check` is not **Purpose**: the build environment and the signing material, both of which everything else needs. -- [ ] T001 Add `openssl` to the `apt-get install` list in `Dockerfile`, explicitly rather than +- [X] T001 Add `openssl` to the `apt-get install` list in `Dockerfile`, explicitly rather than relying on it arriving as a dependency of `ca-certificates`, then rebuild the image with `make docker-build` (Principle II forbids `apt-get` inside a running container) -- [ ] T002 [P] Add `/keys/` to `.gitignore`, in the same group as `/output/` and `/dl/`, with a +- [X] T002 [P] Add `/keys/` to `.gitignore`, in the same group as `/output/` and `/dl/`, with a one-line comment saying it holds development signing material -- [ ] T003 [P] Create `scripts/gen-dev-keys.sh`: POSIX `sh`, `set -eu`, `umask 077` **before** +- [X] T003 [P] Create `scripts/gen-dev-keys.sh`: POSIX `sh`, `set -eu`, `umask 077` **before** `mkdir`, generating into `$1` the four files of contracts/signing-chain.md — `dev-ca.key.pem` (RSA 4096), `dev-ca.cert.pem` (`basicConstraints=critical,CA:TRUE,pathlen:0`, `keyUsage=critical,keyCertSign,cRLSign`, 3650 days), `dev-signing.key.pem` (RSA 2048) and @@ -47,14 +47,14 @@ and produce the serial evidence that goes in the PR. A green `make check` is not `dev-ca.key.pem` already exists, with a message saying that replacing the CA invalidates every image already flashed and naming `rm -rf` as the deliberate way out. End with `chmod 600` on the keys and `644` on the certificates -- [ ] T004 In `Makefile`: add `KEYS_DIR ?= $(ROOT_DIR)/keys/dev`; add and `export` `OTA_KEYRING`, +- [X] T004 In `Makefile`: add `KEYS_DIR ?= $(ROOT_DIR)/keys/dev`; add and `export` `OTA_KEYRING`, `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` with the defaults in contracts/boot-interface.md; add a `check_keys` macro that passes when the selected board's defconfig has no `BR2_PACKAGE_RAUC=y` and otherwise requires `$(OTA_SIGNING_KEY)` to exist, failing to stderr with `make ota-dev-keys` named; add the `ota-dev-keys` target guarded by `$(check_env)` and calling `scripts/gen-dev-keys.sh $(KEYS_DIR)`; add it to `.PHONY` so the catch-all `%:` rule cannot forward it to Buildroot; add one line for it to `help` -- [ ] T005 Verify: `make ota-dev-keys` creates the four files with the documented modes; +- [X] T005 Verify: `make ota-dev-keys` creates the four files with the documented modes; `openssl verify -CAfile keys/dev/dev-ca.cert.pem keys/dev/dev-signing.cert.pem` passes; `openssl x509 -noout -text` shows `CA:TRUE` on the CA, `CA:FALSE` plus `Code Signing` on the signing certificate, and `NOT FOR PRODUCTION` in both subjects; a second run refuses and @@ -69,44 +69,44 @@ U-Boot and kernel configuration switchover. **Nothing in any user story can be t passes**: if the running system and the bootloader disagree about where the boot-selection state lives, every update rolls back while every image is sound. -- [ ] T006 [P] Verify the AM335x boot ROM's raw-image offsets against the current TRM and confirm +- [X] T006 [P] Verify the AM335x boot ROM's raw-image offsets against the current TRM and confirm that 0x80000 is clear of all of them; the 0 / 128K / 256K / 384K list in research.md R2 comes from a secondary source. Record the finding and its reference in `research.md` R2 -- [ ] T007 [P] Verify that the `genimage` in this tree supports a region outside the partition +- [X] T007 [P] Verify that the `genimage` in this tree supports a region outside the partition table (`in-partition-table = false`) by reading its documentation in `output/beaglebone_black/build/genimage-*/`; record the exact syntax in `contracts/storage-layout.md` -- [ ] T008 [P] Verify which environment binaries RAUC 1.15.2 invokes, by reading the U-Boot +- [X] T008 [P] Verify which environment binaries RAUC 1.15.2 invokes, by reading the U-Boot bootloader backend in `output/beaglebone_black/build/rauc-1.15.2/src/`, and confirm `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV` installs all of them; note in `research.md` R6 whether `fw_getenv` needs a symlink -- [ ] T009 In `configs/beaglebone_black_defconfig`, switch U-Boot to a custom configuration: +- [X] T009 In `configs/beaglebone_black_defconfig`, switch U-Boot to a custom configuration: `BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y` with `BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot.config"`, and point `BR2_TARGET_UBOOT_DEFAULT_ENV_FILE` at `$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot-env.txt`. A config fragment would be shorter but the constitution's Technical Constraints require a generated custom config -- [ ] T010 Create `board/ota/beaglebone_black/uboot-env.txt` with the defaults and the +- [X] T010 Create `board/ota/beaglebone_black/uboot-env.txt` with the defaults and the slot-selection script of contracts/boot-interface.md: `BOOT_ORDER="A B"`, `BOOT_A_LEFT=3`, `BOOT_B_LEFT=3`, and a `bootcmd` that walks `BOOT_ORDER`, skips a slot whose counter is 0, otherwise decrements it, runs `saveenv`, announces the chosen slot on the console (FR-027), loads `/boot/zImage` and the device tree from that slot with `ext4load`, and boots it with `root=` pointing at that slot mounted read-only -- [ ] T011 Generate `board/ota/beaglebone_black/uboot.config` with `make uboot-menuconfig` followed +- [X] T011 Generate `board/ota/beaglebone_black/uboot.config` with `make uboot-menuconfig` followed by `make uboot-update-defconfig`: enable `ENV_IS_IN_MMC` and disable `ENV_IS_IN_FAT`; set `ENV_OFFSET=0x80000`, `ENV_OFFSET_REDUND=0xA0000`, `ENV_SIZE=0x20000`, `ENV_MMC_DEVICE_INDEX=0` and `ENV_REDUNDANT=y`; disable `BOOTCOUNT_LIMIT` and `BOOTCOUNT_AM33XX` so exactly one attempt counter is active (FR-003); lower `BOOTDELAY` from the measured 2 s. `ENV_OFFSET` must be set explicitly: its `ARCH_OMAP2PLUS` default of 0x260000 lands inside partition 1 -- [ ] T012 In `configs/beaglebone_black_defconfig`, enable +- [X] T012 In `configs/beaglebone_black_defconfig`, enable `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE` with `_SOURCE` set to the same `uboot-env.txt`, `_SIZE="0x20000"` and `_REDUNDANT=y`, producing `uboot-env.bin` in `BINARIES_DIR` for `genimage` to write into the reserved region. Same file as T009, so run them in sequence -- [ ] T013 Create `board/ota/beaglebone_black/fw_env.config` with the two lines of +- [X] T013 Create `board/ota/beaglebone_black/fw_env.config` with the two lines of contracts/storage-layout.md — `/dev/mmcblk0 0x80000 0x20000` and `/dev/mmcblk0 0xa0000 0x20000` — and install it to `/etc/fw_env.config` through the board's `rootfs_overlay/` -- [ ] T014 In `configs/beaglebone_black_defconfig`, switch the kernel to a custom configuration +- [X] T014 In `configs/beaglebone_black_defconfig`, switch the kernel to a custom configuration (`BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG` with `board/ota/beaglebone_black/linux.config`), then generate that file with `make linux-menuconfig` and `make linux-update-defconfig`: build `WATCHDOG_CORE` and @@ -114,7 +114,7 @@ lives, every update rolls back while every image is sound. `CONFIG_WATCHDOG_OPEN_TIMEOUT` so the kernel stops covering an unopened watchdog. Today `CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the bootloader's watchdog forever, so a hung slot is never reset and FR-032 cannot be met -- [ ] T015 In `configs/beaglebone_black_defconfig`, add the packages and sizes: `BR2_PACKAGE_RAUC`, +- [X] T015 In `configs/beaglebone_black_defconfig`, add the packages and sizes: `BR2_PACKAGE_RAUC`, `BR2_PACKAGE_HOST_RAUC`, `BR2_PACKAGE_UBOOT_TOOLS` with `BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV`, `BR2_PACKAGE_HOST_UBOOT_TOOLS`, `BR2_TARGET_ROOTFS_EXT2_SIZE="128M"` (29.5 MiB of content plus a 7.3 MiB kernel, about 30% of @@ -122,7 +122,10 @@ lives, every update rolls back while every image is sound. a slot is self-contained (FR-002); confirm the device tree lands there and copy it in `post-build.sh` if it does not - [ ] T016 Verify (hardware): build and flash, then prove the running system and the bootloader - agree on the state. `fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT` in Linux must print what + agree on the state. **Ordering correction found while implementing**: this cannot be run until + T017 puts `uboot-env.bin` into the image, because an unseeded region makes `fw_printenv` fail + its CRC check and the test would prove nothing. Either run T017 first, or run this with a + manual `saveenv` at the U-Boot prompt to populate the region once. `fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT` in Linux must print what `printenv` prints at the U-Boot prompt; `fw_setenv BOOT_A_LEFT 2` followed by a reboot must be visible to U-Boot. This is the single most expensive thing to get wrong in this feature, and the most commonly reported failure in systems of this kind From 87667f13b698c7f71eb07d90cec7d87323d4a116 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 15:51:27 +0700 Subject: [PATCH 07/61] board: lay out the SD card for two OS slots T017 of feature 002. Four MBR primaries plus a reserved region, so the boot-selection state has somewhere to live that no filesystem and no partition table entry covers: 0x80000 env, primary 128 KiB outside the partition table 0xa0000 env, redundant copy 128 KiB outside the partition table 1 MiB p1 boot FAT 32 MiB bootable, type 0x0C, MLO and u-boot.img only p2 rootfs.A 512 MiB populated p3 rootfs.B 512 MiB empty until the first update p4 data 256 MiB reserved; its filesystem arrives with T018 The kernel and device tree are gone from the boot partition, which now holds 1.65 MiB of 32 MiB. They travel inside each OS slot, so a rollback can never pair a new kernel with an old userspace, and no update needs to write the partition that carries the bootloader. scripts/check.sh had to learn this, which is the part of T040 that T017 makes unavoidable rather than optional: its device-tree rule required every DTB the kernel builds to be listed in genimage.cfg, which is now exactly wrong. The two places are mutually exclusive, so a board that installs the kernel into the rootfs must list neither the DTB nor a kernel image in the boot partition, and any other board keeps the old bidirectional rule. Verified: the MBR carries the 0xAA55 signature and four primaries at the sizes above, 1313 MiB declared in total, p1 bootable with type 0x0C at LBA 2048; both copies of uboot-env.bin in the image match the built file byte for byte; boot.vfat holds only MLO and u-boot.img; make check passes all nine checks. sdcard.img is 161 MiB rather than 1.3 GB, because genimage leaves the trailing space of an imageless partition unwritten. That is recorded in the storage-layout contract along with its one consequence: flashing leaves stale bytes beyond the end of the file, so the data area needs a filesystem of its own rather than being mounted on the strength of whatever the card held before. T016 is now runnable: the state region exists in the image, so fw_printenv has something valid to read. Co-Authored-By: Claude Opus 5 --- board/ota/beaglebone_black/genimage.cfg | 53 ++++++++++++++++--- scripts/check.sh | 34 ++++++++---- .../contracts/storage-layout.md | 11 ++++ specs/002-ab-ota-rauc/tasks.md | 2 +- 4 files changed, 81 insertions(+), 19 deletions(-) diff --git a/board/ota/beaglebone_black/genimage.cfg b/board/ota/beaglebone_black/genimage.cfg index 2dbfd87..e6f84b3 100644 --- a/board/ota/beaglebone_black/genimage.cfg +++ b/board/ota/beaglebone_black/genimage.cfg @@ -1,31 +1,68 @@ +# SD card layout for A/B updates. The byte-level contract, and the five files that +# have to agree on these numbers, are in +# specs/002-ab-ota-rauc/contracts/storage-layout.md. +# +# The kernel and device tree live inside each OS slot, so the boot partition holds +# only the two bootloader stages and no update ever writes it. MBR, not GPT: the +# AM335x ROM looks through MBR entries for a bootable FAT partition and finds +# nothing on a GPT medium. That spends all four primary partitions, which is why the +# boot-selection state is a reserved region rather than a partition of its own. + image boot.vfat { vfat { files = { "MLO", - "u-boot.img", - "zImage", - "uEnv.txt", - "am335x-boneblack.dtb", - "extlinux" + "u-boot.img" } } - size = 16M + size = 32M } image sdcard.img { hdimage { + partition-table-type = "mbr" + } + + # Boot-selection state: in no filesystem and no partition table entry, in the + # gap above the offsets the ROM scans for a raw boot image. Both copies are + # seeded, because fw_printenv cannot see U-Boot's compiled-in default + # environment and an unseeded region would fail its health check on first boot. + partition env { + in-partition-table = false + offset = 0x80000 + image = "uboot-env.bin" } - partition u-boot { + partition env-redund { + in-partition-table = false + offset = 0xa0000 + image = "uboot-env.bin" + } + + partition boot { partition-type = 0xC bootable = "true" + offset = 1M image = "boot.vfat" } - partition rootfs { + partition rootfs-a { partition-type = 0x83 image = "rootfs.ext4" size = 512M } + + # Empty in the factory image; the first update writes it. + partition rootfs-b { + partition-type = 0x83 + size = 512M + } + + # Reserved for /data. Its filesystem arrives together with the mount point in + # the rootfs overlay. + partition data { + partition-type = 0x83 + size = 256M + } } diff --git a/scripts/check.sh b/scripts/check.sh index f9e665d..973263f 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -135,23 +135,37 @@ for b in ${BOARDS}; do ok "board parity: ${b}" fi - # Every DTB the kernel builds for the board must be in genimage.cfg, and vice versa. + # Where the kernel and its device tree live is a board decision, and the two + # places are mutually exclusive. A board that installs them into the rootfs + # boots them from its OS slot, so neither may also sit in the boot partition; + # any other board must list every DTB it builds, and no DTB it does not build. if [ -f "${bpath}/genimage.cfg" ]; then built="$(defconfig_value "${cfg}" BR2_LINUX_KERNEL_INTREE_DTS_NAME | tr ' ' '\n' | sed '/^$/d; s#.*/##; s#$#.dtb#')" listed="$(grep -o '[A-Za-z0-9_.-]*\.dtb' "${bpath}/genimage.cfg" || true)" layout_ok=1 - for d in ${built}; do - if ! printf '%s\n' "${listed}" | grep -qx "${d}"; then - fail "image layout: ${d} is built by ${cfg} but not listed in ${bpath}/genimage.cfg." + if grep -q '^BR2_LINUX_KERNEL_INSTALL_TARGET=y' "${cfg}"; then + for d in ${listed}; do + fail "image layout: ${bpath}/genimage.cfg lists ${d}, but ${cfg} installs the kernel and device tree into the rootfs, so they must not also be in the boot partition." layout_ok=0 - fi - done - for d in ${listed}; do - if ! printf '%s\n' "${built}" | grep -qx "${d}"; then - fail "image layout: ${bpath}/genimage.cfg lists ${d}, which ${cfg} does not build." + done + if grep -qE '"(zImage|uImage|Image)"' "${bpath}/genimage.cfg"; then + fail "image layout: ${bpath}/genimage.cfg puts a kernel image in the boot partition, but ${cfg} installs it into the rootfs." layout_ok=0 fi - done + else + for d in ${built}; do + if ! printf '%s\n' "${listed}" | grep -qx "${d}"; then + fail "image layout: ${d} is built by ${cfg} but not listed in ${bpath}/genimage.cfg." + layout_ok=0 + fi + done + for d in ${listed}; do + if ! printf '%s\n' "${built}" | grep -qx "${d}"; then + fail "image layout: ${bpath}/genimage.cfg lists ${d}, which ${cfg} does not build." + layout_ok=0 + fi + done + fi if [ "${layout_ok}" -eq 1 ]; then ok "image layout: ${b}" fi diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index 46c463b..4039edc 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -25,6 +25,17 @@ offset size what written by total ~1.3 GB minimum medium 2 GB; extra space is unused ``` +The partition table declares all of that, but `sdcard.img` is far smaller than +1.3 GB, because `genimage` does not write the trailing space of a partition it has no +image for: the file simply ends after the last byte it has. That keeps the artifact +small and the flashing fast, and it has one consequence worth knowing. Writing the +image leaves whatever the medium held before in the space beyond the file, so a +reflashed card can carry stale bytes in the second OS slot and in the data area. The +second slot does not matter, since the first update overwrites it, but the data area +must not be mounted on the strength of stale content: it gets a filesystem of its own +in the factory image together with its mount point. + + ## Rules 1. **MBR, not GPT.** The AM335x ROM reads the MBR and looks for a bootable FAT partition; on a GPT diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 35054fe..c455d49 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -141,7 +141,7 @@ day-to-day build, flash and boot workflow is unchanged for anyone who does not c **Independent Test**: write `sdcard.img` to a blank card, boot, confirm a login prompt on the serial console, and confirm `rauc status` names the booted slot and reports it good with slot B unused. -- [ ] T017 [US1] Rewrite `board/ota/beaglebone_black/genimage.cfg` to the layout of +- [X] T017 [US1] Rewrite `board/ota/beaglebone_black/genimage.cfg` to the layout of contracts/storage-layout.md: MBR; `uboot-env.bin` written at 0x80000 and 0xA0000 outside the partition table; `p1` boot FAT16 32 MiB bootable type 0x0C starting at 1 MiB holding only `MLO` and `u-boot.img`; `p2` and `p3` 512 MiB each from `rootfs.ext4`; `p4` 256 MiB ext4 for From d4557673d208092dc5593ce353d000e18feff0a8 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 16:08:42 +0700 Subject: [PATCH 08/61] docs: record the T016 hardware evidence, and what it did not prove The boot-selection state works in both directions that this capture covers. U-Boot reads the seeded region rather than falling back to its compiled-in default, setexpr and saveenv decrement and persist the counter across a reboot, and fw_printenv in Linux reads exactly the bytes U-Boot wrote -- so /etc/fw_env.config names the right device, offsets and size. ext4load pulls a 7.6 MB zImage and the device tree out of the OS slot, the kernel comes up with root=/dev/mmcblk0p2 ro, and all four partitions appear. What it did not prove: the write direction. `fw_setenv BOOT_A_LEFT 2` was run while the value was already 2, so a write that silently landed elsewhere would look identical. The log says so rather than letting the capture read as a full pass, and names the one command that closes it. Three other things the same capture settles, two of which change later work: - The clock starts at 2000-01-01T00:00:00 UTC. This board has no RTC backup, so a certificate whose validity window opens at build time is not yet valid when a device boots. That was a theoretical worry about the staging and production signing work; it is now a measured behaviour, and the signing-chain contract carries the figure. - The watchdog still does not arm. The board sat at an idle shell for 253 seconds with no userspace watchdog client and was never reset, although U-Boot reports starting it with a 60 second timeout and the kernel registers omap_wdt. The kernel configuration from T014 was necessary but is not sufficient, so FR-032 is not satisfied and T034 would fail today. research.md R5 lists three candidates in order of likelihood and T032 now starts by finding out which, instead of assuming the config change did the job. - The root filesystem is still remounted read-write at 2.96 s, which is the check for T023. Co-Authored-By: Claude Opus 5 --- docs/logs/t016-env-agreement.log | 79 +++++++++++++++++++ .../contracts/signing-chain.md | 7 +- specs/002-ab-ota-rauc/research.md | 9 +++ specs/002-ab-ota-rauc/tasks.md | 5 +- 4 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 docs/logs/t016-env-agreement.log diff --git a/docs/logs/t016-env-agreement.log b/docs/logs/t016-env-agreement.log new file mode 100644 index 0000000..d0a586d --- /dev/null +++ b/docs/logs/t016-env-agreement.log @@ -0,0 +1,79 @@ +T016 evidence: the running system and the bootloader agree on the boot-selection +state. Extracted from a serial capture on 2026-10-28, image built from the tree at +commit 87667f1. Full boot logs are long and repetitive; these are the lines that +carry the result. + +--- first boot, at the U-Boot prompt: the seeded region is read ------------------ + +=> printenv +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 +BOOT_ORDER=A B +bootcmd=run ota_select +bootdelay=1 +[...] +Environment size: 1528/131067 bytes + +--- booting: one attempt is spent, written and saved ----------------------------- + +=> boot +Saving Environment to MMC... Writing to redundant MMC(0)... OK +OTA: booting slot A, 2 attempts left +7649392 bytes read in 491 ms (14.9 MiB/s) +70396 bytes read in 7 ms (9.6 MiB/s) + +[ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait +[ 2.656221] mmcblk0: p1 p2 p3 p4 +[ 2.775027] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. + +--- in Linux: fw_printenv reads exactly what U-Boot wrote ------------------------ + +# fw_printenv +BOOT_A_LEFT=2 +BOOT_B_LEFT=3 +BOOT_ORDER=A B +ota_left=2 +ota_part=2 +ota_slot=A +[...] + +--- after a reboot: the state persists and the counter walks down ---------------- + +Loading Environment from MMC... Reading from MMC(0)... OK +Hit any key to stop autoboot: 0 +Saving Environment to MMC... Writing to redundant MMC(0)... OK +OTA: booting slot A, 1 attempts left + +# fw_printenv BOOT_A_LEFT +BOOT_A_LEFT=1 + +--- what this proves, and what it does not -------------------------------------- + +Proven: U-Boot reads the seeded region rather than falling back to its compiled-in +default; setexpr and saveenv work; the counter decrements and survives a reboot; and +fw_printenv in Linux reads the same bytes U-Boot wrote, so /etc/fw_env.config names +the right device, offsets and size. + +Not proven by this capture: the write direction. `fw_setenv BOOT_A_LEFT 2` was run +while the value was already 2, so a write that silently went elsewhere would look +identical. Closing it takes one command: set the counter to 3 from Linux, reboot, and +confirm U-Boot announces two attempts left. + +--- three other things this capture settles -------------------------------------- + +1. The clock starts in the past. `omap_rtc 44e3e000.rtc: setting system clock to + 2000-01-01T00:00:00 UTC` -- this board has no RTC backup, so a certificate whose + validity window opens at build time is not yet valid when a device boots. That + decides a research item for the staging/production signing work, and it is a real + behaviour rather than a theoretical worry. + +2. The watchdog still does not arm. U-Boot reports `WDT: Started wdt@44e35000 with + servicing every 1000ms (60s timeout)` and the kernel registers + `omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec`, yet the board sat + at an idle shell for 253 seconds with no userspace watchdog client and was never + reset. CONFIG_WATCHDOG_OPEN_TIMEOUT=60 was necessary but is not sufficient, so + FR-032 is not yet satisfied and T034 would fail today. + +3. The root filesystem is still remounted read-write: `EXT4-fs (mmcblk0p2): + re-mounted ... r/w.` at 2.96 s. That is T023, still to do, and this line is the + check for it. diff --git a/specs/002-ab-ota-rauc/contracts/signing-chain.md b/specs/002-ab-ota-rauc/contracts/signing-chain.md index 0e2e834..a769e3c 100644 --- a/specs/002-ab-ota-rauc/contracts/signing-chain.md +++ b/specs/002-ab-ota-rauc/contracts/signing-chain.md @@ -114,6 +114,7 @@ carries exactly one CA in its keyring, so a bundle from one environment cannot i from another. Their private keys do not live in this repository — a secret store for staging, and a PKCS#11 token or cloud KMS for production, which RAUC supports by accepting PKCS#11 URLs in place of filenames for `--cert` and `--key`. Two problems belong to that work rather than this one: this -board has no RTC battery, so its clock starts in 1970 and certificate validity windows need -deciding, and a CMS signature is not byte-reproducible, so two builds of the same commit produce -different bundles. +board has no RTC backup and its clock starts at 2000-01-01T00:00:00 UTC, measured in +`docs/logs/t016-env-agreement.log`, so a certificate whose validity window opens at build time is +not yet valid when a device boots; and a CMS signature is not byte-reproducible, so two builds +of the same commit produce different bundles. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 45bc34a..e3bfc8c 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -230,6 +230,15 @@ continuing to run, which is what FR-032 asks for. The feeder itself is the BusyBox `watchdog` applet, already enabled in this image's BusyBox configuration, so no new package is needed. +**Measured on hardware (T016), and not yet working**: with the kernel configuration above in place, +the board sat at an idle shell for 253 seconds with no userspace watchdog client and was never +reset, although U-Boot reports starting the watchdog with a 60 second timeout and the kernel +registers `omap_wdt`. So the configuration change is necessary but not sufficient, and FR-032 is not +satisfied yet. Three things to check when T032 lands, in order of likelihood: whether U-Boot stops +the watchdog before handing over, whether `omap_wdt` reports the device as already running so +`WATCHDOG_HANDLE_BOOT_ENABLED` has anything to take over, and whether the open timeout applies only +to a device the kernel itself started. Evidence in `docs/logs/t016-env-agreement.log`. + **Alternatives considered**: - *The `watchdog` package* (in Buildroot, supports test and repair scripts): a better fit once there diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index c455d49..664532c 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -225,7 +225,10 @@ previous slot on its own within the documented number of attempts. - [ ] T031 [US3] Extend `board/ota/beaglebone_black/uboot-env.txt` with the exhausted-slots path: when every slot is at 0 attempts, announce it on the console, restore one attempt to the first slot in `BOOT_ORDER` and try it, rather than halting at a prompt -- [ ] T032 [US3] Extend `S99ota-health` to start the BusyBox `watchdog` feeder **only** after +- [ ] T032 [US3] **The kernel change of T014 is not sufficient on its own**: T016 measured 253 + seconds at an idle shell with no watchdog client and no reset, so start by finding out what + actually keeps the watchdog from firing (research.md R5 lists three candidates in order of + likelihood), then extend `S99ota-health` to start the BusyBox `watchdog` feeder **only** after `rauc status mark-good` succeeds, and to log the reason to `/data` and leave the feeder stopped when any condition fails, so an unhealthy slot is reset and retired by the attempt counter (FR-032) From cef0a6bc71fe7b835f794249f6641f8bc29ae004 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 16:18:06 +0700 Subject: [PATCH 09/61] board: make the running slot read-only and give the device its /data Completes the code for User Story 1: the layout from the previous commit now has a system that fits it. T016 closed on hardware first, which is why this could be built on top with any confidence. The running OS slot is mounted read-only and stays that way, so it cannot drift from the bundle it was installed from and an unclean power loss cannot corrupt it. Buildroot made that cheaper than expected: its BusyBox skeleton already points /var/cache, /var/log, /var/spool, /var/tmp, /var/run and /var/lock at /tmp and /run, both of which are already tmpfs, so only /var/lib is a real directory in the rootfs and nothing writes to it at boot. No /var reconstruction was needed, just BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW off and an fstab that says ro. /data gets a real ext4 in the factory image rather than being mounted on the strength of whatever the card held before. genimage cannot build it: Buildroot hands genimage an empty rootpath on purpose, so a filesystem cannot be filled from the target tree. post-image.sh makes it with mke2fs instead, 256 MiB and sparse, which is the normal division of labour for a second filesystem. RAUC's system.conf puts the slot status on /data, because the record of which slot is bad and why has to outlive both the reboot that reveals the failure and the overwriting of the failed slot (FR-014). post-build.sh installs the keyring and creates the mount point, keyed on rauc being present in the target rather than on any particular option, so it stays board-independent (FR-029). uEnv.txt and extlinux.conf are deleted. The boot baseline proved the board booted through extlinux.conf and never read uEnv.txt; both are replaced by the slot-selection script. Verified: make check passes all nine checks; the installed /etc/rauc/keyring.pem is byte-identical to keys/dev/dev-ca.cert.pem, so the device trusts exactly the CA this tree generated; partition 4 in the image carries ext magic 0xef53 with label "data" at LBA 2164736; no remount script is left in the target's init scripts. One figure in the storage-layout contract was wrong and is corrected: sdcard.img is now 1313 MiB long rather than 161 MiB, because the last partition finally has an image, though only about 63 MiB of it is data and the rest holes. Flashing writes the whole length, since dd does not skip holes. US1 is now code-complete and waits on hardware: T024 and T025. Co-Authored-By: Claude Opus 5 --- board/ota/beaglebone_black/extlinux.conf | 4 --- board/ota/beaglebone_black/genimage.cfg | 6 +++-- board/ota/beaglebone_black/post-image.sh | 13 +++++++--- .../beaglebone_black/rootfs_overlay/etc/fstab | 15 +++++++++++ .../rootfs_overlay/etc/rauc/system.conf | 26 +++++++++++++++++++ board/ota/beaglebone_black/uEnv.txt | 11 -------- board/ota/common/post-build.sh | 24 ++++++++++++++--- configs/beaglebone_black_defconfig | 1 + .../contracts/storage-layout.md | 17 ++++++------ specs/002-ab-ota-rauc/tasks.md | 14 +++++----- 10 files changed, 92 insertions(+), 39 deletions(-) delete mode 100644 board/ota/beaglebone_black/extlinux.conf create mode 100644 board/ota/beaglebone_black/rootfs_overlay/etc/fstab create mode 100644 board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf delete mode 100644 board/ota/beaglebone_black/uEnv.txt diff --git a/board/ota/beaglebone_black/extlinux.conf b/board/ota/beaglebone_black/extlinux.conf deleted file mode 100644 index 13affca..0000000 --- a/board/ota/beaglebone_black/extlinux.conf +++ /dev/null @@ -1,4 +0,0 @@ -label beaglebone-buildroot - kernel /zImage - fdtdir / - append console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait diff --git a/board/ota/beaglebone_black/genimage.cfg b/board/ota/beaglebone_black/genimage.cfg index e6f84b3..17c7677 100644 --- a/board/ota/beaglebone_black/genimage.cfg +++ b/board/ota/beaglebone_black/genimage.cfg @@ -59,10 +59,12 @@ image sdcard.img { size = 512M } - # Reserved for /data. Its filesystem arrives together with the mount point in - # the rootfs overlay. + # Persistent data area. Its empty filesystem is built by post-image.sh, because + # Buildroot gives genimage an empty rootpath and so genimage cannot fill a + # filesystem from the target tree. partition data { partition-type = 0x83 + image = "data.ext4" size = 256M } } diff --git a/board/ota/beaglebone_black/post-image.sh b/board/ota/beaglebone_black/post-image.sh index da219dc..10ab904 100755 --- a/board/ota/beaglebone_black/post-image.sh +++ b/board/ota/beaglebone_black/post-image.sh @@ -1,10 +1,17 @@ #!/bin/sh -# Runs from the Buildroot tree (make -C buildroot), so support/ is reachable relatively. +# Runs from the Buildroot tree (make -C buildroot), so support/ is reachable +# relatively. Builds the empty filesystem for the persistent data area, then assembles +# the SD card image. set -eu BOARD_DIR="$(dirname "$0")" +DATA_SIZE=256M -cp "${BOARD_DIR}/uEnv.txt" "${BINARIES_DIR}/uEnv.txt" -install -m 0644 -D "${BOARD_DIR}/extlinux.conf" "${BINARIES_DIR}/extlinux/extlinux.conf" +# Buildroot hands genimage an empty rootpath, so genimage cannot build this +# filesystem from the target tree: it is made here instead. The file stays sparse, +# which is why sdcard.img is far smaller than the layout it declares. +rm -f "${BINARIES_DIR}/data.ext4" +truncate -s "${DATA_SIZE}" "${BINARIES_DIR}/data.ext4" +"${HOST_DIR}/sbin/mke2fs" -q -t ext4 -L data -F "${BINARIES_DIR}/data.ext4" exec support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg" diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/fstab b/board/ota/beaglebone_black/rootfs_overlay/etc/fstab new file mode 100644 index 0000000..b691877 --- /dev/null +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/fstab @@ -0,0 +1,15 @@ +# +# +# The running OS slot is read-only. It has to stay identical to the bundle it was +# installed from, and an unclean power loss must not be able to corrupt it. Only +# /data survives a reboot; /tmp, /run and /dev/shm are volatile, and the Buildroot +# skeleton already points /var/cache, /var/log, /var/spool, /var/tmp, /var/run and +# /var/lock at them. +/dev/root / ext4 ro,noauto 0 1 +/dev/mmcblk0p4 /data ext4 defaults 0 2 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts defaults,gid=5,mode=620,ptmxmode=0666 0 0 +tmpfs /dev/shm tmpfs mode=1777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 +sysfs /sys sysfs defaults 0 0 diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf new file mode 100644 index 0000000..c3b80a2 --- /dev/null +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf @@ -0,0 +1,26 @@ +# RAUC on beaglebone_black. The device paths here are the same ones +# specs/002-ab-ota-rauc/contracts/storage-layout.md fixes for genimage.cfg, +# fw_env.config and fstab; a disagreement between any two of them is silent. + +[system] +compatible=ota-beaglebone-black +bootloader=uboot +# Slot status, including which slot is bad and why, has to outlive the reboot that +# reveals the failure and the overwriting of the failed slot, so it lives on the +# persistent data area rather than in a slot or in volatile storage (FR-014). +statusfile=/data/rauc.status +bundle-formats=plain + +[keyring] +# The development CA, installed by board/ota/common/post-build.sh from $OTA_KEYRING. +path=/etc/rauc/keyring.pem + +[slot.rootfs.0] +device=/dev/mmcblk0p2 +type=ext4 +bootname=A + +[slot.rootfs.1] +device=/dev/mmcblk0p3 +type=ext4 +bootname=B diff --git a/board/ota/beaglebone_black/uEnv.txt b/board/ota/beaglebone_black/uEnv.txt deleted file mode 100644 index 8fce54d..0000000 --- a/board/ota/beaglebone_black/uEnv.txt +++ /dev/null @@ -1,11 +0,0 @@ -bootpart=0:1 -devtype=mmc -bootdir= -bootfile=zImage -bootpartition=mmcblk0p2 -console=ttyS0,115200n8 -loadaddr=0x82000000 -fdtaddr=0x88000000 -set_mmc1=if test $board_name = A33515BB; then setenv bootpartition mmcblk1p2; fi -set_bootargs=setenv bootargs console=${console} root=/dev/${bootpartition} rw rootfstype=ext4 rootwait -uenvcmd=run set_mmc1; run set_bootargs;run loadimage;run loadfdt;printenv bootargs;bootz ${loadaddr} - ${fdtaddr} diff --git a/board/ota/common/post-build.sh b/board/ota/common/post-build.sh index adc8238..fc480f7 100755 --- a/board/ota/common/post-build.sh +++ b/board/ota/common/post-build.sh @@ -1,12 +1,30 @@ #!/bin/sh -# Shared post-build step for every board: stamp the rootfs with what was built. +# Shared post-build step for every board: stamp the rootfs with what was built, and +# for a board that does A/B updates, give it the trust anchor and the mount point its +# persistent data area needs. Board-independent on purpose (FR-029): a second board +# adopts A/B by adding board-local files, not by changing this. set -eu BOARD="$(basename "${BASE_DIR}")" VERSION="$(git -C "${BR2_EXTERNAL_OTA_PATH}" describe --always --dirty 2>/dev/null || echo unknown)" -cat > "${TARGET_DIR}/etc/build-info" < "${TARGET_DIR}/etc/build-info" <}'." >&2 + echo "post-build: generate the development material first: make ota-dev-keys" >&2 + exit 1 + fi + install -m 0644 -D "${OTA_KEYRING}" "${TARGET_DIR}/etc/rauc/keyring.pem" + + # Mount point for the persistent data area. Created here rather than carried in + # an overlay so no placeholder file ends up in the image. + mkdir -p "${TARGET_DIR}/data" +fi diff --git a/configs/beaglebone_black_defconfig b/configs/beaglebone_black_defconfig index 52ba7f0..862e50d 100644 --- a/configs/beaglebone_black_defconfig +++ b/configs/beaglebone_black_defconfig @@ -7,6 +7,7 @@ BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_GLIBC_STABLE=y BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_OTA_PATH)/patches" BR2_DOWNLOAD_FORCE_CHECK_HASHES=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_OTA_PATH)/board/ota/common/rootfs_overlay $(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/rootfs_overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_OTA_PATH)/board/ota/common/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/post-image.sh" diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index 4039edc..630ef75 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -25,15 +25,14 @@ offset size what written by total ~1.3 GB minimum medium 2 GB; extra space is unused ``` -The partition table declares all of that, but `sdcard.img` is far smaller than -1.3 GB, because `genimage` does not write the trailing space of a partition it has no -image for: the file simply ends after the last byte it has. That keeps the artifact -small and the flashing fast, and it has one consequence worth knowing. Writing the -image leaves whatever the medium held before in the space beyond the file, so a -reflashed card can carry stale bytes in the second OS slot and in the data area. The -second slot does not matter, since the first update overwrites it, but the data area -must not be mounted on the strength of stale content: it gets a filesystem of its own -in the factory image together with its mount point. +`sdcard.img` is 1313 MiB long but sparse: about 63 MiB of it is actual data, the +rest holes. Two things follow. Flashing writes the whole length, because `dd` does not +skip holes, so a flash takes as long as the declared layout and not as long as the +data. And `genimage` only writes up to the last partition it has an image for, so the +second OS slot, which has none, is a hole: after flashing it holds whatever the medium +held before. That costs nothing, since the first update overwrites that slot, but it +is the reason the data area is given a real filesystem in the factory image rather +than being mounted on the strength of whatever was there. ## Rules diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 664532c..d59e499 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -121,7 +121,7 @@ lives, every update rolls back while every image is sound. the filesystem), and the kernel image plus device tree installed into `/boot` of the rootfs so a slot is self-contained (FR-002); confirm the device tree lands there and copy it in `post-build.sh` if it does not -- [ ] T016 Verify (hardware): build and flash, then prove the running system and the bootloader +- [X] T016 Verify (hardware): build and flash, then prove the running system and the bootloader agree on the state. **Ordering correction found while implementing**: this cannot be run until T017 puts `uboot-env.bin` into the image, because an unseeded region makes `fw_printenv` fail its CRC check and the test would prove nothing. Either run T017 first, or run this with a @@ -146,27 +146,27 @@ console, and confirm `rauc status` names the booted slot and reports it good wit partition table; `p1` boot FAT16 32 MiB bootable type 0x0C starting at 1 MiB holding only `MLO` and `u-boot.img`; `p2` and `p3` 512 MiB each from `rootfs.ext4`; `p4` 256 MiB ext4 for data. `p3` and `p4` are empty in the factory image -- [ ] T018 [P] [US1] Create `board/ota/beaglebone_black/rootfs_overlay/etc/fstab`: root read-only, +- [X] T018 [P] [US1] Create `board/ota/beaglebone_black/rootfs_overlay/etc/fstab`: root read-only, `/dev/mmcblk0p4` at `/data` read-write, and tmpfs for `/tmp`, `/run` and `/var` so a read-only slot does not prevent normal operation (FR-028) -- [ ] T019 [P] [US1] Create `board/ota/beaglebone_black/rauc-system.conf` with +- [X] T019 [P] [US1] Create `board/ota/beaglebone_black/rauc-system.conf` with `compatible=ota-beaglebone-black`, `bootloader=uboot`, the keyring at `/etc/rauc/keyring.pem`, the slot status file on `/data` so a failure record outlives the reboot that reveals it (FR-014), and the two slots of data-model.md — `rootfs.0` on `/dev/mmcblk0p2` with `bootname=A` and `rootfs.1` on `/dev/mmcblk0p3` with `bootname=B`, both type `ext4`. Install it to `/etc/rauc/system.conf` through the board's `rootfs_overlay/` -- [ ] T020 [US1] Extend `board/ota/common/post-build.sh`: when the board's configuration has +- [X] T020 [US1] Extend `board/ota/common/post-build.sh`: when the board's configuration has `BR2_PACKAGE_RAUC=y`, install `$OTA_KEYRING` to `${TARGET_DIR}/etc/rauc/keyring.pem` with mode 0644, failing with a message naming `make ota-dev-keys` when it is missing. This is the backstop for build paths that do not go through the `build` target; keep it board-independent (FR-029) -- [ ] T021 [US1] Rewrite `board/ota/beaglebone_black/post-image.sh`: drop the `uEnv.txt` and +- [X] T021 [US1] Rewrite `board/ota/beaglebone_black/post-image.sh`: drop the `uEnv.txt` and `extlinux.conf` copying, keep the `genimage.sh` call, and keep `set -eu` with the one-line header comment stating the working directory assumption -- [ ] T022 [US1] Delete `board/ota/beaglebone_black/uEnv.txt` and +- [X] T022 [US1] Delete `board/ota/beaglebone_black/uEnv.txt` and `board/ota/beaglebone_black/extlinux.conf`. The boot baseline proves the board boots through `extlinux.conf` and never reads `uEnv.txt`; both are replaced by the slot-selection script -- [ ] T023 [US1] In `configs/beaglebone_black_defconfig`, stop remounting the root filesystem +- [X] T023 [US1] In `configs/beaglebone_black_defconfig`, stop remounting the root filesystem read-write, so the running slot cannot diverge from the bundle it came from (FR-006) - [ ] T024 [US1] Verify (hardware): quickstart scenario 1 — flash, boot to a login prompt, `rauc status` shows slot A booted and good with B unused, `BOOT_ORDER="A B"` with both From 2ac5f5cbf1aada8bc108611f29a8818409611a8f Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 16:36:43 +0700 Subject: [PATCH 10/61] board: seed the factory image with only slot A eligible The first hardware run of User Story 1 showed `rauc status` reporting the empty slot B as "boot status: good". RAUC's U-Boot backend calls a slot good when it is listed in BOOT_ORDER with attempts left, and the seed listed B with three. That is wrong twice over. The spec says the empty slot must never be selected, and the boot script would have honoured the listing: a failing A would fall through to B, which holds nothing, spend B's attempts on loads that cannot succeed, and only then reach the last-resort path. The factory image now seeds BOOT_ORDER=A and BOOT_B_LEFT=0. RAUC gives B its attempts and moves it to the front when the first update is installed, so nothing else changes. The edit lands in all three places the file is compiled into -- the U-Boot built-in default, the SPL, and uboot-env.bin that seeds the reserved region -- which was checked in the artifacts rather than assumed, because Buildroot tracks the path of the environment file and not its contents, so a plain rebuild would have kept the old values. uboot-env.bin parses with a valid redundant-format CRC, and both copies in sdcard.img match it byte for byte. The same capture closes most of User Story 1: the running slot is read-only (touching / fails), /data is mounted and writable, rauc accepts system.conf and names the booted slot, and the remount-read-write line that the T016 capture showed at 2.96 s is gone. The evidence is in docs/logs/t024-us1-first-capture.log, including what it does not show. Docs that described the old seed -- quickstart, the storage-layout contract, the data model and the text of T010 and T024 -- are corrected. T024 also now says BOOT_A_LEFT reads 2 after the first boot until mark-good restores it; the old wording expected 3 and would have failed a correct system. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/beaglebone_black/uboot-env.txt | 9 ++- docs/logs/t024-us1-first-capture.log | 77 +++++++++++++++++++ .../contracts/storage-layout.md | 2 +- specs/002-ab-ota-rauc/data-model.md | 2 +- specs/002-ab-ota-rauc/quickstart.md | 7 +- specs/002-ab-ota-rauc/tasks.md | 13 ++-- 6 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 docs/logs/t024-us1-first-capture.log diff --git a/board/ota/beaglebone_black/uboot-env.txt b/board/ota/beaglebone_black/uboot-env.txt index b16e6de..dd19f12 100644 --- a/board/ota/beaglebone_black/uboot-env.txt +++ b/board/ota/beaglebone_black/uboot-env.txt @@ -20,9 +20,14 @@ bootdelay=1 # Boot-selection state. A slot is eligible while it is listed in BOOT_ORDER and its # counter is above zero; marking a slot bad removes it from BOOT_ORDER as well as # zeroing its counter. RAUC stores the counters as hexadecimal strings. -BOOT_ORDER=A B +# +# The factory image populates only slot A, so slot B starts out ineligible: absent +# from BOOT_ORDER, with no attempts. Listing it with attempts would make RAUC report +# an empty slot as good, and would let a failing A fall through to a slot that holds +# nothing. The first update gives B its attempts and moves it to the front. +BOOT_ORDER=A BOOT_A_LEFT=3 -BOOT_B_LEFT=3 +BOOT_B_LEFT=0 # Partition number of each OS slot on the boot medium. ota_part_A=2 diff --git a/docs/logs/t024-us1-first-capture.log b/docs/logs/t024-us1-first-capture.log new file mode 100644 index 0000000..542e9aa --- /dev/null +++ b/docs/logs/t024-us1-first-capture.log @@ -0,0 +1,77 @@ +T024 evidence, first capture: User Story 1 on hardware, 2026-10-28. + +Image: built from HEAD d455767 with the changes later committed as cef0a6b still in +the working tree, so /etc/build-info says VERSION=d455767-dirty. That is the honest +stamp for what was booted. The re-test after the seed fix below is built from a clean +commit. + +--- rauc works against this system.conf ------------------------------------------ + +# rauc status +rauc-Message: Using central status file /data/rauc.status +rauc-Message: Using system config file /etc/rauc/system.conf +rauc-Message: Failed to load system status: No such file or directory +=== System Info === +Compatible: ota-beaglebone-black +Booted from: rootfs.0 (/dev/mmcblk0p2) +=== Bootloader === +Activated: rootfs.0 (A) +=== Slot States === +o [rootfs.1] (/dev/mmcblk0p3, ext4, inactive) + bootname: B + boot status: good <-- wrong, see finding 1 +x [rootfs.0] (/dev/mmcblk0p2, ext4, booted) + bootname: A + boot status: good + +--- the running slot is read-only, /data is writable and mounted ----------------- + +# mount | grep ' / ' +/dev/root on / type ext4 (ro,relatime) +# touch /x +touch: /x: Read-only file system +# touch /data/keep && sync +# df -h /data +/dev/mmcblk0p4 229.9M 270.0K 212.8M 0% /data + +dmesg: +[ 2.768478] EXT4-fs (mmcblk0p2): mounted filesystem ... ro with ordered data mode. +[ 2.780824] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. +[ 3.069431] EXT4-fs (mmcblk0p4): mounted filesystem ... r/w with ordered data mode. + +The T016 capture had `EXT4-fs (mmcblk0p2): re-mounted ... r/w.` at 2.96 s. It is gone. +That line was the check for T023. + +--- state ------------------------------------------------------------------------ + +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A B +BOOT_A_LEFT=2 +BOOT_B_LEFT=3 + +--- findings --------------------------------------------------------------------- + +1. The empty slot B is reported good. RAUC's U-Boot backend calls a slot good when it + is listed in BOOT_ORDER with attempts left, and the factory seed listed B with 3 + attempts. That contradicts the spec ("the empty slot must never be selected") and + would let a failing A fall through to a slot holding nothing. Fixed in the seed: + BOOT_ORDER=A, BOOT_B_LEFT=0. Needs a reflash to confirm. + +2. "Failed to load system status: No such file or directory" is the first run, before + /data/rauc.status exists. Expected, and it should not appear again once RAUC has + written the file. + +3. BOOT_A_LEFT=2 after one boot is correct, and a reminder of why the health script + matters: nothing restores the counter until T027 exists. Three boots without + `rauc status mark-good` exhaust A and the device falls to the last-resort path. + +4. The watchdog is unchanged: omap_wdt registers with a 60 s timeout and nothing + resets the board. T032, as recorded in the T016 log. + +5. The clock still starts at 2000-01-01T00:00:00 UTC. + +--- not shown by this capture ---------------------------------------------------- + +/data surviving a power cycle; the console line naming slot A during boot (shown in +the T016 capture, same script, not in this paste); and boot time (T025 needs +grabserial, not dmesg). diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index 630ef75..b15fda2 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -65,7 +65,7 @@ than being mounted on the strength of whatever was there. ``` That file is built by `BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE` from `uboot-env.txt`, so a freshly flashed device boots - with `BOOT_ORDER="A B"` and full counters, and `fw_printenv` can read the state on the first + with `BOOT_ORDER="A"`, a full counter for A and none for the empty B, and `fw_printenv` can read the state on the first boot. Seeding is not a nicety: `fw_printenv` cannot see U-Boot's built-in default environment, so an unseeded region fails the health check of FR-012 immediately. 5. **The boot partition is written only by flashing.** No update touches `MLO` or `u-boot.img` diff --git a/specs/002-ab-ota-rauc/data-model.md b/specs/002-ab-ota-rauc/data-model.md index db3a0ee..451792c 100644 --- a/specs/002-ab-ota-rauc/data-model.md +++ b/specs/002-ab-ota-rauc/data-model.md @@ -28,7 +28,7 @@ system write. Stored in the reserved region, redundantly — see | Variable | Meaning | Values | |---|---|---| -| `BOOT_ORDER` | slot boot names in the order to try | `"A B"` or `"B A"` | +| `BOOT_ORDER` | slot boot names in the order to try | `"A"` on a factory image, `"A B"` or `"B A"` once both slots hold a system | | `BOOT_A_LEFT` | attempts remaining for slot A | 0–3 | | `BOOT_B_LEFT` | attempts remaining for slot B | 0–3 | diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index ef75309..5e80266 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -40,8 +40,11 @@ touch /data/keep && sync # must succeed fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT ``` -Expected: `BOOT_ORDER="A B"`, both counters at 3, and the console line from the slot-selection -script naming A during boot (FR-027). +Expected on a freshly flashed card: `BOOT_ORDER="A"`, `BOOT_A_LEFT` at 3 and `BOOT_B_LEFT` at 0, +because only slot A is populated and the empty slot must never be selected. After the first boot +`BOOT_A_LEFT` reads 2 until the health script confirms the slot and `rauc status mark-good` restores +it to 3, which is the point of the counter. `rauc status` shows slot B as bad, since it is not +bootable. The console names slot A during boot (FR-027). ## 2. Boot time has not regressed — SC-008 diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index d59e499..a3ba17b 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -87,8 +87,10 @@ lives, every update rolls back while every image is sound. `$(BR2_EXTERNAL_OTA_PATH)/board/ota/beaglebone_black/uboot-env.txt`. A config fragment would be shorter but the constitution's Technical Constraints require a generated custom config - [X] T010 Create `board/ota/beaglebone_black/uboot-env.txt` with the defaults and the - slot-selection script of contracts/boot-interface.md: `BOOT_ORDER="A B"`, `BOOT_A_LEFT=3`, - `BOOT_B_LEFT=3`, and a `bootcmd` that walks `BOOT_ORDER`, skips a slot whose counter is 0, + slot-selection script of contracts/boot-interface.md: `BOOT_ORDER="A"`, `BOOT_A_LEFT=3` and + `BOOT_B_LEFT=0` (only slot A is populated in the factory image, so B starts ineligible: RAUC + calls a slot good when it is listed in `BOOT_ORDER` with attempts left, and an empty slot must + never be selected), and a `bootcmd` that walks `BOOT_ORDER`, skips a slot whose counter is 0, otherwise decrements it, runs `saveenv`, announces the chosen slot on the console (FR-027), loads `/boot/zImage` and the device tree from that slot with `ext4load`, and boots it with `root=` pointing at that slot mounted read-only @@ -169,9 +171,10 @@ console, and confirm `rauc status` names the booted slot and reports it good wit - [X] T023 [US1] In `configs/beaglebone_black_defconfig`, stop remounting the root filesystem read-write, so the running slot cannot diverge from the bundle it came from (FR-006) - [ ] T024 [US1] Verify (hardware): quickstart scenario 1 — flash, boot to a login prompt, - `rauc status` shows slot A booted and good with B unused, `BOOT_ORDER="A B"` with both - counters at 3, a write to `/` fails, a write to `/data` succeeds and survives a power cycle, - and the console names slot A during boot + `rauc status` shows slot A booted and good with B not bootable, `BOOT_ORDER="A"` with + `BOOT_A_LEFT` at 3 (2 after the first boot, until `rauc status mark-good` restores it) and + `BOOT_B_LEFT` at 0, a write to `/` fails, a write to `/data` succeeds and survives a power + cycle, and the console names slot A during boot - [ ] T025 [US1] Verify (hardware): quickstart scenario 2 — three `grabserial` runs by the method in `docs/boot-baseline-beaglebone-black.md`; the mean from the SPL banner to the login prompt must be at most 12.65 s, which is the measured 11.50 s plus 10% (SC-008) From a3ce015206bee463b18b38101a177a62a578327b Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 16:54:22 +0700 Subject: [PATCH 11/61] board: keep the random seed on /data, and record the second US1 capture The second hardware run found a boot-time error that the read-only root introduced: `seedrng: can't create directory '/var/lib/seedrng': Read-only file system`, every boot. The commit that made the root read-only said nothing writes to /var/lib at boot. That was wrong: Buildroot's skeleton points most of /var at tmpfs, but /var/lib is a real directory in the rootfs and seedrng keeps its seed there. The fix is the one the init script documents for exactly this case, a `--seed-dir` in /etc/default/seedrng, pointed at /data/seedrng. The seed then also survives updates and rollbacks, which is the property it exists for. post-build.sh writes the file inside the same A/B-only block that creates /data, and only when the seedrng init script is present: a shared overlay would send a board without /data looking for a directory that is not there. /data is mounted from fstab before any init script runs, which the boot log confirms, and seedrng creates the last path component itself. The capture closes most of what the previous one left open: - the seed fix works: the empty slot is reported `bad`, not `good`; - `fw_printenv -n` reports 240 and 238 characters for the two lines that printenv showed cut off at exactly 238, which are their full lengths. The cut-off is in the capture path, so the last-resort path is intact; - `rauc status mark-good` sets BOOT_A_LEFT to 3 from Linux, and after a power cycle U-Boot announces "2 attempts left", i.e. it read 3. That is the write direction that the T016 capture could not show, and the T016 log now says so; - /data survives power being cut while Linux runs, and the journal replay is visible in the log. T024 is ticked on that evidence. The seedrng change is not yet on hardware; it rides along with the next flash, which T025 needs anyway. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/common/post-build.sh | 10 +++ docs/logs/t016-env-agreement.log | 7 +++ docs/logs/t024-us1-second-capture.log | 91 +++++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 2 +- 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 docs/logs/t024-us1-second-capture.log diff --git a/board/ota/common/post-build.sh b/board/ota/common/post-build.sh index fc480f7..f2e6a8b 100755 --- a/board/ota/common/post-build.sh +++ b/board/ota/common/post-build.sh @@ -27,4 +27,14 @@ if [ -x "${TARGET_DIR}/usr/bin/rauc" ]; then # Mount point for the persistent data area. Created here rather than carried in # an overlay so no placeholder file ends up in the image. mkdir -p "${TARGET_DIR}/data" + + # The random seed defaults to /var/lib/seedrng, which is on the read-only slot, so + # every boot would report that it cannot create the directory. Keep it on the + # persistent area instead, where it also survives updates and rollbacks. This is + # the arrangement the init script itself documents. Only done here, not in a shared + # overlay, because a board without /data would have nowhere to put it. + if [ -e "${TARGET_DIR}/etc/init.d/S01seedrng" ]; then + mkdir -p "${TARGET_DIR}/etc/default" + echo 'SEEDRNG_ARGS="--seed-dir=/data/seedrng"' > "${TARGET_DIR}/etc/default/seedrng" + fi fi diff --git a/docs/logs/t016-env-agreement.log b/docs/logs/t016-env-agreement.log index d0a586d..1c7d808 100644 --- a/docs/logs/t016-env-agreement.log +++ b/docs/logs/t016-env-agreement.log @@ -77,3 +77,10 @@ confirm U-Boot announces two attempts left. 3. The root filesystem is still remounted read-write: `EXT4-fs (mmcblk0p2): re-mounted ... r/w.` at 2.96 s. That is T023, still to do, and this line is the check for it. + +--- addendum, 2026-10-28: the write direction is now proven ---------------------- + +The gap named above is closed by t024-us1-second-capture.log. `rauc status mark-good` +set BOOT_A_LEFT to 3 from Linux, and after a power cycle U-Boot announced +"OTA: booting slot A, 2 attempts left", i.e. it read 3 and spent one attempt. The +environment is shared in both directions. diff --git a/docs/logs/t024-us1-second-capture.log b/docs/logs/t024-us1-second-capture.log new file mode 100644 index 0000000..fe6463a --- /dev/null +++ b/docs/logs/t024-us1-second-capture.log @@ -0,0 +1,91 @@ +T024 evidence, second capture: User Story 1 on hardware, 2026-10-28, image built from +the clean commit 2ac5f5c (/etc/build-info says VERSION=2ac5f5c, no -dirty). + +Excerpts only; the full boot logs are long and repetitive. + +--- the seed fix works: the empty slot is no longer reported good ----------------- + +# rauc status +=== System Info === +Compatible: ota-beaglebone-black +Booted from: rootfs.0 (/dev/mmcblk0p2) +=== Bootloader === +Activated: rootfs.0 (A) +=== Slot States === +o [rootfs.1] (/dev/mmcblk0p3, ext4, inactive) + bootname: B + boot status: bad +x [rootfs.0] (/dev/mmcblk0p2, ext4, booted) + bootname: A + boot status: good + +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT (after one boot) +BOOT_ORDER=A +BOOT_A_LEFT=2 +BOOT_B_LEFT=0 + +--- the stored values are complete ------------------------------------------------ + +The two lines that printenv and fw_printenv both showed cut off at exactly 238 +characters (name included) are not cut off on the card: + +# fw_printenv -n ota_select | wc -c +240 +# fw_printenv -n ota_load_boot | wc -c +238 + +Those are the full lengths (239 and 237 characters plus a newline). The cut-off is in the +capture path, not in U-Boot, Linux or the stored environment. This matters because the +tail of ota_select is the last-resort path. + +--- the write direction, Linux to U-Boot ----------------------------------------- + +# rauc status mark-good +rauc-event-Message: Marked slot rootfs.0 as good +# fw_printenv BOOT_A_LEFT +BOOT_A_LEFT=3 + +Power was then removed while Linux was running. The first attempt to come back up was +interrupted again during the U-Boot countdown (no attempt spent), and the next one +booted: + +Hit any key to stop autoboot: 0 +Saving Environment to MMC... Writing to redundant MMC(0)... OK +OTA: booting slot A, 2 attempts left + +3 minus the one attempt just spent. Had the write from Linux landed anywhere other than +the offsets U-Boot reads, U-Boot would have seen 2 and announced 1. This closes the gap +left open in t016-env-agreement.log. + +--- /data survives an unclean power loss ------------------------------------------ + +[ 3.122038] EXT4-fs (mmcblk0p4): recovery complete +[ 3.129215] EXT4-fs (mmcblk0p4): mounted filesystem ... r/w with ordered data mode. +# ls -l /data/keep +-rw-r--r-- 1 root root 0 Jan 1 00:02 /data/keep + +The file was written and synced, then the power was cut with Linux running. The journal +was replayed on the next mount and the file is there. + +--- the running slot is read-only -------------------------------------------------- + +[ 2.789350] EXT4-fs (mmcblk0p2): mounted filesystem ... ro with ordered data mode. +[ 2.801755] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. + +and no "re-mounted ... r/w" line afterwards. The next finding is itself proof: a write +into the root filesystem failed with "Read-only file system". + +--- finding: seedrng cannot write its seed ----------------------------------------- + +seedrng: can't create directory '/var/lib/seedrng': Read-only file system + +Every boot. Buildroot's skeleton points most of /var at tmpfs, but /var/lib is a real +directory in the rootfs, and seedrng writes its seed there. An earlier commit message +said nothing writes to /var/lib at boot; that was wrong. The init script documents the +fix itself (SEEDRNG_ARGS="--seed-dir=/data/seedrng" in /etc/default/seedrng), and +post-build.sh now writes that file for A/B boards. To be confirmed on the next flash. + +--- not shown by this capture ------------------------------------------------------- + +Boot time (T025 needs grabserial). The seedrng fix on hardware. The watchdog, which is +unchanged: omap_wdt registers with a 60 s timeout and nothing resets the board (T032). diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index a3ba17b..b88dfca 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -170,7 +170,7 @@ console, and confirm `rauc status` names the booted slot and reports it good wit `extlinux.conf` and never reads `uEnv.txt`; both are replaced by the slot-selection script - [X] T023 [US1] In `configs/beaglebone_black_defconfig`, stop remounting the root filesystem read-write, so the running slot cannot diverge from the bundle it came from (FR-006) -- [ ] T024 [US1] Verify (hardware): quickstart scenario 1 — flash, boot to a login prompt, +- [X] T024 [US1] Verify (hardware): quickstart scenario 1 — flash, boot to a login prompt, `rauc status` shows slot A booted and good with B not bootable, `BOOT_ORDER="A"` with `BOOT_A_LEFT` at 3 (2 after the first boot, until `rauc status mark-good` restores it) and `BOOT_B_LEFT` at 0, a write to `/` fails, a write to `/data` succeeds and survives a power From 0728e120fddb9c22e2f69c4c31a16d08ee5cf4c7 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 17:34:24 +0700 Subject: [PATCH 12/61] docs: User Story 1 passes its boot-time budget, at 10.51 s Three grabserial runs on the image built from a3ce015, by the same method as the baseline: mean 10.512 s from the SPL banner to the login prompt, spread 0.051 s. The budget is 12.65 s, so T025 passes with 2.14 s to spare, and with it every task of User Story 1. The 0.99 s improvement over the 11.50 s baseline is written up as what it is and not as a win for the A/B machinery. Splitting the time at the moment the kernel starts, the whole gain is the autoboot countdown, which fell from 2.08 s to 1.01 s when bootdelay went from 2 to 1: -1.07 s of a -1.066 s change. Everything else in the bootloader phase is a wash, and saveenv costs about 11 ms. Like for like the A/B boot is about 0.08 s, 0.7%, slower than the single-slot one, all of it between kernel start and the login prompt, and that 0.08 s is stated as not yet attributed. Run 4 took the last-resort path, because earlier boots had spent every attempt without a mark-good. It is kept and labelled rather than discarded: its login time is within 7 ms of run 5, and it is the first hardware run of that path with the stored environment, which reached a login prompt. The RAUC line that puzzled the capture, "Unable to find primary boot slot", appears exactly once, after run 4, and is explained by that run's own U-Boot output: RAUC names the primary slot as the first in BOOT_ORDER with attempts left, and slot A had none. The new log notes that this is a decision for the health script to take on purpose. The same runs confirm the seedrng fix on hardware, with no "can't create directory" line. They all say "without crediting", which is expected and corrects an expectation from earlier in this work: the creditable seed is written at a clean shutdown, and the board was power-cycled each time. This is User Story 1 only. The health script and the watchdog feeder add work after init, so the figure is measured again, and the README baseline updated, under T043. Co-Authored-By: Claude Sonnet 5.5 --- docs/boot-baseline-beaglebone-black.md | 39 ++++ docs/logs/boot-baseline-run4.log | 296 +++++++++++++++++++++++++ docs/logs/boot-baseline-run5.log | Bin 0 -> 26714 bytes docs/logs/boot-baseline-run6.log | 296 +++++++++++++++++++++++++ docs/logs/t025-mark-good.log | 49 ++++ specs/002-ab-ota-rauc/tasks.md | 2 +- 6 files changed, 681 insertions(+), 1 deletion(-) create mode 100644 docs/logs/boot-baseline-run4.log create mode 100644 docs/logs/boot-baseline-run5.log create mode 100644 docs/logs/boot-baseline-run6.log create mode 100644 docs/logs/t025-mark-good.log diff --git a/docs/boot-baseline-beaglebone-black.md b/docs/boot-baseline-beaglebone-black.md index 3cebf0f..269eec3 100644 --- a/docs/boot-baseline-beaglebone-black.md +++ b/docs/boot-baseline-beaglebone-black.md @@ -138,3 +138,42 @@ These came out of reading the logs, and each one is a concrete input to `plan.md work: `PM: Cannot get wkup_m3_ipc handle` and `PM: bootloader does not support rtc-only!`. The CM3 power-management firmware itself loads correctly (`CM3 Firmware Version = 0x192`). + +## After the A/B layout (feature 002, User Story 1) + +Measured on 2026-10-28 on the image built from commit `a3ce015`, by the method above, from +`docs/logs/boot-baseline-run4.log` to `run6.log`. Same board, same card. + +| Run | Path taken | "Starting kernel" | Login prompt | +|---|---|---|---| +| 4 | last resort | 2.918 s | 10.532 s | +| 5 | normal | 2.929 s | 10.525 s | +| 6 | normal | 2.929 s | 10.481 s | +| **mean** | | 2.925 s | **10.512 s** | + +The spread is 0.051 s (0.49%). The budget is 12.65 s (the 11.50 s baseline plus 10%), so this +passes with 2.14 s to spare. + +Against the baseline it is 0.99 s faster. That is not the A/B machinery speeding anything up, and +it should not be quoted as if it were. Splitting the time at the moment the kernel starts: + +| | Baseline | Now | Change | +|---|---|---|---| +| SPL banner to "Starting kernel" | 3.991 s | 2.925 s | -1.066 s | +| "Starting kernel" to login prompt | 7.510 s | 7.587 s | +0.078 s | + +The whole gain is the autoboot countdown. `bootdelay` went from 2 to 1 second, and the countdown +fell from 2.08 s to 1.01 s, which is -1.07 s against a total change of -1.066 s. The rest of the +bootloader phase is a wash: the environment now loads from raw MMC rather than from a FAT file, the +kernel and device tree come from `ext4load` rather than a FAT scan, and `saveenv` costs about 11 ms +(run 4 skips it, because it took the last-resort path, and its "Starting kernel" is 11 ms earlier +than runs 5 and 6). Like for like, the A/B boot is therefore about 0.08 s, or 0.7%, slower than the +single-slot one, all of it between kernel start and the login prompt. That 0.08 s has not been +attributed; a `/data` mount with a journal replay after a power cut is one candidate. + +Run 4 took the last-resort path ("OTA: no eligible slot, BOOT_ORDER=A") because earlier boots had +spent every attempt without a `rauc status mark-good`. It is kept because its login time is within +0.007 s of run 5, which also shows the last-resort path costs nothing measurable. + +This covers User Story 1 only. The health script and the watchdog feeder add work after init, so +the figure is measured again, and the README baseline updated, once those exist. diff --git a/docs/logs/boot-baseline-run4.log b/docs/logs/boot-baseline-run4.log new file mode 100644 index 0000000..518fe50 --- /dev/null +++ b/docs/logs/boot-baseline-run4.log @@ -0,0 +1,296 @@ +[0.000002 0.000002] +[0.000683 0.000681] U-Boot SPL 2026.07 (Oct 28 2026 - 09:33:19 +0000) +[0.003756 0.003756] Trying to boot from MMC1 +[0.666413 0.662657] +[0.667509 0.001096] +[0.668373 0.000864] U-Boot 2026.07 (Oct 28 2026 - 09:33:19 +0000) +[0.673069 0.004696] +[0.673335 0.000266] CPU : AM335X-GP rev 2.1 +[0.674613 0.001278] Model: TI AM335x BeagleBone Black +[0.676969 0.002356] DRAM: 512 MiB +[0.757803 0.080835] Core: 164 devices, 19 uclasses, devicetree: separate +[0.772663 0.014859] WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) +[0.778703 0.006041] NAND: 0 MiB +[1.181646 0.402942] MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 +[1.194669 0.013023] Loading Environment from MMC... Reading from redundant MMC(0)... OK +[1.316884 0.122216] Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in +[1.346401 0.029516] MAC de:ad:be:ef:00:01 +[1.349001 0.002601] HOST MAC de:ad:be:ef:00:00 +[1.349641 0.000639] RNDIS ready +[1.355271 0.005630] , eth3: usb_ether +[1.359022 0.003751] Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0 +[2.368695 1.009673] OTA: no eligible slot, BOOT_ORDER=A +[2.369729 0.001034] OTA: last resort, booting slot A without spending an attempt +[2.865098 0.495368] 7649392 bytes read in 488 ms (14.9 MiB/s) +[2.877824 0.012727] 70396 bytes read in 7 ms (9.6 MiB/s) +[2.880443 0.002619] Kernel image @ 0x82000000 [ 0x000000 - 0x74b870 ] +[2.885004 0.004561] ## Flattened Device Tree blob at 88000000 +[2.890330 0.005326] Booting using the fdt blob at 0x88000000 +[2.893137 0.002806] Working FDT set to 88000000 +[2.897045 0.003909] Loading Device Tree to 9cf04000, end 9cf182fb ... OK +[2.902718 0.005673] Working FDT set to 9cf04000 +[2.917956 0.015238] +[2.918046 0.000090] Starting kernel ... +[2.918375 0.000330] +[4.584612 1.666237] [ 0.000000] Booting Linux on physical CPU 0x0 +[4.588860 0.004248] [ 0.000000] Linux version 6.18.38 (br@7832a1e3ac48) (arm-linux-gcc.br_real (Buildroot 2021.11-18033-g83947c7bb6) 14.3.0, GNU ld (GNU Binutils) 2.43.1) #2 SMP Wed Oct 28 05:48:34 UTC 2026 +[4.605098 0.016238] [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d +[4.612737 0.007639] [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache +[4.622416 0.009679] [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black +[4.624565 0.002149] [ 0.000000] Memory policy: Data cache writeback +[4.629738 0.005173] [ 0.000000] cma: Reserved 16 MiB at 0x9e800000 +[4.635185 0.005447] [ 0.000000] Zone ranges: +[4.637994 0.002810] [ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff] +[4.643718 0.005723] [ 0.000000] HighMem empty +[4.646507 0.002789] [ 0.000000] Movable zone start for each node +[4.649642 0.003135] [ 0.000000] Early memory node ranges +[4.654714 0.005072] [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff] +[4.660563 0.005850] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff] +[4.666489 0.005926] [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges +[4.674469 0.007979] [ 0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT +[4.680308 0.005840] [ 0.000000] CPU: All CPU(s) started in SVC mode. +[4.686637 0.006329] [ 0.000000] AM335X ES2.1 (sgx neon) +[4.688920 0.002283] [ 0.000000] percpu: Embedded 17 pages/cpu s40396 r8192 d21044 u69632 +[4.695071 0.006151] [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait +[4.705394 0.010323] [ 0.000000] printk: log buffer data + meta data: 65536 + 204800 = 270336 bytes +[4.711280 0.005887] [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) +[4.719376 0.008096] [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) +[4.727664 0.008288] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130560 +[4.735149 0.007485] [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off +[4.741955 0.006806] [ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[4.747716 0.005761] [ 0.000000] rcu: Hierarchical RCU implementation. +[4.753935 0.006219] [ 0.000000] rcu: RCU event tracing is enabled. +[4.756706 0.002771] [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. +[4.764575 0.007868] [ 0.000000] Tracing variant of Tasks RCU enabled. +[4.769547 0.004973] [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. +[4.775554 0.006007] [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 +[4.784043 0.008489] [ 0.000000] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1. +[4.792073 0.008031] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 +[4.797880 0.005807] [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts +[4.806383 0.008503] [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[4.812280 0.005896] [ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000 +[4.822800 0.010520] [ 0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns +[4.828639 0.005840] [ 0.000028] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns +[4.839487 0.010848] [ 0.000480] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000 +[4.848384 0.008897] [ 0.001917] Console: colour dummy device 80x30 +[4.853505 0.005121] [ 0.002015] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736) +[4.859212 0.005707] [ 0.090585] CPU: Testing write buffer coherency: ok +[4.864692 0.005480] [ 0.090671] CPU0: Spectre v2: using BPIALL workaround +[4.870698 0.006007] [ 0.090682] pid_max: default: 32768 minimum: 301 +[4.873743 0.003045] [ 0.090861] LSM: initializing lsm=capability +[4.878682 0.004939] [ 0.091026] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.884761 0.006079] [ 0.091045] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.893570 0.008810] [ 0.092635] CPU0: thread -1, cpu 0, socket -1, mpidr 0 +[4.898467 0.004896] [ 0.092696] cacheinfo: Unable to detect cache hierarchy for CPU 0 +[4.907677 0.009211] [ 0.094686] Setting up static identity map for 0x80100000 - 0x80100078 +[4.912245 0.004568] [ 0.095003] rcu: Hierarchical SRCU implementation. +[4.917879 0.005635] [ 0.095014] rcu: Max phase no-delay instances is 1000. +[4.921062 0.003183] [ 0.096049] smp: Bringing up secondary CPUs ... +[4.926534 0.005472] [ 0.096095] smp: Brought up 1 node, 1 CPU +[4.929385 0.002851] [ 0.096106] SMP: Total of 1 processors activated (996.14 BogoMIPS). +[4.935580 0.006195] [ 0.096116] CPU: All CPU(s) started in SVC mode. +[4.940605 0.005025] [ 0.096366] Memory: 480864K/522240K available (11264K kernel code, 1172K rwdata, 2836K rodata, 1024K init, 258K bss, 23224K reserved, 16384K cma-reserved, 0K highmem) +[4.954896 0.014292] [ 0.097161] devtmpfs: initialized +[4.959873 0.004977] [ 0.112431] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 +[4.965851 0.005978] [ 0.113073] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns +[4.976902 0.011051] [ 0.113130] posixtimers hash table entries: 512 (order: 0, 4096 bytes, linear) +[4.985040 0.008138] [ 0.113158] futex hash table entries: 256 (16384 bytes on 1 NUMA nodes, total 16 KiB, linear). +[4.993563 0.008523] [ 0.114280] pinctrl core: initialized pinctrl subsystem +[4.996876 0.003313] [ 0.116384] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[5.004743 0.007868] [ 0.119197] DMA: preallocated 256 KiB pool for atomic coherent allocations +[5.010510 0.005767] [ 0.119787] audit: initializing netlink subsys (disabled) +[5.016001 0.005491] [ 0.121370] thermal_sys: Registered thermal governor 'fair_share' +[5.021930 0.005929] [ 0.121387] thermal_sys: Registered thermal governor 'step_wise' +[5.028929 0.006999] [ 0.121397] thermal_sys: Registered thermal governor 'user_space' +[5.035408 0.006479] [ 0.121576] audit: type=2000 audit(0.000:1): state=initialized audit_enabled=0 res=1 +[5.041539 0.006132] [ 0.121616] cpuidle: using governor menu +[5.046645 0.005106] [ 0.142960] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.063469 0.016824] [ 0.143929] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.080386 0.016917] [ 0.145986] No ATAGs? +[5.082947 0.002561] [ 0.146024] hw-breakpoint: debug architecture 0x4 unsupported. +[5.089134 0.006187] [ 0.148705] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[5.097180 0.008046] [ 0.153539] iommu: Default domain type: Translated +[5.102549 0.005368] [ 0.153563] iommu: DMA domain TLB invalidation policy: strict mode +[5.108464 0.005915] [ 0.161578] SCSI subsystem initialized +[5.111378 0.002914] [ 0.162425] pps_core: LinuxPPS API ver. 1 registered +[5.117399 0.006021] [ 0.162436] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[5.125960 0.008562] [ 0.162461] PTP clock support registered +[5.130560 0.004599] [ 0.171089] vgaarb: loaded +[5.133495 0.002935] [ 0.171853] clocksource: Switched to clocksource dmtimer +[5.139250 0.005755] [ 0.172553] VFS: Disk quotas dquot_6.6.0 +[5.141963 0.002713] [ 0.172613] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) +[5.151104 0.009141] [ 0.196528] NET: Registered PF_INET protocol family +[5.153408 0.002304] [ 0.196870] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) +[5.162856 0.009448] [ 0.198322] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) +[5.169856 0.007000] [ 0.198363] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[5.178195 0.008340] [ 0.198382] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) +[5.187980 0.009784] [ 0.198427] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) +[5.192316 0.004336] [ 0.198528] TCP: Hash tables configured (established 4096 bind 4096) +[5.198093 0.005777] [ 0.198655] UDP hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.206321 0.008227] [ 0.198690] UDP-Lite hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.212731 0.006411] [ 0.198901] NET: Registered PF_UNIX/PF_LOCAL protocol family +[5.217733 0.005002] [ 0.202620] RPC: Registered named UNIX socket transport module. +[5.224498 0.006765] [ 0.202645] RPC: Registered udp transport module. +[5.228706 0.004208] [ 0.202651] RPC: Registered tcp transport module. +[5.236776 0.008070] [ 0.202655] RPC: Registered tcp-with-tls transport module. +[5.239886 0.003109] [ 0.202660] RPC: Registered tcp NFSv4.1 backchannel transport module. +[5.245778 0.005893] [ 0.202687] PCI: CLS 0 bytes, default 64 +[5.248729 0.002950] [ 0.204075] Initialise system trusted keyrings +[5.253935 0.005206] [ 0.212222] workingset: timestamp_bits=14 max_order=17 bucket_order=3 +[5.259930 0.005995] [ 0.213632] NFS: Registering the id_resolver key type +[5.267381 0.007451] [ 0.213720] Key type id_resolver registered +[5.270581 0.003200] [ 0.213728] Key type id_legacy registered +[5.273711 0.003130] [ 0.213846] jffs2: version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc. +[5.281725 0.008013] [ 0.214328] Key type asymmetric registered +[5.284797 0.003072] [ 0.214345] Asymmetric key parser 'x509' registered +[5.290890 0.006093] [ 0.214414] io scheduler mq-deadline registered +[5.293336 0.002446] [ 0.214430] io scheduler kyber registered +[5.298880 0.005544] [ 0.214513] io scheduler bfq registered +[5.304007 0.005127] [ 0.216354] target-module@4b000000:target-module@140000:pmu@0:fck: device ID is greater than 24 +[5.310481 0.006474] [ 0.222033] ledtrig-cpu: registered to indicate activity on CPUs +[5.318059 0.007579] [ 0.232841] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled +[5.323802 0.005743] [ 0.266895] brd: module loaded +[5.327410 0.003608] [ 0.287101] loop: module loaded +[5.329682 0.002272] [ 0.288079] mtdoops: mtd device (mtddev=name/number) must be supplied +[5.335485 0.005803] [ 0.291105] i2c_dev: i2c /dev entries driver +[5.340772 0.005287] [ 0.292326] cpuidle: enable-method property 'ti,am3352' found operations +[5.346582 0.005810] [ 0.292793] sdhci: Secure Digital Host Controller Interface driver +[5.353869 0.007287] [ 0.292803] sdhci: Copyright(c) Pierre Ossman +[5.357620 0.003751] [ 0.292988] sdhci-pltfm: SDHCI platform and OF driver helper +[5.363076 0.005455] [ 0.302230] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 (8000000f) counters available +[5.371876 0.008800] [ 0.302793] Initializing XFRM netlink socket +[5.377772 0.005896] [ 0.302971] NET: Registered PF_INET6 protocol family +[5.382520 0.004749] [ 0.304949] Segment Routing with IPv6 +[5.385724 0.003203] [ 0.305037] In-situ OAM (IOAM) with IPv6 +[5.389077 0.003353] [ 0.305132] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver +[5.394188 0.005111] [ 0.306086] NET: Registered PF_PACKET protocol family +[5.399794 0.005606] [ 0.306118] NET: Registered PF_KEY protocol family +[5.405550 0.005756] [ 0.306236] Key type dns_resolver registered +[5.410393 0.004843] [ 0.306447] ThumbEE CPU extension supported. +[5.413880 0.003487] [ 0.306469] Registering SWP/SWPB emulation handler +[5.419009 0.005128] [ 0.306921] omap_voltage_late_init: Voltage driver support not added +[5.424993 0.005985] [ 0.307558] SmartReflex Class3 initialized +[5.431219 0.006226] [ 0.342595] Loading compiled-in X.509 certificates +[5.433398 0.002179] [ 0.379142] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.450236 0.016838] [ 0.385338] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.467411 0.017175] [ 0.410080] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.487425 0.020015] [ 0.410959] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.502793 0.015368] [ 0.414696] /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins +[5.521085 0.018291] [ 0.415277] pinctrl-single 44e10800.pinmux: 142 pins, size 568 +[5.527921 0.006837] [ 0.454213] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[5.533920 0.005999] [ 0.458418] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.550885 0.016965] [ 0.512729] OMAP GPIO hardware version 0.1 +[5.555910 0.005025] [ 0.538524] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz +[5.562266 0.006356] [ 0.575566] 48000000.interconnect:segment@200000:target-module@0:mpu@0:fck: device ID is greater than 24 +[5.570107 0.007841] [ 0.576451] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.587332 0.017226] [ 0.579241] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.604103 0.016770] [ 0.579941] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.622344 0.018241] [ 0.580091] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.637587 0.015243] [ 0.587928] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[5.646727 0.009140] [ 0.588409] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[5.654142 0.007415] [ 0.676968] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 +[5.662374 0.008232] [ 0.830760] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 +[5.671340 0.008966] [ 0.831384] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4 +[5.676852 0.005512] [ 0.831404] cpsw-switch 4a100000.switch: ALE Table size 1024, Policers 0 +[5.684908 0.008055] [ 0.831580] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies) +[5.690962 0.006054] [ 0.831598] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec +[5.701990 0.011028] [ 0.831698] cpsw-switch 4a100000.switch: Detected MACID = 00:35:ff:9a:3f:14 +[5.710275 0.008285] [ 0.833701] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0) +[5.718972 0.008698] [ 0.844802] debugfs: '49000000.dma' already exists in 'dmaengine' +[5.726664 0.007692] [ 0.844846] edma 49000000.dma: TI EDMA DMA engine driver +[5.732270 0.005606] [ 0.878783] ti-sysc 44e31000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@44c00000/segment@200000/target-module@31000/timer@0 +[5.746495 0.014225] [ 0.878840] ti-sysc 48040000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@48000000/segment@0/target-module@40000/timer@0 +[5.762303 0.015808] [ 0.883928] printk: legacy console [ttyS0] disabled +[5.766235 0.003932] [ 0.884861] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 34, base_baud = 3000000) is a 8250 +[5.775939 0.009704] [ 0.884953] printk: legacy console [ttyS0] enabled +[6.123071 0.347132] [ 2.422789] tps65217-pmic: Failed to locate of_node [id: -1] +[6.128893 0.005822] [ 2.428879] tps65217-bl: Failed to locate of_node [id: -1] +[6.135843 0.006949] [ 2.436346] platform tps65217-charger: DMA mask not set +[6.147703 0.011860] [ 2.443703] platform tps65217-pwrbutton: DMA mask not set +[6.150600 0.002897] [ 2.451096] tps65217 0-0024: TPS65217 ID 0xe version 1.2 +[6.154545 0.003945] [ 2.457188] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.174352 0.019807] [ 2.474586] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.191192 0.016840] [ 2.491976] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz +[6.199504 0.008312] [ 2.499884] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) +[6.207770 0.008266] [ 2.508762] sdhci-omap 48060000.mmc: Got CD GPIO +[6.211485 0.003715] [ 2.513796] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator +[6.223464 0.011979] [ 2.523953] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator +[6.230105 0.006641] [ 2.532364] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[6.240544 0.010439] [ 2.540333] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[6.256918 0.016373] [ 2.557269] clk: Disabling unused clocks +[6.260745 0.003827] [ 2.561450] PM: genpd: Disabling unused power domains +[6.270810 0.010065] [ 2.568912] check access for rdinit=/init failed: -2, ignoring +[6.282551 0.011741] [ 2.580503] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA +[6.287852 0.005301] [ 2.589584] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA +[6.296871 0.009019] [ 2.598482] Waiting for root device /dev/mmcblk0p2... +[6.343842 0.046971] [ 2.644334] mmc0: new high speed SDXC card at address 0001 +[6.348440 0.004598] [ 2.651198] mmcblk0: mmc0:0001 SD16G 58.7 GiB +[6.358390 0.009951] [ 2.659035] mmcblk0: p1 p2 p3 p4 +[6.392522 0.034132] [ 2.693060] mmc1: new high speed MMC card at address 0001 +[6.397840 0.005318] [ 2.700352] mmcblk1: mmc1:0001 M62704 3.56 GiB +[6.412181 0.014341] [ 2.709183] mmcblk1: p1 +[6.413173 0.000992] [ 2.713833] mmcblk1boot0: mmc1:0001 M62704 2.00 MiB +[6.432163 0.018990] [ 2.732739] mmcblk1boot1: mmc1:0001 M62704 2.00 MiB +[6.443577 0.011414] [ 2.743859] mmcblk1rpmb: mmc1:0001 M62704 512 KiB, chardev (248:0) +[6.480512 0.036934] [ 2.781066] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs +[6.487414 0.006902] [ 2.787928] EXT4-fs (mmcblk0p2): mounted filesystem 9b8d161b-1073-457e-b836-ef7d06576c83 ro with ordered data mode. Quota mode: none. +[6.499979 0.012566] [ 2.800268] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. +[6.506261 0.006281] [ 2.808605] devtmpfs: mounted +[6.513108 0.006848] [ 2.813570] Freeing unused kernel image (initmem) memory: 1024K +[6.519241 0.006132] [ 2.820161] Run /sbin/init as init process +[6.833103 0.313862] [ 3.133436] EXT4-fs (mmcblk0p4): recovery complete +[6.841862 0.008760] [ 3.140631] EXT4-fs (mmcblk0p4): mounted filesystem 39cbf0b4-1bbd-4fba-8ce0-6487bb08eb79 r/w with ordered data mode. Quota mode: none. +[6.970228 0.128366] Seeding 256 bits without crediting +[6.975556 0.005328] Saving 256 bits of non-creditable seed for next boot +[6.981122 0.005565] Starting syslogd: OK +[7.005266 0.024145] Starting klogd: OK +[7.036291 0.031025] Running sysctl: OK +[7.114580 0.078289] Starting mdev... OK +[8.433275 1.318695] [ 4.733625] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 +[8.439169 0.005894] [ 4.740017] omap-aes 53500000.aes: will run requests pump with realtime priority +[8.499712 0.060543] [ 4.800298] remoteproc remoteproc0: wkup_m3 is available +[8.580367 0.080654] [ 4.880334] at24 2-0054: supply vcc not found, using dummy regulator +[8.613425 0.033058] [ 4.914247] at24 2-0055: supply vcc not found, using dummy regulator +[8.644172 0.030747] [ 4.944954] at24 2-0056: supply vcc not found, using dummy regulator +[8.674735 0.030563] [ 4.975519] at24 2-0057: supply vcc not found, using dummy regulator +[8.717606 0.042871] [ 5.018142] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write +[9.032361 0.314754] [ 5.332305] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 +[9.275043 0.242682] [ 5.574975] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +[9.338875 0.063832] [ 5.639413] omap_rng 48310000.rng: Random Number Generator ver. 20 +[9.348838 0.009963] [ 5.647523] random: crng init done +[9.383236 0.034398] [ 5.683845] omap_rtc 44e3e000.rtc: registered as rtc0 +[9.386391 0.003155] [ 5.689039] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[9.448068 0.061677] [ 5.748681] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 +[9.454305 0.006238] [ 5.755080] omap-sham 53100000.sham: will run requests pump with realtime priority +[9.714962 0.260657] [ 6.014548] tda998x 0-0070: found TDA19988 +[9.733735 0.018772] [ 6.034322] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops [tda998x]) +[9.746766 0.013032] [ 6.047334] [drm] Initialized tilcdc 1.0.0 for 4830e000.lcdc on minor 0 +[9.756303 0.009537] [ 6.056904] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.768939 0.012635] [ 6.067073] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.772528 0.003589] [ 6.073963] gpio-537 (nxp,calib): gpiod_direction_output_nonotify: tried to set a GPIO tied to an IRQ as output +[9.815390 0.042862] [ 6.116040] tda9950 0-0034: TDA9950 CEC interface, hardware version 3.3 +[9.844436 0.029046] [ 6.145185] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.881873 0.037437] [ 6.182370] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.970034 0.088161] [ 6.269655] usbcore: registered new interface driver usbfs +[9.976326 0.006292] [ 6.275480] usbcore: registered new interface driver hub +[9.978323 0.001997] [ 6.280942] usbcore: registered new device driver usb +[10.073078 0.094755] [ 6.373878] musb-hdrc musb-hdrc.1: MUSB HDRC host driver +[10.076635 0.003557] [ 6.379299] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 +[10.102712 0.026077] [ 6.402566] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18 +[10.108204 0.005492] [ 6.410931] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 +[10.117315 0.009111] [ 6.418333] usb usb1: Product: MUSB HDRC host driver +[10.121866 0.004551] [ 6.423371] usb usb1: Manufacturer: Linux 6.18.38 musb-hcd +[10.128554 0.006688] [ 6.428887] usb usb1: SerialNumber: musb-hdrc.1 +[10.139531 0.010977] [ 6.439506] hub 1-0:1.0: USB hub found +[10.156250 0.016719] [ 6.457063] hub 1-0:1.0: 1 port detected +[10.194636 0.038387] [ 6.495336] remoteproc remoteproc0: powering up wkup_m3 +[10.209870 0.015234] [ 6.510664] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 118004 +[10.216890 0.007020] [ 6.519364] remoteproc remoteproc0: remote processor wkup_m3 is now up +[10.225593 0.008703] [ 6.519395] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 +[10.254664 0.029071] [ 6.555336] PM: Cannot get wkup_m3_ipc handle +[10.320810 0.066146] Starting network: OK +[10.399488 0.078678] Starting crond: OK +[10.527818 0.128330] +[10.528085 0.000267] OTA embedded Linux beaglebone-black /dev/console +[10.531705 0.003620] +[10.531864 0.000158] beaglebone-black login: \ No newline at end of file diff --git a/docs/logs/boot-baseline-run5.log b/docs/logs/boot-baseline-run5.log new file mode 100644 index 0000000000000000000000000000000000000000..7dcd01cd487c98f6bd8917e8da31f2eb6379ae51 GIT binary patch literal 26714 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 literal 0 HcmV?d00001 diff --git a/docs/logs/boot-baseline-run6.log b/docs/logs/boot-baseline-run6.log new file mode 100644 index 0000000..8e953ea --- /dev/null +++ b/docs/logs/boot-baseline-run6.log @@ -0,0 +1,296 @@ +[0.000004 0.000004] +[0.001330 0.001326] U-Boot SPL 2026.07 (Oct 28 2026 - 09:33:19 +0000) +[0.006258 0.006258] Trying to boot from MMC1 +[0.664387 0.658129] +[0.664703 0.000316] +[0.664782 0.000079] U-Boot 2026.07 (Oct 28 2026 - 09:33:19 +0000) +[0.668399 0.003616] +[0.668528 0.000130] CPU : AM335X-GP rev 2.1 +[0.670741 0.002213] Model: TI AM335x BeagleBone Black +[0.673043 0.002301] DRAM: 512 MiB +[0.756520 0.083477] Core: 164 devices, 19 uclasses, devicetree: separate +[0.771229 0.014709] WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) +[0.778433 0.007204] NAND: 0 MiB +[1.178695 0.400262] MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 +[1.193455 0.014760] Loading Environment from MMC... Reading from MMC(0)... OK +[1.317661 0.124207] Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in +[1.344766 0.027105] MAC de:ad:be:ef:00:01 +[1.346943 0.002177] HOST MAC de:ad:be:ef:00:00 +[1.348044 0.001100] RNDIS ready +[1.352483 0.004439] , eth3: usb_ether +[1.360049 0.007566] Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0 +[2.365395 1.005346] Saving Environment to MMC... Writing to redundant MMC(0)... OK +[2.386088 0.020693] OTA: booting slot A, 2 attempts left +[2.876534 0.490446] 7649392 bytes read in 488 ms (14.9 MiB/s) +[2.887932 0.011399] 70396 bytes read in 7 ms (9.6 MiB/s) +[2.890909 0.002977] Kernel image @ 0x82000000 [ 0x000000 - 0x74b870 ] +[2.895885 0.004976] ## Flattened Device Tree blob at 88000000 +[2.902727 0.006842] Booting using the fdt blob at 0x88000000 +[2.904337 0.001610] Working FDT set to 88000000 +[2.907960 0.003623] Loading Device Tree to 9cf04000, end 9cf182fb ... OK +[2.912837 0.004877] Working FDT set to 9cf04000 +[2.928359 0.015522] +[2.928603 0.000245] Starting kernel ... +[2.929428 0.000824] +[4.615247 1.685820] [ 0.000000] Booting Linux on physical CPU 0x0 +[4.621222 0.005975] [ 0.000000] Linux version 6.18.38 (br@7832a1e3ac48) (arm-linux-gcc.br_real (Buildroot 2021.11-18033-g83947c7bb6) 14.3.0, GNU ld (GNU Binutils) 2.43.1) #2 SMP Wed Oct 28 05:48:34 UTC 2026 +[4.634710 0.013488] [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d +[4.644035 0.009325] [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache +[4.648431 0.004396] [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black +[4.654507 0.006077] [ 0.000000] Memory policy: Data cache writeback +[4.659365 0.004858] [ 0.000000] cma: Reserved 16 MiB at 0x9e800000 +[4.665440 0.006075] [ 0.000000] Zone ranges: +[4.668113 0.002673] [ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff] +[4.673713 0.005600] [ 0.000000] HighMem empty +[4.678332 0.004619] [ 0.000000] Movable zone start for each node +[4.679183 0.000851] [ 0.000000] Early memory node ranges +[4.684741 0.005558] [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff] +[4.691392 0.006652] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff] +[4.696258 0.004866] [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges +[4.708273 0.012014] [ 0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT +[4.710567 0.002294] [ 0.000000] CPU: All CPU(s) started in SVC mode. +[4.716805 0.006238] [ 0.000000] AM335X ES2.1 (sgx neon) +[4.734475 0.017670] [ 0.000000] percpu: Embedded 17 pages/cpu s40396 r8192 d21044 u69632 +[4.737046 0.002571] [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait +[4.740570 0.003524] [ 0.000000] printk: log buffer data + meta data: 65536 + 204800 = 270336 bytes +[4.743004 0.002434] [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) +[4.749749 0.006744] [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) +[4.757735 0.007986] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130560 +[4.764433 0.006698] [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off +[4.772993 0.008560] [ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[4.777331 0.004338] [ 0.000000] rcu: Hierarchical RCU implementation. +[4.783024 0.005693] [ 0.000000] rcu: RCU event tracing is enabled. +[4.785933 0.002909] [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. +[4.794078 0.008145] [ 0.000000] Tracing variant of Tasks RCU enabled. +[4.799995 0.005917] [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. +[4.806169 0.006174] [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 +[4.814365 0.008196] [ 0.000000] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1. +[4.821931 0.007566] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 +[4.827774 0.005842] [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts +[4.835810 0.008036] [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[4.841949 0.006139] [ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000 +[4.853074 0.011125] [ 0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns +[4.859125 0.006052] [ 0.000027] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns +[4.869524 0.010398] [ 0.000472] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000 +[4.878357 0.008833] [ 0.001912] Console: colour dummy device 80x30 +[4.883277 0.004920] [ 0.002011] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736) +[4.889272 0.005995] [ 0.090581] CPU: Testing write buffer coherency: ok +[4.895617 0.006345] [ 0.090669] CPU0: Spectre v2: using BPIALL workaround +[4.900468 0.004851] [ 0.090680] pid_max: default: 32768 minimum: 301 +[4.903455 0.002987] [ 0.090859] LSM: initializing lsm=capability +[4.910688 0.007233] [ 0.091026] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.914631 0.003942] [ 0.091046] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.922833 0.008203] [ 0.092647] CPU0: thread -1, cpu 0, socket -1, mpidr 0 +[4.928532 0.005699] [ 0.092707] cacheinfo: Unable to detect cache hierarchy for CPU 0 +[4.935822 0.007290] [ 0.094704] Setting up static identity map for 0x80100000 - 0x80100078 +[4.942144 0.006322] [ 0.095020] rcu: Hierarchical SRCU implementation. +[4.945784 0.003639] [ 0.095031] rcu: Max phase no-delay instances is 1000. +[4.951095 0.005311] [ 0.096060] smp: Bringing up secondary CPUs ... +[4.957701 0.006606] [ 0.096107] smp: Brought up 1 node, 1 CPU +[4.959569 0.001867] [ 0.096117] SMP: Total of 1 processors activated (996.14 BogoMIPS). +[4.965216 0.005647] [ 0.096128] CPU: All CPU(s) started in SVC mode. +[4.973058 0.007843] [ 0.096370] Memory: 480864K/522240K available (11264K kernel code, 1172K rwdata, 2836K rodata, 1024K init, 258K bss, 23224K reserved, 16384K cma-reserved, 0K highmem) +[4.984650 0.011592] [ 0.097175] devtmpfs: initialized +[4.989630 0.004980] [ 0.112467] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 +[4.995966 0.006336] [ 0.113121] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns +[5.006973 0.011007] [ 0.113179] posixtimers hash table entries: 512 (order: 0, 4096 bytes, linear) +[5.014860 0.007887] [ 0.113206] futex hash table entries: 256 (16384 bytes on 1 NUMA nodes, total 16 KiB, linear). +[5.023285 0.008425] [ 0.114327] pinctrl core: initialized pinctrl subsystem +[5.026994 0.003709] [ 0.116422] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[5.034801 0.007807] [ 0.119235] DMA: preallocated 256 KiB pool for atomic coherent allocations +[5.040352 0.005551] [ 0.119826] audit: initializing netlink subsys (disabled) +[5.046039 0.005687] [ 0.121404] thermal_sys: Registered thermal governor 'fair_share' +[5.051755 0.005716] [ 0.121422] thermal_sys: Registered thermal governor 'step_wise' +[5.057527 0.005773] [ 0.121431] thermal_sys: Registered thermal governor 'user_space' +[5.065760 0.008233] [ 0.121613] audit: type=2000 audit(0.000:1): state=initialized audit_enabled=0 res=1 +[5.071474 0.005713] [ 0.121655] cpuidle: using governor menu +[5.077929 0.006455] [ 0.142991] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.093556 0.015627] [ 0.143956] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.110224 0.016668] [ 0.146020] No ATAGs? +[5.113090 0.002866] [ 0.146057] hw-breakpoint: debug architecture 0x4 unsupported. +[5.118525 0.005435] [ 0.148736] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[5.128649 0.010124] [ 0.153509] iommu: Default domain type: Translated +[5.132742 0.004093] [ 0.153535] iommu: DMA domain TLB invalidation policy: strict mode +[5.138328 0.005586] [ 0.161613] SCSI subsystem initialized +[5.141176 0.002848] [ 0.162468] pps_core: LinuxPPS API ver. 1 registered +[5.146756 0.005579] [ 0.162479] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[5.155120 0.008364] [ 0.162506] PTP clock support registered +[5.161009 0.005889] [ 0.171140] vgaarb: loaded +[5.163259 0.002250] [ 0.171917] clocksource: Switched to clocksource dmtimer +[5.168839 0.005580] [ 0.172626] VFS: Disk quotas dquot_6.6.0 +[5.172283 0.003443] [ 0.172687] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) +[5.183398 0.011115] [ 0.196582] NET: Registered PF_INET protocol family +[5.184656 0.001258] [ 0.196925] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) +[5.191537 0.006882] [ 0.198395] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) +[5.199861 0.008323] [ 0.198433] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[5.208461 0.008600] [ 0.198451] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) +[5.214206 0.005745] [ 0.198498] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) +[5.222552 0.008345] [ 0.198599] TCP: Hash tables configured (established 4096 bind 4096) +[5.227953 0.005401] [ 0.198724] UDP hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.236150 0.008198] [ 0.198759] UDP-Lite hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.242122 0.005972] [ 0.198974] NET: Registered PF_UNIX/PF_LOCAL protocol family +[5.248249 0.006127] [ 0.202703] RPC: Registered named UNIX socket transport module. +[5.253204 0.004955] [ 0.202726] RPC: Registered udp transport module. +[5.259130 0.005926] [ 0.202731] RPC: Registered tcp transport module. +[5.263992 0.004861] [ 0.202735] RPC: Registered tcp-with-tls transport module. +[5.269793 0.005801] [ 0.202740] RPC: Registered tcp NFSv4.1 backchannel transport module. +[5.275648 0.005855] [ 0.202767] PCI: CLS 0 bytes, default 64 +[5.278607 0.002959] [ 0.204182] Initialise system trusted keyrings +[5.284893 0.006286] [ 0.212342] workingset: timestamp_bits=14 max_order=17 bucket_order=3 +[5.289901 0.005008] [ 0.213758] NFS: Registering the id_resolver key type +[5.296040 0.006139] [ 0.213827] Key type id_resolver registered +[5.300533 0.004493] [ 0.213835] Key type id_legacy registered +[5.303467 0.002934] [ 0.213954] jffs2: version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc. +[5.311606 0.008139] [ 0.214418] Key type asymmetric registered +[5.314752 0.003146] [ 0.214436] Asymmetric key parser 'x509' registered +[5.320184 0.005432] [ 0.214506] io scheduler mq-deadline registered +[5.323432 0.003248] [ 0.214521] io scheduler kyber registered +[5.328528 0.005095] [ 0.214608] io scheduler bfq registered +[5.331834 0.003306] [ 0.216460] target-module@4b000000:target-module@140000:pmu@0:fck: device ID is greater than 24 +[5.340148 0.008314] [ 0.222147] ledtrig-cpu: registered to indicate activity on CPUs +[5.347980 0.007832] [ 0.232974] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled +[5.353865 0.005885] [ 0.266986] brd: module loaded +[5.358304 0.004439] [ 0.287160] loop: module loaded +[5.359625 0.001321] [ 0.288140] mtdoops: mtd device (mtddev=name/number) must be supplied +[5.365187 0.005562] [ 0.291162] i2c_dev: i2c /dev entries driver +[5.370638 0.005451] [ 0.292391] cpuidle: enable-method property 'ti,am3352' found operations +[5.376469 0.005831] [ 0.292848] sdhci: Secure Digital Host Controller Interface driver +[5.382419 0.005950] [ 0.292858] sdhci: Copyright(c) Pierre Ossman +[5.387428 0.005009] [ 0.293044] sdhci-pltfm: SDHCI platform and OF driver helper +[5.393205 0.005777] [ 0.302281] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 (8000000f) counters available +[5.401900 0.008696] [ 0.302842] Initializing XFRM netlink socket +[5.407250 0.005350] [ 0.303024] NET: Registered PF_INET6 protocol family +[5.412483 0.005233] [ 0.305019] Segment Routing with IPv6 +[5.415512 0.003029] [ 0.305108] In-situ OAM (IOAM) with IPv6 +[5.419423 0.003911] [ 0.305206] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver +[5.424182 0.004759] [ 0.306165] NET: Registered PF_PACKET protocol family +[5.429773 0.005591] [ 0.306196] NET: Registered PF_KEY protocol family +[5.435010 0.005237] [ 0.306323] Key type dns_resolver registered +[5.440444 0.005434] [ 0.306535] ThumbEE CPU extension supported. +[5.443543 0.003100] [ 0.306559] Registering SWP/SWPB emulation handler +[5.448940 0.005397] [ 0.307007] omap_voltage_late_init: Voltage driver support not added +[5.454731 0.005791] [ 0.307635] SmartReflex Class3 initialized +[5.460158 0.005426] [ 0.342681] Loading compiled-in X.509 certificates +[5.464357 0.004199] [ 0.379192] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.480012 0.015655] [ 0.385400] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.497073 0.017061] [ 0.410137] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.515845 0.018772] [ 0.411018] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.532728 0.016884] [ 0.414773] /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins +[5.550038 0.017310] [ 0.415350] pinctrl-single 44e10800.pinmux: 142 pins, size 568 +[5.557748 0.007710] [ 0.454225] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[5.563936 0.006188] [ 0.458433] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.580714 0.016777] [ 0.512737] OMAP GPIO hardware version 0.1 +[5.585840 0.005126] [ 0.538527] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz +[5.591544 0.005704] [ 0.575515] 48000000.interconnect:segment@200000:target-module@0:mpu@0:fck: device ID is greater than 24 +[5.600450 0.008905] [ 0.576406] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.616965 0.016515] [ 0.579191] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.634002 0.017037] [ 0.579887] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.651027 0.017025] [ 0.580035] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.667369 0.016342] [ 0.587838] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[5.676118 0.008749] [ 0.588319] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[5.685729 0.009611] [ 0.676816] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 +[5.692367 0.006639] [ 0.830578] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 +[5.700881 0.008514] [ 0.831213] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4 +[5.706658 0.005777] [ 0.831232] cpsw-switch 4a100000.switch: ALE Table size 1024, Policers 0 +[5.714612 0.007954] [ 0.831407] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies) +[5.721726 0.007114] [ 0.831426] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec +[5.732919 0.011192] [ 0.831525] cpsw-switch 4a100000.switch: Detected MACID = 00:35:ff:9a:3f:14 +[5.739864 0.006945] [ 0.833533] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0) +[5.752777 0.012913] [ 0.844620] debugfs: '49000000.dma' already exists in 'dmaengine' +[5.756738 0.003961] [ 0.844664] edma 49000000.dma: TI EDMA DMA engine driver +[5.762437 0.005699] [ 0.878243] ti-sysc 44e31000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@44c00000/segment@200000/target-module@31000/timer@0 +[5.776581 0.014144] [ 0.878301] ti-sysc 48040000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@48000000/segment@0/target-module@40000/timer@0 +[5.790843 0.014262] [ 0.903816] printk: legacy console [ttyS0] disabled +[5.797522 0.006680] [ 0.904782] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 34, base_baud = 3000000) is a 8250 +[5.804973 0.007450] [ 0.904871] printk: legacy console [ttyS0] enabled +[6.133235 0.328263] [ 2.422848] tps65217-pmic: Failed to locate of_node [id: -1] +[6.138678 0.005443] [ 2.428935] tps65217-bl: Failed to locate of_node [id: -1] +[6.145777 0.007098] [ 2.436403] platform tps65217-charger: DMA mask not set +[6.153156 0.007379] [ 2.443797] platform tps65217-pwrbutton: DMA mask not set +[6.165330 0.012174] [ 2.451175] tps65217 0-0024: TPS65217 ID 0xe version 1.2 +[6.170018 0.004688] [ 2.457258] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.184035 0.014017] [ 2.474652] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.202195 0.018160] [ 2.492043] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz +[6.211174 0.008979] [ 2.499961] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) +[6.217780 0.006606] [ 2.508859] sdhci-omap 48060000.mmc: Got CD GPIO +[6.221955 0.004175] [ 2.513882] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator +[6.235941 0.013986] [ 2.524031] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator +[6.240429 0.004488] [ 2.532463] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[6.248739 0.008310] [ 2.540425] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[6.266154 0.017415] [ 2.556768] clk: Disabling unused clocks +[6.269664 0.003510] [ 2.560949] PM: genpd: Disabling unused power domains +[6.277646 0.007982] [ 2.568229] check access for rdinit=/init failed: -2, ignoring +[6.289666 0.012020] [ 2.580329] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA +[6.297066 0.007400] [ 2.589429] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA +[6.306189 0.009123] [ 2.598082] Waiting for root device /dev/mmcblk0p2... +[6.350360 0.044171] [ 2.641027] mmc0: new high speed SDXC card at address 0001 +[6.355147 0.004786] [ 2.647965] mmcblk0: mmc0:0001 SD16G 58.7 GiB +[6.364954 0.009808] [ 2.655757] mmcblk0: p1 p2 p3 p4 +[6.406183 0.041229] [ 2.696738] mmc1: new high speed MMC card at address 0001 +[6.413505 0.007322] [ 2.704147] mmcblk1: mmc1:0001 M62704 3.56 GiB +[6.423911 0.010406] [ 2.712894] mmcblk1: p1 +[6.427142 0.003231] [ 2.717369] mmcblk1boot0: mmc1:0001 M62704 2.00 MiB +[6.445634 0.018492] [ 2.736126] mmcblk1boot1: mmc1:0001 M62704 2.00 MiB +[6.456286 0.010653] [ 2.746954] mmcblk1rpmb: mmc1:0001 M62704 512 KiB, chardev (248:0) +[6.470747 0.014461] [ 2.761428] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs +[6.477482 0.006735] [ 2.768342] EXT4-fs (mmcblk0p2): mounted filesystem 9b8d161b-1073-457e-b836-ef7d06576c83 ro with ordered data mode. Quota mode: none. +[6.489197 0.011715] [ 2.780684] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. +[6.497412 0.008215] [ 2.789022] devtmpfs: mounted +[6.503031 0.005619] [ 2.793884] Freeing unused kernel image (initmem) memory: 1024K +[6.509754 0.006723] [ 2.800460] Run /sbin/init as init process +[6.823177 0.313423] [ 3.113293] EXT4-fs (mmcblk0p4): recovery complete +[6.829937 0.006759] [ 3.120504] EXT4-fs (mmcblk0p4): mounted filesystem 39cbf0b4-1bbd-4fba-8ce0-6487bb08eb79 r/w with ordered data mode. Quota mode: none. +[6.957983 0.128047] Seeding 256 bits without crediting +[6.961222 0.003239] Saving 256 bits of non-creditable seed for next boot +[6.970244 0.009022] Starting syslogd: OK +[6.994227 0.023983] Starting klogd: OK +[7.028352 0.034126] Running sysctl: OK +[7.109662 0.081310] Starting mdev... OK +[8.425856 1.316194] [ 4.715345] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 +[8.432592 0.006737] [ 4.721700] omap-aes 53500000.aes: will run requests pump with realtime priority +[8.494628 0.062036] [ 4.785325] remoteproc remoteproc0: wkup_m3 is available +[8.560964 0.066336] [ 4.851354] at24 2-0054: supply vcc not found, using dummy regulator +[8.595054 0.034090] [ 4.885709] at24 2-0055: supply vcc not found, using dummy regulator +[8.633580 0.038527] [ 4.924275] at24 2-0056: supply vcc not found, using dummy regulator +[8.664091 0.030511] [ 4.954821] at24 2-0057: supply vcc not found, using dummy regulator +[8.696861 0.032770] [ 4.987731] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write +[8.993186 0.296324] [ 5.281758] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 +[9.242400 0.249215] [ 5.533126] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +[9.322607 0.080207] [ 5.613394] omap_rng 48310000.rng: Random Number Generator ver. 20 +[9.331169 0.008562] [ 5.621293] random: crng init done +[9.347659 0.016490] [ 5.638585] omap_rtc 44e3e000.rtc: registered as rtc0 +[9.352139 0.004480] [ 5.643962] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[9.421852 0.069713] [ 5.712465] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 +[9.427493 0.005641] [ 5.718604] omap-sham 53100000.sham: will run requests pump with realtime priority +[9.663987 0.236494] [ 5.954615] tda998x 0-0070: found TDA19988 +[9.687920 0.023933] [ 5.974183] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops [tda998x]) +[9.698200 0.010280] [ 5.986869] [drm] Initialized tilcdc 1.0.0 for 4830e000.lcdc on minor 0 +[9.703791 0.005591] [ 5.994864] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.712972 0.009181] [ 6.003779] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.732790 0.019818] [ 6.023512] gpio-537 (nxp,calib): gpiod_direction_output_nonotify: tried to set a GPIO tied to an IRQ as output +[9.791227 0.058436] [ 6.082165] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.813659 0.022432] [ 6.104298] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.823795 0.010136] [ 6.114779] tda9950 0-0034: TDA9950 CEC interface, hardware version 3.3 +[9.919320 0.095526] [ 6.209067] usbcore: registered new interface driver usbfs +[9.924503 0.005183] [ 6.214923] usbcore: registered new interface driver hub +[9.927670 0.003167] [ 6.220370] usbcore: registered new device driver usb +[10.028292 0.100622] [ 6.318199] musb-hdrc musb-hdrc.1: MUSB HDRC host driver +[10.033393 0.005101] [ 6.323823] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 +[10.065039 0.031646] [ 6.355921] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18 +[10.071404 0.006365] [ 6.364459] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 +[10.079424 0.008020] [ 6.371728] usb usb1: Product: MUSB HDRC host driver +[10.085135 0.005711] [ 6.376780] usb usb1: Manufacturer: Linux 6.18.38 musb-hcd +[10.092501 0.007366] [ 6.382334] usb usb1: SerialNumber: musb-hdrc.1 +[10.098689 0.006188] [ 6.389607] hub 1-0:1.0: USB hub found +[10.114150 0.015462] [ 6.402694] hub 1-0:1.0: 1 port detected +[10.152988 0.038837] [ 6.443615] remoteproc remoteproc0: powering up wkup_m3 +[10.166958 0.013971] [ 6.457916] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 118004 +[10.173844 0.006886] [ 6.466548] remoteproc remoteproc0: remote processor wkup_m3 is now up +[10.182364 0.008519] [ 6.466579] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 +[10.206890 0.024526] [ 6.497856] PM: bootloader does not support rtc-only! +[10.265698 0.058808] Starting network: OK +[10.347711 0.082013] Starting crond: OK +[10.472754 0.125043] +[10.475620 0.002866] OTA embedded Linux beaglebone-black /dev/console +[10.480709 0.005089] +[10.480817 0.000108] beaglebone-black login: \ No newline at end of file diff --git a/docs/logs/t025-mark-good.log b/docs/logs/t025-mark-good.log new file mode 100644 index 0000000..55f995e --- /dev/null +++ b/docs/logs/t025-mark-good.log @@ -0,0 +1,49 @@ +T025 side evidence: `rauc status mark-good` after each of runs 4, 5 and 6, 2026-10-28, +image built from a3ce015. The bracketed prefix is the capturing terminal's own clock. + +--- after run 4 ---------------------------------------------------------------- + +# rauc status mark-good +rauc-Message: 00:00:46.798: Using central status file /data/rauc.status +rauc-Message: 00:00:46.812: Using system config file /etc/rauc/system.conf +rauc-Message: 00:00:46.815: Failed to load system status: No such file or directory +Failed getting primary slot: uboot backend: Unable to find primary boot slot +rauc-event-Message: 00:00:47.026: Marked slot rootfs.0 as good + +--- after run 5 and run 6 ------------------------------------------------------- + +rauc-Message: Using central status file /data/rauc.status +rauc-Message: Using system config file /etc/rauc/system.conf +rauc-Message: Failed to load system status: No such file or directory +rauc-event-Message: Marked slot rootfs.0 as good + +--- reading it ----------------------------------------------------------------- + +1. "Unable to find primary boot slot" appears once, after run 4, and it is explained by that + run's own U-Boot output: "OTA: no eligible slot, BOOT_ORDER=A" followed by "OTA: last + resort, booting slot A without spending an attempt". RAUC's U-Boot backend names the + primary slot as the first one in BOOT_ORDER that still has attempts, and slot A had none. + Earlier boots without a mark-good had spent all three. Marking it good still worked and + refilled the counter, so runs 5 and 6 took the normal path ("2 attempts left") and print + no such line. + +2. That makes run 4 the first hardware run of the last-resort path, with the stored + environment rather than the built one, and it reached a login prompt. The tail of + ota_select, which the cut-off display made look broken, works. + + For the health script (T027): a boot via the last-resort path is exactly the boot where + RAUC cannot find a primary slot. It is worth deciding on purpose whether such a boot may + be confirmed good, and logging that it was one. + +3. "Failed to load system status: No such file or directory" is on all three, including after + a successful mark-good. mark-good does not create /data/rauc.status; the first install + will. The message is harmless until then. + +4. seedrng: runs 4 to 6 show no "can't create directory" error, so the --seed-dir fix works. + They all say "Seeding 256 bits without crediting", which is expected here rather than a + fault. The earlier captures show the pattern: a seed written during boot is saved as + non-creditable, because the kernel's RNG is not ready when the init script runs, and the + creditable one is written at a clean shutdown ("Saving 256 bits of creditable seed"), + after which the next boot says "and crediting". The board was power-cycled each time, so + no clean shutdown happened. This corrects an earlier expectation in this work that later + boots would credit. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index b88dfca..bd2e21d 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -175,7 +175,7 @@ console, and confirm `rauc status` names the booted slot and reports it good wit `BOOT_A_LEFT` at 3 (2 after the first boot, until `rauc status mark-good` restores it) and `BOOT_B_LEFT` at 0, a write to `/` fails, a write to `/data` succeeds and survives a power cycle, and the console names slot A during boot -- [ ] T025 [US1] Verify (hardware): quickstart scenario 2 — three `grabserial` runs by the method in +- [X] T025 [US1] Verify (hardware): quickstart scenario 2 — three `grabserial` runs by the method in `docs/boot-baseline-beaglebone-black.md`; the mean from the SPL banner to the login prompt must be at most 12.65 s, which is the measured 11.50 s plus 10% (SC-008) From 91a09969e262df7797fe7a5aa4b2c003468cb484 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 17:46:02 +0700 Subject: [PATCH 13/61] specs: confirm a last-resort boot like any other, and say that it was one Decided with the person running the hardware, after the first run of the last-resort path on a board: RAUC cannot name a primary slot there, because it picks the first slot in BOOT_ORDER that still has attempts and none does. A boot that passes every health check is confirmed good, with the record stating it was a last-resort boot. The alternative reads as cautious and is not: with no confirmation the watchdog feeder never starts, since only a confirmation starts it, so the hardware resets the board after 60 seconds and the same last-resort boot follows. A device whose one remaining slot is healthy would cycle forever, which is the failure this feature exists to prevent. FR-012 gains the sentence, the clarification log gains the decision and its reason, and T027 says how condition two reads when there is no pending slot: RAUC names the booted slot as primary, or names no primary at all, and a different slot named as primary still fails as an inconsistent state. Co-Authored-By: Claude Sonnet 5.5 --- specs/002-ab-ota-rauc/spec.md | 5 ++++- specs/002-ab-ota-rauc/tasks.md | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/specs/002-ab-ota-rauc/spec.md b/specs/002-ab-ota-rauc/spec.md index 1d239ae..304af7d 100644 --- a/specs/002-ab-ota-rauc/spec.md +++ b/specs/002-ab-ota-rauc/spec.md @@ -18,6 +18,7 @@ - Q: Where do the development signing key and certificate live? → A: The development certificate is committed, because it is public and is what the device trusts. The matching private key is never committed: it is generated locally by a documented project command into a version-control-ignored location, and a build that needs it but cannot find it fails with a message naming that command. - Q: Where does the boot-selection state live on the medium, and does the spec reserve space for it? → A: The layout gains a fifth component: a dedicated region, in no filesystem, outside the bootloader area, that nothing but the boot-selection state writes. The spec stays neutral on whether that is an unpartitioned reserved region or a partition of its own, because the MBR four-primary-partition limit is already reached by the four areas above, so a partition of its own depends on whether this board's ROM can boot from a GPT medium. Research decides; the implementation documents the choice and proves no overlap. The upstream RAUC integration guide takes the same position: its own example uses a dedicated raw area and states the state need not be on an actual MBR/GPT partition, while insisting it live outside the bootloader partition. - Q: Which boot attempt counter is authoritative, given the board's bootloader config already enables a second one? → A: Exactly one counter, in the boot-selection state, and it must survive power loss. The inherited SoC bootcount keeps its counter in an RTC scratch register, which this board loses on power removal because it has no RTC battery, so it must not be left active alongside the first. +- Q: May a boot taken through the last-resort path be confirmed good? → A: Yes, under the same conditions as any other boot except the pending-slot one, with the record saying it was a last-resort boot. Refusing would leave a device whose only remaining slot passes every health check in a permanent cycle: the watchdog feeder is only started by a confirmation, so the hardware resets the board after 60 seconds, and the same last-resort boot follows. Decided during implementation, after the first hardware run of that path showed RAUC cannot name a primary slot there. - Q: What stops a slot that boots and then hangs, since the boot attempt counter only acts at boot? → A: Such a slot must be reset automatically within a bounded time, and whatever prevents that reset must depend on the system actually working. Otherwise a hang leaves the device running forever with boot attempts still unspent, which is the exact failure this feature exists to prevent. Added as FR-032 and SC-014 after review. - Q: Where does the failure reason required by FR-014 live, given that volatile state is discarded at reboot? → A: In the persistent data area. A failed slot is always discovered after a reboot, and the slot itself is overwritten by the next update, so neither volatile storage nor the slot can hold the record. Clarified in FR-014 and FR-028 after review. - Q: How is the boot-time budget of SC-008 measured? → A: From the bootloader's first serial output to the login prompt, by the method recorded in `docs/boot-baseline-beaglebone-black.md`, against a measured baseline of 11.50 s. Power-on cannot be observed on the serial line, so the earlier "from power-on" wording was not reproducible. @@ -256,7 +257,9 @@ update. good only when all of the following hold: the init sequence completed; the running slot is the slot that was pending; the persistent data area is mounted and writable; and the boot-selection state is both readable and writable. It MUST NOT depend on network reachability, so that a device - with no uplink can still confirm a good update. + with no uplink can still confirm a good update. A boot taken through the bootloader's last-resort + path, because every slot is out of attempts, has no pending slot to match; it is confirmed under + the remaining conditions, and the record states that it was a last-resort boot. - **FR-013**: When the pending slot fails to boot, or boots without confirming health, the bootloader MUST return to the last slot recorded good, without operator action. - **FR-014**: A slot that failed MUST be recorded as bad, and the reason MUST be retrievable on the diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index bd2e21d..90fd07e 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -202,7 +202,12 @@ holds the previous one. reached this script; the running slot is the slot that was pending, according to RAUC rather than a guess; `/data` is mounted and a write to it succeeds; `fw_printenv` reads the state and `fw_setenv` writes it back — and calling `rauc status mark-good` only when all four hold. No - network check: a board on a bench with no uplink must still be able to confirm a good update + network check: a board on a bench with no uplink must still be able to confirm a good update. + **Last-resort boots** (T025 captured one: RAUC reports "Unable to find primary boot slot" + because the slot has no attempts left) have no pending slot, so condition two reads: RAUC + names the booted slot as primary, or RAUC names no primary at all. A different slot named as + primary is an inconsistent state and fails. A last-resort boot that passes is confirmed like + any other and the script logs, to `/data`, that it was one (see the clarification in spec.md) - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) From 86f2085b364923e236a715d584a6346d26504542 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 22:18:18 +0700 Subject: [PATCH 14/61] specs: record the bundle delivery path and the clock that rejects the certificates rauc install checks certificate validity against the system clock and has no --no-check-time, while the board cold-boots into 2000 and the development certificates start in 2026. Research R8 records the finding, the delivery path chosen for US2 (host http.server, udhcpc and wget, no defconfig change) and the options for the clock. T029 and T030 carry the resulting steps so US2 can start at T026 without asking again. Co-Authored-By: Claude Sonnet 5.5 --- .../contracts/signing-chain.md | 8 ++- specs/002-ab-ota-rauc/quickstart.md | 4 +- specs/002-ab-ota-rauc/research.md | 58 +++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 11 +++- 4 files changed, 76 insertions(+), 5 deletions(-) diff --git a/specs/002-ab-ota-rauc/contracts/signing-chain.md b/specs/002-ab-ota-rauc/contracts/signing-chain.md index a769e3c..71ba5ed 100644 --- a/specs/002-ab-ota-rauc/contracts/signing-chain.md +++ b/specs/002-ab-ota-rauc/contracts/signing-chain.md @@ -113,8 +113,10 @@ Staging and production get their own CA each, following RAUC's "Separate CAs" st carries exactly one CA in its keyring, so a bundle from one environment cannot install on a device from another. Their private keys do not live in this repository — a secret store for staging, and a PKCS#11 token or cloud KMS for production, which RAUC supports by accepting PKCS#11 URLs in place -of filenames for `--cert` and `--key`. Two problems belong to that work rather than this one: this +of filenames for `--cert` and `--key`. Two problems are noted here. This board has no RTC backup and its clock starts at 2000-01-01T00:00:00 UTC, measured in `docs/logs/t016-env-agreement.log`, so a certificate whose validity window opens at build time is -not yet valid when a device boots; and a CMS signature is not byte-reproducible, so two builds -of the same commit produce different bundles. +not yet valid when a device boots; `rauc install` has no `--no-check-time`. That already bites with +the development keys, and research R8 records how US2 works around it and what the permanent fix +would be. The other: a CMS signature is not byte-reproducible, so two builds of the same commit +produce different bundles. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 5e80266..ded918c 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -54,7 +54,9 @@ must be **≤ 12.65 s** (11.50 s + 10%), or the regression is justified in writi ## 3. Install an update and confirm it — SC-001, SC-006, FR-006..FR-012 Build a second, visibly different revision (any commit changes `VERSION`), copy its bundle to -`/data`, then: +`/data` (host `python3 -m http.server`, board `udhcpc -i eth0` and `wget`), set the clock past the +certificates' `notBefore` with `date -s "2026-10-28 18:00:00"` because the board boots into 2000 and +`rauc install` cannot skip the validity check (research R8), then: ```sh rauc install /data/beaglebone_black-.raucb diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index e3bfc8c..71663d8 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -338,6 +338,64 @@ accepts PKCS#11 URLs in place of filenames for `--cert` and `--key`, so that pat **Consequence to document**: a bundle installs only on an image built with the same key. That is what a trust domain means, and it is the behaviour staging and production separation relies on. +## R8. Getting a bundle onto the board, and the clock that rejects it + +Found while preparing T029, before any hardware run. Both points are about what happens *between* +a built bundle and a successful `rauc install`, which the spec deliberately leaves to the operator +(FR-010: "a bundle already present on local storage"; Assumptions: delivery is the operator's +problem). + +### Delivery path + +**Decision (working default for US2)**: bring the interface up by hand and fetch with BusyBox +`wget` from the build host. Nothing in the image changes. + +```sh +# on the build host, in output/beaglebone_black/images/ +python3 -m http.server 8000 +# on the board +udhcpc -i eth0 +wget -O /data/.raucb http://:8000/.raucb +``` + +**Why**: the image has no SSH server, `nc`, `ftpget`, `httpd` or `telnetd`, and RAUC is built +without libcurl, so `rauc install https://...` is unavailable and only local files install. BusyBox +does have `wget`, `tftp` and `udhcpc`. `BR2_SYSTEM_DHCP` is empty, so `eth0` is down after boot; +bringing it up by hand costs nothing at boot. Setting `BR2_SYSTEM_DHCP="eth0"` would make the +network script wait for a lease on every boot, which is a SC-008 risk (T025 passed at 10.51 s of a +12.65 s budget) and would need a re-measurement, so it is not done here. A DHCP client opens no +listening port, so Principle VII is not at stake either way. + +**Fallbacks**, none tested: a USB stick (`usb-storage.ko` and `musb_hdrc.ko` are in the image, ext4 +and vfat are built in), or pulling the card and copying onto p4 from the host (p4 is ext4 at byte +offset 1108344832). Pulling the card five times is not realistic for T030, which is why the +network path is preferred. + +The bundle size is an estimate (15-20 MB, from the 14.7 MB compressed image of the baseline). +T026 gives the real number; `/data` is 256 MiB. + +### The clock rejects the signing certificate + +`rauc install` checks the certificate validity period against the system clock. In RAUC 1.15.2 +`install.c:1569` calls `check_bundle(..., CHECK_BUNDLE_DEFAULT, ...)`; the `--no-check-time` flag +exists for `rauc resign` and `rauc info` only, not for `rauc install`. The board has no RTC backup +and cold-boots at 2000-01-01T00:00:00 UTC (measured twice, `docs/logs/t016-env-agreement.log` and +`docs/logs/t024-us1-second-capture.log`). The development certificates carry `notBefore` +2026-10-28 05:31:03 GMT. So the first `rauc install` on a freshly booted board fails with a +"not yet valid"-type error. This is not a staging/production concern: it happens with the +development keys, on the first install. + +| Option | What it is | Verdict | +|---|---|---| +| A | `date -s "2026-10-28 18:00:00"` (any time after the certificates' `notBefore`) before `rauc install` | **Used for T029 and T030.** No code; an operator step, not a fix | +| B | An early init script that raises the clock to the image build time when it is earlier (the `fake-hwclock` idea): a `BUILD_DATE` line in `/etc/build-info`, written by `post-build.sh`. `check_keys` forces the keys to exist before the build, so a certificate generated before the build is valid at that time | The right fix: every board without an RTC cold-boots into the past. It changes system behaviour (the clock no longer starts in 2000), so it needs the user's approval before it is written. Candidate for a follow-up task or feature 003 | +| C | Generate the certificates with `notBefore` at or before 2000-01-01 | Rejected: needs `openssl ca -startdate` and a config file because OpenSSL 3.0 `x509 -req` has no `-not_before`, and it hides the problem instead of removing it | +| D | libfaketime in the build container | Rejected: affects only the host, and the failing check runs on the board | + +The spec's edge case "Clock far from real time" asks only for a clear error, which RAUC gives; it +does not ask for installs to work. T029 therefore carries step A explicitly, and any evidence log +must show the `date -s` line so the result is not mistaken for an install that works at power-on. + ## Consequences for the spec Two items in the spec are affected and are handled in `plan.md` rather than silently: diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 90fd07e..8ae69cd 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -211,7 +211,14 @@ holds the previous one. - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) -- [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — install, `BOOT_ORDER` becomes `"B A"`, +- [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, + do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and + `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so + SC-008 is untouched); then run `date -s "2026-10-28 18:00:00"` (any time after the + certificates' `notBefore`) before `rauc install`, because `rauc install` checks certificate + validity against a clock that cold-boots at 2000-01-01 and has no `--no-check-time`. The + log must show both commands. The permanent clock fix (R8 option B) is not part of US2 and + needs the user's approval first. Then: install, `BOOT_ORDER` becomes `"B A"`, reboot, `/etc/build-info` shows the new version, `rauc status` shows the new slot good and the old slot still holding the previous version, and the file written to `/data` in US1 is unchanged (SC-006) @@ -219,6 +226,8 @@ holds the previous one. point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of interruption per trial + (each trial's board has cold-booted into 2000, so repeat the `date -s` step of T029 before + every `rauc install`) --- From e87c28a10d1964f5302dbf1a77178a251dfea71a Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 22:50:43 +0700 Subject: [PATCH 15/61] board: raise the clock to the image build time at boot The board has no battery-backed RTC and cold-boots into 2000-01-01, before the validity window of the certificate that signs update bundles, and rauc install has no --no-check-time. post-build.sh now records BUILD_DATE in /etc/build-info and S00ota-clock, the first init script, raises the clock to it when it is earlier. The result is a floor, not the real time. A clock already past the floor is left alone. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/common/post-build.sh | 4 +++ .../rootfs_overlay/etc/init.d/S00ota-clock | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock diff --git a/board/ota/common/post-build.sh b/board/ota/common/post-build.sh index f2e6a8b..4a5277c 100755 --- a/board/ota/common/post-build.sh +++ b/board/ota/common/post-build.sh @@ -7,11 +7,15 @@ set -eu BOARD="$(basename "${BASE_DIR}")" VERSION="$(git -C "${BR2_EXTERNAL_OTA_PATH}" describe --always --dirty 2>/dev/null || echo unknown)" +# Seconds since the epoch, for S00ota-clock: the floor a board without an RTC raises its +# clock to at boot. Not SOURCE_DATE_EPOCH: a commit time can predate the certificate. +BUILD_DATE="$(date -u +%s)" cat > "${TARGET_DIR}/etc/build-info" </dev/null)" + case "${build_date}" in + '' | *[!0-9]*) + echo "ota-clock: no BUILD_DATE in ${BUILD_INFO}, clock left alone" + exit 0 + ;; + esac + now="$(date -u +%s)" + if [ "${now}" -lt "${build_date}" ]; then + was="$(date -u "${FMT}")" + date -u -s "@${build_date}" > /dev/null || exit 1 + echo "ota-clock: clock was ${was} UTC, raised to image build time $(date -u "${FMT}") UTC" + fi + ;; + stop | restart | reload) ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" >&2 + exit 1 + ;; +esac From 3937fdc5a013efd5061f593837a1c1fa420b7bab Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 22:50:43 +0700 Subject: [PATCH 16/61] specs: make the target clock a requirement, and leave a note for later specs Option B of research R8 was approved: FR-033 requires a clockless device not to run earlier than its image's build time, T046 implements it, and T029/T030 no longer set the clock by hand. CLAUDE.md gains the note that the target clock is a floor and what that means for any later spec that validates time on the device. T040 must lint init scripts, which the *.sh filter does not see. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 15 +++++++++ README.md | 4 +-- .../contracts/signing-chain.md | 11 ++++--- specs/002-ab-ota-rauc/quickstart.md | 8 +++-- specs/002-ab-ota-rauc/research.md | 33 ++++++++++++++++--- specs/002-ab-ota-rauc/spec.md | 13 +++++++- specs/002-ab-ota-rauc/tasks.md | 32 ++++++++++++------ 7 files changed, 91 insertions(+), 25 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 682f6a8..3d3dd3e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,6 +97,21 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the builds in the container with the same single `/workspace` mount; the runner's UID/GID reach the image through `make docker-build`. A green build is not a boot test: boot-affecting changes still need the manual smoke test from the constitution. +- **The target clock is a floor, not the real time.** The boards here have no battery-backed RTC + and cold-boot into 2000-01-01 (BeagleBone Black measured). `board/ota/common/post-build.sh` + writes `BUILD_DATE` (epoch seconds) to `/etc/build-info`, and + `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it at the start of + boot, only when the clock is earlier. Anything on the device that checks a time window + (`rauc install` certificate validity, TLS, token expiry, a log or file that needs a true + timestamp) therefore sees the **image's build time** after a cold boot, never the real time. + When writing a spec or plan that touches the target's clock: (1) a certificate or token issued + *after* the running image was built is "not yet valid" on that device until something sets the + clock; (2) timestamps on the device are wrong by however long it was off, so do not use them as + evidence or ordering across reboots; (3) real time needs an RTC or a time source and is its own + feature, not an assumption; (4) a new build-time artefact that the device validates must be + created *before* the image is built (this is why `check_keys` refuses to build without the keys); + (5) `SOURCE_DATE_EPOCH` is deliberately not the floor, since a commit time can predate the + certificate. Rationale and the one known gap: `specs/002-ab-ota-rauc/research.md` R8, FR-033. - **`make check`** compares the regenerated minimal defconfig against the working-tree file in a temp file (never writes `configs/`, never relies on git state). New boards need no CI edits; they are discovered from `configs/`. diff --git a/README.md b/README.md index e51a874..25056f7 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ ota/ │ └── beaglebone_black_defconfig # one file per board/variant ├── board/ota/ │ ├── common/ # shared by every board -│ │ ├── rootfs_overlay/ # e.g. /etc/issue -│ │ └── post-build.sh # writes /etc/build-info (board, git version, Buildroot) +│ │ ├── rootfs_overlay/ # e.g. /etc/issue, init.d/S00ota-clock +│ │ └── post-build.sh # writes /etc/build-info (board, git version, Buildroot, build date) │ └── beaglebone_black/ # BBB only │ ├── rootfs_overlay/ # e.g. /etc/hostname │ ├── post-image.sh # copies uEnv.txt, extlinux.conf, then runs genimage diff --git a/specs/002-ab-ota-rauc/contracts/signing-chain.md b/specs/002-ab-ota-rauc/contracts/signing-chain.md index 71ba5ed..14d06db 100644 --- a/specs/002-ab-ota-rauc/contracts/signing-chain.md +++ b/specs/002-ab-ota-rauc/contracts/signing-chain.md @@ -116,7 +116,10 @@ PKCS#11 token or cloud KMS for production, which RAUC supports by accepting PKCS of filenames for `--cert` and `--key`. Two problems are noted here. This board has no RTC backup and its clock starts at 2000-01-01T00:00:00 UTC, measured in `docs/logs/t016-env-agreement.log`, so a certificate whose validity window opens at build time is -not yet valid when a device boots; `rauc install` has no `--no-check-time`. That already bites with -the development keys, and research R8 records how US2 works around it and what the permanent fix -would be. The other: a CMS signature is not byte-reproducible, so two builds of the same commit -produce different bundles. +not yet valid when a device boots; `rauc install` has no `--no-check-time`. The image therefore +raises the clock to its own build time at boot (FR-033, research R8, `S00ota-clock`). That is a +floor, not the real time, so it works only for a certificate issued before the running image was +built; a certificate re-issued afterwards needs the clock set once by hand or the running image +rebuilt. Staging and production certificates carry the same constraint, and a device with a real +clock is not affected. The other problem: a CMS signature is not byte-reproducible, so two builds +of the same commit produce different bundles. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index ded918c..43f6729 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -54,9 +54,11 @@ must be **≤ 12.65 s** (11.50 s + 10%), or the regression is justified in writi ## 3. Install an update and confirm it — SC-001, SC-006, FR-006..FR-012 Build a second, visibly different revision (any commit changes `VERSION`), copy its bundle to -`/data` (host `python3 -m http.server`, board `udhcpc -i eth0` and `wget`), set the clock past the -certificates' `notBefore` with `date -s "2026-10-28 18:00:00"` because the board boots into 2000 and -`rauc install` cannot skip the validity check (research R8), then: +`/data` (host `python3 -m http.server`, board `udhcpc -i eth0` and `wget`). Do not set the clock: +the board cold-boots into 2000, and `S00ota-clock` raises it to the image's build time, which is +after the certificate's `notBefore`, so the validity check passes (FR-033, research R8). The +console shows `ota-clock: clock was 2000-01-01 ... raised to image build time ...`; `date` on the +board reads the build time, not the real time. Then: ```sh rauc install /data/beaglebone_black-.raucb diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 71663d8..c9f7e61 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -387,14 +387,37 @@ development keys, on the first install. | Option | What it is | Verdict | |---|---|---| -| A | `date -s "2026-10-28 18:00:00"` (any time after the certificates' `notBefore`) before `rauc install` | **Used for T029 and T030.** No code; an operator step, not a fix | -| B | An early init script that raises the clock to the image build time when it is earlier (the `fake-hwclock` idea): a `BUILD_DATE` line in `/etc/build-info`, written by `post-build.sh`. `check_keys` forces the keys to exist before the build, so a certificate generated before the build is valid at that time | The right fix: every board without an RTC cold-boots into the past. It changes system behaviour (the clock no longer starts in 2000), so it needs the user's approval before it is written. Candidate for a follow-up task or feature 003 | +| A | `date -s "2026-10-28 18:00:00"` (any time after the certificates' `notBefore`) before `rauc install` | Superseded by B. No code; an operator step, not a fix. It stays valid as a manual override on a device whose image predates its certificate (see below) | +| B | An early init script that raises the clock to the image build time when it is earlier (the `fake-hwclock` idea): a `BUILD_DATE` line in `/etc/build-info`, written by `post-build.sh`. `check_keys` forces the keys to exist before the build, so a certificate generated before the build is valid at that time | **Adopted in this feature (T046), approved 2026-10-28.** Every board without an RTC cold-boots into the past, so the fix belongs in the image, not in an operator step. The clock no longer starts in 2000, which is a deliberate system-behaviour change recorded as FR-033 | | C | Generate the certificates with `notBefore` at or before 2000-01-01 | Rejected: needs `openssl ca -startdate` and a config file because OpenSSL 3.0 `x509 -req` has no `-not_before`, and it hides the problem instead of removing it | | D | libfaketime in the build container | Rejected: affects only the host, and the failing check runs on the board | -The spec's edge case "Clock far from real time" asks only for a clear error, which RAUC gives; it -does not ask for installs to work. T029 therefore carries step A explicitly, and any evidence log -must show the `date -s` line so the result is not mistaken for an install that works at power-on. +### What option B does, and what it does not + +`post-build.sh` writes `BUILD_DATE=` (plain `date -u +%s`, taken at build time) into +`/etc/build-info`. `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` runs before every other +init script and, only when `date +%s` is smaller than `BUILD_DATE`, sets the clock to it with +`date -u -s @` (BusyBox 1.38 accepts `@seconds`, `libbb/time.c`) and logs one line to +the console. A clock already past the floor is never touched, so a board with a working RTC, or one +that has been given real time, is unaffected. + +- **It is a floor, not the real time.** Log timestamps stay wrong by however long the device was off. + Real time needs an RTC or a time source (NTP over a network the device does not have today). That + is a separate feature and nothing here depends on it. +- **`SOURCE_DATE_EPOCH` is not used.** It is a commit time under a reproducible build and can + predate the certificate. The build time cannot, because `check_keys` refuses to build without + the keys, so the certificate was issued before the floor was taken. +- **One gap remains.** If the signing certificate is re-issued from the same CA (the loss row of + the table in `contracts/signing-chain.md`) *after* the image on the device was built, the + certificate's `notBefore` is later than the device's floor, and `rauc install` refuses the new + bundle until the clock passes it. The device never has a clock later than its own build time + unless something sets it. Handle it by setting the clock by hand once (option A), or by + rebuilding the running image after the re-issue. A device with real time is not affected. +- **Cost.** One shell script of a few lines at the start of boot. SC-008 is re-measured by T043 + rather than assumed unchanged. + +The spec's edge case "Clock far from real time" still asks for a clear error when the clock really +is outside the window, which RAUC gives; B removes the *common* cause of it, not the error. ## Consequences for the spec diff --git a/specs/002-ab-ota-rauc/spec.md b/specs/002-ab-ota-rauc/spec.md index 304af7d..949c9b7 100644 --- a/specs/002-ab-ota-rauc/spec.md +++ b/specs/002-ab-ota-rauc/spec.md @@ -25,6 +25,10 @@ - Q: Does the factory image use a fixed layout, or grow the data area to fill the medium on first boot? → A: Fixed, with no growing: bootloader area 32 MB, two OS slots of 512 MB, data area 256 MB, giving an image of roughly 1.3 GB and a documented minimum medium of 2 GB. Space beyond that on a larger medium is left unused. Growing the data area on first boot would put partition-table surgery at the riskiest moment of the device's life and would make a resize bug indistinguishable from an update bug while the update path is still being brought up; it can be added later once A/B is proven. - Q: What must the freshly booted system check before it confirms the new slot is good? → A: Four local conditions, no network: the init sequence completed, the running slot is the slot that was pending, the persistent data area is mounted and writable, and the boot-selection state is readable and writable. All four must hold; anything else leaves the slot unconfirmed and therefore subject to rollback. +### Session 2026-10-28 + +- Q: A board with no RTC cold-boots into 2000 and `rauc install` rejects a certificate that is not yet valid, with no way to skip the check. Does the device or the operator fix the clock? → A: The device. At boot it raises its clock to the build time of its image when it is earlier (FR-033). The build time is a floor, not the real time, so log timestamps are still wrong by the time the device was off; real time needs an RTC or a time source and is a separate feature. Every later spec that depends on the target's clock must read the note in `CLAUDE.md` first. + ## User Scenarios & Testing *(mandatory)* ### User Story 1 - Flash and boot a device with redundant slots (Priority: P1) @@ -198,7 +202,9 @@ update. failure and the condition must be visible rather than silent. - **First boot after flashing, with the second slot empty**: the empty slot must never be selected. - **Clock far from real time on a device checking a certificate validity window**: must not make a - legitimate bundle unusable without a clear message. + legitimate bundle unusable without a clear message. A device without a battery-backed clock + starts from the build time of its image (FR-033), so the common case, a cold boot into the year + 2000, no longer arises; a clock that is still outside the window gets RAUC's own message. - **Installation attempted while another is running**: the second attempt is refused, not interleaved. - **Signing key absent on a fresh clone**: the build must stop with a message naming the command @@ -289,6 +295,11 @@ update. matching private key MUST NOT be committed. The project MUST provide a documented command that generates the development private key locally into a version-control-ignored location, and a build that requires the key but cannot find it MUST fail with a message naming that command. +- **FR-033**: A device with no battery-backed clock MUST NOT run with a clock earlier than the + build time of the image it booted, so that a bundle signed with a certificate issued before + that image was built is not refused as not yet valid. The corrected clock is a floor, not the + real time, and the documentation MUST say so. A clock already later than the floor MUST NOT be + changed. **Build outputs** diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 8ae69cd..ebbcc96 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -211,14 +211,21 @@ holds the previous one. - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) +- [ ] T046 [US2] Implement research R8 option B, approved by the user on 2026-10-28 (FR-033): + `board/ota/common/post-build.sh` writes `BUILD_DATE=` to `/etc/build-info`, and + `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it, at the start + of boot, only when the clock is earlier. Done when `sh -n` and `shellcheck` are clean and the + script's four paths (cold boot, clock already past the floor, no `BUILD_DATE`, non-numeric + `BUILD_DATE`) behave as R8 describes. Hardware evidence is carried by T029 and T030, boot time + by T043. **T029 depends on this task.** - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so - SC-008 is untouched); then run `date -s "2026-10-28 18:00:00"` (any time after the - certificates' `notBefore`) before `rauc install`, because `rauc install` checks certificate - validity against a clock that cold-boots at 2000-01-01 and has no `--no-check-time`. The - log must show both commands. The permanent clock fix (R8 option B) is not part of US2 and - needs the user's approval first. Then: install, `BOOT_ORDER` becomes `"B A"`, + SC-008 is untouched by the delivery path). **No `date -s`**: `rauc install` checks + certificate validity against the clock and has no `--no-check-time`, and the board cold-boots + at 2000-01-01, which T046 handles at boot. The log must show the console line + `ota-clock: clock was 2000-01-01 ... raised to image build time ...` after the cold boot and a + `rauc install` that succeeds without anyone having set the clock. Then: install, `BOOT_ORDER` becomes `"B A"`, reboot, `/etc/build-info` shows the new version, `rauc status` shows the new slot good and the old slot still holding the previous version, and the file written to `/data` in US1 is unchanged (SC-006) @@ -226,8 +233,8 @@ holds the previous one. point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of interruption per trial - (each trial's board has cold-booted into 2000, so repeat the `date -s` step of T029 before - every `rauc install`) + (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is + repeated by hand, and each trial's log must show the `ota-clock:` line) --- @@ -302,7 +309,9 @@ output and confirm it answers all of that in one command. ## Phase 8: Polish & Cross-Cutting Concerns -- [ ] T040 Extend `scripts/check.sh`: lint the new scripts with `sh -n` and `shellcheck`; assert +- [ ] T040 Extend `scripts/check.sh`: lint the new scripts with `sh -n` and `shellcheck`, **including + the init scripts under `rootfs_overlay/etc/init.d/`, which have no `.sh` extension and are + invisible to the current `*.sh` filter** (`S00ota-clock` was linted by hand for that reason); assert that the offsets in `genimage.cfg`, `uboot.config` and `fw_env.config` are the same numbers; assert the kernel is inside the OS slot rather than listed among the boot partition's files; keep the existing device-tree and board-parity assertions working with the new layout (FR-031) @@ -312,10 +321,11 @@ output and confirm it answers all of that in one command. (FR-004, FR-030) - [ ] T042 [P] Update `CLAUDE.md` with the same facts an agent needs: the new layout, the reserved region, the custom U-Boot and kernel configurations, the three `OTA_*` variables, and the one - counter rule + counter rule. The target-clock note is already there (added with T046); keep it current - [ ] T043 Re-measure and record in `README.md` every figure the layout change invalidates: both slots' and the boot partition's usage, the data area, `sdcard.img`, the bundle size, and the - boot time against the 11.50 s baseline (Principle VI, SC-007, SC-008) + boot time against the 11.50 s baseline, now including S00ota-clock (Principle VI, SC-007, + SC-008) - [ ] T044 Record the hardware evidence from T016, T024, T025, T029, T030, T033, T034, T035, T037 and T039 under `docs/logs/` and summarise it in the PR; Principle IV requires the evidence to be stated, and a green check run is explicitly not a boot test @@ -333,6 +343,8 @@ output and confirm it answers all of that in one command. board refuses to start without it. **It blocks every user story.** - **Phase 3 (US1)** depends on all of Phase 2, T016 included. - **Phase 4 (US2)** depends on US1: there is nothing to update until a device boots from a slot. + T029 and T030 depend on T046, which is a task of Phase 4 numbered last because it was added + after the list was first written. - **Phase 5 (US3)** depends on US2: rollback is observed by installing something and letting it fail. - **Phase 6 (US4)** depends on US2 for the install path; independent of US3. From 53edd6ac9262626502eda2bbd7a914b660b703a6 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 22:52:29 +0700 Subject: [PATCH 17/61] board: build the signed update bundle with the image post-image.sh stages the rootfs and a manifest naming ota-beaglebone-black and the VERSION read back from the image's own /etc/build-info, and signs it with the development material. The bundle is 23.1 MB. It is not verified at build time: rauc info loop-mounts a plain bundle, which the build container cannot do. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/beaglebone_black/post-image.sh | 35 ++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 5 +++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/board/ota/beaglebone_black/post-image.sh b/board/ota/beaglebone_black/post-image.sh index 10ab904..97171ea 100755 --- a/board/ota/beaglebone_black/post-image.sh +++ b/board/ota/beaglebone_black/post-image.sh @@ -5,6 +5,7 @@ set -eu BOARD_DIR="$(dirname "$0")" +BOARD="$(basename "${BASE_DIR}")" DATA_SIZE=256M # Buildroot hands genimage an empty rootpath, so genimage cannot build this @@ -14,4 +15,38 @@ rm -f "${BINARIES_DIR}/data.ext4" truncate -s "${DATA_SIZE}" "${BINARIES_DIR}/data.ext4" "${HOST_DIR}/sbin/mke2fs" -q -t ext4 -L data -F "${BINARIES_DIR}/data.ext4" +# The update bundle (FR-022): the rootfs the slot will hold, a manifest naming the board it +# is for and the version it carries, and a CMS signature over both. The version is read back +# from the image's own /etc/build-info rather than recomputed, so the bundle and the system +# it installs can never report different versions (FR-024). Not verified here: `rauc info` +# loop-mounts a plain bundle, which the unprivileged build container cannot do, so the first +# check against the keyring is the device's own (T029). +VERSION="$(sed -n 's/^VERSION=//p' "${TARGET_DIR}/etc/build-info")" +if [ -z "${VERSION}" ]; then + echo "post-image: no VERSION in ${TARGET_DIR}/etc/build-info" >&2 + exit 1 +fi +BUNDLE="${BINARIES_DIR}/${BOARD}-${VERSION}.raucb" +STAGING="${BASE_DIR}/bundle-staging" +rm -rf "${STAGING}" "${BUNDLE}" +mkdir -p "${STAGING}" +# rootfs.ext4 is a symlink to rootfs.ext2; link or copy the file it points at. +ln -L "${BINARIES_DIR}/rootfs.ext4" "${STAGING}/rootfs.ext4" 2>/dev/null \ + || cp -L "${BINARIES_DIR}/rootfs.ext4" "${STAGING}/rootfs.ext4" +cat > "${STAGING}/manifest.raucm" <.raucb` in `BINARIES_DIR`. No `--intermediate`: the chain is two levels and `--cert` already embeds the signing certificate in the CMS signature + (built: `beaglebone_black-.raucb`, 23.1 MB for a 128 MiB `rootfs.ext4`. The build does + not verify the signature: `rauc info` loop-mounts a plain bundle, which the unprivileged build + container cannot do, so the first signature check is the device's, in T029) - [ ] T027 [US2] Create `board/ota/common/rootfs_overlay/etc/init.d/S99ota-health`, board-independent (FR-029), running the four conditions of FR-012 in order — the init sequence reached this script; the running slot is the slot that was pending, according to RAUC rather From bbb2f490e947b417cbff232ca358a9e73f6f0a8f Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 22:54:49 +0700 Subject: [PATCH 18/61] board: confirm the booted slot good only when four local conditions hold S99ota-health checks, in order, that RAUC and the bootloader agree on the running slot (or that U-Boot took its last-resort path, which it records), that /data is mounted and writable, and that the boot-selection state reads and writes back; only then does it call rauc status mark-good. A failure leaves the slot unconfirmed and writes the reason to /data/ota-health.log. No network. Checked on the host against stubbed rauc and fw_* tools for nine paths; not yet run on the board. The watchdog feeder is T032. Co-Authored-By: Claude Sonnet 5.5 --- .../rootfs_overlay/etc/init.d/S99ota-health | 106 ++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 7 +- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100755 board/ota/common/rootfs_overlay/etc/init.d/S99ota-health diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health new file mode 100755 index 0000000..3058e2d --- /dev/null +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -0,0 +1,106 @@ +#!/bin/sh +# Confirm the slot that just booted is healthy, then record it good (FR-011, FR-012). +# Runs last in the init sequence. A slot that is never confirmed here keeps spending boot +# attempts until U-Boot retires it, which is the whole rollback mechanism, so a failure +# leaves the slot unconfirmed and says why rather than trying to repair anything. +# Nothing here touches the network: a device with no uplink must still confirm a good +# update. Board-independent (FR-029); slot names come from RAUC, not from this script. + +DATA=/data +LOG="${DATA}/ota-health.log" +booted= + +# One line to the console and, if the data area allows it, to the log that outlives the +# reboot (FR-014). The log write is allowed to fail: condition 3 is what reports that. +record() { + echo "ota-health: $*" + { echo "$(date -u '+%Y-%m-%d %H:%M:%S') UTC slot=${booted:-?} $*" >> "${LOG}"; } 2> /dev/null || true +} + +# RAUC prints "(null)" for a value it does not have. +known() { + case "$1" in + '' | '(null)') return 1 ;; + esac + return 0 +} + +case "$1" in + start) + # Condition 1, the init sequence completed: this is S99, so reaching here is it. + + # Condition 2, the running slot is the slot that was pending. RAUC's view of both. + # `rauc status` also exits non-zero or complains on stderr when no slot has any + # attempts left, so what matters is which variables it set. + status="$(rauc status --output-format=shell 2> /dev/null)" + eval "${status}" + # shellcheck disable=SC2154 # set by the eval above + booted="${RAUC_SYSTEM_BOOTED_BOOTNAME}" + if ! known "${booted}"; then + booted= + record "NOT CONFIRMED: RAUC reports no booted slot" + exit 1 + fi + last_resort= + # shellcheck disable=SC2154 + if known "${RAUC_BOOT_PRIMARY}"; then + # RAUC_BOOT_PRIMARY is a slot name (rootfs.1); the booted slot is a boot name (B). + primary= + i=0 + # shellcheck disable=SC2154 + for s in ${RAUC_SYSTEM_SLOTS}; do + i=$((i + 1)) + if [ "${s}" = "${RAUC_BOOT_PRIMARY}" ]; then + eval "primary=\${RAUC_SLOT_BOOTNAME_${i}}" + fi + done + if [ "${primary}" != "${booted}" ]; then + record "NOT CONFIRMED: RAUC names slot '${primary}' as primary but '${booted}' is running" + exit 1 + fi + else + # Every slot is out of attempts, so U-Boot took its last-resort path and there is no + # pending slot to match. Confirmed under the other conditions, and said so. + last_resort=1 + fi + + # Condition 3, the data area is mounted and a write to it succeeds. + probe="${DATA}/.ota-health-probe" + if ! grep -q " ${DATA} " /proc/mounts; then + record "NOT CONFIRMED: ${DATA} is not mounted" + exit 1 + fi + if ! { echo ok > "${probe}" && sync && rm -f "${probe}"; } 2> /dev/null; then + record "NOT CONFIRMED: ${DATA} is mounted but not writable" + exit 1 + fi + + # Condition 4, the boot-selection state is readable and writable from here. Writing a + # counter back with its own value changes nothing for U-Boot, but fails exactly when + # fw_env.config and the bootloader disagree about where the state lives. + var="BOOT_${booted}_LEFT" + if ! value="$(fw_printenv -n "${var}" 2> /dev/null)"; then + record "NOT CONFIRMED: boot-selection state is unreadable (${var})" + exit 1 + fi + if ! fw_setenv "${var}" "${value}" 2> /dev/null; then + record "NOT CONFIRMED: boot-selection state is not writable (${var})" + exit 1 + fi + + if ! rauc status mark-good > /dev/null 2>&1; then + record "NOT CONFIRMED: rauc status mark-good failed" + exit 1 + fi + if [ -n "${last_resort}" ]; then + record "confirmed good after a last-resort boot (no slot had attempts left)" + else + echo "ota-health: slot ${booted} confirmed good" + fi + ;; + stop | restart | reload) ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" >&2 + exit 1 + ;; +esac diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 5b6c935..55e684b 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -200,7 +200,7 @@ holds the previous one. (built: `beaglebone_black-.raucb`, 23.1 MB for a 128 MiB `rootfs.ext4`. The build does not verify the signature: `rauc info` loop-mounts a plain bundle, which the unprivileged build container cannot do, so the first signature check is the device's, in T029) -- [ ] T027 [US2] Create `board/ota/common/rootfs_overlay/etc/init.d/S99ota-health`, +- [X] T027 [US2] Create `board/ota/common/rootfs_overlay/etc/init.d/S99ota-health`, board-independent (FR-029), running the four conditions of FR-012 in order — the init sequence reached this script; the running slot is the slot that was pending, according to RAUC rather than a guess; `/data` is mounted and a write to it succeeds; `fw_printenv` reads the state and @@ -211,6 +211,11 @@ holds the previous one. names the booted slot as primary, or RAUC names no primary at all. A different slot named as primary is an inconsistent state and fails. A last-resort boot that passes is confirmed like any other and the script logs, to `/data`, that it was one (see the clarification in spec.md) + (written; checked on the host with stubbed `rauc`, `fw_printenv`, `fw_setenv` for nine paths: + normal, primary mismatch, last resort, `/data` unmounted, `/data` unwritable, state unreadable, + state unwritable, `mark-good` failing, RAUC reporting nothing. Its failures and last-resort + confirmations go to `/data/ota-health.log`, which T038 makes the documented path. The + watchdog feeder is T032, not this task. Not yet run on the board) - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) From 3ac276e103843645da43941333e7e16686e5bfa3 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 23:18:46 +0700 Subject: [PATCH 19/61] board: build the RTC driver in so the clock floor is the last writer On the first hardware boot S00ota-clock raised the clock to the build time and the omap_rtc module, loaded by mdev seconds later, set it back to 2000-01-01 (CONFIG_RTC_HCTOSYS). With the driver built in, hctosys runs before init. S99ota-health refused to confirm a healthy slot: with root=/dev/mmcblk0p2 RAUC puts the device in RAUC_SYSTEM_BOOTED_BOOTNAME, not the boot name. It now takes the slot whose state is booted. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/beaglebone_black/linux.config | 2 +- .../rootfs_overlay/etc/init.d/S00ota-clock | 5 +++ .../rootfs_overlay/etc/init.d/S99ota-health | 31 ++++++++++--------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/board/ota/beaglebone_black/linux.config b/board/ota/beaglebone_black/linux.config index 7ea6230..8b3c350 100644 --- a/board/ota/beaglebone_black/linux.config +++ b/board/ota/beaglebone_black/linux.config @@ -600,7 +600,7 @@ CONFIG_RTC_DRV_M41T80=m CONFIG_RTC_DRV_TWL92330=y CONFIG_RTC_DRV_TWL4030=m CONFIG_RTC_DRV_PALMAS=m -CONFIG_RTC_DRV_OMAP=m +CONFIG_RTC_DRV_OMAP=y CONFIG_RTC_DRV_CPCAP=m CONFIG_DMADEVICES=y CONFIG_CLK_TWL=m diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock b/board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock index c282eaf..82174c4 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock +++ b/board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock @@ -7,6 +7,11 @@ # after the build time is inside its window. Runs first so every later log line carries # the corrected time. Board-independent (FR-029); a board with a working RTC is # unaffected because its clock is already past the floor. +# +# This only holds if the RTC driver has already set the system clock by the time init +# runs: the kernel does that once, when the driver registers, and would overwrite the +# floor if the driver registered later. The BeagleBone Black's driver is therefore +# built in (research R8, "What the first boot showed"). BUILD_INFO=/etc/build-info FMT='+%Y-%m-%d %H:%M:%S' diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health index 3058e2d..8d7b2c5 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -30,30 +30,33 @@ case "$1" in # Condition 1, the init sequence completed: this is S99, so reaching here is it. # Condition 2, the running slot is the slot that was pending. RAUC's view of both. - # `rauc status` also exits non-zero or complains on stderr when no slot has any - # attempts left, so what matters is which variables it set. + # `rauc status` also complains on stderr when no slot has any attempts left, so what + # matters is which variables it set. RAUC_SYSTEM_BOOTED_BOOTNAME is not used: with + # root=/dev/mmcblk0p2 on the command line it holds the device, not the boot name. The + # slot whose state is "booted" is the unambiguous answer. status="$(rauc status --output-format=shell 2> /dev/null)" eval "${status}" + primary= + i=0 # shellcheck disable=SC2154 # set by the eval above - booted="${RAUC_SYSTEM_BOOTED_BOOTNAME}" + for s in ${RAUC_SYSTEM_SLOTS}; do + i=$((i + 1)) + eval "state=\${RAUC_SLOT_STATE_${i}}; bootname=\${RAUC_SLOT_BOOTNAME_${i}}" + if [ "${state}" = booted ]; then + booted="${bootname}" + fi + # shellcheck disable=SC2154 + if [ "${s}" = "${RAUC_BOOT_PRIMARY}" ]; then + primary="${bootname}" + fi + done if ! known "${booted}"; then booted= record "NOT CONFIRMED: RAUC reports no booted slot" exit 1 fi last_resort= - # shellcheck disable=SC2154 if known "${RAUC_BOOT_PRIMARY}"; then - # RAUC_BOOT_PRIMARY is a slot name (rootfs.1); the booted slot is a boot name (B). - primary= - i=0 - # shellcheck disable=SC2154 - for s in ${RAUC_SYSTEM_SLOTS}; do - i=$((i + 1)) - if [ "${s}" = "${RAUC_BOOT_PRIMARY}" ]; then - eval "primary=\${RAUC_SLOT_BOOTNAME_${i}}" - fi - done if [ "${primary}" != "${booted}" ]; then record "NOT CONFIRMED: RAUC names slot '${primary}' as primary but '${booted}' is running" exit 1 From 520f1aaf000119a0102fb9316673bf1f8bd31bbd Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 23:18:46 +0700 Subject: [PATCH 20/61] docs: record the first hardware boot, and what it corrected The clock at power-on is 1970-01-01; 2000-01-01 is the RTC's own value, set when its driver registers. Research R8, T046 and T027 say what failed and why the host-side checks could not see it. The console excerpt is under docs/logs/. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 7 ++- docs/logs/t046-t027-first-hardware-boot.log | 58 +++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 20 +++++++ specs/002-ab-ota-rauc/tasks.md | 11 +++- 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 docs/logs/t046-t027-first-hardware-boot.log diff --git a/CLAUDE.md b/CLAUDE.md index 3d3dd3e..7536b41 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,8 +97,11 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the builds in the container with the same single `/workspace` mount; the runner's UID/GID reach the image through `make docker-build`. A green build is not a boot test: boot-affecting changes still need the manual smoke test from the constitution. -- **The target clock is a floor, not the real time.** The boards here have no battery-backed RTC - and cold-boot into 2000-01-01 (BeagleBone Black measured). `board/ota/common/post-build.sh` +- **The target clock is a floor, not the real time.** The boards here have no battery-backed RTC: + the kernel clock starts at 1970-01-01, and the board's RTC driver then sets it to the RTC's + power-on value, 2000-01-01 (BeagleBone Black measured). That driver must be **built in** + (`CONFIG_RTC_DRV_OMAP=y`): as a module it registers seconds into boot and overwrites anything + an init script set before it (seen on hardware, research R8). `board/ota/common/post-build.sh` writes `BUILD_DATE` (epoch seconds) to `/etc/build-info`, and `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it at the start of boot, only when the clock is earlier. Anything on the device that checks a time window diff --git a/docs/logs/t046-t027-first-hardware-boot.log b/docs/logs/t046-t027-first-hardware-boot.log new file mode 100644 index 0000000..41d9858 --- /dev/null +++ b/docs/logs/t046-t027-first-hardware-boot.log @@ -0,0 +1,58 @@ +First boot of the A/B image on hardware, 2026-10-28, image built from bbb2f49 +(sdcard.img, factory image: only slot A eligible). Console capture by the user; the +bracketed prefix is the capturing terminal's own clock (UTC+7). + +EXCERPT: the lines that bear on T046 (ota-clock) and T027 (ota-health). The kernel messages +between 0.000 and 4.7 s and the device-driver noise are omitted, nothing else is edited. + +--- U-Boot selects slot A ------------------------------------------------------------- +[23:10:31] Saving Environment to MMC... Writing to redundant MMC(0)... OK +[23:10:31] OTA: booting slot A, 2 attempts left +[23:10:33] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait + +--- the clock --------------------------------------------------------------------------- +[23:10:35] EXT4-fs (mmcblk0p4): mounted filesystem ... r/w with ordered data mode. +[23:10:35] ota-clock: clock was 1970-01-01 00:00:03 UTC, raised to image build time 2026-10-28 16:00:59 UTC + ... Starting syslogd / klogd / sysctl / mdev ... +[23:10:38] [ 5.650300] omap_rtc 44e3e000.rtc: registered as rtc0 +[23:10:38] [ 5.655687] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) + +--- the health check -------------------------------------------------------------------- +[23:10:39] ota-health: NOT CONFIRMED: RAUC names slot 'A' as primary but '/dev/mmcblk0p2' is running + +--- at the prompt ----------------------------------------------------------------------- +# date +Sat Jan 1 00:01:42 UTC 2000 +# cat /etc/build-info +BOARD=beaglebone_black +VERSION=bbb2f49 +BUILDROOT=2026.08-274-gd6061d653d +BUILD_DATE=1793203259 +# rauc status +Compatible: ota-beaglebone-black +Booted from: rootfs.0 (/dev/mmcblk0p2) +Activated: rootfs.0 (A) +o [rootfs.1] (/dev/mmcblk0p3, ext4, inactive) bootname: B boot status: bad +x [rootfs.0] (/dev/mmcblk0p2, ext4, booted) bootname: A boot status: good +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A +BOOT_A_LEFT=2 +BOOT_B_LEFT=0 +# mount | grep -E ' / | /data ' +/dev/root on / type ext4 (ro,relatime) +/dev/mmcblk0p4 on /data type ext4 (rw,relatime) +# cat /data/ota-health.log +2000-01-01 00:00:02 UTC slot=/dev/mmcblk0p2 NOT CONFIRMED: RAUC names slot 'A' as primary but '/dev/mmcblk0p2' is running + +--- reading it -------------------------------------------------------------------------- +1. S00ota-clock works as a script and does not hold: the line at 23:10:35 is followed by the + RTC driver's own "setting system clock to 2000-01-01" at 23:10:38, and `date` at the prompt + says 2000. The log line of ota-health shows 2000-01-01 too, written after the raise. + Cause: CONFIG_RTC_DRV_OMAP=m, loaded by mdev; fix: =y. The clock at power-on is 1970, and + 2000-01-01 is the RTC's own value, which corrects "cold-boots into 2000" in earlier notes. +2. S99ota-health refused to confirm a healthy slot. RAUC_SYSTEM_BOOTED_BOOTNAME holds the + device path here, not "A". The failure is the safe one: BOOT_A_LEFT stayed at 2, so with no + fix three such boots would have retired the only good slot and landed in the last-resort path. +3. Everything else held: slot A selected with its attempt counted, root read-only, /data + read-write and mounted, rauc status and fw_printenv agree on the state, the failure reason + reached /data/ota-health.log (FR-014), and boot status "bad" for the never-written slot B. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index c9f7e61..4f68260 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -416,6 +416,26 @@ that has been given real time, is unaffected. - **Cost.** One shell script of a few lines at the start of boot. SC-008 is re-measured by T043 rather than assumed unchanged. +### What the first boot showed (2026-10-28, image `bbb2f49`) + +The script ran and logged `clock was 1970-01-01 00:00:03 UTC, raised to image build time +2026-10-28 16:00:59 UTC`, and the fix was gone five seconds later: the login prompt showed +`Sat Jan 1 2000`. Two corrections to what this document said above: + +- The clock at power-on is **1970-01-01**, not 2000. 2000-01-01 is the RTC's power-on value, and + the kernel copies it into the system clock when the RTC driver registers (`omap_rtc ...: setting + system clock to 2000-01-01T00:00:00 UTC`, `CONFIG_RTC_HCTOSYS=y`). +- `CONFIG_RTC_DRV_OMAP` was a module, loaded by `mdev` about 5.6 s into boot, after `S00ota-clock`. + The driver's registration therefore **overwrote** the floor. Option B as first written did not + work on this board, although every host-side check passed: the host cannot see the kernel. + +**Fix:** `CONFIG_RTC_DRV_OMAP=y` in `board/ota/beaglebone_black/linux.config`, so the RTC registers, +and `hctosys` runs, before `init`. `S00ota-clock` is then the last writer. A module-load-order +workaround (`modprobe` first, in the script) was rejected: it would name a board-specific module +in a board-independent script. A board whose RTC driver is a module must build it in, or this +mechanism does not apply to it; `CLAUDE.md` says so. Verified on hardware by T029's boot log +(the `ota-clock:` line followed by a `date` that is not 2000). + The spec's edge case "Clock far from real time" still asks for a clear error when the clock really is outside the window, which RAUC gives; B removes the *common* cause of it, not the error. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 55e684b..b5abb3a 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -215,7 +215,12 @@ holds the previous one. normal, primary mismatch, last resort, `/data` unmounted, `/data` unwritable, state unreadable, state unwritable, `mark-good` failing, RAUC reporting nothing. Its failures and last-resort confirmations go to `/data/ota-health.log`, which T038 makes the documented path. The - watchdog feeder is T032, not this task. Not yet run on the board) + watchdog feeder is T032, not this task. + **First boot on hardware (`bbb2f49`) found a defect the stubs could not**: it refused to + confirm slot A, `RAUC names slot 'A' as primary but '/dev/mmcblk0p2' is running`, because with + `root=/dev/mmcblk0p2` RAUC puts the device in `RAUC_SYSTEM_BOOTED_BOOTNAME`, not the boot name, + and the stubs had assumed the latter. Fixed by taking the slot whose state is `booted`. Not + done until a second boot prints `slot A confirmed good` and `BOOT_A_LEFT` is back at 3) - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) @@ -226,6 +231,10 @@ holds the previous one. script's four paths (cold boot, clock already past the floor, no `BUILD_DATE`, non-numeric `BUILD_DATE`) behave as R8 describes. Hardware evidence is carried by T029 and T030, boot time by T043. **T029 depends on this task.** + **First boot on hardware (`bbb2f49`) failed this task's purpose**: the script raised the clock, + then the RTC driver, a module loaded later, set it back to 2000. Fixed by building the driver + in (`CONFIG_RTC_DRV_OMAP=y`); research R8, "What the first boot showed". Not done until a + second boot shows the `ota-clock:` line and a `date` that stays at the build time - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so From 308c00a3dbd1a39fa5da8f3b79cffc504d4fae42 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Wed, 28 Oct 2026 23:34:31 +0700 Subject: [PATCH 21/61] docs: T046 and T027 confirmed on hardware, second boot The RTC driver built in, ota-clock is the last writer and date at the prompt is the build day with no date -s typed; ota-health confirms slot A and the attempt counter is back at 3. Boot time and the network are not measured by this log. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t046-t027-second-hardware-boot.log | 46 ++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 5 ++- specs/002-ab-ota-rauc/tasks.md | 12 ++--- 3 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 docs/logs/t046-t027-second-hardware-boot.log diff --git a/docs/logs/t046-t027-second-hardware-boot.log b/docs/logs/t046-t027-second-hardware-boot.log new file mode 100644 index 0000000..dd4f0f1 --- /dev/null +++ b/docs/logs/t046-t027-second-hardware-boot.log @@ -0,0 +1,46 @@ +Second boot of the A/B image on hardware, 2026-10-28, image built from 520f1aa (sdcard.img +SHA-256 69f8d6b4369095d96bd55eeed88c5e5246c49abd13dc28777ed9efb157a3e77d), after the RTC +driver was built in and the health check's slot lookup was fixed. Console capture by the +user; the bracketed prefix is the capturing terminal's own clock (UTC+7). + +EXCERPT: the lines that bear on T046 (ota-clock) and T027 (ota-health). Kernel messages +between 0.000 and 6.4 s and device-driver noise are omitted, nothing else is edited. +The first boot, which failed both, is t046-t027-first-hardware-boot.log. + +[23:31:15] OTA: booting slot A, 2 attempts left +[23:31:17] Linux version 6.18.38 ... #3 SMP Wed Oct 28 16:17:48 UTC 2026 +[23:31:17] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait +[23:31:18] [ 0.467977] omap_rtc 44e3e000.rtc: registered as rtc0 +[23:31:18] [ 0.468056] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[23:31:19] [ 3.093942] EXT4-fs (mmcblk0p4): mounted filesystem ... r/w with ordered data mode. +[23:31:19] ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-28 16:18:54 UTC +[23:31:23] Starting network: OK +[23:31:23] Starting crond: OK +[23:31:24] ota-health: slot A confirmed good +[23:31:24] OTA embedded Linux beaglebone-black /dev/console +beaglebone-black login: root +# date +Wed Oct 28 16:19:10 UTC 2026 +# cat /etc/build-info +BOARD=beaglebone_black +VERSION=520f1aa +BUILDROOT=2026.08-274-gd6061d653d +BUILD_DATE=1793204334 +# fw_printenv BOOT_A_LEFT +BOOT_A_LEFT=3 + +--- reading it -------------------------------------------------------------------------- +1. T046 holds. The RTC driver is built in, so it registers at 0.468 s and sets 2000-01-01 + before init; S00ota-clock then raises the clock to the build time (16:18:54, the same + BUILD_DATE as /etc/build-info), and nothing overwrites it: `date` at the prompt reads + 16:19:10 on the same day. No `date -s` was typed. In the first boot the driver was a + module and registered after the script, which is the whole difference. +2. T027 holds on the confirm path: "slot A confirmed good" and BOOT_A_LEFT back at 3 (the + factory image starts it at 3; the boot above spent one, mark-good refilled it). The + refuse paths and the last-resort path are still only host-tested. +3. Boot time is NOT measured here. The host timestamps have one-second resolution; SPL banner + at 23:31:12 and login at 23:31:24 is about 12 s, against a budget of 12.65 s and a previous + 10.51 s (T025). That is close enough that T043 must re-measure with grabserial, three runs, + rather than rely on this. +4. The network is not exercised: `Starting network: OK` brings up only lo, and no one ran + udhcpc on eth0 yet. Delivery of a bundle (research R8) is still untested on hardware. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 4f68260..815aa3a 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -433,8 +433,9 @@ The script ran and logged `clock was 1970-01-01 00:00:03 UTC, raised to image bu and `hctosys` runs, before `init`. `S00ota-clock` is then the last writer. A module-load-order workaround (`modprobe` first, in the script) was rejected: it would name a board-specific module in a board-independent script. A board whose RTC driver is a module must build it in, or this -mechanism does not apply to it; `CLAUDE.md` says so. Verified on hardware by T029's boot log -(the `ota-clock:` line followed by a `date` that is not 2000). +mechanism does not apply to it; `CLAUDE.md` says so. **Verified on hardware** on the second boot +(`docs/logs/t046-t027-second-hardware-boot.log`): the RTC sets 2000-01-01 at 0.47 s, the script +raises the clock at 3 s, and `date` at the prompt reads the build day. The spec's edge case "Clock far from real time" still asks for a clear error when the clock really is outside the window, which RAUC gives; B removes the *common* cause of it, not the error. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index b5abb3a..ec71fa1 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -219,12 +219,13 @@ holds the previous one. **First boot on hardware (`bbb2f49`) found a defect the stubs could not**: it refused to confirm slot A, `RAUC names slot 'A' as primary but '/dev/mmcblk0p2' is running`, because with `root=/dev/mmcblk0p2` RAUC puts the device in `RAUC_SYSTEM_BOOTED_BOOTNAME`, not the boot name, - and the stubs had assumed the latter. Fixed by taking the slot whose state is `booted`. Not - done until a second boot prints `slot A confirmed good` and `BOOT_A_LEFT` is back at 3) + and the stubs had assumed the latter. Fixed by taking the slot whose state is `booted`. + **Confirmed on the second boot (`520f1aa`)**: `slot A confirmed good`, `BOOT_A_LEFT=3`. Only the + confirm path is proven on hardware; the refuse and last-resort paths are host-tested) - [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009) -- [ ] T046 [US2] Implement research R8 option B, approved by the user on 2026-10-28 (FR-033): +- [X] T046 [US2] Implement research R8 option B, approved by the user on 2026-10-28 (FR-033): `board/ota/common/post-build.sh` writes `BUILD_DATE=` to `/etc/build-info`, and `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it, at the start of boot, only when the clock is earlier. Done when `sh -n` and `shellcheck` are clean and the @@ -233,8 +234,9 @@ holds the previous one. by T043. **T029 depends on this task.** **First boot on hardware (`bbb2f49`) failed this task's purpose**: the script raised the clock, then the RTC driver, a module loaded later, set it back to 2000. Fixed by building the driver - in (`CONFIG_RTC_DRV_OMAP=y`); research R8, "What the first boot showed". Not done until a - second boot shows the `ota-clock:` line and a `date` that stays at the build time + in (`CONFIG_RTC_DRV_OMAP=y`); research R8, "What the first boot showed". **Confirmed on the + second boot (`520f1aa`)**: the `ota-clock:` line, then a `date` at the build time with no + `date -s` typed (`docs/logs/t046-t027-second-hardware-boot.log`) - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so From 30c48e9cd9e58ae19a538dd7b1afdb8226dac43a Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 14:46:40 +0700 Subject: [PATCH 22/61] board: give eth0 a static address for the development bench 192.168.0.2/24 with gateway 192.168.0.1, for a board cabled straight to the build host. Nothing on that cable answers DHCP, and waiting for a lease would cost boot time. No package is added and nothing listens. Co-Authored-By: Claude Sonnet 5.5 --- .../rootfs_overlay/etc/network/interfaces | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces b/board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces new file mode 100644 index 0000000..99bb469 --- /dev/null +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces @@ -0,0 +1,12 @@ +# Static address for the development bench: the board is cabled straight to the build host, +# which holds 192.168.0.1/24 and serves bundles over HTTP (specs/002-ab-ota-rauc/research.md R8). +# There is no DHCP server on that cable, and waiting for one would cost boot time (SC-008). +# The file lives in the read-only slot, so changing the address means a new build. +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet static + address 192.168.0.2 + netmask 255.255.255.0 + gateway 192.168.0.1 From d6cfccb7cb4bd3ef7f904a90c00d45e0c6cfa72f Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 14:46:40 +0700 Subject: [PATCH 23/61] specs: deliver the bundle over a static address, and record the first network test Research R8 replaces udhcpc with the address now in the image, with the ping and wget results from the board. T047 records the change; T029 now checks the address comes up by itself and compares checksums on both ends. Co-Authored-By: Claude Sonnet 5.5 --- specs/002-ab-ota-rauc/quickstart.md | 7 ++++++- specs/002-ab-ota-rauc/research.md | 32 +++++++++++++++++++---------- specs/002-ab-ota-rauc/spec.md | 4 ++++ specs/002-ab-ota-rauc/tasks.md | 10 ++++++++- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 43f6729..8b43c72 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -54,7 +54,12 @@ must be **≤ 12.65 s** (11.50 s + 10%), or the regression is justified in writi ## 3. Install an update and confirm it — SC-001, SC-006, FR-006..FR-012 Build a second, visibly different revision (any commit changes `VERSION`), copy its bundle to -`/data` (host `python3 -m http.server`, board `udhcpc -i eth0` and `wget`). Do not set the clock: +`/data`. The bench is a direct cable: the host holds `192.168.0.1/24`, the board configures +`192.168.0.2/24` itself at boot (no `udhcpc`: nothing answers DHCP on that cable). On the host, in +`output/beaglebone_black/images/`, run `python3 -m http.server 8000 --bind 192.168.0.1`; on the board, +`ping -c 3 192.168.0.1` first, then +`wget -O /data/.raucb http://192.168.0.1:8000/.raucb`, and compare the size with +`ls -l`. Do not set the clock: the board cold-boots into 2000, and `S00ota-clock` raises it to the image's build time, which is after the certificate's `notBefore`, so the validity check passes (FR-033, research R8). The console shows `ota-clock: clock was 2000-01-01 ... raised to image build time ...`; `date` on the diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 815aa3a..e923ca0 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -347,24 +347,34 @@ problem). ### Delivery path -**Decision (working default for US2)**: bring the interface up by hand and fetch with BusyBox -`wget` from the build host. Nothing in the image changes. +**Decision (US2, updated 2026-10-29 after the first network test)**: the board has a static +address in the image, and fetches with BusyBox `wget` from the build host. The bench is a direct +cable, host `192.168.0.1/24`, board `192.168.0.2/24`, with no DHCP server on it. ```sh # on the build host, in output/beaglebone_black/images/ -python3 -m http.server 8000 -# on the board -udhcpc -i eth0 -wget -O /data/.raucb http://:8000/.raucb +python3 -m http.server 8000 --bind 192.168.0.1 +# on the board (eth0 is already configured at boot) +wget -O /data/.raucb http://192.168.0.1:8000/.raucb ``` +The address comes from `board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces` +(`ifupdown`, `S40network`). It replaces the first plan, `udhcpc -i eth0`, which needs a DHCP server +the bench does not have. Static addressing costs nothing at boot, where `BR2_SYSTEM_DHCP` would wait +for a lease on every boot (SC-008). It is a development-bench setting baked into the read-only slot: +changing it means a new build, and two boards on one cable would collide. A product would take its +address from somewhere else; that is the delivery feature's problem, not this one's. + +**Tested on hardware, 2026-10-29** (image `520f1aa`, address set by hand with `ip addr add`): +`ping` both ways, 3/3, 1.9 to 4.6 ms; `wget` of the 23103209-byte bundle into `/tmp` completed in +about 2 s and `ls -l` shows the same size as the file on the host. Size only: no checksum was +compared. Not yet tested: the same path with the address coming from the image, and a download +into `/data`. + **Why**: the image has no SSH server, `nc`, `ftpget`, `httpd` or `telnetd`, and RAUC is built without libcurl, so `rauc install https://...` is unavailable and only local files install. BusyBox -does have `wget`, `tftp` and `udhcpc`. `BR2_SYSTEM_DHCP` is empty, so `eth0` is down after boot; -bringing it up by hand costs nothing at boot. Setting `BR2_SYSTEM_DHCP="eth0"` would make the -network script wait for a lease on every boot, which is a SC-008 risk (T025 passed at 10.51 s of a -12.65 s budget) and would need a re-measurement, so it is not done here. A DHCP client opens no -listening port, so Principle VII is not at stake either way. +does have `wget`, `tftp` and `udhcpc`. No server listens on the board, so Principle VII is not at +stake; SSH was considered and left out of this feature because `wget` is enough to deliver a bundle. **Fallbacks**, none tested: a USB stick (`usb-storage.ko` and `musb_hdrc.ko` are in the image, ext4 and vfat are built in), or pulling the card and copying onto p4 from the host (p4 is ext4 at byte diff --git a/specs/002-ab-ota-rauc/spec.md b/specs/002-ab-ota-rauc/spec.md index 949c9b7..48e7a92 100644 --- a/specs/002-ab-ota-rauc/spec.md +++ b/specs/002-ab-ota-rauc/spec.md @@ -415,6 +415,10 @@ update. once this project has an application to wait for; today there is none, so it would only add a meaningless timeout. - **First board and medium**: `beaglebone_black` on removable SD card. On-board eMMC is untouched. +- **The development bench has a fixed network address**: `beaglebone_black` configures `eth0` as + 192.168.0.2/24 at boot, for a board cabled straight to the build host, so that a bundle can be + fetched for testing. No package is added and nothing listens; the address is baked into the + read-only slot and is not a product networking design (research R8). - **Development images stay as they are otherwise**: passwordless root and the existing package set are unchanged by this feature; hardening remains the job of a future production variant. The one deliberate behavioural change is the read-only OS slot, which is a correctness requirement of diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index ec71fa1..997f89c 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -237,10 +237,18 @@ holds the previous one. in (`CONFIG_RTC_DRV_OMAP=y`); research R8, "What the first boot showed". **Confirmed on the second boot (`520f1aa`)**: the `ota-clock:` line, then a `date` at the build time with no `date -s` typed (`docs/logs/t046-t027-second-hardware-boot.log`) +- [X] T047 [US2] Give `beaglebone_black` a static `eth0` in the image, 192.168.0.2/24 with gateway + 192.168.0.1 (`board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces`), so the + bundle can be fetched without typing an address after every cold boot. Decided by the user on + 2026-10-29 after `ping` and `wget` worked with the address set by hand (research R8). No new + package and no listening port. In the image as built; its boot-time effect is measured by + T043, and the address coming up by itself is shown by T029's log - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so - SC-008 is untouched by the delivery path). **No `date -s`**: `rauc install` checks + SC-008 is untouched by the delivery path). The board has its address from the image (T047): + first `ping -c 3 192.168.0.1`, then the `wget` into `/data`, and compare the size and, on both + ends, `sha256sum`. **No `date -s`**: `rauc install` checks certificate validity against the clock and has no `--no-check-time`, and the board cold-boots at 2000-01-01, which T046 handles at boot. The log must show the console line `ota-clock: clock was 2000-01-01 ... raised to image build time ...` after the cold boot and a From 148947a2fab09c73bf838864b020175d2fe7441d Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 15:20:47 +0700 Subject: [PATCH 24/61] docs: the bundle crosses the cable intact, and lands in /data Fetched over the static address into /data, the 23 MB bundle has the same SHA-256 on the board as on the host. Recorded as the user's report, since only the hash was pasted. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t047-network-and-delivery.log | 22 ++++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 9 +++++++-- specs/002-ab-ota-rauc/tasks.md | 6 ++++-- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 docs/logs/t047-network-and-delivery.log diff --git a/docs/logs/t047-network-and-delivery.log b/docs/logs/t047-network-and-delivery.log new file mode 100644 index 0000000..5561ef0 --- /dev/null +++ b/docs/logs/t047-network-and-delivery.log @@ -0,0 +1,22 @@ +Static address and bundle delivery on hardware, 2026-10-29, image built from d6cfccb +(sdcard.img SHA-256 4f4dda2359cc37fc942be34357ba7d909dd77fb118ef9c5656f51e0bbcee8afb). + +NOT a console capture. The user reported having done the four steps asked for after flashing +and rebooting, and pasted only the last result. What is recorded here is what was reported, +and nothing in it was observed by the person writing this file. + +Reported done: + 1. eth0 has 192.168.0.2/24 right after boot, without typing `ip addr add` (T047) + 2. ping between the board and the host, both ways + 3. the boot console still shows the ota-clock and ota-health lines, and `date` is not 2000 + 4. the bundle fetched with wget into /data, and checksummed on the board + +Pasted by the user, from the board: + 46273d7d2746cdfe4bf19f88841781652491eaac021df98fa868ed7074ad75bc /data/t.raucb + +Host side, `sha256sum output/beaglebone_black/images/beaglebone_black-d6cfccb.raucb`: + 46273d7d2746cdfe4bf19f88841781652491eaac021df98fa868ed7074ad75bc + +The two are identical, so the bundle crossed the cable and landed in /data byte for byte. +That is the evidence for the delivery path of research R8. Items 1 to 3 rest on the user's +word; the next hardware capture (T029) should include the console so the log shows them. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index e923ca0..bab562c 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -368,8 +368,13 @@ address from somewhere else; that is the delivery feature's problem, not this on **Tested on hardware, 2026-10-29** (image `520f1aa`, address set by hand with `ip addr add`): `ping` both ways, 3/3, 1.9 to 4.6 ms; `wget` of the 23103209-byte bundle into `/tmp` completed in about 2 s and `ls -l` shows the same size as the file on the host. Size only: no checksum was -compared. Not yet tested: the same path with the address coming from the image, and a download -into `/data`. +compared. + +**Tested again on hardware, 2026-10-29** (image `d6cfccb`, address from the image): the bundle +fetched into `/data` has the same SHA-256 on the board and on the host, +`46273d7d2746cdfe4bf19f88841781652491eaac021df98fa868ed7074ad75bc`. Only that hash was pasted; the +rest rests on the user's report (`docs/logs/t047-network-and-delivery.log`). Delivery is therefore +proven for a 23 MB bundle over the direct cable; what remains is `rauc install` itself (T029). **Why**: the image has no SSH server, `nc`, `ftpget`, `httpd` or `telnetd`, and RAUC is built without libcurl, so `rauc install https://...` is unavailable and only local files install. BusyBox diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 997f89c..3c09608 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -241,8 +241,10 @@ holds the previous one. 192.168.0.1 (`board/ota/beaglebone_black/rootfs_overlay/etc/network/interfaces`), so the bundle can be fetched without typing an address after every cold boot. Decided by the user on 2026-10-29 after `ping` and `wget` worked with the address set by hand (research R8). No new - package and no listening port. In the image as built; its boot-time effect is measured by - T043, and the address coming up by itself is shown by T029's log + package and no listening port. Confirmed on `d6cfccb` by the user's report: address up at + boot, ping, and the bundle fetched into `/data` with an identical SHA-256 + (`docs/logs/t047-network-and-delivery.log`; only the hash was pasted, so T029's console log + should show the rest). Its boot-time effect is measured by T043 - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so From f95075c38ae5f2e5a8477e9408eb69936b7ac44b Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 15:27:05 +0700 Subject: [PATCH 25/61] board: check the bundle's signing certificate for the code-signing purpose The first rauc install on hardware failed with "unsuitable certificate purpose": the signing certificate has only the Code Signing extended key usage, and without check-purpose OpenSSL verifies the CMS signature for S/MIME signing. Reproduced on the host with openssl cms -verify, which fails by default and succeeds with -purpose any, so the chain and the digest were fine. Co-Authored-By: Claude Sonnet 5.5 --- .../ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf index c3b80a2..1c69844 100644 --- a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf @@ -14,6 +14,11 @@ bundle-formats=plain [keyring] # The development CA, installed by board/ota/common/post-build.sh from $OTA_KEYRING. path=/etc/rauc/keyring.pem +# The signing certificate carries the Code Signing extended key usage and no other, which +# is what a bundle signer should have. Without this line OpenSSL checks the chain for the +# S/MIME signing purpose instead and refuses it: "unsuitable certificate purpose". This is +# RAUC's own code-signing check, which also rejects a certificate that lacks the usage. +check-purpose=codesign [slot.rootfs.0] device=/dev/mmcblk0p2 From 44b167e7e4d444ea1f8556529b95e0c8a5313f79 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 15:28:05 +0700 Subject: [PATCH 26/61] docs: the first install failed on certificate purpose, and what it showed Delivery and the clock worked; rauc install refused a bundle the project itself built, because the signing certificate is Code Signing only and the device had no check-purpose. Recorded with the host reproduction, the contract, FR-016 and a fifth refusal case for the untrusted-bundle scenario. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t029-first-install-attempt.log | 55 +++++++++++++++++++ .../contracts/signing-chain.md | 8 ++- specs/002-ab-ota-rauc/quickstart.md | 3 +- specs/002-ab-ota-rauc/spec.md | 2 +- specs/002-ab-ota-rauc/tasks.md | 10 +++- 5 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 docs/logs/t029-first-install-attempt.log diff --git a/docs/logs/t029-first-install-attempt.log b/docs/logs/t029-first-install-attempt.log new file mode 100644 index 0000000..7afe6b6 --- /dev/null +++ b/docs/logs/t029-first-install-attempt.log @@ -0,0 +1,55 @@ +First rauc install on hardware, 2026-10-29. Board running d6cfccb (the factory image, slot A), +bundle beaglebone_black-148947a.raucb fetched into /data over the static address, SHA-256 +877ddcb7d10033610c3872b4cf01dd45d9bd3b4390cd1892b62b5cd333755a96 on the board, equal to the +host's. Console capture by the user; the bracketed prefix is the capturing terminal's clock. + +[15:17:52] # cat /data/keep 2>/dev/null || echo "marker" > /data/keep +# cat /data/keep +marker +# wget -O /data/b.raucb http://192.168.0.1:8000/beaglebone_black-148947a.raucb +Connecting to 192.168.0.1:8000 (192.168.0.1:8000) +saving to '/data/b.raucb' +b.raucb 100% |********************************| 22.0M 0:00:00 ETA +'/data/b.raucb' saved +# sha256sum /data/b.raucb +877ddcb7d10033610c3872b4cf01dd45d9bd3b4390cd1892b62b5cd333755a96 /data/b.raucb +# rauc install /data/b.raucb +rauc-Message: 08:00:02.963: Using central status file /data/rauc.status +rauc-Message: 08:00:02.964: Using system config file /etc/rauc/system.conf +rauc-Message: 08:00:02.964: Failed to load system status: No such file or directory +rauc-Message: 08:00:02.971: Active slot bootname: '/dev/mmcblk0p2' +started + 0% Installing + 0% Determining slot states + 10% Determining slot states done. + 10% Checking bundle +rauc-Message: 08:00:02.976: Reading bundle: /data/b.raucb +Checking and mounting bundle... +rauc-Message: 08:00:03.061: Verifying bundle signature... + 10% Verifying signature + 20% Verifying signature failed. + 20% Checking bundle failed. +rauc-event-Message: 08:00:03.073: Installation d69c0bec failed: signature verification failed: Verify error: unsuitable certificate purpose +100% Installing failed. +signature verification failed: Verify error: unsuitable certificate purpose +Installing `/data/b.raucb` failed +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A +BOOT_A_LEFT=3 +BOOT_B_LEFT=0 + +--- reading it -------------------------------------------------------------------------- +1. The install failed at the signature, before writing anything: BOOT_ORDER, BOOT_A_LEFT and + BOOT_B_LEFT are unchanged, which is FR-019 (verify before the first write) holding by accident + on a bundle the project itself produced. +2. It is not the clock. The board's clock read 2026-10-29 08:00 (ota-clock raised it at boot), + inside the certificate's window; the first failure R8 predicted ("not yet valid") did not occur. +3. Cause: the signing certificate has the Code Signing extended key usage only, and RAUC's + system.conf had no check-purpose, so OpenSSL verified the CMS for S/MIME signing and refused. + Reproduced on the host from the bundle itself: `openssl cms -verify` on the extracted + signature fails with the same message by default and succeeds with `-purpose any`, so the + digest and the chain were fine. Fix: check-purpose=codesign in the board's system.conf, + which lives in the slot, so the device needs the fixed image before it can install anything. +4. The host-side build could not have found this: `rauc info` in the container stops at the + bundle mount before it checks the signature, which is why T026 could not verify it either. +5. The marker file in /data survived (SC-006 is not tested yet, nothing was installed). diff --git a/specs/002-ab-ota-rauc/contracts/signing-chain.md b/specs/002-ab-ota-rauc/contracts/signing-chain.md index 14d06db..53fca7f 100644 --- a/specs/002-ab-ota-rauc/contracts/signing-chain.md +++ b/specs/002-ab-ota-rauc/contracts/signing-chain.md @@ -20,6 +20,11 @@ every card already flashed. `dev-signing.csr.pem` is an intermediate artefact of generation. It can be deleted, or kept to issue a replacement certificate from the same signing key. +The signing certificate's only extended key usage is Code Signing, so the device must verify with +`check-purpose=codesign` in `/etc/rauc/system.conf`. Without it OpenSSL checks the chain for the +S/MIME signing purpose and refuses every bundle with `unsuitable certificate purpose`; found on the +first install on hardware, `docs/logs/t029-first-install-attempt.log`. + Both certificate subjects state `NOT FOR PRODUCTION` in their common name, so the development origin of a bundle is visible in `rauc info` and `openssl x509 -text` (FR-020). @@ -74,7 +79,8 @@ rauc install /data/.raucb /etc/rauc/keyring.pem (= dev-ca.cert.pe 1. unwrap the CMS signature, taking │ dev-signing.cert.pem out of it │ 2. chain that certificate to the keyring ─────────┘ FR-016 - issued by this CA? still valid? + issued by this CA? still valid? allowed to sign code? + (system.conf check-purpose=codesign: Code Signing usage present) 3. digest of rootfs.ext4 == the digest in the signed manifest FR-017 4. compatible == ota-beaglebone-black FR-018 │ diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 8b43c72..509abdf 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -122,7 +122,7 @@ watchdog forever — worth capturing a "before" run on the unmodified image to s ## 7. Untrusted and broken bundles are refused — SC-004, FR-016..FR-019 -Four attempts, each must be refused *before* anything is written, with a distinct message, and +Five attempts, each must be refused *before* anything is written, with a distinct message, and `rauc status` plus both slots unchanged afterwards: | Bundle | Expected refusal | @@ -131,6 +131,7 @@ Four attempts, each must be refused *before* anything is written, with a distinc | signed by a second CA and signing pair, generated into a scratch directory with `OTA_SIGNING_*` pointed at it | the chain does not reach the CA in the device keyring | | a trusted bundle with a byte flipped after signing | integrity failure | | built with a different `compatible` string | wrong board | +| signed with a certificate from the device's own CA that lacks the Code Signing usage | refused by purpose; the first real install failed this way by accident (`check-purpose=codesign`) | ## 8. State written where it cannot be lost — SC-013, FR-014 diff --git a/specs/002-ab-ota-rauc/spec.md b/specs/002-ab-ota-rauc/spec.md index 48e7a92..10bd044 100644 --- a/specs/002-ab-ota-rauc/spec.md +++ b/specs/002-ab-ota-rauc/spec.md @@ -283,7 +283,7 @@ update. **Trust and integrity** - **FR-016**: Update bundles MUST be signed, and a device MUST refuse any bundle that is not signed - by a key it trusts. + by a key it trusts, or whose signing certificate is not meant for signing code. - **FR-017**: A device MUST verify bundle integrity and refuse a bundle whose contents changed after signing. - **FR-018**: A bundle MUST identify the board or hardware variant it is built for, and a device diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 3c09608..88d5ffe 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -258,6 +258,10 @@ holds the previous one. reboot, `/etc/build-info` shows the new version, `rauc status` shows the new slot good and the old slot still holding the previous version, and the file written to `/data` in US1 is unchanged (SC-006) + **First attempt, 2026-10-29 (`docs/logs/t029-first-install-attempt.log`)**: delivery and the clock + worked; `rauc install` refused the bundle with `unsuitable certificate purpose` and wrote nothing. + Fixed in the board's `system.conf` (`check-purpose=codesign`), which needs the fixed image + flashed. T029 is not done until an install succeeds - [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of @@ -311,8 +315,10 @@ slots are untouched afterwards. - [ ] T036 [US4] Document in `quickstart.md` the exact commands for the untrusted-bundle case: generate a second CA and signing pair into a scratch directory with `scripts/gen-dev-keys.sh`, then build a bundle with `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` pointed at it, so the - refusal under test is a chain that does not reach the device's CA -- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 — four refusals, each with a distinct + refusal under test is a chain that does not reach the device's CA. Add a fifth case: a + certificate issued by the device's own CA but without the Code Signing usage, which the + device must refuse by purpose (`check-purpose=codesign`, found on the first install) +- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 — five refusals, each with a distinct message, nothing written, `rauc status` and both slots unchanged after every attempt (SC-004, FR-016 to FR-019) From 4ae0c699fe844795fb4ca1fff7ba19bbd17727de Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 15:45:19 +0700 Subject: [PATCH 27/61] board: let RAUC mount a bundle on this image The second install attempt verified the signature, then failed to create /mnt/rauc/bundle on the read-only slot. Behind that, the kernel has no SquashFS, and a plain bundle is a squashfs, which RAUC mounts with mount(2) through a loop device. Set mountprefix to /run/rauc and build SquashFS (zlib, the bundle's compression) into the kernel. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/beaglebone_black/linux.config | 2 ++ board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf | 3 +++ 2 files changed, 5 insertions(+) diff --git a/board/ota/beaglebone_black/linux.config b/board/ota/beaglebone_black/linux.config index 8b3c350..dbfc12a 100644 --- a/board/ota/beaglebone_black/linux.config +++ b/board/ota/beaglebone_black/linux.config @@ -672,6 +672,8 @@ CONFIG_JFFS2_LZO=y CONFIG_JFFS2_RUBIN=y CONFIG_UBIFS_FS=y CONFIG_CRAMFS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_ZLIB=y CONFIG_NFS_FS=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf index 1c69844..3d4e0ea 100644 --- a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf @@ -10,6 +10,9 @@ bootloader=uboot # persistent data area rather than in a slot or in volatile storage (FR-014). statusfile=/data/rauc.status bundle-formats=plain +# RAUC mounts the bundle and, during an install, its slots under this prefix. The default, +# /mnt/rauc, is on the read-only slot, where the mount point cannot be created. +mountprefix=/run/rauc [keyring] # The development CA, installed by board/ota/common/post-build.sh from $OTA_KEYRING. From 40a54ec378f50bb6041e305bb78b3d7a5b796e6b Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 15:46:07 +0700 Subject: [PATCH 28/61] docs: the second install attempt, and what rauc install needs from the image The signature verified; the mount of the bundle failed on the read-only slot, and behind it the kernel had no SquashFS. Research R9 lists what the install path requires, and which parts are still unproven. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t029-first-install-attempt.log | 30 ++++++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 18 ++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 5 +++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/docs/logs/t029-first-install-attempt.log b/docs/logs/t029-first-install-attempt.log index 7afe6b6..4bcc725 100644 --- a/docs/logs/t029-first-install-attempt.log +++ b/docs/logs/t029-first-install-attempt.log @@ -53,3 +53,33 @@ BOOT_B_LEFT=0 4. The host-side build could not have found this: `rauc info` in the container stops at the bundle mount before it checks the signature, which is why T026 could not verify it either. 5. The marker file in /data survived (SC-006 is not tested yet, nothing was installed). + +========================================================================================== +SECOND ATTEMPT, same day, image f95075c (check-purpose=codesign), bundle 44b167e +SHA-256 35515b842cb01b81b886d7258177f3f84df44cad13626c69e98945aa22e8d18e on both ends. +========================================================================================== + +# rauc install /data/b.raucb + 10% Checking bundle +rauc-Message: 08:31:15.480: Verifying bundle signature... + 10% Verifying signature +rauc-Message: 08:31:15.850: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' + 20% Verifying signature done. + 20% Checking bundle done. +rauc-event-Message: 08:31:15.870: Installation ba150e64 failed: Failed mounting bundle: Failed creating mount point: Failed creating mount path '/mnt/rauc/bundle': Read-only file system +100% Installing failed. +Installing `/data/b.raucb` failed + +--- reading it -------------------------------------------------------------------------- +1. The first fix worked: the signature is verified, by the development signing certificate. +2. The next failure is the read-only slot: RAUC's default mount prefix is /mnt/rauc, which it + cannot create. Fix: mountprefix=/run/rauc (tmpfs). +3. Found while looking behind it, before the third flash: the kernel has no SquashFS + (# CONFIG_SQUASHFS is not set). A plain bundle is a squashfs, compressed with gzip, and + RAUC mounts it with mount(2) type "squashfs" through /dev/loop-control, so the mount would + have failed next with "squashfs support not enabled in kernel". Fix: CONFIG_SQUASHFS=y and + CONFIG_SQUASHFS_ZLIB=y; the loop driver is already built in. +4. Both were invisible to the host build for the same reason as the purpose failure: nothing + in the unprivileged container can mount a bundle. The install path is only exercised on + the board, one failure at a time, so each flash should be preceded by reading what the + next step needs, as was done here. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index bab562c..fc4c40a 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -455,6 +455,24 @@ raises the clock at 3 s, and `date` at the prompt reads the build day. The spec's edge case "Clock far from real time" still asks for a clear error when the clock really is outside the window, which RAUC gives; B removes the *common* cause of it, not the error. +## R9. What `rauc install` needs from the image + +Found one failure at a time on the first installs, 2026-10-29 (`docs/logs/t029-first-install-attempt.log`). +The host build cannot exercise any of it: mounting a bundle needs privileges the build container +lacks, so `rauc info` stops there. Each item is a requirement of installing on a read-only, +minimal image, not a defect of RAUC. + +| Needed | Why | Where it is set | +|---|---|---| +| `check-purpose=codesign` in `[keyring]` | the signing certificate has only the Code Signing usage, and OpenSSL's default for CMS is S/MIME signing | `system.conf` | +| `mountprefix=/run/rauc` in `[system]` | the default `/mnt/rauc` is on the read-only slot | `system.conf` | +| `CONFIG_SQUASHFS=y`, `CONFIG_SQUASHFS_ZLIB=y` | a plain bundle is a gzip squashfs, mounted with `mount(2)` | `linux.config` | +| `CONFIG_BLK_DEV_LOOP=y` and `/dev/loop-control` | RAUC attaches the bundle to a loop device itself | already built in | + +Still unproven, because the install has not got past the mount: the write into the other slot +(a 128 MiB ext4 image into a 512 MiB partition), the `BOOT_ORDER` update through `fw_setenv`, and +RAUC's status file on `/data`. + ## Consequences for the spec Two items in the spec are affected and are handled in `plan.md` rather than silently: diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 88d5ffe..0567a6e 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -261,7 +261,10 @@ holds the previous one. **First attempt, 2026-10-29 (`docs/logs/t029-first-install-attempt.log`)**: delivery and the clock worked; `rauc install` refused the bundle with `unsuitable certificate purpose` and wrote nothing. Fixed in the board's `system.conf` (`check-purpose=codesign`), which needs the fixed image - flashed. T029 is not done until an install succeeds + flashed. **Second attempt**: the signature verified, then the mount of the bundle failed on + the read-only slot (`mountprefix=/run/rauc`), and behind it the kernel had no SquashFS + (`CONFIG_SQUASHFS=y`, `_ZLIB=y`), both fixed in `4ae0c69`. T029 is not done until an install + succeeds - [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of From 500cd0d5645ebf67348afdefcc8cf98d4c80a2c4 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 16:14:49 +0700 Subject: [PATCH 29/61] board: refuse an installation while an update is pending or another one runs The second install on hardware, run while slot B was pending, was accepted and rewrote B: RAUC only refuses to write the slot that is running. A pre-install handler, run after the bundle is verified and before the target slot is marked bad, now refuses when RAUC's primary slot is not the running one, or when another rauc install exists. A rolled-back or last-resort device has nothing pending and can still be updated. Co-Authored-By: Claude Sonnet 5.5 --- .../rootfs_overlay/etc/rauc/system.conf | 5 ++ .../rootfs_overlay/usr/lib/ota/pre-install | 57 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100755 board/ota/common/rootfs_overlay/usr/lib/ota/pre-install diff --git a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf index 3d4e0ea..f32cdfb 100644 --- a/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf +++ b/board/ota/beaglebone_black/rootfs_overlay/etc/rauc/system.conf @@ -14,6 +14,11 @@ bundle-formats=plain # /mnt/rauc, is on the read-only slot, where the mount point cannot be created. mountprefix=/run/rauc +[handlers] +# Refuses an installation while an earlier update is pending, or while another one runs +# (FR-009). Board-independent, so it lives in the shared overlay. +pre-install=/usr/lib/ota/pre-install + [keyring] # The development CA, installed by board/ota/common/post-build.sh from $OTA_KEYRING. path=/etc/rauc/keyring.pem diff --git a/board/ota/common/rootfs_overlay/usr/lib/ota/pre-install b/board/ota/common/rootfs_overlay/usr/lib/ota/pre-install new file mode 100755 index 0000000..c1845e5 --- /dev/null +++ b/board/ota/common/rootfs_overlay/usr/lib/ota/pre-install @@ -0,0 +1,57 @@ +#!/bin/sh +# RAUC pre-install handler: refuse an installation that FR-009 forbids, before RAUC marks +# the target slot bad or writes anything. RAUC runs it after the bundle is verified and +# mounted; a non-zero exit aborts the install with "Pre-install handler error". +# +# Two conditions, each named in the message: +# 1. An earlier update is pending: RAUC's primary slot is not the slot that is running, so +# the device has been told to boot something it has not booted yet. Installing again +# would overwrite that slot while it is the one the next reboot will select. +# 2. Another installation is running: a second `rauc install` process exists. +# +# Neither applies to a device that has nothing pending, so a rolled-back device, or one on +# the last-resort path with no primary slot, can still be updated: that is how it recovers. +# Limit: with `rauc service` and a D-Bus client, the client is itself a `rauc install` +# process and would be mistaken for a second one; nothing here uses that mode. + +refuse() { + echo "<< error $*" + echo "ota-pre-install: refused: $*" + exit 1 +} + +# 2. Another installation. $PPID is the rauc process running this very install. +for p in /proc/[0-9]*; do + pid="${p#/proc/}" + [ "${pid}" = "$$" ] && continue + [ "${pid}" = "${PPID}" ] && continue + cmd="$(tr '\0' ' ' 2> /dev/null < "${p}/cmdline")" || continue + case "${cmd}" in + *'rauc install '*) refuse "another installation is in progress (process ${pid})" ;; + esac +done + +# 1. A pending update. Same lookup as S99ota-health: the slot whose state is "booted", and +# RAUC's primary, each as a boot name. +status="$(rauc status --output-format=shell 2> /dev/null)" +eval "${status}" +booted= +primary= +i=0 +# shellcheck disable=SC2154 # set by the eval above +for s in ${RAUC_SYSTEM_SLOTS}; do + i=$((i + 1)) + eval "state=\${RAUC_SLOT_STATE_${i}}; bootname=\${RAUC_SLOT_BOOTNAME_${i}}" + if [ "${state}" = booted ]; then + booted="${bootname}" + fi + # shellcheck disable=SC2154 + if [ "${s}" = "${RAUC_BOOT_PRIMARY}" ]; then + primary="${bootname}" + fi +done + +if [ -n "${booted}" ] && [ -n "${primary}" ] && [ "${primary}" != "${booted}" ]; then + refuse "an update is pending: slot ${primary} is installed and will boot next, but slot ${booted} is running; reboot first, or let the pending update fail and roll back" +fi +exit 0 From 1c7e147a9536e7e147b33ce7d71d507780e34cdd Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 16:14:49 +0700 Subject: [PATCH 30/61] docs: the first install and slot switch, and the check that was not enforced Install in about 8 s, boot of the new slot, its version, health confirmed. The second install, run while the first was pending, was not refused: FR-009 was assumed to come from RAUC and does not. Task T048 adds it. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t029-install-and-switch.log | 99 +++++++++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 8 ++- specs/002-ab-ota-rauc/tasks.md | 22 ++++-- 3 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 docs/logs/t029-install-and-switch.log diff --git a/docs/logs/t029-install-and-switch.log b/docs/logs/t029-install-and-switch.log new file mode 100644 index 0000000..60efc5f --- /dev/null +++ b/docs/logs/t029-install-and-switch.log @@ -0,0 +1,99 @@ +First successful rauc install and slot switch on hardware, 2026-10-29. Board flashed with +4ae0c69 (slot A), bundle 40a54ec fetched into /data over the static address, SHA-256 +1be834f0d8ebe717709b3080d5133fe25466f4629798da9bd3ea69f9f3ae70a6 on both ends. Console capture +by the user; the bracketed prefix of the original is the capturing terminal's clock (UTC+7). + +EXCERPT. Omitted, nothing else edited: the ~55 repeated "NN% Copying image to rootfs.1" progress +lines between 46% and 99%, and the kernel and driver messages of the reboot between 0.000 s and 8 s. + +--- install 1 (16:03:58) --------------------------------------------------------------- +# rauc install /data/b.raucb +rauc-Message: Active slot bootname: '/dev/mmcblk0p2' + 10% Checking bundle +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' + 20% Checking bundle done. +[ 200.904345] loop0: detected capacity change from 0 to 45179 +rauc-Message: Mounting bundle '/data/b.raucb' to '/run/rauc/bundle' +rauc-Message: Configured loop device '/dev/loop0' for 23130112 bytes +rauc-Message: Found handler for image type 'ext4' and slot type 'ext4' +rauc-Message: Marking target slot rootfs.1 as non-bootable (bad)... +rauc-Message: Updating /dev/mmcblk0p3 with /run/rauc/bundle/rootfs.ext4 + 46% Copying image to rootfs.1 16:03:59 + 99% Copying image to rootfs.1 16:04:03 + 99% Copying image to rootfs.1 done. 16:04:07 (a 4 s pause at 99%, then done) +rauc-Message: Marking target slot rootfs.1 as bootable (active/primary)... +rauc-event-Message: Installation ae7f3851 succeeded +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=B A +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 +# rauc status +Booted from: rootfs.0 (/dev/mmcblk0p2) +Activated: rootfs.1 (B) +x [rootfs.1] (/dev/mmcblk0p3, ext4, inactive) bootname: B boot status: good +o [rootfs.0] (/dev/mmcblk0p2, ext4, booted) bootname: A boot status: good + +--- install 2, the same bundle, while slot B was pending (16:07:23) ---------------------- +# rauc install /data/b.raucb +rauc-Message: Verified detached signature by ... +rauc-Message: Marking target slot rootfs.1 as non-bootable (bad)... +rauc-Message: Updating /dev/mmcblk0p3 with /run/rauc/bundle/rootfs.ext4 + 99% Copying image to rootfs.1 done. 16:07:33 +rauc-Message: Marking target slot rootfs.1 as bootable (active/primary)... +rauc-event-Message: Installation 55ad70bc succeeded +Installing `/data/b.raucb` succeeded +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=B A +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 + +--- reboot (16:07:47) --------------------------------------------------------------------- +# reboot +Stopping network: ... OK +Seeding 256 bits without crediting +Saving 256 bits of creditable seed for next boot +umount: devtmpfs busy - remounted read-only +[16:08:49] U-Boot SPL 2026.07 ... +[16:08:51] OTA: booting slot B, 2 attempts left +[16:08:53] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait +[ 0.213235] squashfs: version 4.0 (2009/01/31) Phillip Lougher +[ 0.467435] omap_rtc 44e3e000.rtc: already running +[ 0.469171] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:08:14 UTC (946685294) +[ 2.792716] EXT4-fs (mmcblk0p3): mounted filesystem ... ro with ordered data mode. +[ 3.093391] EXT4-fs (mmcblk0p4): mounted filesystem ... r/w with ordered data mode. +ota-clock: clock was 2000-01-01 00:08:17 UTC, raised to image build time 2026-10-29 08:46:19 UTC +Seeding 256 bits and crediting +Starting network: ... OK +[ 8.802979] cpsw-switch 4a100000.switch eth0: Link is Up - 100Mbps/Full - flow control off +Starting crond: OK +[16:09:00] ota-health: slot B confirmed good +beaglebone-black login: root +# cat /etc/build-info +BOARD=beaglebone_black +VERSION=40a54ec +BUILDROOT=2026.08-274-gd6061d653d +BUILD_DATE=1793263579 + +--- reading it -------------------------------------------------------------------------- +1. T029's core holds. A bundle fetched over the static address, installed from /data, written to + the other slot in about 8 s, BOOT_ORDER becomes "B A" with both counters at 3, the next boot + takes slot B (root=/dev/mmcblk0p3), the running system is the new version (VERSION=40a54ec, + the bundle's) and health confirms it. SC-001's "one command plus one reboot" is met. +2. T028 FAILS as the image stood. Install 2 ran while slot B was pending and was not refused: + RAUC marked B bad, rewrote it, and marked it active again. FR-009 asks for a refusal that + names the pending state. The target of a second install is the slot that the next reboot + will select, so this is not harmless in general, only here because the content was identical. + RAUC only refuses to write the slot that is running. Fixed with a pre-install handler + (T048), which needs the fixed image on the device before it can be shown. +3. The clock: the RTC was already running (a warm reboot keeps it counting from 2000-01-01), and + ota-clock still raised it to the build time of the slot that booted. Slot B's build time is + later than slot A's, so an update also moves the floor forward. +4. Not in this capture, still needed for T029: `rauc status` and `fw_printenv` after the reboot + (B booted and good, A still holding the previous version, BOOT_B_LEFT back at 3) and + `cat /data/keep` (the marker, SC-006). +5. Boot time, coarse (one-second host timestamps): SPL banner 16:08:49 to the login prompt + 16:09:00 is about 11 s, against the budget of 12.65 s. T043 must still measure it with + grabserial. +6. Two things seen at the reboot that this feature did not cause and did not fix: + "umount: devtmpfs busy - remounted read-only", and a new "PM: Cannot get wkup_m3_ipc handle" + about 6.4 s in, a few lines before the wkup_m3 firmware boots normally. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index fc4c40a..d0abd71 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -468,10 +468,12 @@ minimal image, not a defect of RAUC. | `mountprefix=/run/rauc` in `[system]` | the default `/mnt/rauc` is on the read-only slot | `system.conf` | | `CONFIG_SQUASHFS=y`, `CONFIG_SQUASHFS_ZLIB=y` | a plain bundle is a gzip squashfs, mounted with `mount(2)` | `linux.config` | | `CONFIG_BLK_DEV_LOOP=y` and `/dev/loop-control` | RAUC attaches the bundle to a loop device itself | already built in | +| `[handlers] pre-install` | RAUC refuses only to write the slot that is running, so a second install onto a pending slot is accepted and rewrites it (FR-009, found by T028) | `system.conf`, `/usr/lib/ota/pre-install` | -Still unproven, because the install has not got past the mount: the write into the other slot -(a 128 MiB ext4 image into a 512 MiB partition), the `BOOT_ORDER` update through `fw_setenv`, and -RAUC's status file on `/data`. +**Proven on the third attempt** (`docs/logs/t029-install-and-switch.log`): the write into the other +slot (a 128 MiB ext4 image into a 512 MiB partition, about 8 s), the `BOOT_ORDER` update, the boot +of the new slot and its health confirmation. Not yet shown: RAUC's status file on `/data` after an +install, and `rauc status` after the reboot. ## Consequences for the spec diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 0567a6e..8e1c26d 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -222,9 +222,12 @@ holds the previous one. and the stubs had assumed the latter. Fixed by taking the slot whose state is `booted`. **Confirmed on the second boot (`520f1aa`)**: `slot A confirmed good`, `BOOT_A_LEFT=3`. Only the confirm path is proven on hardware; the refuse and last-resort paths are host-tested) -- [ ] T028 [US2] Verify: with an update installed and not yet confirmed, a second `rauc install` is +- [ ] T028 [US2] Verify (hardware): with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards - (FR-009) + (FR-009). **First run, 2026-10-29, failed**: the second install was not refused, it rewrote + the pending slot (`docs/logs/t029-install-and-switch.log`); T048 adds the refusal. Verify again + on an image that has T048, in the state "installed, not yet rebooted", and also with two + `rauc install` started at once - [X] T046 [US2] Implement research R8 option B, approved by the user on 2026-10-28 (FR-033): `board/ota/common/post-build.sh` writes `BUILD_DATE=` to `/etc/build-info`, and `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it, at the start @@ -245,6 +248,14 @@ holds the previous one. boot, ping, and the bundle fetched into `/data` with an identical SHA-256 (`docs/logs/t047-network-and-delivery.log`; only the hash was pasted, so T029's console log should show the rest). Its boot-time effect is measured by T043 +- [X] T048 [US2] Refuse an installation while an earlier update is pending or another one runs + (FR-009), found missing by T028: `board/ota/common/rootfs_overlay/usr/lib/ota/pre-install`, + wired in as `[handlers] pre-install` in the board's `system.conf`. It runs after the bundle is + verified and mounted and before RAUC marks the target slot bad, so a refusal writes nothing. + Pending means RAUC's primary slot is not the running one; a rolled-back device or one on the + last-resort path has nothing pending and can still be updated. Host-checked for five states + (nothing pending, pending, booted into the update, last resort, a second `rauc install` + running); not yet run on the board, which needs the image that contains it - [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so @@ -263,8 +274,11 @@ holds the previous one. Fixed in the board's `system.conf` (`check-purpose=codesign`), which needs the fixed image flashed. **Second attempt**: the signature verified, then the mount of the bundle failed on the read-only slot (`mountprefix=/run/rauc`), and behind it the kernel had no SquashFS - (`CONFIG_SQUASHFS=y`, `_ZLIB=y`), both fixed in `4ae0c69`. T029 is not done until an install - succeeds + (`CONFIG_SQUASHFS=y`, `_ZLIB=y`), both fixed in `4ae0c69`. **Third attempt: it worked** + (`docs/logs/t029-install-and-switch.log`): install in about 8 s, `BOOT_ORDER="B A"`, boot of slot + B, the bundle's `VERSION`, health confirmed. Not yet shown, so T029 stays open: `rauc status` + and `fw_printenv` after the reboot (A still holds the previous version, B good, `BOOT_B_LEFT` + back at 3) and `/data/keep` unchanged (SC-006) - [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of From bc41cc3a2424021d9143abe357ce982d38d0c061 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 16:36:25 +0700 Subject: [PATCH 31/61] docs: FR-009 holds on hardware, and the handler arrived over the air The second install, run while slot B was pending, is refused with the pending slot named, before anything is written, and the status is unchanged. The handler reached the board inside a bundle, not by reflashing. T028 and T029 are done. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t028-refused-while-pending.log | 66 ++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 18 ++++--- 2 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 docs/logs/t028-refused-while-pending.log diff --git a/docs/logs/t028-refused-while-pending.log b/docs/logs/t028-refused-while-pending.log new file mode 100644 index 0000000..eb891ae --- /dev/null +++ b/docs/logs/t028-refused-while-pending.log @@ -0,0 +1,66 @@ +FR-009 on hardware, 2026-10-29. The board had been updated over the air to bundle 1c7e147, which +contains the pre-install handler (T048): the bundle was installed into slot A while B ran, and the +board rebooted into A. Before that, the running slot B (40a54ec) had no handler in its system.conf, +which is the expected state and not a reason to reflash. Console capture by the user. + +EXCERPT. Omitted, nothing else edited: the repeated "NN% Copying image to rootfs.1" progress lines, +and the first screen of `cat /etc/rauc/system.conf`, which scrolled and is partly garbled in the +capture; its [handlers] section reads as below. + +--- the booted slot has the handler ------------------------------------------------------ +# cat /etc/rauc/system.conf +mountprefix=/run/rauc +[handlers] +pre-install=/usr/lib/ota/pre-install +[keyring] +check-purpose=codesign +# rauc status +Booted from: rootfs.0 (/dev/mmcblk0p2) +Activated: rootfs.0 (A) + rootfs.1 (B) boot status: good rootfs.0 (A, booted) boot status: good +# cat /data/keep +marker + +--- install 1 of bundle 1c7e147 (16:32:51): nothing pending, so the handler lets it through --- +# rauc install /data/b.raucb +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +rauc-Message: Mounting bundle '/data/b.raucb' to '/run/rauc/bundle' +rauc-Message: Starting pre install handler: /usr/lib/ota/pre-install 16:32:52 +rauc-Message: Marking target slot rootfs.1 as non-bootable (bad)... 16:32:53 (one second later) +rauc-Message: Updating /dev/mmcblk0p3 with /run/rauc/bundle/rootfs.ext4 + 99% Copying image to rootfs.1 done. 16:33:02 +rauc-Message: Marking target slot rootfs.1 as bootable (active/primary)... +rauc-event-Message: Installation 4934e1e2 succeeded + +--- install 2, same bundle, slot B now pending (16:33:05): refused -------------------------- +# rauc install /data/b.raucb +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +rauc-Message: Mounting bundle '/data/b.raucb' to '/run/rauc/bundle' +rauc-Message: Starting pre install handler: /usr/lib/ota/pre-install 16:33:06 +Error: an update is pending: slot B is installed and will boot next, but slot A is running; reboot first, or let the pending update fail and roll back +# ota-pre-install: refused: an update is pending: slot B is installed and will boot next, but slot A is running; reboot first, or let the pending update fail and roll back +rauc-event-Message: Installation e0863128 failed: Pre-install handler error: Child process exited with code 1 +Installing `/data/b.raucb` failed +# rauc status +Booted from: rootfs.0 (/dev/mmcblk0p2) +Activated: rootfs.1 (B) + rootfs.1 (B) boot status: good rootfs.0 (A, booted) boot status: good + +--- reading it -------------------------------------------------------------------------- +1. FR-009's first condition holds on the board. The refusal names the pending state and both + slots, happens after the signature check and the mount and before "Marking target slot ... + bad", so nothing was written: the second attempt has no "Marking" and no "Updating" line, and + `rauc status` afterwards is the one from before it (Activated rootfs.1 (B), both good). +2. The handler costs about one second of an install, and it does not get in the way when + nothing is pending (install 1). +3. The update changed the device's own configuration and its install logic over the air: the + handler arrived inside a bundle, and was in force from the first boot of the slot that + carried it. That was the point of the whole mechanism, shown on something other than the + version string. +4. SC-006 on the board: /data/keep, written before the first install, still reads "marker" + after two installs and two reboots, and /data/rauc.status now exists (the "Failed to load + system status" line is gone from rauc status). +5. The message is printed twice (RAUC's "Error: ..." from the protocol line and the "# ..." + echo). Cosmetic, left as it is: a change would need another over-the-air update to show. +6. Not shown on hardware: the second condition (two installs at once; host-checked only), and + `fw_printenv` after the refusal. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 8e1c26d..eed1226 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -222,12 +222,15 @@ holds the previous one. and the stubs had assumed the latter. Fixed by taking the slot whose state is `booted`. **Confirmed on the second boot (`520f1aa`)**: `slot A confirmed good`, `BOOT_A_LEFT=3`. Only the confirm path is proven on hardware; the refuse and last-resort paths are host-tested) -- [ ] T028 [US2] Verify (hardware): with an update installed and not yet confirmed, a second `rauc install` is +- [X] T028 [US2] Verify (hardware): with an update installed and not yet confirmed, a second `rauc install` is refused with a message naming the pending state and `rauc status` is unchanged afterwards (FR-009). **First run, 2026-10-29, failed**: the second install was not refused, it rewrote the pending slot (`docs/logs/t029-install-and-switch.log`); T048 adds the refusal. Verify again on an image that has T048, in the state "installed, not yet rebooted", and also with two - `rauc install` started at once + `rauc install` started at once. **Passed for the pending condition**, on `1c7e147` which was + itself installed over the air: the second install is refused, names slot B as pending and slot + A as running, writes nothing, and `rauc status` is unchanged + (`docs/logs/t028-refused-while-pending.log`). Two installs at once is host-checked only - [X] T046 [US2] Implement research R8 option B, approved by the user on 2026-10-28 (FR-033): `board/ota/common/post-build.sh` writes `BUILD_DATE=` to `/etc/build-info`, and `board/ota/common/rootfs_overlay/etc/init.d/S00ota-clock` raises the clock to it, at the start @@ -255,8 +258,8 @@ holds the previous one. Pending means RAUC's primary slot is not the running one; a rolled-back device or one on the last-resort path has nothing pending and can still be updated. Host-checked for five states (nothing pending, pending, booted into the update, last resort, a second `rauc install` - running); not yet run on the board, which needs the image that contains it -- [ ] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, + running); the pending case confirmed on the board (T028) +- [X] T029 [US2] Verify (hardware): quickstart scenario 3 — **preparation, decided in research R8, do not re-ask**: deliver the bundle with `python3 -m http.server` on the host and `udhcpc -i eth0` plus `wget -O /data/.raucb` on the board (no defconfig change, so SC-008 is untouched by the delivery path). The board has its address from the image (T047): @@ -276,9 +279,10 @@ holds the previous one. the read-only slot (`mountprefix=/run/rauc`), and behind it the kernel had no SquashFS (`CONFIG_SQUASHFS=y`, `_ZLIB=y`), both fixed in `4ae0c69`. **Third attempt: it worked** (`docs/logs/t029-install-and-switch.log`): install in about 8 s, `BOOT_ORDER="B A"`, boot of slot - B, the bundle's `VERSION`, health confirmed. Not yet shown, so T029 stays open: `rauc status` - and `fw_printenv` after the reboot (A still holds the previous version, B good, `BOOT_B_LEFT` - back at 3) and `/data/keep` unchanged (SC-006) + B, the bundle's `VERSION`, health confirmed. Done, with one reading to be careful of: the install, `BOOT_ORDER="B A"`, the + boot of the new slot, its `VERSION`, health, and `/data/keep` unchanged after two installs and + two reboots (SC-006) are all on record (`t029-*.log`, `t028-*.log`). `rauc status` prints + boot status, not versions; the per-slot versions are `rauc status --detailed`, asked of T039 - [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of From 40f5569cd8209a395abd07d19162940902b16124 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:01:41 +0700 Subject: [PATCH 32/61] docs: power loss before the first boot passes, and the procedure for the cut trials The pending state survives a pulled plug and the new slot boots and confirms. Scenario 4 now says what to install (an older bundle, so the previous version is distinguishable), the five points to cut at, and what to check after each. Co-Authored-By: Claude Sonnet 5.5 --- .../edge-power-loss-before-first-boot.log | 16 ++++++++++ specs/002-ab-ota-rauc/quickstart.md | 31 +++++++++++++++++-- specs/002-ab-ota-rauc/tasks.md | 6 +++- 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 docs/logs/edge-power-loss-before-first-boot.log diff --git a/docs/logs/edge-power-loss-before-first-boot.log b/docs/logs/edge-power-loss-before-first-boot.log new file mode 100644 index 0000000..324c0cc --- /dev/null +++ b/docs/logs/edge-power-loss-before-first-boot.log @@ -0,0 +1,16 @@ +Edge case "power loss between installation and first boot of the new slot", 2026-10-29. + +NOT a console capture: the user reported the result in a sentence. What is recorded is that +sentence, and nothing in it was observed by the person writing this file. + +State before: bundle 1c7e147 installed over the air into slot B while slot A (also 1c7e147, +installed earlier) was running. BOOT_ORDER "B A", slot B pending, never booted. The user pulled +the power instead of typing reboot, then powered the board on. + +Reported: U-Boot chose slot B; "ota-health: slot B confirmed good"; /etc/build-info shows +VERSION=1c7e147. + +What it shows: the pending state survives an unclean power loss. The boot-selection state was +written before the loss and read after it, the new slot booted, and health confirmed it. It does +not show the version change, because slots A and B held the same revision at that point, so the +evidence is that B was chosen, not what B contained. Not reported: fw_printenv after the loss. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 509abdf..3cab488 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -81,16 +81,41 @@ with a message naming the pending state, and `rauc status` must be unchanged aft ## 4. Power loss during install never costs the device — SC-002 -Five trials. Start `rauc install`, cut power at a different point each time (early, mid-write, -near the end), then power on normally: +Five trials. The bundle installed must be a *different* revision from the running one, or "the +previous version" cannot be told from a half-written new one. Run the newest image and install an +older bundle (a downgrade is permitted); keep it on the host in its own directory and serve that +directory. On the board, once: `wget -O /data/old.raucb http://192.168.0.1:8000/.raucb` and +check the SHA-256. + +Each trial: start `rauc install /data/old.raucb`, watch the console, and **pull the power** (not +`reboot`, not `sysrq`) when the point below is on screen. The last progress line before the board +goes silent is the point of interruption; keep the whole serial capture, not a copy of the answers. + +| Trial | Cut at | +|---|---| +| 1 | within a second of pressing Enter: before or during `Verifying signature` | +| 2 | right after `Marking target slot ... as non-bootable (bad)` (about 40%) | +| 3 | mid-write, about 50% `Copying image` | +| 4 | late in the write, about 90% | +| 5 | in the pause at 99%, before `Copying image ... done` (about 4 s) | + +Optional sixth, different outcome: right after `Marking target slot ... as bootable`. The install +has completed by then, so the board correctly boots the *new* version; this is not a failure. + +After each, power on and let it boot with no hand on the keyboard until the login prompt: ```sh cat /etc/build-info # the PREVIOUS version, every time rauc status # booted the previously good slot, good mount | grep ' / ' # ro, intact +fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT # the interrupted slot is not in BOOT_ORDER +cat /data/keep # unchanged ``` -Five out of five must pass. Record the point of interruption per trial. +The console must also show `OTA: booting slot ` and `ota-health: ... confirmed good`. +Trials chain without cleanup: the pre-install handler lets a device with nothing pending install +again, whatever the other slot holds. Five out of five must pass. Finish with one uninterrupted +install of the same bundle: a slot left half-written must take a good install (FR-015). ## 5. A broken update rolls back by itself — SC-003, FR-013..FR-015 diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index eed1226..cf42f03 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -286,7 +286,11 @@ holds the previous one. - [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of - interruption per trial + interruption per trial. **Install a bundle of a different, older revision** than the running + one, or the check "previous version reported" cannot tell the old slot from a half-written new + one; the procedure and the five cut points are in quickstart scenario 4. The edge case "power + loss between installation and first boot" passed on 2026-10-29, as the user reported it + (`docs/logs/edge-power-loss-before-first-boot.log`) (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From 92e82b4897cacd74798608c0a17eb9500eef6f39 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:43:30 +0700 Subject: [PATCH 33/61] docs: T030 trial 1 passes, and says how early it was cut The plug came out inside the pre-install handler, before the slot was marked bad, so nothing had been written. The previous version boots and the data is intact; the windows that could hurt are trials 2 to 5. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t030-power-cut-trials.log | 52 +++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 4 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 docs/logs/t030-power-cut-trials.log diff --git a/docs/logs/t030-power-cut-trials.log b/docs/logs/t030-power-cut-trials.log new file mode 100644 index 0000000..77631b5 --- /dev/null +++ b/docs/logs/t030-power-cut-trials.log @@ -0,0 +1,52 @@ +T030 (SC-002): power pulled during `rauc install`, five trials, one section per trial. +Procedure and cut points: quickstart scenario 4. Board running slot B, revision 1c7e147; the bundle +being installed is the older 40a54ec (SHA-256 1be834f0d8ebe717709b3080d5133fe25466f4629798da9bd3ea69f9f3ae70a6), +so "the previous version" is distinguishable from a half-written new one. Console capture by the user. +EXCERPT per trial: the kernel and driver messages of the reboot are omitted, nothing else is edited. + +========================================================================================== +TRIAL 1, 2026-10-29. Point of interruption: right after "Starting pre install handler" +========================================================================================== +# rauc install /data/old.raucb +rauc-Message: Active slot bootname: '/dev/mmcblk0p3' +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +rauc-Message: Mounting bundle '/data/old.raucb' to '/run/rauc/bundle' + 40% Determining target install group done. +rauc-Message: 10:03:59.522: Starting pre install handler: /usr/lib/ota/pre-install [17:39:59] <- last line + (the console is silent from here; "CCCCCCCC" at 17:40:31 is line noise as the board is powered up again) +[17:40:35] U-Boot SPL 2026.07 ... +[17:40:35] Loading Environment from MMC... Reading from redundant MMC(0)... OK +[17:40:36] OTA: booting slot B, 2 attempts left +[ 3.153291] EXT4-fs (mmcblk0p4): recovery complete +ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-29 09:15:01 UTC +ota-health: slot B confirmed good +# rauc status +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.1 (B) + rootfs.1 (B, booted) boot status: good rootfs.0 (A, inactive) boot status: good +# cat /etc/build-info +VERSION=1c7e147 +BUILD_DATE=1793265301 +# mount | grep ' / ' +/dev/root on / type ext4 (ro,relatime) +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=B A +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 +# cat /data/keep +marker + +--- reading it -------------------------------------------------------------------------- +Result: PASS, the previous version (1c7e147), booted slot, root read-only, data intact. + +How early the cut was: the pre-install handler takes about a second (16:32:52 to :53 in the +FR-009 capture), and nothing follows its start line, so the plug came out inside that second. +That is before "Marking target slot ... as non-bootable (bad)", so nothing had been written +and BOOT_ORDER never changed: this trial shows that an install interrupted before its first +write leaves the device exactly as it was. It is the "early" point of the procedure, and by +construction the least dangerous one. The windows that could hurt (after the slot is marked +bad, during the write, in the flush at 99%) are trials 2 to 5. + +Seen and expected: /data replayed its journal ("recovery complete"), which is the unclean +shutdown; U-Boot read the redundant copy of its environment, which is only the other of the +two alternating copies being the newer one. Both boots after the cut behaved normally. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index cf42f03..d0f549a 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -290,7 +290,9 @@ holds the previous one. one, or the check "previous version reported" cannot tell the old slot from a half-written new one; the procedure and the five cut points are in quickstart scenario 4. The edge case "power loss between installation and first boot" passed on 2026-10-29, as the user reported it - (`docs/logs/edge-power-loss-before-first-boot.log`) + (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials: 1 of 5 done, pass** + (`docs/logs/t030-power-cut-trials.log`); trial 1 was cut before the first write, so the + dangerous windows are still ahead (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From d2b6c1aeda5c0ee159b8bcbd13b37a84cf93416d Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:47:02 +0700 Subject: [PATCH 34/61] docs: T030 trial 2 passes, cut a second into the write The previous version boots, the data is intact, and the half-written slot is marked bad, out of BOOT_ORDER and out of attempts. The point on the procedure that a hand cannot reach is replaced by one it can. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t030-power-cut-trials.log | 52 +++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/quickstart.md | 6 ++-- specs/002-ab-ota-rauc/tasks.md | 6 ++-- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/logs/t030-power-cut-trials.log b/docs/logs/t030-power-cut-trials.log index 77631b5..1dac646 100644 --- a/docs/logs/t030-power-cut-trials.log +++ b/docs/logs/t030-power-cut-trials.log @@ -50,3 +50,55 @@ bad, during the write, in the flush at 99%) are trials 2 to 5. Seen and expected: /data replayed its journal ("recovery complete"), which is the unclean shutdown; U-Boot read the redundant copy of its environment, which is only the other of the two alternating copies being the newer one. Both boots after the cut behaved normally. + +========================================================================================== +TRIAL 2, 2026-10-29. Point of interruption: mid-write, at 53% "Copying image to rootfs.0" +========================================================================================== +# rauc install /data/old.raucb +rauc-Message: Active slot bootname: '/dev/mmcblk0p3' +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +rauc-Message: 09:19:28.812: Starting pre install handler: /usr/lib/ota/pre-install +rauc-Message: 09:19:29.761: Marking target slot rootfs.0 as non-bootable (bad)... +rauc-event-Message: 09:19:29.833: Marked slot rootfs.0 as bad +rauc-Message: 09:19:29.850: Updating /dev/mmcblk0p2 with /run/rauc/bundle/rootfs.ext4 + 46% Copying image to rootfs.0 + ... + 53% Copying image to rootfs.0 [17:45:10] <- last line + (silent from here; the next line is the U-Boot banner at 17:45:19) +[17:45:20] Loading Environment from MMC... Reading from MMC(0)... OK +[17:45:21] OTA: booting slot B, 2 attempts left +[ 3.150614] EXT4-fs (mmcblk0p4): recovery complete +ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-29 09:15:01 UTC +ota-health: slot B confirmed good +# cat /etc/build-info +VERSION=1c7e147 +# rauc status +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.1 (B) + rootfs.1 (B, booted) boot status: good rootfs.0 (A, inactive) boot status: bad +# mount | grep ' / ' +/dev/root on / type ext4 (ro,relatime) +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=B +BOOT_A_LEFT=0 +BOOT_B_LEFT=3 +# cat /data/keep +marker + +--- reading it -------------------------------------------------------------------------- +Result: PASS. The previous version boots, the root filesystem is read-only, the data is intact, +and the half-written slot is out of the way: RAUC had marked it bad before the first byte was +written, so it is absent from BOOT_ORDER, has no attempts left, and rauc status calls it bad. +U-Boot never considered it. + +The cut came about one second into the write (46% to 53% is about a second of an eight-second +copy), which is the "early in the write" point. The procedure had asked for "right after Marking +bad", a window of some 80 ms between that line and the first write, which a hand on a plug +cannot hit; the log above shows the order (Marked slot as bad, then Updating) and this trial +shows the state that order leaves behind. quickstart scenario 4 now names the points a hand can +reach. + +Boot-time observation that is not part of the pass/fail: "PM: Cannot get wkup_m3_ipc handle" +appeared at 6.5 s in this boot. It is in the pre-feature baseline logs as well (boot-baseline-run1 +and run4), alternating from boot to boot with "PM: bootloader does not support rtc-only!", so it +is a race in the PM firmware setup and not something this work introduced. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 3cab488..b1d2b2f 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -93,9 +93,9 @@ goes silent is the point of interruption; keep the whole serial capture, not a c | Trial | Cut at | |---|---| -| 1 | within a second of pressing Enter: before or during `Verifying signature` | -| 2 | right after `Marking target slot ... as non-bootable (bad)` (about 40%) | -| 3 | mid-write, about 50% `Copying image` | +| 1 | before the first write: within a second of pressing Enter, during the signature check or the pre-install handler (about 1 s) | +| 2 | early in the write: 46% to 55% `Copying image`, about a second after `Marking ... (bad)`. The 80 ms between that line and the first write is not reachable by hand; the state it leaves is the same | +| 3 | mid-write, about 70% | | 4 | late in the write, about 90% | | 5 | in the pause at 99%, before `Copying image ... done` (about 4 s) | diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index d0f549a..ac657af 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -290,9 +290,9 @@ holds the previous one. one, or the check "previous version reported" cannot tell the old slot from a half-written new one; the procedure and the five cut points are in quickstart scenario 4. The edge case "power loss between installation and first boot" passed on 2026-10-29, as the user reported it - (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials: 1 of 5 done, pass** - (`docs/logs/t030-power-cut-trials.log`); trial 1 was cut before the first write, so the - dangerous windows are still ahead + (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials: 2 of 5 done, both pass** + (`docs/logs/t030-power-cut-trials.log`): 1 before the first write, 2 about a second into the + write (53%). Still to do: about 70%, about 90%, and the pause at 99% (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From 4686f1c0004965263139ab17d70668623d6580cf Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:52:12 +0700 Subject: [PATCH 35/61] docs: T030 trial 5 passes, cut in the pause at 99% The plug came out between the last progress line and "done", the window where the image may be complete in the slot but the slot is not yet active. The previous version boots, the data is intact, and the slot stays out of BOOT_ORDER. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t030-power-cut-trials.log | 42 +++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 5 ++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/docs/logs/t030-power-cut-trials.log b/docs/logs/t030-power-cut-trials.log index 1dac646..7eed0a2 100644 --- a/docs/logs/t030-power-cut-trials.log +++ b/docs/logs/t030-power-cut-trials.log @@ -102,3 +102,45 @@ Boot-time observation that is not part of the pass/fail: "PM: Cannot get wkup_m3 appeared at 6.5 s in this boot. It is in the pre-feature baseline logs as well (boot-baseline-run1 and run4), alternating from boot to boot with "PM: bootloader does not support rtc-only!", so it is a race in the PM firmware setup and not something this work introduced. + +========================================================================================== +TRIAL 5, 2026-10-29. Point of interruption: the pause at 99%, before "Copying image ... done" +========================================================================================== + 97% Copying image to rootfs.0 + 98% Copying image to rootfs.0 + 99% Copying image to rootfs.0 [17:48:27] <- last line + (silent from here; the next line is the U-Boot banner at 17:48:46) +[17:48:47] Loading Environment from MMC... Reading from MMC(0)... OK +[17:48:48] OTA: booting slot B, 2 attempts left +[ 3.148538] EXT4-fs (mmcblk0p4): recovery complete +ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-29 09:15:01 UTC +ota-health: slot B confirmed good +# cat /etc/build-info +VERSION=1c7e147 +# rauc status +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.1 (B) + rootfs.1 (B, booted) boot status: good rootfs.0 (A, inactive) boot status: bad +# mount | grep ' / ' +/dev/root on / type ext4 (ro,relatime) +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=B +BOOT_A_LEFT=0 +BOOT_B_LEFT=3 +# cat /data/keep +marker + +--- reading it -------------------------------------------------------------------------- +Result: PASS, same state as trial 2: previous version, root read-only, data intact, A bad and +out of BOOT_ORDER. + +This is the window that was worth most. In the uninterrupted installs the copy reaches 99% and +then RAUC waits about four seconds before it prints "done" and marks the slot active (16:04:03 +to 16:04:07, 16:07:29 to 16:07:33, 16:32:57 to 16:33:02); that is the data being pushed to the +card. The plug came out inside that wait: the last line is the 99% one and no "done" follows +it. At that moment slot A may hold all of the new image or part of it, and has not been marked +active. It does not matter which, because the slot was marked bad before the first byte and +only "Marking ... as bootable" can change that. + +Not in this record: trials 3 (about 70%) and 4 (about 90%). The user reported "trial 5"; no log +of 3 or 4 has been pasted, and none is assumed. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index ac657af..18cbaa6 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -290,9 +290,10 @@ holds the previous one. one, or the check "previous version reported" cannot tell the old slot from a half-written new one; the procedure and the five cut points are in quickstart scenario 4. The edge case "power loss between installation and first boot" passed on 2026-10-29, as the user reported it - (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials: 2 of 5 done, both pass** + (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials recorded: 3 of 5, all pass** (`docs/logs/t030-power-cut-trials.log`): 1 before the first write, 2 about a second into the - write (53%). Still to do: about 70%, about 90%, and the pause at 99% + write (53%), 5 in the pause at 99%. No log yet for 3 (about 70%) or 4 (about 90%), and then the + closing uninterrupted install (FR-015) (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From c06c6e80a24dfc8e6014823fa8fda393cacb3bea Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:53:18 +0700 Subject: [PATCH 36/61] docs: close T030 with three trials run and two waived by the user Trials 1, 2 and 5 pass. Trials 3 and 4 were not run; the record says so instead of counting them, and notes that SC-002's five of five is not shown as written. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t030-power-cut-trials.log | 22 ++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 12 +++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/docs/logs/t030-power-cut-trials.log b/docs/logs/t030-power-cut-trials.log index 7eed0a2..c2edab6 100644 --- a/docs/logs/t030-power-cut-trials.log +++ b/docs/logs/t030-power-cut-trials.log @@ -144,3 +144,25 @@ only "Marking ... as bootable" can change that. Not in this record: trials 3 (about 70%) and 4 (about 90%). The user reported "trial 5"; no log of 3 or 4 has been pasted, and none is assumed. + +========================================================================================== +DECISION, 2026-10-29: trials 3 and 4 are not run +========================================================================================== +The user decided to stop after three trials and not to run the other two ("I only tested three +times, no need to test more; count 3 and 4 as pass"). + +What this record therefore says, and does not say: +- Run and passed: trial 1 (before the first write), trial 2 (a second into the write, 53%), + trial 5 (in the pause at 99%). That is 3 of 3. +- Not run: trial 3 (about 70%) and trial 4 (about 90%). They have no result. They are recorded + as waived by the user's decision, not as passed, and SC-002's "5 of 5 trials" is NOT + demonstrated as written. +- Why the waiver is a reasonable one, offered as an argument and not as evidence: trials 2 and 5 + already bracket the write, and in every one of them the slot was marked bad before the first + byte, so the device's state after a cut at 70% or 90% is the same state trial 2 and trial 5 + left behind. The three runs covered the three distinct situations (nothing written, writing, + flushing); the two skipped points fall inside the second. +- Not covered by this task either way: the closing uninterrupted install of the same bundle, + which shows that a slot left bad and half-written takes a good install (FR-015). It is also + an acceptance scenario of User Story 3, so the hardware tasks of that story are where it + will be seen. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 18cbaa6..c2196b8 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -283,17 +283,19 @@ holds the previous one. boot of the new slot, its `VERSION`, health, and `/data/keep` unchanged after two installs and two reboots (SC-006) are all on record (`t029-*.log`, `t028-*.log`). `rauc status` prints boot status, not versions; the per-slot versions are `rauc status --detailed`, asked of T039 -- [ ] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different +- [X] T030 [US2] Verify (hardware): quickstart scenario 4 — five trials cutting power at a different point of the installation; every trial must boot the previous version to a login prompt with the previous version reported and the root filesystem intact (SC-002). Record the point of interruption per trial. **Install a bundle of a different, older revision** than the running one, or the check "previous version reported" cannot tell the old slot from a half-written new one; the procedure and the five cut points are in quickstart scenario 4. The edge case "power loss between installation and first boot" passed on 2026-10-29, as the user reported it - (`docs/logs/edge-power-loss-before-first-boot.log`). **Trials recorded: 3 of 5, all pass** - (`docs/logs/t030-power-cut-trials.log`): 1 before the first write, 2 about a second into the - write (53%), 5 in the pause at 99%. No log yet for 3 (about 70%) or 4 (about 90%), and then the - closing uninterrupted install (FR-015) + (`docs/logs/edge-power-loss-before-first-boot.log`). **Closed with a waiver, 2026-10-29: 3 of 5 + trials run, all 3 pass** (`docs/logs/t030-power-cut-trials.log`): 1 before the first write, 2 + about a second into the write (53%), 5 in the pause at 99%. Trials 3 (about 70%) and 4 (about + 90%) were **not run**: the user decided to stop at three. They are waived, not passed, and + SC-002's "5 of 5" is not demonstrated as written. The closing uninterrupted install (FR-015) + is left to User Story 3's hardware tasks (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From 80f7af50ffecca258eb5bade3ff629a1aa65c905 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 17:56:14 +0700 Subject: [PATCH 37/61] docs: a slot left bad by the cut trials takes the next install (FR-015) The closing install put 40a54ec into the half-written slot A: BOOT_ORDER "A B", counter back at 3, boots, confirmed good, reports the older version. Also records that booting an older image lowers the clock floor, and that boot time is close to its budget and needs a proper measurement. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t030-power-cut-trials.log | 52 +++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 5 +-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/docs/logs/t030-power-cut-trials.log b/docs/logs/t030-power-cut-trials.log index c2edab6..bb230d0 100644 --- a/docs/logs/t030-power-cut-trials.log +++ b/docs/logs/t030-power-cut-trials.log @@ -166,3 +166,55 @@ What this record therefore says, and does not say: which shows that a slot left bad and half-written takes a good install (FR-015). It is also an acceptance scenario of User Story 3, so the hardware tasks of that story are where it will be seen. + +========================================================================================== +CLOSING INSTALL, 2026-10-29: an uninterrupted install into the slot the trials left bad (FR-015) +========================================================================================== +The user ran this although the decision above had stopped the trials; it is not one of the five. +State before: running slot B (1c7e147); slot A bad, out of BOOT_ORDER (BOOT_A_LEFT=0), and left +half-written by the cut trials. Bundle 40a54ec, the same one the trials interrupted. + +# rauc install /data/old.raucb +rauc-Message: Active slot bootname: '/dev/mmcblk0p3' +rauc-Message: 09:20:06.776: Starting pre install handler: /usr/lib/ota/pre-install (allowed: nothing pending) +rauc-Message: 09:20:07.548: Marking target slot rootfs.0 as non-bootable (bad)... +rauc-Message: 09:20:07.629: Updating /dev/mmcblk0p2 with /run/rauc/bundle/rootfs.ext4 + 99% Copying image to rootfs.0 [17:54:04] + 99% Copying image to rootfs.0 done. [17:54:09] +rauc-Message: 09:20:17.029: Marking target slot rootfs.0 as bootable (active/primary)... +rauc-event-Message: 09:20:17.220: Installation f025809b succeeded +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A B +BOOT_A_LEFT=3 +BOOT_B_LEFT=3 +# rauc status +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.0 (A) + rootfs.1 (B, booted) boot status: good rootfs.0 (A, inactive) boot status: good +# reboot +[17:54:43] OTA: booting slot A, 2 attempts left +Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait +[ 0.467176] omap_rtc 44e3e000.rtc: already running +[ 0.468750] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:05:55 UTC (946685155) +ota-clock: clock was 2000-01-01 00:05:58 UTC, raised to image build time 2026-10-29 08:46:19 UTC +ota-health: slot A confirmed good +# cat /etc/build-info +VERSION=40a54ec +BUILD_DATE=1793263579 + +--- reading it -------------------------------------------------------------------------- +1. FR-015 holds. A slot recorded bad, and left half-written by the cut trials, became eligible + again on the next trusted install (BOOT_ORDER "A B", BOOT_A_LEFT=3, status good), booted, + and confirmed itself. The version it reports is the older bundle's, 40a54ec, which tells it + apart from slot B (1c7e147), so what booted is what was just written and not leftover content. +2. The pre-install handler did not get in the way: with nothing pending (slot B running and + primary) it let the install through, which is what a recovering device needs. +3. A consequence of the clock rule, worth knowing and not a defect: the floor is the running + image's build time, so booting an OLDER image lowers it. The clock here went from slot B's + floor (2026-10-29 09:15:01) to slot A's (08:46:19), half an hour back. A certificate issued + between those two times would be "not yet valid" on the older slot. The development signing + certificate dates from 2026-10-28 05:31, so nothing here is affected; research R8 already + records that a certificate issued after the running image was built is the one gap. +4. Boot time, coarse: the reboot banner at 17:54:41 to the login prompt at 17:54:53 is about 12 s + with one-second timestamps, against a budget of 12.65 s. Closer than the 11 s of the earlier + capture; T043 must measure it with grabserial, three runs, before anything is claimed. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index c2196b8..7bc6d22 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -294,8 +294,9 @@ holds the previous one. trials run, all 3 pass** (`docs/logs/t030-power-cut-trials.log`): 1 before the first write, 2 about a second into the write (53%), 5 in the pause at 99%. Trials 3 (about 70%) and 4 (about 90%) were **not run**: the user decided to stop at three. They are waived, not passed, and - SC-002's "5 of 5" is not demonstrated as written. The closing uninterrupted install (FR-015) - is left to User Story 3's hardware tasks + SC-002's "5 of 5" is not demonstrated as written. The closing uninterrupted install + (FR-015) was run anyway and passed: the slot the trials left bad took the install, booted + and confirmed (`docs/logs/t030-power-cut-trials.log`, last section) (each trial's board cold-boots into 2000; T046 raises the clock at boot, so no step is repeated by hand, and each trial's log must show the `ota-clock:` line) From fb19ed4b84c3b926249d64d30df33652c0d8d190 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 18:02:40 +0700 Subject: [PATCH 38/61] board: arm the watchdog at probe and hand it to a feeder only once confirmed omap_wdt stops the watchdog U-Boot started unless early_enable is set, so nothing could ever reset a hung board: the 253 s idle shell measured by T016. The parameter now comes from the kernel's built-in command line (extending the bootloader's, with the old root= string replaced so it cannot override the slot's), and S99ota-health starts the BusyBox feeder (5 s feed, 30 s margin) only after rauc status mark-good succeeds. A slot that does not confirm is reset about two minutes after boot, and the attempt counter retires it. Host-checked; the reset itself is for the hardware trials of User Story 3. Co-Authored-By: Claude Sonnet 5.5 --- board/ota/beaglebone_black/linux.config | 3 +- .../rootfs_overlay/etc/init.d/S99ota-health | 22 ++++++++++++ .../contracts/boot-interface.md | 25 ++++++++++--- specs/002-ab-ota-rauc/quickstart.md | 33 +++++++++++++---- specs/002-ab-ota-rauc/research.md | 36 +++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 6 +++- 6 files changed, 111 insertions(+), 14 deletions(-) diff --git a/board/ota/beaglebone_black/linux.config b/board/ota/beaglebone_black/linux.config index dbfc12a..f76d7c5 100644 --- a/board/ota/beaglebone_black/linux.config +++ b/board/ota/beaglebone_black/linux.config @@ -38,7 +38,8 @@ CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ATAG_DTB_COMPAT=y -CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200" +CONFIG_CMDLINE="omap_wdt.early_enable=1" +CONFIG_CMDLINE_EXTEND=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health index 8d7b2c5..5804ac9 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -5,9 +5,21 @@ # leaves the slot unconfirmed and says why rather than trying to repair anything. # Nothing here touches the network: a device with no uplink must still confirm a good # update. Board-independent (FR-029); slot names come from RAUC, not from this script. +# +# The hardware watchdog is what turns "never confirmed" into a reset (FR-032). The kernel +# arms it before init and pings it for CONFIG_WATCHDOG_OPEN_TIMEOUT seconds (60); nothing +# claims it until this script does, and only when the slot is confirmed. So a slot that does +# not confirm, or hangs before this point, is reset about two minutes after the kernel +# started, the boot attempt is spent, and U-Boot retires the slot after the third. Once the +# slot is confirmed the BusyBox feeder keeps it alive every WDT_FEED seconds, and a system +# that stops running stops feeding: reset after WDT_MARGIN seconds. Both numbers are in +# specs/002-ab-ota-rauc/contracts/boot-interface.md. DATA=/data LOG="${DATA}/ota-health.log" +WDT_DEV=/dev/watchdog +WDT_FEED=5 +WDT_MARGIN=30 booted= # One line to the console and, if the data area allows it, to the log that outlives the @@ -100,6 +112,16 @@ case "$1" in else echo "ota-health: slot ${booted} confirmed good" fi + + # Only now claim the watchdog: from here the system is alive because this slot proved + # it works. The applet daemonises before it opens the device, so a failure to open it + # cannot be seen from here; the kernel stops pinging 60 s after boot if nobody opens + # it, and the board resets, which is the right outcome for a slot that cannot feed it. + if [ ! -c "${WDT_DEV}" ]; then + record "WATCHDOG MISSING: ${WDT_DEV} does not exist, so a hang cannot be caught" + exit 1 + fi + watchdog -t "${WDT_FEED}" -T "${WDT_MARGIN}" "${WDT_DEV}" ;; stop | restart | reload) ;; *) diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index 4637fae..7c2c415 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -79,12 +79,27 @@ the attempt counter retires the slot (FR-032). | Layer | Behaviour | |---|---| | U-Boot | starts the watchdog, 60 s timeout, as the baseline log shows | -| Kernel | watchdog core and `omap_wdt` built in, not modules, so the early window is covered; `CONFIG_WATCHDOG_OPEN_TIMEOUT` non-zero so the kernel stops covering an unopened watchdog | -| Userspace | the BusyBox `watchdog` applet, started **only** by a successful health check | +| Kernel | `omap_wdt` and the watchdog core built in; **`omap_wdt.early_enable=1`** from the built-in command line (`CONFIG_CMDLINE`, `CONFIG_CMDLINE_EXTEND=y`), without which the driver *stops* the watchdog at probe; `CONFIG_WATCHDOG_OPEN_TIMEOUT=60`, after which the kernel stops pinging a device nobody opened | +| Userspace | the BusyBox `watchdog` applet, `-t 5 -T 30 /dev/watchdog`, started **only** by a successful health check, after `rauc status mark-good` | -The point of the ordering: keeping the device alive depends on userspace that proved itself. Today -`CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 means the kernel pings forever -and a hung device is never reset. +Keeping the device alive depends on userspace that proved itself. Without `early_enable` the kernel +disables the watchdog U-Boot started and nothing ever resets a hung device. + +### Documented reset times (FR-032, SC-014) + +The times start from the point where the watchdog was last fed. Margins are the hardware timeout, 60 s +until userspace takes over and 30 s after. + +| Situation | Reset after | Why | +|---|---|---| +| Kernel hangs or panics (`panic=0`) | at most 60 s | the kernel's pings stop with it | +| Init or `S99ota-health` hangs, or the slot is never confirmed | at most 125 s from kernel start (60 s of kernel pings plus the 60 s margin) | nobody opens the device, so the kernel stops pinging at 60 s | +| A confirmed slot stops working later (feeder killed or hung, system wedged) | at most 30 s | `-T 30`, fed every 5 s | +| Confirmation fails (`NOT CONFIRMED`), or `/dev/watchdog` is missing | at most 125 s from kernel start | the feeder is never started | + +Each reset is a boot attempt spent; with three attempts, a slot that never confirms is retired after +about 6 minutes and U-Boot falls back to the other slot. A slot that does confirm gets its attempts +back, so a single hang costs one reset and the device stays on the slot. ## Build surface diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index b1d2b2f..c6b7664 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -133,17 +133,36 @@ from `/data`. Three trials. ## 6. A hung slot is reset and retired — SC-014, FR-032 -Install a bundle whose health script is made to hang (or whose init stops before `S99ota-health`). -Reboot and leave the board alone: +Two different things are being tested, with the times in `contracts/boot-interface.md`. + +**A. The system stops working after it was confirmed** (the feeder, at most 30 s). On a running, +confirmed slot: + +```sh +ps | grep watchdog # the BusyBox feeder is there +cat /sys/class/watchdog/watchdog0/state # active +killall -9 watchdog # no "magic close": the watchdog stays armed +# expected: the board resets by itself within 30 s, boots the same slot, and confirms it again +``` + +and a hung kernel (`CONFIG_MAGIC_SYSRQ` is on, `panic=0` means it hangs rather than reboots): + +```sh +echo c > /proc/sysrq-trigger # expected: dead console, then a reset within 60 s +``` + +**B. A slot that never confirms is retired** (the attempt counter, 125 s per reset). Install a bundle +whose init is made to hang before `S99ota-health` (the way to make one without a rebuild is to write +a copy of its `rootfs.ext4` with `debugfs -w` and re-sign it), reboot, and leave the board alone: ``` -expect: the watchdog resets the board within the documented window, - each reset spends one attempt, and the device ends on the previous good slot +expect: a reset about two minutes after each boot, BOOT__LEFT counting 3 -> 2 -> 1 -> 0, + then the other slot, good, with nobody touching anything ``` -Three trials. This is the scenario the current image cannot pass at all, because -`CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y` with an open timeout of 0 makes the kernel ping the -watchdog forever — worth capturing a "before" run on the unmodified image to show the difference. +Three trials of B, since that is SC-014; A is the quick check that the feeder is real. A "before" run +of the unmodified image (the build before `early_enable`, whose watchdog is stopped at 0.47 s) shows +the difference: it never resets. ## 7. Untrusted and broken bundles are refused — SC-004, FR-016..FR-019 diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index d0abd71..74ccb0f 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -239,8 +239,44 @@ the watchdog before handing over, whether `omap_wdt` reports the device as alrea `WATCHDOG_HANDLE_BOOT_ENABLED` has anything to take over, and whether the open timeout applies only to a device the kernel itself started. Evidence in `docs/logs/t016-env-agreement.log`. +**What actually kept it from firing (T032, from the driver source; hardware proof is T034):** none +of the three candidates above, but a fourth, and it is in the driver. `omap_wdt_probe()` in +`drivers/watchdog/omap_wdt.c` (lines 271 to 276) does + +```c +if (early_enable) { + omap_wdt_start(&wdev->wdog); + set_bit(WDOG_HW_RUNNING, &wdev->wdog.status); +} else { + omap_wdt_disable(wdev); +} +``` + +`early_enable` is a module parameter that defaults to off, so the driver **stops** the watchdog U-Boot +had started, at about 0.47 s, and registers it as not running. `WATCHDOG_HANDLE_BOOT_ENABLED` then has +nothing to take over, and `WATCHDOG_OPEN_TIMEOUT` is never consulted. The board was unprotected from +the first second of Linux until something opened `/dev/watchdog`; the 253 s idle shell is exactly that. +(The `omap_wdt: ... initial timeout 60 sec` line in the log is the driver's registration message and +says nothing about whether it is running.) + +**Fix:** `omap_wdt.early_enable=1` on the kernel command line, so the driver starts the watchdog at +probe and marks it running, and the core then pings it for `CONFIG_WATCHDOG_OPEN_TIMEOUT` (60 s) and +stops if no one opens the device. The parameter is set with the kernel's own built-in command line, +`CONFIG_CMDLINE="omap_wdt.early_enable=1"` and `CONFIG_CMDLINE_EXTEND=y`, not in the U-Boot +environment: the kernel and the parameter that its driver needs travel in the same slot and are +replaced together by an update, whereas the U-Boot environment sits in the reserved region and no +bundle reaches it. With `EXTEND` the built-in string comes first and U-Boot's `root=` and `console=` +come after it, so they still win; the previous built-in string, `root=/dev/mmcblk0p2 ...`, had to be +replaced, not extended, or a duplicate `root=` would have made slot B boot slot A's root. + +The three reset times that follow from it are in `contracts/boot-interface.md`. + **Alternatives considered**: +- *`early_enable` through U-Boot's `bootargs`*: rejected for the reason above; the U-Boot environment + would need a reflash, or `fw_setenv` on every device, to carry it. +- *Patching the driver's default*: works, and moves the setting into a patch to be rebased on every + kernel bump; the command line does the same without one. - *The `watchdog` package* (in Buildroot, supports test and repair scripts): a better fit once there is an application whose health is worth testing. Today it would only wrap the same checks the init script already makes. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 7bc6d22..652caec 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -319,7 +319,11 @@ previous slot on its own within the documented number of attempts. likelihood), then extend `S99ota-health` to start the BusyBox `watchdog` feeder **only** after `rauc status mark-good` succeeds, and to log the reason to `/data` and leave the feeder stopped when any condition fails, so an unhealthy slot is reset and retired by the attempt counter - (FR-032) + (FR-032). **Cause found in the driver source** (research R5): `omap_wdt` stops the watchdog at + probe unless `omap_wdt.early_enable=1`; set through the built-in command line + (`CONFIG_CMDLINE_EXTEND`), with the old built-in string replaced. The feeder starts only after + `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Not + done until T034 shows a reset on hardware** - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the From bfed9fb1dfae829dc21efb02057df8f815323fa9 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 21:21:11 +0700 Subject: [PATCH 39/61] docs: do not point the watchdog check at a sysfs file this kernel does not have The kernel is built without CONFIG_WATCHDOG_SYSFS, so /sys/class/watchdog/watchdog0 has no state attribute. The feeder is shown through its process and its open file. Co-Authored-By: Claude Sonnet 5.5 --- specs/002-ab-ota-rauc/quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index c6b7664..c379fd3 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -139,8 +139,8 @@ Two different things are being tested, with the times in `contracts/boot-interfa confirmed slot: ```sh -ps | grep watchdog # the BusyBox feeder is there -cat /sys/class/watchdog/watchdog0/state # active +ps | grep '[w]atchdog' # the BusyBox feeder is there +ls -l /proc/$(pidof watchdog)/fd # one of its descriptors is /dev/watchdog0 killall -9 watchdog # no "magic close": the watchdog stays armed # expected: the board resets by itself within 30 s, boots the same slot, and confirms it again ``` From 261208a32ac1af44e3f8c3b70e74d464067d4068 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 21:24:42 +0700 Subject: [PATCH 40/61] docs: the feeder holds /dev/watchdog, as seen on the board Co-Authored-By: Claude Sonnet 5.5 --- specs/002-ab-ota-rauc/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index c379fd3..1a9d706 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -140,7 +140,7 @@ confirmed slot: ```sh ps | grep '[w]atchdog' # the BusyBox feeder is there -ls -l /proc/$(pidof watchdog)/fd # one of its descriptors is /dev/watchdog0 +ls -l /proc/$(pidof watchdog)/fd # descriptor 3 is /dev/watchdog killall -9 watchdog # no "magic close": the watchdog stays armed # expected: the board resets by itself within 30 s, boots the same slot, and confirms it again ``` From c468d985636d97d4b0e074f5382ec46f0b3ecaea Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 21:28:05 +0700 Subject: [PATCH 41/61] docs: the watchdog resets a board whose feeder died, and the command line order is corrected Killing the feeder without the magic close reset the board in 25 s inside the 30 s margin, and the same slot confirmed again. The kernel appends CONFIG_CMDLINE after U-Boot's arguments, so research R5 had the order backwards; CLAUDE.md now says what may go in it. The kernel-hang reset and the never-confirmed scenario are open. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 5 +++ docs/logs/t034-watchdog-feeder-killed.log | 52 +++++++++++++++++++++++ specs/002-ab-ota-rauc/research.md | 10 +++-- specs/002-ab-ota-rauc/tasks.md | 6 ++- 4 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 docs/logs/t034-watchdog-feeder-killed.log diff --git a/CLAUDE.md b/CLAUDE.md index 7536b41..b7dd1fe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -115,6 +115,11 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the created *before* the image is built (this is why `check_keys` refuses to build without the keys); (5) `SOURCE_DATE_EPOCH` is deliberately not the floor, since a commit time can predate the certificate. Rationale and the one known gap: `specs/002-ab-ota-rauc/research.md` R8, FR-033. +- **`CONFIG_CMDLINE` is read last.** The beaglebone kernel uses `CONFIG_CMDLINE_EXTEND`, and + `drivers/of/fdt.c` appends the built-in string *after* what U-Boot passes (the Kconfig help says + the opposite), so on a duplicate the built-in value wins. It carries only `omap_wdt.early_enable=1`, + without which the driver stops the watchdog U-Boot started (research R5). Never put `root=` or + `console=` there: `root=` is set per slot by `uboot-env.txt`, and a built-in one would override it. - **`make check`** compares the regenerated minimal defconfig against the working-tree file in a temp file (never writes `configs/`, never relies on git state). New boards need no CI edits; they are discovered from `configs/`. diff --git a/docs/logs/t034-watchdog-feeder-killed.log b/docs/logs/t034-watchdog-feeder-killed.log new file mode 100644 index 0000000..21ee333 --- /dev/null +++ b/docs/logs/t034-watchdog-feeder-killed.log @@ -0,0 +1,52 @@ +Watchdog, scenario A of quickstart 6, 2026-10-29. Image fb19ed4 installed over the air into slot B +(bundle fb19ed4, sha256 2478d220...4005), the board booted B, confirmed it, and the user killed the +feeder. Console capture by the user; the bracketed prefix is the capturing terminal's clock. +EXCERPT: the kernel and driver messages of the reboot are omitted, nothing else is edited. + +--- before: the feeder holds the watchdog ------------------------------------------------- +# ps | grep '[w]atchdog' + 31 root [watchdogd] + 186 root watchdog -t 5 -T 30 /dev/watchdog +# ls -l /proc/$(pidof watchdog)/fd +l-wx------ 1 root root 64 Oct 29 11:12 3 -> /dev/watchdog + +--- the feeder is killed without the "magic close" ------------------------------------------ +# date; killall -9 watchdog +Thu Oct 29 11:15:24 UTC 2026 [21:25:25] +[ 703.376922] watchdog: watchdog0: watchdog did not stop! [21:25:25] +(the console is silent from here) +U-Boot SPL 2026.07 (Oct 28 2026 - 09:33:19 +0000) [21:25:50] <- 25 s later + +--- after: the same slot, confirmed again ------------------------------------------------ +[21:25:53] OTA: booting slot B, 2 attempts left +Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait omap_wdt.early_enable=1 +[ 0.466578] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[ 0.471839] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T03:37:04 UTC (946697824) +ota-clock: clock was 2000-01-01 03:37:07 UTC, raised to image build time 2026-10-29 11:03:45 UTC +ota-health: slot B confirmed good +# ps | grep '[w]atchdog' + 31 root [watchdogd] + 186 root watchdog -t 5 -T 30 /dev/watchdog + +--- reading it -------------------------------------------------------------------------- +Result: PASS for the feeder half of FR-032. With the userspace feeder gone and the device left armed +("watchdog did not stop!" is the kernel saying the close carried no magic character), the board reset +itself 25 s later, inside the 30 s margin (the last feed was up to 5 s before the kill), booted the same +slot and confirmed it. Nobody touched it; the "ll" at 21:25:50 was typed after the banner appeared. + +Also shown: +1. The kernel carries omap_wdt.early_enable=1 on its command line, from the built-in CONFIG_CMDLINE, + and the slot's root= is still the slot's own (/dev/mmcblk0p3). +2. The kernel command line is the bootloader's arguments FOLLOWED BY the built-in string, not the + other way round (drivers/of/fdt.c appends CONFIG_CMDLINE with strlcat), which is the opposite of + what the Kconfig help says. Research R5 said the built-in string came first and was wrong; it is + corrected there. The consequence is stronger than the text had it: anything in CONFIG_CMDLINE is + read last and wins over U-Boot's root= and console=, so the old built-in "root=/dev/mmcblk0p2" + would have made slot B boot slot A's root filesystem, and it was right to replace it. +3. The ota-health line is printed on the boot that follows the reset, so the watchdog reset did not + leave the slot unconfirmed: a healthy slot that was hit once returns to service on its own. +4. The ota-clock floor is now the build time of fb19ed4 (11:03:45), the running slot's, as designed. + +NOT shown by this capture: the kernel-hang half (echo c > /proc/sysrq-trigger, at most 60 s), and +scenario B (a slot that never confirms is reset about every two minutes and retired after the third +attempt, SC-014). T032 and T034 stay open until those two are on record. diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 74ccb0f..6ccc0ba 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -265,9 +265,13 @@ stops if no one opens the device. The parameter is set with the kernel's own bui `CONFIG_CMDLINE="omap_wdt.early_enable=1"` and `CONFIG_CMDLINE_EXTEND=y`, not in the U-Boot environment: the kernel and the parameter that its driver needs travel in the same slot and are replaced together by an update, whereas the U-Boot environment sits in the reserved region and no -bundle reaches it. With `EXTEND` the built-in string comes first and U-Boot's `root=` and `console=` -come after it, so they still win; the previous built-in string, `root=/dev/mmcblk0p2 ...`, had to be -replaced, not extended, or a duplicate `root=` would have made slot B boot slot A's root. +bundle reaches it. With `EXTEND` the built-in string is appended **after** U-Boot's arguments +(`drivers/of/fdt.c` does `strlcat(cmdline, CONFIG_CMDLINE)`; the Kconfig help says the opposite and is +wrong), so on a duplicate it is read last and wins. The previous built-in string, +`root=/dev/mmcblk0p2 ...`, therefore had to be replaced and not merely extended: left in place it would +have overridden U-Boot's `root=` and made slot B boot slot A's root filesystem. Confirmed on the board: +`... rootwait omap_wdt.early_enable=1`. (An earlier version of this paragraph had the order backwards.) +`CONFIG_CMDLINE` must carry only options that the slot itself owns, never `root=` or `console=`. The three reset times that follow from it are in `contracts/boot-interface.md`. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 652caec..84bb207 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -322,8 +322,10 @@ previous slot on its own within the documented number of attempts. (FR-032). **Cause found in the driver source** (research R5): `omap_wdt` stops the watchdog at probe unless `omap_wdt.early_enable=1`; set through the built-in command line (`CONFIG_CMDLINE_EXTEND`), with the old built-in string replaced. The feeder starts only after - `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Not - done until T034 shows a reset on hardware** + `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Feeder half + shown on hardware, 2026-10-29**: `killall -9 watchdog` reset the board in 25 s and the same slot + confirmed again (`docs/logs/t034-watchdog-feeder-killed.log`). Not done until the kernel-hang + reset and scenario B (SC-014) are on record too - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the From 561f8c851b9c5f5bb99c37154b5903ff4e5f8345 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:06:49 +0700 Subject: [PATCH 42/61] docs: a hung kernel is reset in 24 s, and the table of reset times is split A panic on the confirmed slot was reset by the hardware within the feeder's 30 s margin and the slot confirmed again. The 60 s figure applies only to a kernel that hangs before userspace claims the watchdog; the contract had the two as one row. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t034-watchdog-feeder-killed.log | 32 +++++++++++++++++++ .../contracts/boot-interface.md | 3 +- specs/002-ab-ota-rauc/quickstart.md | 2 +- specs/002-ab-ota-rauc/tasks.md | 9 +++--- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/docs/logs/t034-watchdog-feeder-killed.log b/docs/logs/t034-watchdog-feeder-killed.log index 21ee333..b43cbc2 100644 --- a/docs/logs/t034-watchdog-feeder-killed.log +++ b/docs/logs/t034-watchdog-feeder-killed.log @@ -50,3 +50,35 @@ Also shown: NOT shown by this capture: the kernel-hang half (echo c > /proc/sysrq-trigger, at most 60 s), and scenario B (a slot that never confirms is reset about every two minutes and retired after the third attempt, SC-014). T032 and T034 stay open until those two are on record. + +========================================================================================== +KERNEL HANG, same session. `echo c > /proc/sysrq-trigger` on the confirmed slot B (fb19ed4) +========================================================================================== +# echo c > /proc/sysrq-trigger +[ 2324.430859] sysrq: Trigger a crash [22:04:38] +[ 2324.434653] Kernel panic - not syncing: sysrq triggered crash +[ 2324.440512] ---[ end Kernel panic - not syncing: sysrq triggered crash ]--- +(the console is silent from here: panic=0, so the kernel hangs instead of rebooting) +U-Boot SPL 2026.07 (Oct 28 2026 - 09:33:19 +0000) [22:05:02] <- 24 s later +[22:05:04] OTA: booting slot B, 2 attempts left +Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait omap_wdt.early_enable=1 +ota-clock: clock was 2000-01-01 04:16:19 UTC, raised to image build time 2026-10-29 11:03:45 UTC +ota-health: slot B confirmed good +beaglebone-black login: + +--- reading it -------------------------------------------------------------------------- +Result: PASS. A hung kernel, with no userspace left to do anything, was reset by the hardware in 24 s +without anyone touching the board, and the slot came back and confirmed itself. + +The time is the margin the userspace feeder set (30 s, `-T 30`), not the 60 s of the kernel's own +timeout: once the feeder has claimed the device it also programs the timeout, so a kernel that dies +after confirmation is caught within 30 s of the last feed. The 60 s figure applies to a kernel that +hangs before userspace has claimed the watchdog. contracts/boot-interface.md had them as one row +and is corrected. + +The clock reading in this capture shows the RTC counting across resets (2000-01-01 04:16 at boot, +03:37 at the previous one): the RTC keeps running while the board has power and only the system +clock is reset, which is why ota-clock still has to raise it every boot. + +Still NOT on record: scenario B (a slot that never confirms: a reset about every two minutes, the +attempt counter walking 3 -> 2 -> 1 -> 0, then the other slot; SC-014, three trials). diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index 7c2c415..b6b9d87 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -92,7 +92,8 @@ until userspace takes over and 30 s after. | Situation | Reset after | Why | |---|---|---| -| Kernel hangs or panics (`panic=0`) | at most 60 s | the kernel's pings stop with it | +| Kernel hangs or panics (`panic=0`) after the slot is confirmed | at most 30 s (measured 24 s) | the feeder has set the timeout to 30 s and stops with the kernel | +| Kernel hangs before userspace has claimed the watchdog | at most 60 s | the kernel's own pings stop with it, and the hardware timeout is still the 60 s it started with | | Init or `S99ota-health` hangs, or the slot is never confirmed | at most 125 s from kernel start (60 s of kernel pings plus the 60 s margin) | nobody opens the device, so the kernel stops pinging at 60 s | | A confirmed slot stops working later (feeder killed or hung, system wedged) | at most 30 s | `-T 30`, fed every 5 s | | Confirmation fails (`NOT CONFIRMED`), or `/dev/watchdog` is missing | at most 125 s from kernel start | the feeder is never started | diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 1a9d706..b78fd2c 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -148,7 +148,7 @@ killall -9 watchdog # no "magic close": the watchdog stays arm and a hung kernel (`CONFIG_MAGIC_SYSRQ` is on, `panic=0` means it hangs rather than reboots): ```sh -echo c > /proc/sysrq-trigger # expected: dead console, then a reset within 60 s +echo c > /proc/sysrq-trigger # expected: dead console, then a reset within 30 s (24 s measured) ``` **B. A slot that never confirms is retired** (the attempt counter, 125 s per reset). Install a bundle diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 84bb207..493301e 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -322,10 +322,11 @@ previous slot on its own within the documented number of attempts. (FR-032). **Cause found in the driver source** (research R5): `omap_wdt` stops the watchdog at probe unless `omap_wdt.early_enable=1`; set through the built-in command line (`CONFIG_CMDLINE_EXTEND`), with the old built-in string replaced. The feeder starts only after - `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Feeder half - shown on hardware, 2026-10-29**: `killall -9 watchdog` reset the board in 25 s and the same slot - confirmed again (`docs/logs/t034-watchdog-feeder-killed.log`). Not done until the kernel-hang - reset and scenario B (SC-014) are on record too + `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Shown on + hardware, 2026-10-29**: `killall -9 watchdog` reset the board in 25 s, and a kernel panic + (`echo c > /proc/sysrq-trigger`) in 24 s, each time with the same slot confirming again + (`docs/logs/t034-watchdog-feeder-killed.log`). Not done until scenario B (a slot that never + confirms, SC-014) is on record too - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the From d7c4fb8b69fc66b1bd2b5fc58e938ad07a938163 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:17:32 +0700 Subject: [PATCH 43/61] docs: scenario B reported by the user, with only the last boot captured Records what the end of the console shows and what the user's account adds, and keeps the two apart. The counters, the timing and rauc status are still to come. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t034-watchdog-feeder-killed.log | 26 +++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 7 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/logs/t034-watchdog-feeder-killed.log b/docs/logs/t034-watchdog-feeder-killed.log index b43cbc2..8b3b836 100644 --- a/docs/logs/t034-watchdog-feeder-killed.log +++ b/docs/logs/t034-watchdog-feeder-killed.log @@ -82,3 +82,29 @@ clock is reset, which is why ota-clock still has to raise it every boot. Still NOT on record: scenario B (a slot that never confirms: a reset about every two minutes, the attempt counter walking 3 -> 2 -> 1 -> 0, then the other slot; SC-014, three trials). + +========================================================================================== +SCENARIO B, 2026-10-29, as reported by the user. Bundle fb19ed4-hang installed into slot A +(sha256 deed7d33ad3a7b5259b2ed7f431216a974fba4b2cb775369e86e9484f72ed08d), then rebooted and left alone. +========================================================================================== +NOT a full capture. The user reported: the board tried to boot slot A three times, A never came up, +and the device rolled back to slot B. Only the end of the console was pasted, and it is all this +record contains; the three attempts at A, the time between resets and the counters were not. + +Pasted (the boot that ends the sequence): +[22:16:01] ota-health: slot B confirmed good +beaglebone-black login: root +# cat /etc/build-info +BOARD=beaglebone_black +VERSION=fb19ed4 +BUILD_DATE=1793271825 + +What it shows, and what it does not: +- Shows: the device ends on slot B, confirmed good, running fb19ed4 (the good revision; the hang + bundle is labelled fb19ed4-hang but carries the same /etc/build-info), with nobody at the keyboard. +- Does not show: that the slot tried was A, that it was tried three times, that each failure ended in a + watchdog reset about two minutes after boot (rather than something else), that BOOT_A_LEFT walked + 3 -> 2 -> 1 -> 0, or that rauc status calls A bad. Those are the user's account, not this capture. +Asked for, to turn the account into evidence: fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT and +rauc status now, and the "OTA: booting slot A, N attempts left" lines with their timestamps if the +terminal log has them. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 493301e..310da08 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -325,8 +325,11 @@ previous slot on its own within the documented number of attempts. `mark-good` (host-checked for seven paths; the reset times are in `boot-interface.md`). **Shown on hardware, 2026-10-29**: `killall -9 watchdog` reset the board in 25 s, and a kernel panic (`echo c > /proc/sysrq-trigger`) in 24 s, each time with the same slot confirming again - (`docs/logs/t034-watchdog-feeder-killed.log`). Not done until scenario B (a slot that never - confirms, SC-014) is on record too + (`docs/logs/t034-watchdog-feeder-killed.log`). Scenario B (a slot that never + confirms, SC-014): one trial reported by the user, 2026-10-29, three failed boots of the hanging + slot and a rollback to the good one, with only the final boot captured; the counters, the + timing and `rauc status` are asked for. Not done until that is evidence, and SC-014 asks for + 3 of 3 trials - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the From 2544cfbfa379ad7fa2c9a042387fceb9664c8f44 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:20:18 +0700 Subject: [PATCH 44/61] docs: a slot that never confirms is retired in three resets of 49 s each The full capture of scenario B shows A tried three times with the counter at 2, 1, 0, the watchdog resetting 49 s after each kernel start, and the good slot taking over. The documented 125 s was wrong: the watchdog core gives an unopened watchdog one 60 s window, not 60 s of pings plus another 60 s. The tables and the comment in S99ota-health now say what was measured. Co-Authored-By: Claude Sonnet 5.5 --- .../rootfs_overlay/etc/init.d/S99ota-health | 5 +- docs/logs/t034-watchdog-feeder-killed.log | 58 +++++++++++++++++++ .../contracts/boot-interface.md | 34 ++++++----- specs/002-ab-ota-rauc/quickstart.md | 4 +- specs/002-ab-ota-rauc/research.md | 6 +- specs/002-ab-ota-rauc/tasks.md | 8 +-- 6 files changed, 91 insertions(+), 24 deletions(-) diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health index 5804ac9..c76e56c 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -9,8 +9,9 @@ # The hardware watchdog is what turns "never confirmed" into a reset (FR-032). The kernel # arms it before init and pings it for CONFIG_WATCHDOG_OPEN_TIMEOUT seconds (60); nothing # claims it until this script does, and only when the slot is confirmed. So a slot that does -# not confirm, or hangs before this point, is reset about two minutes after the kernel -# started, the boot attempt is spent, and U-Boot retires the slot after the third. Once the +# not confirm, or hangs before this point, is reset about 50 s after the kernel started +# (the one 60 s window the kernel gives an unopened watchdog), the boot attempt is spent, and +# U-Boot retires the slot after the third. Once the # slot is confirmed the BusyBox feeder keeps it alive every WDT_FEED seconds, and a system # that stops running stops feeding: reset after WDT_MARGIN seconds. Both numbers are in # specs/002-ab-ota-rauc/contracts/boot-interface.md. diff --git a/docs/logs/t034-watchdog-feeder-killed.log b/docs/logs/t034-watchdog-feeder-killed.log index 8b3b836..405d191 100644 --- a/docs/logs/t034-watchdog-feeder-killed.log +++ b/docs/logs/t034-watchdog-feeder-killed.log @@ -108,3 +108,61 @@ What it shows, and what it does not: Asked for, to turn the account into evidence: fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT and rauc status now, and the "OTA: booting slot A, N attempts left" lines with their timestamps if the terminal log has them. + +========================================================================================== +SCENARIO B, full capture, 2026-10-29. The hang bundle (S98hang before S99ota-health) is in slot A; +the board runs slot B and is rebooted. Console capture by the user; host clock in brackets. +========================================================================================== +EXCERPT: per attempt, the U-Boot choice, the kernel start, how far init got, and the next U-Boot banner. + +[22:13:04] # reboot ... Requesting system reboot +attempt 1 +[22:13:07] U-Boot SPL 2026.07 +[22:13:10] OTA: booting slot A, 2 attempts left +[22:13:12] [ 0.000000] Linux ... Kernel command line: ... root=/dev/mmcblk0p2 ro ... omap_wdt.early_enable=1 +[22:13:14] ota-clock: clock was 2000-01-01 04:24:24 UTC, raised to image build time 2026-10-29 11:03:45 UTC +[22:13:18] Starting network: OK / Starting crond: OK +[22:13:28] [ 17.123426] PM: bootloader does not support rtc-only! <- last line; no ota-health, no login prompt +[22:14:01] U-Boot SPL 2026.07 <- 49 s after the kernel's first line +attempt 2 +[22:14:03] OTA: booting slot A, 1 attempts left +[22:14:06] [ 0.000000] Linux ... +[22:14:12] Starting crond: OK +[22:14:15] [ 9.922937] cpsw-switch 4a100000.switch eth0: Link is Up <- last line of the boot +[22:14:55] U-Boot SPL 2026.07 <- 49 s after the kernel's first line +attempt 3 +[22:14:58] OTA: booting slot A, 0 attempts left +[22:15:00] [ 0.000000] Linux ... +[22:15:06] Starting crond: OK +[22:15:16] [ 17.123516] PM: bootloader does not support rtc-only! +[22:15:49] U-Boot SPL 2026.07 <- 49 s after the kernel's first line +the fallback +[22:15:52] OTA: booting slot B, 2 attempts left +[22:15:54] Kernel command line: ... root=/dev/mmcblk0p3 ro ... omap_wdt.early_enable=1 +[22:16:01] ota-health: slot B confirmed good +beaglebone-black login: +# cat /etc/build-info +VERSION=fb19ed4 + +--- reading it -------------------------------------------------------------------------- +Result: the behaviour SC-014 asks for, with nobody at the keyboard after the reboot command. +1. A slot that boots but never confirms is reset by the watchdog, every time: three attempts at A, + the counter reading 2, 1, 0 at U-Boot, then U-Boot skips A and boots B, which confirms. About + 2 min 45 s from the `reboot` to B's login prompt. (A's own rauc status and BOOT_A_LEFT after + the sequence were not captured; the counter U-Boot printed is the evidence for it.) +2. Init got as far as `Starting crond: OK` and no further, which is where S98hang sits (after + S50crond, before S99ota-health): no ota-health line, no login prompt, in any of the three. +3. THE RESET COMES AFTER 49 s, NOT THE "UP TO 125 s" THAT THE CONTRACT SAID. Three attempts, three + times 49 s from the kernel's first line to the next U-Boot banner. The earlier figure was a + mistake in how the kernel's watchdog core works, found by reading it: for a watchdog that is + running but not opened, watchdog_next_keepalive() schedules the last kernel ping at + open_deadline minus the hardware heartbeat, and with CONFIG_WATCHDOG_OPEN_TIMEOUT=60 equal to the + 60 s hardware timeout that last ping is the one at registration. The hardware then expires AT the + open deadline: one 60 s window, not 60 s of pings followed by another 60 s. +4. 49 s measured against 60 s nominal means the watchdog's timer runs about 18% fast (49/60). The + same ratio fits the two earlier tests, taken together: a 30 s margin gave 25 s (killall) and + 24 s (panic) from a feed that was up to 5 s old, so a real margin of about 24.5 s. This is an + inference from five timings, not a measurement of the clock; what is documented is the times. +5. Not shown by this capture: that the slot in A is the hang bundle (its /etc/build-info was not + read; the hang at S98 three times in a row is the evidence), and the per-trial count: this is + one trial of the three that SC-014 asks for. diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index b6b9d87..6b6f0f0 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -87,20 +87,26 @@ disables the watchdog U-Boot started and nothing ever resets a hung device. ### Documented reset times (FR-032, SC-014) -The times start from the point where the watchdog was last fed. Margins are the hardware timeout, 60 s -until userspace takes over and 30 s after. - -| Situation | Reset after | Why | -|---|---|---| -| Kernel hangs or panics (`panic=0`) after the slot is confirmed | at most 30 s (measured 24 s) | the feeder has set the timeout to 30 s and stops with the kernel | -| Kernel hangs before userspace has claimed the watchdog | at most 60 s | the kernel's own pings stop with it, and the hardware timeout is still the 60 s it started with | -| Init or `S99ota-health` hangs, or the slot is never confirmed | at most 125 s from kernel start (60 s of kernel pings plus the 60 s margin) | nobody opens the device, so the kernel stops pinging at 60 s | -| A confirmed slot stops working later (feeder killed or hung, system wedged) | at most 30 s | `-T 30`, fed every 5 s | -| Confirmation fails (`NOT CONFIRMED`), or `/dev/watchdog` is missing | at most 125 s from kernel start | the feeder is never started | - -Each reset is a boot attempt spent; with three attempts, a slot that never confirms is retired after -about 6 minutes and U-Boot falls back to the other slot. A slot that does confirm gets its attempts -back, so a single hang costs one reset and the device stays on the slot. +The watchdog is armed by the kernel at about 0.5 s with a 60 s timeout, and `omap_wdt` expires about 18% +sooner than its nominal figure on this board, so each time below is **nominal, then measured**. The +kernel's watchdog core pings an unopened, running watchdog once, at registration, and arranges for the +hardware to expire at `CONFIG_WATCHDOG_OPEN_TIMEOUT` (60 s); it does not keep it alive until then and +then add another 60 s. + +| Situation | Nominal | Measured | Why | +|---|---|---|---| +| Init, or `S99ota-health`, hangs; or the slot never confirms; or confirmation fails; or `/dev/watchdog` is missing | 60 s from kernel start | **49 s**, three times | nobody opens the device, so the one window that began at registration is all there is | +| Kernel hangs or panics before userspace has claimed the watchdog | 60 s | not measured separately; same window as the row above | the kernel's own timeout | +| Kernel hangs or panics after the slot is confirmed (`panic=0`) | 30 s after the last feed | **24 s** | the feeder set the timeout to 30 s and fed every 5 s | +| A confirmed slot stops working later (feeder killed or hung, system wedged) | 30 s after the last feed | **25 s** | same | + +Each reset spends a boot attempt. A slot that never confirms is retired after three of them, about 49 s +each plus U-Boot and the kernel's start: **2 min 45 s from the `reboot` to the fallback slot's login +prompt**, measured once (`docs/logs/t034-watchdog-feeder-killed.log`). A slot that does confirm gets its +attempts back, so a single hang costs one reset and the device stays on the slot. + +A boot that has not reached `S99ota-health` after about 45 s is reset, so a slot that legitimately needs +longer than that to start would be retired. This image reaches it in about 10 s. ## Build surface diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index b78fd2c..c664999 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -151,12 +151,12 @@ and a hung kernel (`CONFIG_MAGIC_SYSRQ` is on, `panic=0` means it hangs rather t echo c > /proc/sysrq-trigger # expected: dead console, then a reset within 30 s (24 s measured) ``` -**B. A slot that never confirms is retired** (the attempt counter, 125 s per reset). Install a bundle +**B. A slot that never confirms is retired** (the attempt counter, about 50 s per reset). Install a bundle whose init is made to hang before `S99ota-health` (the way to make one without a rebuild is to write a copy of its `rootfs.ext4` with `debugfs -w` and re-sign it), reboot, and leave the board alone: ``` -expect: a reset about two minutes after each boot, BOOT__LEFT counting 3 -> 2 -> 1 -> 0, +expect: a reset about 50 s after each kernel start, BOOT__LEFT counting 3 -> 2 -> 1 -> 0, then the other slot, good, with nobody touching anything ``` diff --git a/specs/002-ab-ota-rauc/research.md b/specs/002-ab-ota-rauc/research.md index 6ccc0ba..e52423f 100644 --- a/specs/002-ab-ota-rauc/research.md +++ b/specs/002-ab-ota-rauc/research.md @@ -260,8 +260,10 @@ the first second of Linux until something opened `/dev/watchdog`; the 253 s idle says nothing about whether it is running.) **Fix:** `omap_wdt.early_enable=1` on the kernel command line, so the driver starts the watchdog at -probe and marks it running, and the core then pings it for `CONFIG_WATCHDOG_OPEN_TIMEOUT` (60 s) and -stops if no one opens the device. The parameter is set with the kernel's own built-in command line, +probe and marks it running. For a running watchdog that nobody has opened, the core then pings once, at +registration, and sets the hardware to expire at `CONFIG_WATCHDOG_OPEN_TIMEOUT` (60 s) after it +(`watchdog_next_keepalive()`); an earlier version of this paragraph had it pinging for 60 s and then +waiting another 60 s, which is wrong and was caught by measuring 49 s on the board. The parameter is set with the kernel's own built-in command line, `CONFIG_CMDLINE="omap_wdt.early_enable=1"` and `CONFIG_CMDLINE_EXTEND=y`, not in the U-Boot environment: the kernel and the parameter that its driver needs travel in the same slot and are replaced together by an update, whereas the U-Boot environment sits in the reserved region and no diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 310da08..b6f56d3 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -326,10 +326,10 @@ previous slot on its own within the documented number of attempts. hardware, 2026-10-29**: `killall -9 watchdog` reset the board in 25 s, and a kernel panic (`echo c > /proc/sysrq-trigger`) in 24 s, each time with the same slot confirming again (`docs/logs/t034-watchdog-feeder-killed.log`). Scenario B (a slot that never - confirms, SC-014): one trial reported by the user, 2026-10-29, three failed boots of the hanging - slot and a rollback to the good one, with only the final boot captured; the counters, the - timing and `rauc status` are asked for. Not done until that is evidence, and SC-014 asks for - 3 of 3 trials + confirms, SC-014): **one trial captured in full, 2026-10-29**: three boots of the hanging slot, + the counter reading 2, 1, 0, a reset 49 s after each kernel start, then the good slot, with + nobody at the keyboard. The first estimate of the reset time (125 s) was wrong and is corrected + (`contracts/boot-interface.md`). SC-014 asks for 3 of 3 trials; 1 has been run - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the From ca79941305abdcd0367babff05fec3ffc9a5ad66 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:25:23 +0700 Subject: [PATCH 45/61] docs: close T032 and T034 with the trials waived, and flag T031's mismatch SC-014 asked for three trials of a slot that never confirms; one was run and the user decided to stop. It is recorded as waived, with the T016 measurement standing in for the unrepeated "before" run. Closing the story also showed that the last-resort path boots slot A, where T031 and the boot contract say the first slot in BOOT_ORDER; noted as open instead of settled either way. Co-Authored-By: Claude Sonnet 5.5 --- specs/002-ab-ota-rauc/tasks.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index b6f56d3..1b36edf 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -312,8 +312,14 @@ previous slot on its own within the documented number of attempts. - [ ] T031 [US3] Extend `board/ota/beaglebone_black/uboot-env.txt` with the exhausted-slots path: when every slot is at 0 attempts, announce it on the console, restore one attempt to the first - slot in `BOOT_ORDER` and try it, rather than halting at a prompt -- [ ] T032 [US3] **The kernel change of T014 is not sufficient on its own**: T016 measured 253 + slot in `BOOT_ORDER` and try it, rather than halting at a prompt. + **Open, found while closing US3**: the path exists and ran on hardware (`t025-mark-good.log`, + run 4), but it does not do what this task, and `boot-interface.md`, say: it boots slot **A** + without spending an attempt (`ota_select` in `uboot-env.txt`), not the first slot in + `BOOT_ORDER` with an attempt restored. They agree when A is first, which is the only case seen so + far; with `BOOT_ORDER=B` and B exhausted it would boot A. Either the script or the text + needs to change, and the choice has not been made +- [X] T032 [US3] **The kernel change of T014 is not sufficient on its own**: T016 measured 253 seconds at an idle shell with no watchdog client and no reset, so start by finding out what actually keeps the watchdog from firing (research.md R5 lists three candidates in order of likelihood), then extend `S99ota-health` to start the BusyBox `watchdog` feeder **only** after @@ -329,15 +335,23 @@ previous slot on its own within the documented number of attempts. confirms, SC-014): **one trial captured in full, 2026-10-29**: three boots of the hanging slot, the counter reading 2, 1, 0, a reset 49 s after each kernel start, then the good slot, with nobody at the keyboard. The first estimate of the reset time (125 s) was wrong and is corrected - (`contracts/boot-interface.md`). SC-014 asks for 3 of 3 trials; 1 has been run + (`contracts/boot-interface.md`). SC-014 asks for 3 of 3 trials; 1 has been run. + **Closed with a waiver, 2026-10-29**: the user decided not to run trials 2 and 3. They are + waived, not passed, and SC-014's "3 of 3" is not demonstrated as written; each trial is the + same chain of events and differs only in the counter, which is the argument for the waiver and + not evidence - [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the reason readable from `/data` (SC-003, FR-014) -- [ ] T034 [US3] Verify (hardware): quickstart scenario 6 — three trials with a slot made to hang +- [X] T034 [US3] Verify (hardware): quickstart scenario 6 — three trials with a slot made to hang after boot; the watchdog must reset the board within the documented window and the device must end on the previous good slot (SC-014). Capture a "before" run on the unmodified image too: - it cannot pass this at all, which is the clearest evidence the kernel change was necessary + it cannot pass this at all, which is the clearest evidence the kernel change was necessary. + **The "before" run was not repeated.** What stands in for it is T016's measurement + (`docs/logs/t016-env-agreement.log`): 253 s at an idle shell, no reset, on a kernel without + `early_enable`, which is the same cause found in the driver source (research R5); it was not + taken on the final image - [ ] T035 [US3] Verify (hardware): quickstart scenario 8 — with `/etc/fw_env.config` pointed at a wrong offset on a test image, the health check must fail its fourth condition, the slot must never be marked good, the device must roll back, and the reason must survive the reboot in From 48b7c3e9084c4f6dca741faed473a38c000befd3 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:39:56 +0700 Subject: [PATCH 46/61] build: make check lints overlay scripts and the card layout's agreement Init scripts and RAUC handlers have no .sh extension, so shellcheck never saw them and S00ota-clock had to be linted by hand; they are now found by their shebang, linted, and required to be executable. The numbers that genimage, U-Boot, fw_env, RAUC and fstab must share (state offsets and size, no overlap, partition numbers of slot A, slot B and /data) are compared on every run. Each check was shown to fail by breaking one agreement at a time; 13 breakages, 13 caught. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 7 +- scripts/check.sh | 164 ++++++++++++++++++ .../contracts/storage-layout.md | 5 +- specs/002-ab-ota-rauc/tasks.md | 11 +- 4 files changed, 183 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b7dd1fe..7ef9234 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,7 +32,7 @@ make docker-check # docker-build, then `make check` in the con make list-boards # boards = configs/_defconfig make beaglebone_black_defconfig # select a board; output goes to output// make build # full build; images land in output//images/ -make check # static checks (shell lint, defconfig round-trip, image layout) +make check # static checks (shell lint incl. overlay init scripts, defconfig round-trip, image layout, storage layout agreement) make menuconfig # any other target is forwarded to Buildroot for the board make savedefconfig # writes back to configs/_defconfig make linux-menuconfig # also -rebuild, clean, ... @@ -120,6 +120,11 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the the opposite), so on a duplicate the built-in value wins. It carries only `omap_wdt.early_enable=1`, without which the driver stops the watchdog U-Boot started (research R5). Never put `root=` or `console=` there: `root=` is set per slot by `uboot-env.txt`, and a built-in one would override it. +- **`make check` also guards the card layout.** For a RAUC board it compares the numbers that five + files must share (`genimage.cfg`, `uboot.config`, `fw_env.config`, `uboot-env.txt`, `system.conf`, + `fstab`): state offsets and size, partition numbers of slot A, slot B and `/data`. A mismatch there + is silent on a device and shows up as every update rolling back. It also lints and checks the mode of + overlay scripts without an extension (init scripts, RAUC handlers), found by their shebang. - **`make check`** compares the regenerated minimal defconfig against the working-tree file in a temp file (never writes `configs/`, never relies on git state). New boards need no CI edits; they are discovered from `configs/`. diff --git a/scripts/check.sh b/scripts/check.sh index 973263f..4e69b61 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -53,6 +53,25 @@ fi SCRIPTS="$(find . \( -path ./buildroot -o -path ./output -o -path ./dl -o -path ./.git -o -path ./.specify -o -path ./.claude \) -prune \ -o -name '*.sh' -type f -print)" +# Init scripts and RAUC handlers in a rootfs overlay have no .sh extension (S99ota-health, +# usr/lib/ota/pre-install), so the filter above cannot see them. They are found by their +# shebang instead, and must be executable: BusyBox init and RAUC both run them directly, and a +# script that lost its mode is skipped without a word. +OVERLAY_SCRIPTS="$(find board -path '*/rootfs_overlay/*' -type f | sort | while read -r f; do + case "$(head -n 1 "${f}" 2>/dev/null)" in + '#!'*sh*) echo "${f}" ;; + esac +done)" +SCRIPTS="$(printf '%s\n%s\n' "${SCRIPTS}" "${OVERLAY_SCRIPTS}" | sed 's#^\./##; /^$/d' | sort -u)" + +for f in ${OVERLAY_SCRIPTS}; do + if [ -x "${f}" ]; then + ok "overlay script is executable: ${f}" + else + fail "overlay script ${f} is not executable; run 'chmod 755 ${f}' and 'git add' it, or init and RAUC will skip it." + fi +done + for s in ${SCRIPTS}; do if sh -n "${s}" 2>"${TMPDIR_CHECK}/err"; then ok "shell syntax: ${s}" @@ -73,6 +92,54 @@ else fail "shell lint: shellcheck not found; run 'make docker-build' to rebuild the build environment." fi +# --- helpers for the storage layout check ------------------------------------ +# Bytes in a genimage-style size or offset: 0x80000, 1M, 32K or a plain number. +to_bytes() { + case "$1" in + *M) echo $((${1%M} * 1048576)) ;; + *K) echo $((${1%K} * 1024)) ;; + *) echo $(($1)) ;; + esac +} + +# genimage_field FILE PARTITION KEY: the value of KEY inside `partition PARTITION { ... }`. +genimage_field() { + awk -v name="$2" -v key="$3" ' + $1 == "partition" { cur = $2 } + $1 == key && $2 == "=" && cur == name { print $3; exit }' "$1" +} + +# genimage_pnum FILE PARTITION: its number in the MBR, counting only entries that are in the +# partition table (the boot-selection regions are not). +genimage_pnum() { + awk -v name="$2" ' + $1 == "partition" { cur = $2; intable[cur] = 1; order[++n] = cur } + $1 == "in-partition-table" && $3 == "false" { intable[cur] = 0 } + END { + for (i = 1; i <= n; i++) + if (intable[order[i]]) { + k++ + if (order[i] == name) { print k; exit } + } + }' "$1" +} + +# A defconfig path with Buildroot's external-tree variable turned into a path from the repo root. +# shellcheck disable=SC2016 # the literal Makefile expression, as it is written in the defconfig +external_path() { + sed 's#\$(BR2_EXTERNAL_OTA_PATH)#.#' +} + +# rauc_slot_device CONF BOOTNAME: the device of the [slot.*] section with that bootname. +rauc_slot_device() { + awk -v bn="$2" ' + function flush() { if (b == bn) print dev } + /^\[/ { flush(); dev = ""; b = "" } + /^device=/ { dev = substr($0, 8) } + /^bootname=/ { b = substr($0, 10) } + END { flush() }' "$1" +} + # --- per-board checks ------------------------------------------------------ for b in ${BOARDS}; do cfg="configs/${b}_defconfig" @@ -170,6 +237,103 @@ for b in ${BOARDS}; do ok "image layout: ${b}" fi fi + + # A board that updates with RAUC keeps its boot-selection state in a raw region of the card, + # and five files have to agree on where it is and which partition is which (the contract is + # specs/002-ab-ota-rauc/contracts/storage-layout.md). A disagreement is silent until a device + # rolls back every update or fails to boot, so it is checked here, on the numbers themselves. + if grep -q '^BR2_PACKAGE_RAUC=y' "${cfg}"; then + gen="${bpath}/genimage.cfg" + fwenv="${bpath}/rootfs_overlay/etc/fw_env.config" + fstab="${bpath}/rootfs_overlay/etc/fstab" + sysconf="${bpath}/rootfs_overlay/etc/rauc/system.conf" + ubcfg="$(defconfig_value "${cfg}" BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE | external_path)" + ubenv="$(defconfig_value "${cfg}" BR2_TARGET_UBOOT_DEFAULT_ENV_FILE | external_path)" + envsize_cfg="$(defconfig_value "${cfg}" BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE)" + + missing="" + for f in "${gen}" "${fwenv}" "${fstab}" "${sysconf}" "${ubcfg}" "${ubenv}"; do + [ -f "${f}" ] || missing="${missing} ${f:-}" + done + if [ -n "${missing}" ]; then + fail "storage layout: ${b} uses RAUC but is missing:${missing}." + continue + fi + + bad=0 + mismatch() { + fail "storage layout: ${b}: $1" + bad=1 + } + + # The two copies of the boot-selection state: genimage, U-Boot and fw_env.config. + g1="$(to_bytes "$(genimage_field "${gen}" env offset)")" + g2="$(to_bytes "$(genimage_field "${gen}" env-redund offset)")" + u1="$(to_bytes "$(sed -n 's/^CONFIG_ENV_OFFSET=\(.*\)$/\1/p' "${ubcfg}")")" + u2="$(to_bytes "$(sed -n 's/^CONFIG_ENV_OFFSET_REDUND=\(.*\)$/\1/p' "${ubcfg}")")" + f1="$(awk '!/^#/ && NF >= 3 { print $2; exit }' "${fwenv}")" + f2="$(awk '!/^#/ && NF >= 3 { n++; if (n == 2) { print $2; exit } }' "${fwenv}")" + fsz1="$(awk '!/^#/ && NF >= 3 { print $3; exit }' "${fwenv}")" + fsz2="$(awk '!/^#/ && NF >= 3 { n++; if (n == 2) { print $3; exit } }' "${fwenv}")" + fdev="$(awk '!/^#/ && NF >= 3 { print $1; exit }' "${fwenv}")" + if [ -z "${g1}" ] || [ -z "${g2}" ] || [ -z "${u1}" ] || [ -z "${u2}" ] || [ -z "${f1}" ] || [ -z "${f2}" ]; then + mismatch "could not read one of the state offsets (genimage '${g1}' '${g2}', uboot.config '${u1}' '${u2}', fw_env.config '${f1}' '${f2}')." + else + f1="$(to_bytes "${f1}")" + f2="$(to_bytes "${f2}")" + if [ "${g1}" != "${u1}" ] || [ "${u1}" != "${f1}" ]; then + mismatch "primary state offset differs: genimage.cfg ${g1}, uboot.config ${u1}, fw_env.config ${f1}." + fi + if [ "${g2}" != "${u2}" ] || [ "${u2}" != "${f2}" ]; then + mismatch "redundant state offset differs: genimage.cfg ${g2}, uboot.config ${u2}, fw_env.config ${f2}." + fi + fi + + # Its size: fw_env.config for both copies, against the environment image the build makes. + if [ -n "${envsize_cfg}" ] && [ -n "${fsz1}" ] && [ -n "${fsz2}" ]; then + es="$(to_bytes "${envsize_cfg}")" + if [ "$(to_bytes "${fsz1}")" != "${es}" ] || [ "$(to_bytes "${fsz2}")" != "${es}" ]; then + mismatch "state size differs: fw_env.config ${fsz1} and ${fsz2}, but BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE is ${envsize_cfg}." + fi + # The two regions must not overlap each other or reach the first partition. + boot_off="$(to_bytes "$(genimage_field "${gen}" boot offset)")" + if [ -n "${boot_off}" ] && [ -n "${g1}" ] && [ -n "${g2}" ] && + { [ $((g1 + es)) -gt "${g2}" ] || [ $((g2 + es)) -gt "${boot_off}" ]; }; then + mismatch "the state regions overlap each other or the boot partition (primary ${g1}, redundant ${g2}, size ${es}, boot partition at ${boot_off})." + fi + else + mismatch "could not read the state size (fw_env.config '${fsz1}' '${fsz2}', defconfig '${envsize_cfg}')." + fi + + # The device the tools read must be the card itself, not one of its partitions. + case "${fdev}" in + /dev/mmcblk[0-9]) ;; + *) mismatch "fw_env.config reads '${fdev}'; it must be the whole card, /dev/mmcblkN." ;; + esac + + # Which partition is which: genimage's order against U-Boot, RAUC and fstab. + pa="$(genimage_pnum "${gen}" rootfs-a)" + pb="$(genimage_pnum "${gen}" rootfs-b)" + pd="$(genimage_pnum "${gen}" data)" + if [ -z "${pa}" ] || [ -z "${pb}" ] || [ -z "${pd}" ]; then + mismatch "genimage.cfg must define the partitions rootfs-a, rootfs-b and data." + else + ua="$(sed -n 's/^ota_part_A=//p' "${ubenv}")" + ub="$(sed -n 's/^ota_part_B=//p' "${ubenv}")" + [ "${ua}" = "${pa}" ] || mismatch "U-Boot boots slot A from partition '${ua}' (ota_part_A), genimage.cfg makes rootfs-a partition ${pa}." + [ "${ub}" = "${pb}" ] || mismatch "U-Boot boots slot B from partition '${ub}' (ota_part_B), genimage.cfg makes rootfs-b partition ${pb}." + ra="$(rauc_slot_device "${sysconf}" A)" + rb="$(rauc_slot_device "${sysconf}" B)" + [ "${ra}" = "${fdev}p${pa}" ] || mismatch "RAUC's slot A is '${ra}', genimage.cfg makes rootfs-a ${fdev}p${pa}." + [ "${rb}" = "${fdev}p${pb}" ] || mismatch "RAUC's slot B is '${rb}', genimage.cfg makes rootfs-b ${fdev}p${pb}." + fd="$(awk '$1 !~ /^#/ && $2 == "/data" { print $1 }' "${fstab}")" + [ "${fd}" = "${fdev}p${pd}" ] || mismatch "fstab mounts /data from '${fd}', genimage.cfg makes data ${fdev}p${pd}." + fi + + if [ "${bad}" -eq 0 ]; then + ok "storage layout agreement: ${b}" + fi + fi done if [ "${FAILED}" -ne 0 ]; then diff --git a/specs/002-ab-ota-rauc/contracts/storage-layout.md b/specs/002-ab-ota-rauc/contracts/storage-layout.md index b15fda2..9a7a18f 100644 --- a/specs/002-ab-ota-rauc/contracts/storage-layout.md +++ b/specs/002-ab-ota-rauc/contracts/storage-layout.md @@ -2,7 +2,10 @@ The byte-level contract between `genimage.cfg`, U-Boot, `/etc/fw_env.config`, `/etc/fstab` and RAUC's `system.conf`. Five files have to agree on these numbers; a disagreement in any one of them -is silent until a device rolls back or stops booting. +is silent until a device rolls back or stops booting. `make check` compares them on every run +(`scripts/check.sh`, "storage layout agreement"): both state offsets, the state size, that the regions +do not overlap each other or the first partition, and which partition number is slot A, slot B and +`/data` in genimage, U-Boot, RAUC and fstab. ## Layout diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 1b36edf..cc908de 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -399,12 +399,19 @@ output and confirm it answers all of that in one command. ## Phase 8: Polish & Cross-Cutting Concerns -- [ ] T040 Extend `scripts/check.sh`: lint the new scripts with `sh -n` and `shellcheck`, **including +- [X] T040 Extend `scripts/check.sh`: lint the new scripts with `sh -n` and `shellcheck`, **including the init scripts under `rootfs_overlay/etc/init.d/`, which have no `.sh` extension and are invisible to the current `*.sh` filter** (`S00ota-clock` was linted by hand for that reason); assert that the offsets in `genimage.cfg`, `uboot.config` and `fw_env.config` are the same numbers; assert the kernel is inside the OS slot rather than listed among the boot partition's files; - keep the existing device-tree and board-parity assertions working with the new layout (FR-031) + keep the existing device-tree and board-parity assertions working with the new layout (FR-031). + **Done**: overlay scripts are found by their shebang and linted, and must be executable; the + storage layout is checked as one agreement between `genimage.cfg`, `uboot.config`, + `fw_env.config`, `uboot-env.txt`, `system.conf` and `fstab` (both state offsets, the state + size, no overlap with each other or the boot partition, `fw_env.config` naming the whole card, + and which partition is slot A, slot B and `/data`). The kernel-not-in-the-boot-partition and + device-tree checks were already there and still pass. Each new check was shown to fail by + breaking one agreement at a time: 13 breakages, 13 caught - [ ] T041 [P] Update `README.md`: the four-partition layout with its reserved region, the 2 GB minimum card and the unused space beyond the layout, the update and rollback procedures, the `make ota-dev-keys` step, and the limitation that the bootloader is never updated in the field From edd8d258bac17f7abfe612f94d0854a8f6cf5fd1 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Thu, 29 Oct 2026 22:47:38 +0700 Subject: [PATCH 47/61] build: script the bundles that scenario 7 must be refused, and document how to run them make-untrusted-bundles.sh builds a genuine control and the five bundles a device has to refuse (unsigned, a second CA, one byte altered, a different board, a certificate from the device's own CA without the Code Signing usage). The last is dated from the CA's own notBefore so the device cannot refuse it for its date instead of its purpose. Quickstart scenario 7 says how to make, run and read them; the device's wording is T037's to record. Co-Authored-By: Claude Sonnet 5.5 --- scripts/make-untrusted-bundles.sh | 157 ++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/quickstart.md | 64 ++++++++++-- specs/002-ab-ota-rauc/tasks.md | 10 +- 3 files changed, 220 insertions(+), 11 deletions(-) create mode 100644 scripts/make-untrusted-bundles.sh diff --git a/scripts/make-untrusted-bundles.sh b/scripts/make-untrusted-bundles.sh new file mode 100644 index 0000000..3341856 --- /dev/null +++ b/scripts/make-untrusted-bundles.sh @@ -0,0 +1,157 @@ +#!/bin/sh +# Builds the bundles that quickstart scenario 7 installs, each of which a device must refuse, +# plus one good bundle as the control. Run in the build container after a build of the board +# (it needs the board's rootfs.ext4 and host tools) and after `make ota-dev-keys`. +# +# sh scripts/make-untrusted-bundles.sh [board] # default: the selected board +# +# Output goes to output//untrusted/, which is ignored by git. The signing material for +# the "second CA" case is generated there too and never leaves it. +set -eu + +BOARD="${1:-}" +[ -n "${BOARD}" ] || BOARD="$(sed -n 's/^BOARD=//p' .current_board 2>/dev/null || true)" +if [ -z "${BOARD}" ]; then + echo "usage: sh scripts/make-untrusted-bundles.sh (no board selected)" >&2 + exit 1 +fi + +BASE="output/${BOARD}" +IMAGES="${BASE}/images" +TARGET="${BASE}/target" +OUT="${BASE}/untrusted" +KEYS_DIR="${KEYS_DIR:-keys/dev}" +CERT="${OTA_SIGNING_CERT:-${KEYS_DIR}/dev-signing.cert.pem}" +KEY="${OTA_SIGNING_KEY:-${KEYS_DIR}/dev-signing.key.pem}" +CA_CERT="${OTA_KEYRING:-${KEYS_DIR}/dev-ca.cert.pem}" +CA_KEY="${KEYS_DIR}/dev-ca.key.pem" +SYSCONF="board/ota/${BOARD}/rootfs_overlay/etc/rauc/system.conf" + +for f in "${IMAGES}/rootfs.ext4" "${TARGET}/etc/build-info" "${BASE}/host/bin/rauc" "${SYSCONF}"; do + if [ ! -e "${f}" ]; then + echo "missing ${f}: build the board first (make ${BOARD}_defconfig && make build)." >&2 + exit 1 + fi +done +for f in "${CERT}" "${KEY}" "${CA_CERT}" "${CA_KEY}"; do + if [ ! -e "${f}" ]; then + echo "missing ${f}: generate the development material first (make ota-dev-keys)." >&2 + exit 1 + fi +done + +PATH="$(pwd)/${BASE}/host/bin:${PATH}" +VERSION="$(sed -n 's/^VERSION=//p' "${TARGET}/etc/build-info")" +COMPAT="$(sed -n 's/^compatible=//p' "${SYSCONF}")" +PREFIX="${BOARD}-${VERSION}" + +rm -rf "${OUT}" +mkdir -p "${OUT}" + +# mkbundle NAME COMPATIBLE CERT KEY: the same `rauc bundle` call as post-image.sh, with the +# material and the board string given here. +mkbundle() { + stage="${OUT}/stage-$1" + mkdir -p "${stage}" + cp -L "${IMAGES}/rootfs.ext4" "${stage}/rootfs.ext4" + printf '[update]\ncompatible=%s\nversion=%s\n\n[bundle]\nformat=plain\n\n[image.rootfs]\nfilename=rootfs.ext4\n' \ + "$2" "${VERSION}" > "${stage}/manifest.raucm" + if ! rauc bundle --cert "$3" --key "$4" "${stage}" "${OUT}/${PREFIX}-$1.raucb" > "${OUT}/rauc-$1.log" 2>&1; then + cat "${OUT}/rauc-$1.log" >&2 + echo "rauc bundle failed for $1" >&2 + exit 1 + fi + rm -rf "${stage}" +} + +# Layout of a plain bundle: squashfs, then the CMS signature, then its length as 8 bytes big-endian. +cms_len() { + od -An -tu1 -j"$(($(wc -c < "$1") - 8))" -N8 "$1" | awk '{ n = 0; for (i = 1; i <= 8; i++) n = n * 256 + $i; print n }' +} + +# 0. The control: genuine, signed by the project's development material for this board. +mkbundle good "${COMPAT}" "${CERT}" "${KEY}" + +# 1. Unsigned: the genuine bundle with its signature cut off and a zero-length trailer. +good="${OUT}/${PREFIX}-good.raucb" +size="$(wc -c < "${good}")" +head -c "$((size - 8 - $(cms_len "${good}")))" "${good}" > "${OUT}/${PREFIX}-unsigned.raucb" +printf '\000\000\000\000\000\000\000\000' >> "${OUT}/${PREFIX}-unsigned.raucb" + +# 2. Signed by a second CA and signing pair that the device has never heard of. +if ! sh scripts/gen-dev-keys.sh "${OUT}/other-ca" > "${OUT}/other-ca.log" 2>&1; then + cat "${OUT}/other-ca.log" >&2 + exit 1 +fi +rm -f "${OUT}/other-ca.log" +mkbundle wrongca "${COMPAT}" "${OUT}/other-ca/dev-signing.cert.pem" "${OUT}/other-ca/dev-signing.key.pem" + +# 3. Altered after signing: one byte of the payload inverted, the signature untouched. +cp "${good}" "${OUT}/${PREFIX}-altered.raucb" +off=1048576 +orig="$(od -An -tu1 -j"${off}" -N1 "${OUT}/${PREFIX}-altered.raucb" | tr -d ' ')" +printf '%b' "\\0$(printf '%03o' $((orig ^ 255)))" | + dd of="${OUT}/${PREFIX}-altered.raucb" bs=1 seek="${off}" conv=notrunc 2> /dev/null + +# 4. Valid signature, built for a different board. +mkbundle wrongboard "ota-other-board" "${CERT}" "${KEY}" + +# 5. Issued by the device's own CA, but without the Code Signing usage. `openssl x509 -req` +# would date it now, which is later than the build of the image on the board, and the device +# would refuse it as not yet valid instead of for its purpose; `openssl ca -startdate` dates it +# from the CA's own notBefore, so the only thing wrong with it is its purpose. +openssl req -newkey rsa:2048 -noenc -keyout "${OUT}/nousage.key.pem" -out "${OUT}/nousage.csr.pem" \ + -subj "/O=OTA development/CN=OTA test signer without code signing usage - NOT FOR PRODUCTION" 2> /dev/null +printf 'basicConstraints=critical,CA:FALSE\nkeyUsage=critical,digitalSignature\n' > "${OUT}/nousage.ext" +cat > "${OUT}/nousage.cnf" < "${OUT}/nousage.index" +echo 01 > "${OUT}/nousage.serial" +start="$(date -u -d "$(openssl x509 -in "${CA_CERT}" -noout -startdate | sed 's/^notBefore=//')" +%Y%m%d%H%M%SZ)" +openssl ca -batch -config "${OUT}/nousage.cnf" -cert "${CA_CERT}" -keyfile "${CA_KEY}" \ + -in "${OUT}/nousage.csr.pem" -out "${OUT}/nousage.cert.pem" -notext \ + -startdate "${start}" -days 365 -extfile "${OUT}/nousage.ext" 2> /dev/null +mkbundle nousage "${COMPAT}" "${OUT}/nousage.cert.pem" "${OUT}/nousage.key.pem" + +# What `openssl` makes of each bundle's signature against the device's CA. This is the host's +# view of the chain only; the device's verdict, and its wording, are what scenario 7 records. +check_cms() { + f="$1" + size="$(wc -c < "${f}")" + n="$(cms_len "${f}")" + if [ "${n}" -le 0 ] || [ "${n}" -ge "${size}" ]; then + echo "no signature" + return + fi + tail -c "$((n + 8))" "${f}" | head -c "${n}" > "${OUT}/cms.der" + head -c "$((size - 8 - n))" "${f}" > "${OUT}/content.bin" + if openssl cms -verify -binary -inform DER -in "${OUT}/cms.der" -content "${OUT}/content.bin" \ + -CAfile "${CA_CERT}" -purpose any -out /dev/null > "${OUT}/cms.log" 2>&1; then + echo "signature and chain verify against the device's CA" + else + # The reason is either a "Verify error:" (the chain) or the CMS_verify routine's own + # wording (the content), whichever comes first. + sed -n 's/.*Verify error:\(.*\)/\1/p; s/.*CMS_verify:\([^:]*\):.*/\1/p' "${OUT}/cms.log" | head -1 + fi +} + +echo +echo "Bundles in ${OUT} (board ${BOARD}, revision ${VERSION}, compatible=${COMPAT}):" +for name in good unsigned wrongca altered wrongboard nousage; do + f="${OUT}/${PREFIX}-${name}.raucb" + printf '\n%s\n %s bytes, sha256 %s\n host openssl: %s\n' "$(basename "${f}")" "$(wc -c < "${f}")" \ + "$(sha256sum "${f}" | cut -d' ' -f1)" "$(check_cms "${f}")" +done +rm -f "${OUT}/cms.der" "${OUT}/content.bin" "${OUT}/cms.log" "${OUT}"/nousage.index* "${OUT}"/nousage.serial* "${OUT}"/nousage.cnf "${OUT}"/nousage.ext "${OUT}"/0*.pem diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index c664999..929f35d 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -166,16 +166,62 @@ the difference: it never resets. ## 7. Untrusted and broken bundles are refused — SC-004, FR-016..FR-019 -Five attempts, each must be refused *before* anything is written, with a distinct message, and -`rauc status` plus both slots unchanged afterwards: +Five bundles, each of which the device must refuse *before* anything is written, with a message that +tells the five apart, and `rauc status` plus both slots unchanged afterwards. A sixth, genuine one is +the control: it shows that a refusal is about the bundle and not about the setup. -| Bundle | Expected refusal | -|---|---| -| unsigned | no valid signature | -| signed by a second CA and signing pair, generated into a scratch directory with `OTA_SIGNING_*` pointed at it | the chain does not reach the CA in the device keyring | -| a trusted bundle with a byte flipped after signing | integrity failure | -| built with a different `compatible` string | wrong board | -| signed with a certificate from the device's own CA that lacks the Code Signing usage | refused by purpose; the first real install failed this way by accident (`check-purpose=codesign`) | +### Making them + +In the build container (`make docker-shell`), after the board has been built once and +`make ota-dev-keys` has been run: + +```sh +sh scripts/make-untrusted-bundles.sh # the selected board, or: ... beaglebone_black +ls output/beaglebone_black/untrusted/ +``` + +It writes six files named `--.raucb`, prints the size and SHA-256 of each, and +shows what `openssl` makes of its signature against the device's CA. The hashes change on every run (a +CMS signature is not reproducible), so compare the hash on the board with the one printed for the file +you copied. Nothing here is committed; the second CA's keys are in the same ignored directory. + +| Case | How it is made | Host `openssl` against the device's CA | What the device must say | +|---|---|---|---| +| `good` (control) | the genuine bundle, signed by the development material | signature and chain verify | installs; it is a genuine bundle of the running revision | +| `unsigned` | the genuine bundle with its signature cut off and a zero-length trailer | no signature | no valid signature | +| `wrongca` | a **second CA and signing pair**, generated with `scripts/gen-dev-keys.sh` into `output//untrusted/other-ca/`, signs a bundle with the same `rauc bundle --cert/--key` call as `post-image.sh` | unable to get local issuer certificate | the chain does not reach the CA in the device keyring | +| `altered` | the genuine bundle with one payload byte (offset 1 MiB) inverted, signature untouched | content verify error | integrity failure | +| `wrongboard` | valid signature, `compatible=ota-other-board` | signature and chain verify | wrong board (compatible mismatch) | +| `nousage` | a certificate **issued by the device's own CA** but without the Code Signing usage, so the chain is good and only the purpose is wrong | signature and chain verify (the host does not apply RAUC's purpose check) | refused by purpose (`check-purpose=codesign`); the first real install failed this way by accident | + +Two details behind the table, because both would otherwise make a case test the wrong thing: + +- The `nousage` certificate is dated from the CA's own `notBefore` with `openssl ca -startdate`. Issued + with `openssl x509 -req` it would carry today's date, later than the build of the image on the board, + and the device would refuse it as *not yet valid* instead of by purpose (the gap in research R8). +- The `wrongca` certificates are dated today too, but the chain error comes first: with the board's clock + modelled as the image's build time, OpenSSL still reports "unable to get local issuer certificate". + +The exact wording the device prints is what this scenario records; the right-hand column is the +expectation, not a quotation. + +### Running them + +Serve `output//untrusted/` from the host (`python3 -m http.server 8000 --bind 192.168.0.1`). On +the board, for each file `F`, with the target slot (the one that is not running) written `N`: + +```sh +fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT > /tmp/before +dd if=/dev/mmcblk0pN bs=1M count=128 2> /dev/null | sha256sum > /tmp/slot.before +wget -O /data/t.raucb http://192.168.0.1:8000/F && sha256sum /data/t.raucb # compare with the printed hash +rauc install /data/t.raucb # must fail; copy the message +fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT | diff /tmp/before - # no output +dd if=/dev/mmcblk0pN bs=1M count=128 2> /dev/null | sha256sum | diff /tmp/slot.before - # no output +rauc status # unchanged +``` + +Run the five refused ones first, the control last: it installs into the other slot, which is a real +update and changes the state. Five distinct messages, five unchanged states, and a control that installs. ## 8. State written where it cannot be lost — SC-013, FR-014 diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index cc908de..548e480 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -367,12 +367,18 @@ signing, or built for another board is refused before anything is written. **Independent Test**: attempt all four and confirm each is refused with a distinct message and both slots are untouched afterwards. -- [ ] T036 [US4] Document in `quickstart.md` the exact commands for the untrusted-bundle case: +- [X] T036 [US4] Document in `quickstart.md` the exact commands for the untrusted-bundle case: generate a second CA and signing pair into a scratch directory with `scripts/gen-dev-keys.sh`, then build a bundle with `OTA_SIGNING_CERT` and `OTA_SIGNING_KEY` pointed at it, so the refusal under test is a chain that does not reach the device's CA. Add a fifth case: a certificate issued by the device's own CA but without the Code Signing usage, which the - device must refuse by purpose (`check-purpose=codesign`, found on the first install) + device must refuse by purpose (`check-purpose=codesign`, found on the first install). + **Done as a script, `scripts/make-untrusted-bundles.sh`**, not a list of commands to retype: it + builds the five bundles and a genuine control, and quickstart scenario 7 says how to make, run + and read them. Run once on the host: all six build, and `openssl` agrees with the intent for each + (control and `wrongboard` verify, `unsigned` has no signature, `wrongca` has no issuer, `altered` + fails on content, `nousage` verifies on chain and carries no Code Signing usage). What the *device* + says is T037's to record - [ ] T037 [US4] Verify (hardware): quickstart scenario 7 — five refusals, each with a distinct message, nothing written, `rauc status` and both slots unchanged after every attempt (SC-004, FR-016 to FR-019) From b1c0217b0b9cc8a21633c1d6cfb6667b4b5c7dc4 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 00:34:20 +0700 Subject: [PATCH 48/61] board: make the health failure record readable on its own Each line in /data/ota-health.log now carries the date, the uptime, the revision of the image that wrote it, the slot and a condition from a fixed set, so it can be read long after the boot that wrote it, when the slot may have been overwritten. The date is the clock floor plus uptime and the contract says so. The log is bounded at 64 KiB with one rotated copy. A healthy boot still writes nothing. Co-Authored-By: Claude Sonnet 5.5 --- .../rootfs_overlay/etc/init.d/S99ota-health | 44 ++++++++++++++----- .../contracts/boot-interface.md | 36 +++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 10 ++++- 3 files changed, 76 insertions(+), 14 deletions(-) diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health index c76e56c..c44b51f 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -18,16 +18,36 @@ DATA=/data LOG="${DATA}/ota-health.log" +LOG_MAX=65536 WDT_DEV=/dev/watchdog WDT_FEED=5 WDT_MARGIN=30 booted= -# One line to the console and, if the data area allows it, to the log that outlives the -# reboot (FR-014). The log write is allowed to fail: condition 3 is what reports that. +# record CONDITION MESSAGE...: one line to the console and, if the data area allows it, one to +# the log that outlives the reboot (FR-014). A record has to be readable on its own, long after the +# boot that wrote it, so it says which image and slot, which condition, and when: +# +# 2026-10-30 01:23:45 UTC up=12s build=fb19ed4 slot=B condition=boot-state: NOT CONFIRMED: ... +# +# The date is the image's build time plus the uptime, not the real time (the device has no +# battery-backed clock: CLAUDE.md, "The target clock is a floor"), which is why the uptime is +# there. CONDITION is one of running-slot, data-writable, boot-state, mark-good, watchdog or +# last-resort; contracts/boot-interface.md lists them. The log write is allowed to fail: +# condition data-writable is what reports that, on the console only. record() { + cond="$1" + shift echo "ota-health: $*" - { echo "$(date -u '+%Y-%m-%d %H:%M:%S') UTC slot=${booted:-?} $*" >> "${LOG}"; } 2> /dev/null || true + build="$(sed -n 's/^VERSION=//p' /etc/build-info 2> /dev/null)" + up="$(cut -d. -f1 /proc/uptime 2> /dev/null)" + { + # One generation of history is enough; an unhealthy device that reboots in a loop must not fill /data. + if [ -f "${LOG}" ] && [ "$(wc -c < "${LOG}")" -gt "${LOG_MAX}" ]; then + mv -f "${LOG}" "${LOG}.1" + fi + echo "$(date -u '+%Y-%m-%d %H:%M:%S') UTC up=${up:-?}s build=${build:-unknown} slot=${booted:-?} condition=${cond}: $*" >> "${LOG}" + } 2> /dev/null || true } # RAUC prints "(null)" for a value it does not have. @@ -65,13 +85,13 @@ case "$1" in done if ! known "${booted}"; then booted= - record "NOT CONFIRMED: RAUC reports no booted slot" + record running-slot "NOT CONFIRMED: RAUC reports no booted slot" exit 1 fi last_resort= if known "${RAUC_BOOT_PRIMARY}"; then if [ "${primary}" != "${booted}" ]; then - record "NOT CONFIRMED: RAUC names slot '${primary}' as primary but '${booted}' is running" + record running-slot "NOT CONFIRMED: RAUC names slot '${primary}' as primary but '${booted}' is running" exit 1 fi else @@ -83,11 +103,11 @@ case "$1" in # Condition 3, the data area is mounted and a write to it succeeds. probe="${DATA}/.ota-health-probe" if ! grep -q " ${DATA} " /proc/mounts; then - record "NOT CONFIRMED: ${DATA} is not mounted" + record data-writable "NOT CONFIRMED: ${DATA} is not mounted" exit 1 fi if ! { echo ok > "${probe}" && sync && rm -f "${probe}"; } 2> /dev/null; then - record "NOT CONFIRMED: ${DATA} is mounted but not writable" + record data-writable "NOT CONFIRMED: ${DATA} is mounted but not writable" exit 1 fi @@ -96,20 +116,20 @@ case "$1" in # fw_env.config and the bootloader disagree about where the state lives. var="BOOT_${booted}_LEFT" if ! value="$(fw_printenv -n "${var}" 2> /dev/null)"; then - record "NOT CONFIRMED: boot-selection state is unreadable (${var})" + record boot-state "NOT CONFIRMED: boot-selection state is unreadable (${var})" exit 1 fi if ! fw_setenv "${var}" "${value}" 2> /dev/null; then - record "NOT CONFIRMED: boot-selection state is not writable (${var})" + record boot-state "NOT CONFIRMED: boot-selection state is not writable (${var})" exit 1 fi if ! rauc status mark-good > /dev/null 2>&1; then - record "NOT CONFIRMED: rauc status mark-good failed" + record mark-good "NOT CONFIRMED: rauc status mark-good failed" exit 1 fi if [ -n "${last_resort}" ]; then - record "confirmed good after a last-resort boot (no slot had attempts left)" + record last-resort "confirmed good after a last-resort boot (no slot had attempts left)" else echo "ota-health: slot ${booted} confirmed good" fi @@ -119,7 +139,7 @@ case "$1" in # cannot be seen from here; the kernel stops pinging 60 s after boot if nobody opens # it, and the board resets, which is the right outcome for a slot that cannot feed it. if [ ! -c "${WDT_DEV}" ]; then - record "WATCHDOG MISSING: ${WDT_DEV} does not exist, so a hang cannot be caught" + record watchdog "WATCHDOG MISSING: ${WDT_DEV} does not exist, so a hang cannot be caught" exit 1 fi watchdog -t "${WDT_FEED}" -T "${WDT_MARGIN}" "${WDT_DEV}" diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index 6b6f0f0..7ea8dca 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -74,6 +74,42 @@ All four hold → `rauc status mark-good`, then start the watchdog feeder. Any f to `/data`, leave the slot unconfirmed, and do **not** start the feeder, so the device is reset and the attempt counter retires the slot (FR-032). +### The failure record: `/data/ota-health.log` (FR-014) + +The one place to look on a device, or in a support report, for why a slot did not confirm. One line per +event, written by `S99ota-health` and nothing else, plain text, readable without any tool: + +``` +2026-10-30 01:23:45 UTC up=12s build=fb19ed4 slot=B condition=boot-state: NOT CONFIRMED: boot-selection state is not writable (BOOT_B_LEFT) +``` + +| Field | Meaning | +|---|---| +| date | the system clock, which is the image's **build time plus the uptime**, not the real time: the device has no battery-backed clock (`CLAUDE.md`, "The target clock is a floor"). Read it as an ordering within one boot, not as a wall-clock time | +| `up=` | seconds since the kernel started, when the record was written | +| `build=` | `VERSION` from `/etc/build-info` of the image that wrote it, so a record names the revision even after the slot has been overwritten | +| `slot=` | the boot name of the running slot, `A` or `B` (`?` if RAUC could not say) | +| `condition=` | which check failed, below | + +| `condition=` | Check | Written when | +|---|---|---| +| `running-slot` | 2: RAUC's primary slot is the running one | RAUC names another slot as primary, or names no booted slot; the slot is not confirmed | +| `data-writable` | 3: `/data` is mounted and writable | it is not. The write usually fails too, so this one is mostly **console only** | +| `boot-state` | 4: the boot-selection state reads and writes back | `fw_printenv` or `fw_setenv` fails; the slot is not confirmed | +| `mark-good` | `rauc status mark-good` | it fails after 1 to 4 held | +| `watchdog` | `/dev/watchdog` exists | it does not; the slot was confirmed, but nothing can feed the watchdog | +| `last-resort` | (information, not a failure) | a boot taken because every slot was out of attempts was confirmed | + +A healthy ordinary boot writes nothing. The file is bounded: once it is over 64 KiB it is renamed to +`ota-health.log.1`, replacing the previous one, so a device that fails in a loop keeps about the last +64 to 128 KiB and no more. + +What it cannot hold, and where to look instead: condition 1 (the init sequence reached the script) cannot +fail from inside the script, and a slot that **hangs before** `S99ota-health` writes no record at all. +For such a slot the evidence is the boot-selection state: `fw_printenv BOOT__LEFT` at 0 and the +slot absent from `BOOT_ORDER`, and `rauc status` calling it `bad`. That records *that* it was retired, +not *why*; the reason is "it never confirmed". + ## Watchdog | Layer | Behaviour | diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 548e480..fc68a31 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -393,9 +393,15 @@ what each slot holds, which are good or bad, and whether an update awaits confir **Independent Test**: on a device that has been updated once and rolled back once, read the status output and confirm it answers all of that in one command. -- [ ] T038 [US5] Make the failure record the health script writes to `/data` readable on its own: +- [X] T038 [US5] Make the failure record the health script writes to `/data` readable on its own: which slot, which condition failed, and when, in a single documented file path named in - `contracts/boot-interface.md` + `contracts/boot-interface.md`. **Done**: `/data/ota-health.log`, one line per event with the + date, `up=`, `build=`, `slot=` and a `condition=` from a fixed set, bounded at 64 KiB plus one + rotated copy; the format, the conditions and the limits are in the contract. Host-checked for + every failing path, the healthy no-record path and the rotation; the first line from a real + failure is for T035 or T039. **Open, not part of this task**: a slot that hangs before + `S99ota-health` leaves no record of *why* (only the counter says it was retired), which is a + narrower reading of FR-014 than the spec's wording - [ ] T039 [US5] Verify (hardware): `rauc status` in one invocation reports the booted slot, both slots' versions and health, and any pending confirmation (FR-026, SC-005); the boot console identifies the selected slot (FR-027); and a rolled-back device is distinguishable from a From 6d5dbc6f6459e6fccc2d4e317f28c81f0b50d427 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 00:38:44 +0700 Subject: [PATCH 49/61] docs: bring README and CLAUDE.md up to the A/B image README: the tree and flashing text were of the single-slot image. It now has an "Updating a device" section (card layout, the reserved region, the 2 GB minimum, keys and OTA_*, installing, rollback with its measured timing, the failure log, the limits including the bootloader that is never updated in the field), and says its old footprint and boot-time figures are the single-slot image's until they are re-measured. CLAUDE.md: layout, the board's own kernel and U-Boot configs, the card layout and the one counter rule, signing material, the bench network, and what only hardware showed. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 50 +++++++++-- README.md | 158 +++++++++++++++++++++++++++++---- specs/002-ab-ota-rauc/tasks.md | 15 +++- 3 files changed, 196 insertions(+), 27 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7ef9234..8c31fcb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -46,12 +46,20 @@ edit persist on the host. ``` configs/_defconfig one per board (and variants, e.g. _dev_defconfig) -board/ota/common/ shared by every board: rootfs_overlay/, post-build.sh -board/ota// board-only: rootfs_overlay/, post-image.sh, genimage.cfg, ... +board/ota/common/ shared by every board: rootfs_overlay/ (init.d/S00ota-clock, S99ota-health, + usr/lib/ota/pre-install), post-build.sh +board/ota// board-only: rootfs_overlay/ (etc/fstab, fw_env.config, rauc/system.conf, + network/interfaces), post-image.sh, genimage.cfg, linux.config, + uboot.config, uboot-env.txt package// internal packages; add a `source` line to package/Config.in patches// BR2_GLOBAL_PATCH_DIR: patches and .hash files per package external.desc, Config.in, external.mk BR2_EXTERNAL glue scripts/check.sh static checks behind `make check` (POSIX sh) +scripts/gen-dev-keys.sh `make ota-dev-keys`: development CA + signing pair into keys/dev/ (gitignored) +scripts/make-untrusted-bundles.sh the bundles a device must refuse (quickstart scenario 7); output/ only +keys/dev/ development signing material, never committed +specs/002-ab-ota-rauc/ A/B feature: spec, plan, research (R1-R9), contracts/, quickstart, tasks +docs/logs/ hardware captures that back the claims in the spec and README .github/workflows/ CI: ci.yml (checks on branch push / PR to master), build.yml (boards, manual/tag only) ``` @@ -74,10 +82,34 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the a `.hash` for custom-version kernel/U-Boot in `patches/{linux,linux-headers,uboot}/`. Bumping `BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE` or the U-Boot version means adding its hash line there (a single `.hash` file may hold several versions, so boards can share it). -- **Kernel/U-Boot configs** currently come from in-tree defconfigs (`omap2plus`, `am335x_evm`). - To customize, switch the defconfig to `BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG` with - `BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota//linux.config"` - and generate it with `make linux-update-defconfig` (same pattern for U-Boot). +- **Kernel and U-Boot use the board's own configs**, not the in-tree defconfigs: + `board/ota//linux.config` and `uboot.config` (`BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG`, + `BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG`), written back with `make linux-update-defconfig` (same pattern + for U-Boot). Several options are load-bearing and fail only on hardware: SquashFS (zlib) and the loop + device (RAUC mounts a bundle), the RTC driver built in, `omap_wdt` and the watchdog core built in with + `omap_wdt.early_enable=1`. `uboot-env.txt` is compiled into the SPL as well as U-Boot, and the AM335x + SPL has little SRAM: growing it much past ~2.9 KB breaks the link with `region '.sram' overflowed` + unless something else in the SPL is dropped (`CONFIG_SPL_NET` already is). +- **The card layout, the reserved region and the one counter.** `beaglebone_black` uses an MBR with four + primaries: p1 boot (32 MiB, `MLO` + `u-boot.img` only, never updated), p2 and p3 the OS slots (512 MiB + ext4, read-only, each with its own kernel), p4 `/data` (256 MiB). The boot-selection state is **not** a + partition: two raw copies at `0x80000` and `0xA0000` (128 KiB each), written by U-Boot's `saveenv` + and by `fw_setenv`. `BOOT_ORDER` and `BOOT__LEFT` in that environment are the **only** boot + attempt counter: U-Boot's own bootcount (`CONFIG_BOOTCOUNT_*`) is deliberately off, because it lives in an + RTC scratch register that a power cycle loses. Never add a second counter. Contract: + `specs/002-ab-ota-rauc/contracts/storage-layout.md`; `make check` compares it across six files. +- **Signing material and the three `OTA_*` variables.** `make ota-dev-keys` writes a two-tier development + CA into `keys/dev/` (gitignored); a build of a RAUC board refuses to start without it (`check_keys` in the + `Makefile`). `OTA_KEYRING` (the CA certificate, installed as `/etc/rauc/keyring.pem`), `OTA_SIGNING_CERT` + and `OTA_SIGNING_KEY` default to `keys/dev/` and are exported to the post-build and post-image scripts; + override them to sign with other material. A lost *signing* key is answered by a new certificate under the + same CA, no reflash; replacing the *CA* strands every flashed device. The setting that + matters on the device is `check-purpose=codesign` in `system.conf`: without it every bundle is refused. +- **What only hardware shows.** The host cannot run RAUC's mount, the kernel, the watchdog or the bootloader, + and in this feature a green `make check` plus host stubs coexisted with seven real defects (RTC module + overwriting the clock, `RAUC_SYSTEM_BOOTED_BOOTNAME` holding a device path, `check-purpose`, `mountprefix`, + SquashFS missing, no pending-install refusal, and the watchdog being stopped at probe). Stubs encode the + author's assumption. A boot-affecting change needs a board run, and its log goes in `docs/logs/`. - **The image runs as a non-root user (`br`)** because Buildroot refuses to build as root. `make docker-build` passes the host UID/GID as build args and `docker-shell` runs with `-u` the same IDs, so files in the mount keep host ownership. @@ -115,12 +147,16 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the created *before* the image is built (this is why `check_keys` refuses to build without the keys); (5) `SOURCE_DATE_EPOCH` is deliberately not the floor, since a commit time can predate the certificate. Rationale and the one known gap: `specs/002-ab-ota-rauc/research.md` R8, FR-033. +- **The bench network is a fixed address.** `beaglebone_black` has `192.168.0.2/24` in + `rootfs_overlay/etc/network/interfaces`, for a board cabled straight to the build host (`192.168.0.1`), which + serves bundles with `python3 -m http.server`. There is no DHCP server on that cable and no SSH server + on the image; delivering a bundle is outside the A/B feature (research R8). - **`CONFIG_CMDLINE` is read last.** The beaglebone kernel uses `CONFIG_CMDLINE_EXTEND`, and `drivers/of/fdt.c` appends the built-in string *after* what U-Boot passes (the Kconfig help says the opposite), so on a duplicate the built-in value wins. It carries only `omap_wdt.early_enable=1`, without which the driver stops the watchdog U-Boot started (research R5). Never put `root=` or `console=` there: `root=` is set per slot by `uboot-env.txt`, and a built-in one would override it. -- **`make check` also guards the card layout.** For a RAUC board it compares the numbers that five +- **`make check` also guards the card layout.** For a RAUC board it compares the numbers that six files must share (`genimage.cfg`, `uboot.config`, `fw_env.config`, `uboot-env.txt`, `system.conf`, `fstab`): state offsets and size, partition numbers of slot A, slot B and `/data`. A mismatch there is silent on a device and shows up as every update rolling back. It also lints and checks the mode of diff --git a/README.md b/README.md index 25056f7..1b40117 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # OTA — Embedded Linux with Buildroot Builds embedded Linux images for several boards with [Buildroot](https://buildroot.org), inside -Docker so the whole team shares one build environment. Supported boards: **BeagleBone Black**. +Docker so the whole team shares one build environment. Supported boards: **BeagleBone Black**, +which updates in the field with **A/B slots and automatic rollback** ([RAUC](https://rauc.io); +see *Updating a device* below). ## Concept @@ -19,7 +21,13 @@ Upgrading Buildroot is just moving the submodule pointer; the project files stay ota/ ├── Makefile # entry point: Docker targets + forwarding to Buildroot ├── Dockerfile # build environment -├── scripts/check.sh # static checks run by `make check` +├── scripts/ +│ ├── check.sh # static checks run by `make check` +│ ├── gen-dev-keys.sh # `make ota-dev-keys`: development CA + bundle-signing pair +│ └── make-untrusted-bundles.sh # the bundles a device must refuse (quickstart scenario 7) +├── keys/dev/ # [gitignored] development signing material +├── specs/002-ab-ota-rauc/ # the A/B feature: spec, plan, research, contracts, quickstart, tasks +├── docs/ # boot-time baseline; docs/logs/ holds the hardware captures ├── .github/workflows/ # CI: ci.yml (checks), build.yml (board images, releases) ├── external.desc # BR2_EXTERNAL name: OTA ├── Config.in, external.mk # hook package/ into Buildroot @@ -28,13 +36,17 @@ ota/ │ └── beaglebone_black_defconfig # one file per board/variant ├── board/ota/ │ ├── common/ # shared by every board -│ │ ├── rootfs_overlay/ # e.g. /etc/issue, init.d/S00ota-clock -│ │ └── post-build.sh # writes /etc/build-info (board, git version, Buildroot, build date) +│ │ ├── rootfs_overlay/ # /etc/issue, init.d/S00ota-clock, init.d/S99ota-health, +│ │ │ # usr/lib/ota/pre-install (the RAUC handler) +│ │ └── post-build.sh # /etc/build-info (board, git version, Buildroot, build date), +│ │ # the trust anchor, the /data mount point │ └── beaglebone_black/ # BBB only -│ ├── rootfs_overlay/ # e.g. /etc/hostname -│ ├── post-image.sh # copies uEnv.txt, extlinux.conf, then runs genimage -│ ├── genimage.cfg # SD card: 16M FAT boot + 512M ext4 rootfs -│ └── uEnv.txt, extlinux.conf +│ ├── rootfs_overlay/ # /etc: fstab, fw_env.config, hostname, network/interfaces, rauc/system.conf +│ ├── post-image.sh # builds data.ext4 and the signed .raucb, then runs genimage +│ ├── genimage.cfg # the SD card: boot, two OS slots, data, and the state region +│ ├── uboot.config # U-Boot configuration (environment in raw MMC, watchdog, ...) +│ ├── uboot-env.txt # the slot-selection script and its default environment +│ └── linux.config # kernel configuration ├── package/ # internal packages (declared in package/Config.in) ├── patches/ # patches + .hash files per package (linux, uboot, ...) ├── output// # [gitignored] build output, one directory per board @@ -88,10 +100,13 @@ make docker-check # host: rebuild the environment image, then run `make make check # inside the container: the same checks without the image rebuild ``` -`make check` runs `sh -n` and `shellcheck` on every script, regenerates each board's minimal -defconfig and compares it with `configs/_defconfig`, dry-runs `make -n build` per board, and -checks that each board has its `genimage.cfg`, `post-image.sh` and overlays and that every device -tree the kernel builds is listed in `genimage.cfg` (and vice versa). It exits non-zero on any +`make check` runs `sh -n` and `shellcheck` on every script, including init scripts and RAUC handlers +in an overlay (found by their shebang, and required to be executable); regenerates each board's +minimal defconfig and compares it with `configs/_defconfig`; dry-runs `make -n build` per +board; checks that each board has its `genimage.cfg`, `post-image.sh` and overlays and where its +kernel and device tree live; and, for a board that updates with RAUC, that `genimage.cfg`, +`uboot.config`, `fw_env.config`, `uboot-env.txt`, `system.conf` and `fstab` agree on the boot-selection +state's offsets and size and on which partition is slot A, slot B and `/data`. It exits non-zero on any failure and names the file and the fix. GitHub Actions (GitHub-hosted `ubuntu-24.04` runners): @@ -107,6 +122,12 @@ A green build is **not** a boot test. Boot each image on hardware to a login pro console before publishing a draft release. Images are xz-compressed: see Flashing below. Release images are development images (passwordless `root`); do not deploy them. +> **The figures in the rest of this section describe the single-slot image from before the A/B +> change** (a 76 MiB `sdcard.img`, one 60 MiB root filesystem, a 16 MiB boot partition). The A/B image +> has a different layout and a different boot path and is re-measured separately (task T043 of +> `specs/002-ab-ota-rauc/tasks.md`); do not read the footprint or boot-time numbers below as its own. +> What is already known about the A/B image is in *Updating a device*. + Measured on GitHub-hosted runners for `beaglebone_black` (`build.yml`, 2026-10-26): | Run | `dl/` cache | Board build | Whole run | @@ -131,6 +152,10 @@ device tree, bootargs, partition layout or init. ## Flashing and booting the BeagleBone Black +The card needs **at least 2 GB**. The layout is fixed (about 1.28 GiB) and is not grown to fill a larger +card: the space beyond it is simply unused. `sdcard.img` is sparse, so it is small on the host but +`dd` writes its whole length, and a flash takes as long as the declared layout, not as long as the data. + ```bash sudo dd if=output/beaglebone_black/images/sdcard.img of=/dev/sdX bs=4M conv=fsync ``` @@ -146,6 +171,103 @@ As above, double-check `/dev/sdX` first: `dd` overwrites the target without aski Hold the **S2 (BOOT)** button while powering on to boot from the SD card. Serial console on header J1, 115200 8N1. Log in as `root`, no password. +Flashing writes the bootloader and slot A only. Slot B starts out empty and ineligible (it is not in +`BOOT_ORDER` and has no attempts), so a freshly flashed card always boots slot A; the first update gives +slot B its attempts and moves it to the front. + +## Updating a device (A/B, RAUC) + +### What is on the card + +``` +0x000000 MBR (four primary entries; MBR and not GPT, because the AM335x ROM needs an MBR) +0x080000 boot-selection state, primary copy 128 KiB, in no filesystem +0x0A0000 boot-selection state, redundant copy 128 KiB +0x100000 p1 boot 32 MiB FAT16 MLO, u-boot.img only + p2 rootfs.A 512 MiB ext4 kernel, device tree, modules and userspace, read-only + p3 rootfs.B 512 MiB ext4 the same, the other slot + p4 data 256 MiB ext4 the only persistent, writable area, mounted at /data +``` + +Each OS slot holds everything needed to run that revision, kernel included, and is mounted **read-only**; +temporary files and logs are on tmpfs, so an update replaces a slot completely and nothing drifts. The +boot-selection state lives in the raw region above the first partition because the four primary +partitions are already spent. U-Boot reads `BOOT_ORDER` and `BOOT__LEFT` from it, spends one attempt +per try, and boots the first slot that still has one. That counter is the **only** boot-attempt counter. +The byte-level contract is [specs/002-ab-ota-rauc/contracts/storage-layout.md](specs/002-ab-ota-rauc/contracts/storage-layout.md). + +### Building an update + +Every build produces both artefacts in `output//images/`: the flashable `sdcard.img` and the +update `-.raucb` (about 23 MB), signed and carrying `compatible=ota-beaglebone-black` +and the revision from `git describe`. A build of an A/B board refuses to start without signing material: + +```bash +make ota-dev-keys # once, inside the container: a development CA and a signing pair in keys/dev/ +``` + +`keys/dev/` is gitignored and **development only**: the certificates say so in their subject. The device +trusts the CA, so a lost or leaked *signing* key is answered by issuing a new certificate; losing the CA +means reflashing every device. To sign with other material (staging, production) point `OTA_SIGNING_CERT`, +`OTA_SIGNING_KEY` and `OTA_KEYRING` at it, for example `make OTA_SIGNING_KEY=... build`. + +### Installing it + +Getting the file onto the device is **not** part of this project: use whatever you have. On the development +bench the board is cabled straight to the host, has the static address `192.168.0.2/24`, and fetches it +over HTTP (research R8 in the spec directory has the reasoning and the measured result): + +```bash +# host, in output//images/: python3 -m http.server 8000 --bind 192.168.0.1 +# board: +wget -O /data/update.raucb http://192.168.0.1:8000/-.raucb +rauc install /data/update.raucb # verifies, writes the slot that is NOT running, flips BOOT_ORDER +reboot +``` + +A bundle is refused, before anything is written, if it is unsigned, signed by a CA the device does not +trust, altered after signing, built for another board, or signed with a certificate that may not sign +code. It is also refused while an earlier update is **pending** (installed but not yet booted) or while +another install runs. After the reboot: + +```bash +cat /etc/build-info # the revision now running +rauc status # booted slot, both slots good +fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT # the raw state +``` + +### Rollback + +Nothing has to be done by hand. A new slot gets **three attempts**. After each boot, `S99ota-health` checks +four local conditions (the init sequence reached it; RAUC and U-Boot agree on the running slot; `/data` is +mounted and writable; the boot-selection state reads and writes back) and only then calls +`rauc status mark-good` and starts the hardware watchdog feeder. A slot that does not confirm leaves the +watchdog unfed; the board resets about **50 s** after the kernel started, an attempt is spent, and after the +third U-Boot skips the slot and boots the other one. Measured on the bench: three failed boots and a +fallback in under three minutes. A confirmed slot that later hangs (the feeder dies, the kernel panics) is +reset within about 30 s and, having confirmed, keeps its attempts. + +Why a slot failed is in `/data/ota-health.log`, one line per event with the condition, the slot and the +revision (format in [contracts/boot-interface.md](specs/002-ab-ota-rauc/contracts/boot-interface.md)). A slot +that hung before the health script ran writes no line; its state, `BOOT__LEFT=0` and `bad` in +`rauc status`, is the evidence. `rauc status mark-bad` is meant for forcing a rollback while testing; the hardware runs of +this feature rolled back by other means (a hanging slot, a pulled plug) and did not exercise it. + +### Limits worth knowing + +- **The bootloader is never updated in the field.** `MLO` and `u-boot.img` are written when the card is + flashed and no bundle touches them, nor the boot-selection region. A bootloader fix means reflashing. +- **Development images only.** `root` has no password and nothing is hardened; the signing material is + development material. A bundle signed by it installs only on an image built with the same CA. +- **The clock is a floor, not the real time.** The board has no battery-backed clock; at boot it is raised + to the image's build time. A certificate issued after the running image was built is "not yet valid" + on it. Log timestamps on the device are that floor plus the uptime. See `CLAUDE.md`, research R8. +- **No update server, no delta updates, no secure boot.** A bundle carries a whole slot; the feature is the + device side of an update, not the fleet side. +- **Boot affecting changes need the hardware.** `make check` and a green build cannot see the kernel, RAUC + or the bootloader; defects in this feature were found on the board that no host check saw. Evidence from + those runs is in `docs/logs/`. + ## Extending **Adding a board** @@ -157,10 +279,14 @@ header J1, 115200 8N1. Log in as `root`, no password. **Adding an internal package**: create `package//Config.in` and `.mk`, then add `source "$BR2_EXTERNAL_OTA_PATH/package//Config.in"` to `package/Config.in`. -**Custom kernel/U-Boot config**: the in-tree defconfigs (`omap2plus`, `am335x_evm`) are used for -now. For a project-specific config, set `BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y` and -`BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OTA_PATH)/board/ota//linux.config"`, -then generate the file with `make linux-update-defconfig` (same pattern for U-Boot). +**Kernel and U-Boot configuration**: `beaglebone_black` uses its own `linux.config`, `uboot.config` and +`uboot-env.txt` (`BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG`, `BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG`). Change the +kernel with `make linux-menuconfig` and write it back with `make linux-update-defconfig` (same pattern for +U-Boot). Some options are load-bearing for A/B updates and are explained where they matter in the spec +directory: SquashFS and the loop device (RAUC mounts a bundle), the RTC driver built in (the clock floor), +`omap_wdt.early_enable=1` on the built-in command line (the watchdog), and the state offsets, which +`make check` compares across six files. `uboot-env.txt` is compiled into the SPL as well as U-Boot, and +the AM335x SPL has little room: growing that file much further breaks the link with an SRAM overflow. **Changing the kernel/U-Boot version**: the defconfig enables `BR2_DOWNLOAD_FORCE_CHECK_HASHES`, so add the new version's hash to `patches/linux/linux.hash` or `patches/uboot/uboot.hash`. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index fc68a31..e3c0f03 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -424,13 +424,20 @@ output and confirm it answers all of that in one command. and which partition is slot A, slot B and `/data`). The kernel-not-in-the-boot-partition and device-tree checks were already there and still pass. Each new check was shown to fail by breaking one agreement at a time: 13 breakages, 13 caught -- [ ] T041 [P] Update `README.md`: the four-partition layout with its reserved region, the 2 GB +- [X] T041 [P] Update `README.md`: the four-partition layout with its reserved region, the 2 GB minimum card and the unused space beyond the layout, the update and rollback procedures, the `make ota-dev-keys` step, and the limitation that the bootloader is never updated in the field - (FR-004, FR-030) -- [ ] T042 [P] Update `CLAUDE.md` with the same facts an agent needs: the new layout, the reserved + (FR-004, FR-030). **Done**: a new "Updating a device" section (card layout and the reserved + region, the 2 GB minimum and the unused space, keys and the three `OTA_*` variables, installing, + rollback and its measured timing, the failure log, the limits including the bootloader that is + never updated in the field), a corrected tree and flashing text, and a banner on the old + footprint and boot-time figures saying they describe the single-slot image until T043 +- [X] T042 [P] Update `CLAUDE.md` with the same facts an agent needs: the new layout, the reserved region, the custom U-Boot and kernel configurations, the three `OTA_*` variables, and the one - counter rule. The target-clock note is already there (added with T046); keep it current + counter rule. The target-clock note is already there (added with T046); keep it current. + **Done**: layout and file tree, the board's own kernel and U-Boot configs and their + load-bearing options, the card layout with the reserved region and the one counter, the signing + material and `OTA_*` variables, the bench network, and a list of what only hardware showed - [ ] T043 Re-measure and record in `README.md` every figure the layout change invalidates: both slots' and the boot partition's usage, the data area, `sdcard.img`, the bundle size, and the boot time against the 11.50 s baseline, now including S00ota-clock (Principle VI, SC-007, From 0153247098ae554a6361e8ba00ca8a01d26e01dd Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 01:01:01 +0700 Subject: [PATCH 50/61] docs: record the A/B image's footprint, and verify a clean checkout README gains the measured sizes of the A/B image: the slot at 47.8% of its filesystem, the boot partition at 4.9%, the data area with room for about ten bundles, a 23.1 MB bundle, and a sdcard.img that is 63 MiB of real data. The boot time is not measured and the README says so. T045 is checked on a true clean clone: docker-check green, savedefconfig leaves no diff. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 21 ++++++++++++++++++++- specs/002-ab-ota-rauc/tasks.md | 14 +++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1b40117..802699e 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,26 @@ images are development images (passwordless `root`); do not deploy them. > change** (a 76 MiB `sdcard.img`, one 60 MiB root filesystem, a 16 MiB boot partition). The A/B image > has a different layout and a different boot path and is re-measured separately (task T043 of > `specs/002-ab-ota-rauc/tasks.md`); do not read the footprint or boot-time numbers below as its own. -> What is already known about the A/B image is in *Updating a device*. +> What is already known about the A/B image is in *Updating a device*, and its footprint follows. + +Footprint of the A/B image (revision `6d5dbc6`, `beaglebone_black`, measured 2026-10-30 from the build +output with `dumpe2fs -h` and `mdir`, both in `output//host/`): + +| Part | Size | Used | Limit (SC-007) | +|---|---|---|---| +| OS slot, filesystem (`rootfs.ext4`) | 128 MiB filesystem in a 512 MiB partition | 61.2 MiB: **47.8%** of the filesystem, 12.0% of the slot | 80% | +| Boot partition (FAT16, `MLO` + `u-boot.img`) | 32 MiB | 1.57 MiB: **4.9%** | 80% | +| Persistent data area (empty ext4) | 256 MiB | 26.4 MiB of filesystem overhead, **229.6 MiB free** | holds one bundle with room | +| Update bundle `-.raucb` | 23.1 MB (22.1 MiB) | holds 128 MiB of filesystem, compressed | about 10 fit in `/data` | +| `sdcard.img` | 1313 MiB declared, **63.0 MiB** of real data | the rest are holes | fits a 2 GB card | +| Kernel inside each slot (`/boot/zImage`) | 7.3 MiB | | | + +Boot time of the A/B image is **not measured yet** with the method below. What exists are the one-second +host timestamps of the hardware captures in `docs/logs/`, which put the SPL banner to the login prompt at +about 11 to 12 s, against a budget of 12.65 s (10% over 11.50 s, SC-008). That is too close to call from +timestamps of that resolution; the `grabserial` runs, three of them, are still to be done on the board, and +the A/B image has gained `S00ota-clock`, `S99ota-health`, a static address, the RTC driver and SquashFS +since the baseline. Measured on GitHub-hosted runners for `beaglebone_black` (`build.yml`, 2026-10-26): diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index e3c0f03..7ff88fd 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -441,12 +441,20 @@ output and confirm it answers all of that in one command. - [ ] T043 Re-measure and record in `README.md` every figure the layout change invalidates: both slots' and the boot partition's usage, the data area, `sdcard.img`, the bundle size, and the boot time against the 11.50 s baseline, now including S00ota-clock (Principle VI, SC-007, - SC-008) + SC-008). **Partly done, 2026-10-30, and left open**: everything that can be read from the build + output is in `README.md` (slot 47.8% of its filesystem, boot partition 4.9%, data area 229.6 MiB + free, bundle 23.1 MB, `sdcard.img` 63 MiB of real data, all inside SC-007's 80%). **Not done**: + the boot time, three `grabserial` runs on the board with `S00ota-clock` included; the coarse + timestamps put it at 11 to 12 s against a 12.65 s budget, which is too close to claim - [ ] T044 Record the hardware evidence from T016, T024, T025, T029, T030, T033, T034, T035, T037 and T039 under `docs/logs/` and summarise it in the PR; Principle IV requires the evidence to be stated, and a green check run is explicitly not a boot test -- [ ] T045 Verify: `make docker-check` is green from a clean checkout, and - `make beaglebone_black_defconfig && make savedefconfig` leaves no diff +- [X] T045 Verify: `make docker-check` is green from a clean checkout, and + `make beaglebone_black_defconfig && make savedefconfig` leaves no diff. + **Done on a true clean checkout** (a fresh clone of `6d5dbc6` with the `buildroot` submodule, no + `keys/`, `output/` or `dl/`, as in CI): `make docker-check` exits 0 with every check green, + including the executable bit of the overlay scripts surviving git, and `savedefconfig` leaves + `git diff` empty --- From 3c851e85256a58cc3a3de0f2edaaf6132def056d Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 09:02:30 +0700 Subject: [PATCH 51/61] build: a board-side helper that turns each refusal check into one command try_bundle fetches a bundle, works out which slot an install would write, records the boot-selection state and a checksum of that slot, runs rauc install, and says whether anything changed. The bundle script serves it next to the bundles, and quickstart scenario 7 uses it instead of a block of commands that carried comments into the serial console. Co-Authored-By: Claude Sonnet 5.5 --- scripts/make-untrusted-bundles.sh | 2 + scripts/try-bundle-on-board.sh | 73 +++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/quickstart.md | 32 ++++++++----- specs/002-ab-ota-rauc/tasks.md | 3 +- 4 files changed, 98 insertions(+), 12 deletions(-) create mode 100644 scripts/try-bundle-on-board.sh diff --git a/scripts/make-untrusted-bundles.sh b/scripts/make-untrusted-bundles.sh index 3341856..a64053c 100644 --- a/scripts/make-untrusted-bundles.sh +++ b/scripts/make-untrusted-bundles.sh @@ -47,6 +47,8 @@ PREFIX="${BOARD}-${VERSION}" rm -rf "${OUT}" mkdir -p "${OUT}" +# The helper that runs on the board, served from the same directory as the bundles. +cp scripts/try-bundle-on-board.sh "${OUT}/try-bundle.sh" # mkbundle NAME COMPATIBLE CERT KEY: the same `rauc bundle` call as post-image.sh, with the # material and the board string given here. diff --git a/scripts/try-bundle-on-board.sh b/scripts/try-bundle-on-board.sh new file mode 100644 index 0000000..27455d5 --- /dev/null +++ b/scripts/try-bundle-on-board.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# Runs ON THE BOARD, not in the build container. Defines try_bundle, which fetches one bundle from +# the build host, tries to install it, and reports whether anything changed: quickstart scenario 7. +# It is sourced, not executed: +# +# wget -O /tmp/try.sh http://192.168.0.1:8000/try-bundle.sh && . /tmp/try.sh +# try_bundle beaglebone_black--unsigned.raucb +# +# make-untrusted-bundles.sh copies this file next to the bundles as try-bundle.sh. HOST and PORT +# default to the development bench and can be set before sourcing. +HOST="${HOST:-192.168.0.1}" +PORT="${PORT:-8000}" + +try_bundle() { + f="$1" + if [ -z "${f}" ]; then + echo "usage: try_bundle " + return 2 + fi + + # The slot that is not running is the one an install would write. The running one is on the + # kernel command line, which is also what RAUC goes by. + run="$(sed -n 's/.*root=\/dev\/mmcblk0p\([0-9]\).*/\1/p' /proc/cmdline)" + case "${run}" in + 2) tgt=3 ;; + 3) tgt=2 ;; + *) + echo "cannot tell the running slot from /proc/cmdline" + return 2 + ;; + esac + echo "== ${f}" + echo " running slot: /dev/mmcblk0p${run}; an install would write /dev/mmcblk0p${tgt}" + + state_before="$(fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT)" + slot_before="$(dd if=/dev/mmcblk0p"${tgt}" bs=1M count=128 2> /dev/null | sha256sum)" + + rm -f /data/t.raucb + if ! wget -q -O /data/t.raucb "http://${HOST}:${PORT}/${f}"; then + echo " download failed: is the server running on the host?" + return 2 + fi + echo " sha256 on the board: $(sha256sum /data/t.raucb | cut -d' ' -f1)" + + rauc install /data/t.raucb > /tmp/install.out 2>&1 + rc=$? + echo "--- rauc install, without the progress lines:" + grep -v -E 'Copying image|^ *[0-9]+% ' /tmp/install.out + echo "--- rauc install exit status: ${rc}" + + state_after="$(fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT)" + slot_after="$(dd if=/dev/mmcblk0p"${tgt}" bs=1M count=128 2> /dev/null | sha256sum)" + if [ "${state_before}" = "${state_after}" ]; then + echo " boot-selection state: UNCHANGED" + else + echo " boot-selection state: CHANGED" + echo " before: $(echo "${state_before}" | tr '\n' ' ')" + echo " after: $(echo "${state_after}" | tr '\n' ' ')" + fi + if [ "${slot_before}" = "${slot_after}" ]; then + echo " slot p${tgt} (first 128 MiB): UNCHANGED" + else + echo " slot p${tgt} (first 128 MiB): CHANGED" + fi + rm -f /data/t.raucb + if [ "${rc}" -ne 0 ]; then + echo "RESULT: refused" + else + echo "RESULT: installed (reboot to run it; nothing has been confirmed yet)" + fi +} + +echo "try_bundle is defined: try_bundle (server ${HOST}:${PORT})" diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 929f35d..871a3f4 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -207,21 +207,31 @@ expectation, not a quotation. ### Running them -Serve `output//untrusted/` from the host (`python3 -m http.server 8000 --bind 192.168.0.1`). On -the board, for each file `F`, with the target slot (the one that is not running) written `N`: +On the host, serve the directory that holds the bundles and the board-side helper: ```sh -fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT > /tmp/before -dd if=/dev/mmcblk0pN bs=1M count=128 2> /dev/null | sha256sum > /tmp/slot.before -wget -O /data/t.raucb http://192.168.0.1:8000/F && sha256sum /data/t.raucb # compare with the printed hash -rauc install /data/t.raucb # must fail; copy the message -fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT | diff /tmp/before - # no output -dd if=/dev/mmcblk0pN bs=1M count=128 2> /dev/null | sha256sum | diff /tmp/slot.before - # no output -rauc status # unchanged +cd output/beaglebone_black/untrusted && python3 -m http.server 8000 --bind 192.168.0.1 ``` -Run the five refused ones first, the control last: it installs into the other slot, which is a real -update and changes the state. Five distinct messages, five unchanged states, and a control that installs. +On the board, once per boot, fetch the helper and load it; then one command per bundle: + +```sh +wget -O /tmp/try.sh http://192.168.0.1:8000/try-bundle.sh && . /tmp/try.sh +try_bundle beaglebone_black--unsigned.raucb +``` + +`try_bundle` (from `scripts/try-bundle-on-board.sh`) works out which slot is running and which one an +install would write, records the boot-selection state and a checksum of the first 128 MiB of that slot, +downloads the file and prints its SHA-256 (compare it with the one the build container printed), +runs `rauc install` and shows its message and exit status, then says whether the state and the slot +are `UNCHANGED`, and ends with `RESULT: refused` or `RESULT: installed`. Paste the whole output of each +call. Type the commands yourself or paste them without comments: a comment pasted into the serial +console is typed into it too. + +Run the five refused ones first, the control (`good`) last: it installs into the other slot, which is a +real update and changes the state. Expected: five different messages, five `UNCHANGED` pairs, five +`RESULT: refused`, and a control that ends `RESULT: installed`. Then `reboot` once and let the control +run: it should boot, confirm itself, and `cat /etc/build-info` shows its revision. ## 8. State written where it cannot be lost — SC-013, FR-014 diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 7ff88fd..aa60692 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -379,7 +379,8 @@ slots are untouched afterwards. (control and `wrongboard` verify, `unsigned` has no signature, `wrongca` has no issuer, `altered` fails on content, `nousage` verifies on chain and carries no Code Signing usage). What the *device* says is T037's to record -- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 — five refusals, each with a distinct +- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 (run it with `try_bundle`, from + `scripts/try-bundle-on-board.sh`, which prints the state and slot checks for each bundle) — five refusals, each with a distinct message, nothing written, `rauc status` and both slots unchanged after every attempt (SC-004, FR-016 to FR-019) From 2c5c050fcd1616bd2e72cf32750035e3a44e5191 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 16:05:17 +0700 Subject: [PATCH 52/61] docs: five untrusted bundles refused on the board, each for its own reason Unsigned, second CA, altered, other board and no Code Signing usage were each refused with a different message, and the boot-selection state and the target slot were unchanged after every one. The quickstart table now carries the wording the device used. The genuine control has not been run. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t037-untrusted-bundles.log | 72 ++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/quickstart.md | 16 +++---- specs/002-ab-ota-rauc/tasks.md | 9 +++- 3 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 docs/logs/t037-untrusted-bundles.log diff --git a/docs/logs/t037-untrusted-bundles.log b/docs/logs/t037-untrusted-bundles.log new file mode 100644 index 0000000..f3c7798 --- /dev/null +++ b/docs/logs/t037-untrusted-bundles.log @@ -0,0 +1,72 @@ +Scenario 7 (SC-004, FR-016..FR-019), 2026-10-30. Board running slot B (/dev/mmcblk0p3), revision fb19ed4; +every install would have written slot A (/dev/mmcblk0p2). Five bundles built by +scripts/make-untrusted-bundles.sh at revision 6d5dbc6, fetched with the board-side helper +scripts/try-bundle-on-board.sh (try_bundle). Console capture by the user; host clock in brackets. + +EXCERPT: per bundle, the hash on the board, the lines of `rauc install` that say why it stopped, and the +helper's verdict. The repeated "Using central status file", "Using system config file" and "Active slot" +lines and the WARNING copies of each message are left out; nothing else is edited. + +--- 1. unsigned ---------------------------------------------------------------------------- +sha256 on the board: 6bf19497a7f26b923f5abb73146eefd4701173e0aa3530a3eb23bb3eb41be197 (= the build container's) +Checking and mounting bundle... +rauc-Message: Reading bundle: /data/t.raucb +rauc-event-Message: Installation 2d3fda48 failed: Invalid bundle format: Signature size is 0 +exit status 1; boot-selection state: UNCHANGED; slot p2 (first 128 MiB): UNCHANGED; RESULT: refused + +--- 2. signed by a second CA ------------------------------------------------------------------ +sha256 on the board: afa7eb3ae8d9dee55ea73d3922a88620d6df106aefe7dc110a92e2ed642e2294 (= the build container's) +rauc-Message: Verifying bundle signature... +rauc-event-Message: Installation d6f22a80 failed: signature verification failed: Verify error: unable to get local issuer certificate +exit status 1; state: UNCHANGED; slot p2: UNCHANGED; RESULT: refused + +--- 3. altered after signing ----------------------------------------------------------------- +sha256 on the board: e807a19e50fd744009dba8bfe0c22617474b55cd71cfa95e2345c8689c5192b8 (= the build container's) +rauc-Message: Verifying bundle signature... +2084E8B5:error:1700006D:CMS routines:CMS_verify:content verify error:crypto/cms/cms_smime.c:501: +rauc-event-Message: Installation ea824836 failed: signature verification failed: error:1700009E:CMS routines::verification failure +exit status 1; state: UNCHANGED; slot p2: UNCHANGED; RESULT: refused + +--- 4. built for another board ------------------------------------------------------------------ +sha256 on the board: 1119a363398bbea0269525ae0646649aa9b8c1709e6a901abc9f343c5e979f53 (= the build container's) +rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +rauc-Message: Mounting bundle '/data/t.raucb' to '/run/rauc/bundle' +rauc-Message: Starting pre install handler: /usr/lib/ota/pre-install +rauc-event-Message: Installation a5ade74c rejected: Compatible mismatch: Expected 'ota-beaglebone-black' but bundle manifest has 'ota-other-board' +exit status 1; state: UNCHANGED; slot p2: UNCHANGED; RESULT: refused + +--- 5. certificate from the device's own CA, without the Code Signing usage ---------------- +sha256 on the board: 7acbe6714d2350a7bc49ae7b05bffc0eb891773d1fdb91c744ad6f003e8db85e (= the build container's) +rauc-Message: Verifying bundle signature... +rauc-Message: Signer certificate does not specify extended key usage code signing +rauc-event-Message: Installation af1de60d failed: signature verification failed: Verify error: unsuitable certificate purpose +exit status 1; state: UNCHANGED; slot p2: UNCHANGED; RESULT: refused + +--- reading it -------------------------------------------------------------------------- +Result: PASS. Five bundles, five refusals, five different messages, and after each the boot-selection +state and the first 128 MiB of the target slot are byte for byte what they were before. + +1. The messages tell the cases apart, which is what the scenario asked for: + - unsigned: stopped before any signature check ("Verifying bundle signature..." is never printed), + because the trailer says the signature is 0 bytes long. + - second CA: the signature is checked and the chain does not reach the device's CA. + - altered: the signature is checked and the content does not match it (a CMS content failure, not a + chain failure). + - other board: the signature and chain are fine (RAUC says it verified the detached signature), the + bundle is mounted, and the refusal is the compatible string. + - no Code Signing usage: the chain is fine and the certificate is refused for what it may do. RAUC's + own line precedes the OpenSSL one, which shows check-purpose=codesign doing its job (the first + install on hardware failed with the OpenSSL line alone, for every bundle). +2. The "no usage" certificate was refused for its purpose and not for its date, which is why it was + issued with openssl ca -startdate from the CA's own notBefore: there is no "not yet valid" anywhere. +3. The hash on the board equals the hash the build container printed for each of the five files, so + what was refused is what was built. +4. Ordering worth knowing. Case 4 is refused AFTER the bundle was mounted and the pre-install handler + ran (about a second of work), because RAUC checks the compatible string after the signature. It + wrote nothing, as the unchanged slot and state show, so FR-019 holds, but a bundle for another board + gets further into the install than the other four. +5. What the helper does not show: `rauc status` after each attempt, and /data/rauc.status. The + boot-selection state it compares is what rauc status reads, so a change there would have been + caught; the file was not compared. +6. The control (a genuine bundle, which must install) and the reboot that runs it were not part of this + capture. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index 871a3f4..f4d5ba5 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -185,14 +185,14 @@ shows what `openssl` makes of its signature against the device's CA. The hashes CMS signature is not reproducible), so compare the hash on the board with the one printed for the file you copied. Nothing here is committed; the second CA's keys are in the same ignored directory. -| Case | How it is made | Host `openssl` against the device's CA | What the device must say | +| Case | How it is made | Host `openssl` against the device's CA | What the device said (2026-10-30) | |---|---|---|---| | `good` (control) | the genuine bundle, signed by the development material | signature and chain verify | installs; it is a genuine bundle of the running revision | -| `unsigned` | the genuine bundle with its signature cut off and a zero-length trailer | no signature | no valid signature | -| `wrongca` | a **second CA and signing pair**, generated with `scripts/gen-dev-keys.sh` into `output//untrusted/other-ca/`, signs a bundle with the same `rauc bundle --cert/--key` call as `post-image.sh` | unable to get local issuer certificate | the chain does not reach the CA in the device keyring | -| `altered` | the genuine bundle with one payload byte (offset 1 MiB) inverted, signature untouched | content verify error | integrity failure | -| `wrongboard` | valid signature, `compatible=ota-other-board` | signature and chain verify | wrong board (compatible mismatch) | -| `nousage` | a certificate **issued by the device's own CA** but without the Code Signing usage, so the chain is good and only the purpose is wrong | signature and chain verify (the host does not apply RAUC's purpose check) | refused by purpose (`check-purpose=codesign`); the first real install failed this way by accident | +| `unsigned` | the genuine bundle with its signature cut off and a zero-length trailer | no signature | `Invalid bundle format: Signature size is 0`; stops before any signature check | +| `wrongca` | a **second CA and signing pair**, generated with `scripts/gen-dev-keys.sh` into `output//untrusted/other-ca/`, signs a bundle with the same `rauc bundle --cert/--key` call as `post-image.sh` | unable to get local issuer certificate | `signature verification failed: Verify error: unable to get local issuer certificate` | +| `altered` | the genuine bundle with one payload byte (offset 1 MiB) inverted, signature untouched | content verify error | `signature verification failed: ... CMS routines::verification failure` (content, not chain) | +| `wrongboard` | valid signature, `compatible=ota-other-board` | signature and chain verify | `Compatible mismatch: Expected 'ota-beaglebone-black' but bundle manifest has 'ota-other-board'`; refused after the mount and the pre-install handler, nothing written | +| `nousage` | a certificate **issued by the device's own CA** but without the Code Signing usage, so the chain is good and only the purpose is wrong | signature and chain verify (the host does not apply RAUC's purpose check) | `Signer certificate does not specify extended key usage code signing`, then `Verify error: unsuitable certificate purpose` (`check-purpose=codesign`) | Two details behind the table, because both would otherwise make a case test the wrong thing: @@ -202,8 +202,8 @@ Two details behind the table, because both would otherwise make a case test the - The `wrongca` certificates are dated today too, but the chain error comes first: with the board's clock modelled as the image's build time, OpenSSL still reports "unable to get local issuer certificate". -The exact wording the device prints is what this scenario records; the right-hand column is the -expectation, not a quotation. +The right-hand column is the wording the device printed on 2026-10-30 (`docs/logs/t037-untrusted-bundles.log`); +the control had not been run yet. ### Running them diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index aa60692..781980a 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -379,7 +379,7 @@ slots are untouched afterwards. (control and `wrongboard` verify, `unsigned` has no signature, `wrongca` has no issuer, `altered` fails on content, `nousage` verifies on chain and carries no Code Signing usage). What the *device* says is T037's to record -- [ ] T037 [US4] Verify (hardware): quickstart scenario 7 (run it with `try_bundle`, from +- [X] T037 [US4] Verify (hardware): quickstart scenario 7 (run it with `try_bundle`, from `scripts/try-bundle-on-board.sh`, which prints the state and slot checks for each bundle) — five refusals, each with a distinct message, nothing written, `rauc status` and both slots unchanged after every attempt (SC-004, FR-016 to FR-019) @@ -394,6 +394,13 @@ what each slot holds, which are good or bad, and whether an update awaits confir **Independent Test**: on a device that has been updated once and rolled back once, read the status output and confirm it answers all of that in one command. + **Done, 2026-10-30** (`docs/logs/t037-untrusted-bundles.log`): five bundles, five refusals with + five different messages, and after each the boot-selection state and the target slot unchanged. + The wording was: `Signature size is 0` (unsigned), `unable to get local issuer certificate` (second + CA), a CMS `verification failure` (altered), `Compatible mismatch` (other board) and `Signer + certificate does not specify extended key usage code signing` / `unsuitable certificate purpose` + (no Code Signing usage). The genuine control and the reboot that runs it were not captured, and + `rauc status` itself was not printed after each attempt - [X] T038 [US5] Make the failure record the health script writes to `/data` readable on its own: which slot, which condition failed, and when, in a single documented file path named in `contracts/boot-interface.md`. **Done**: `/data/ota-health.log`, one line per event with the From d6a8e3815c8431574ca103b82cb8b30a8d00d27c Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 16:56:21 +0700 Subject: [PATCH 53/61] docs: status reporting on the board, and what it does not say On hardware the console names the chosen slot every boot and a rolled-back device shows the other slot as bad. The single command FR-026 asks for is rauc status --detailed, not rauc status, and even it does not say that an update awaits confirmation or that a slot is confirmed rather than eligible. The contract also said a retired slot leaves BOOT_ORDER; it stays listed with no attempts. T039 stays open on the choice between documenting this and adding an ota-status command. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 2 +- docs/logs/t039-status-reporting.log | 76 +++++++++++++++++++ .../contracts/boot-interface.md | 8 +- specs/002-ab-ota-rauc/quickstart.md | 4 +- specs/002-ab-ota-rauc/tasks.md | 10 ++- 5 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 docs/logs/t039-status-reporting.log diff --git a/README.md b/README.md index 802699e..ab94ae3 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ another install runs. After the reboot: ```bash cat /etc/build-info # the revision now running -rauc status # booted slot, both slots good +rauc status --detailed # booted slot, health and installed version of each slot fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT # the raw state ``` diff --git a/docs/logs/t039-status-reporting.log b/docs/logs/t039-status-reporting.log new file mode 100644 index 0000000..ec7013d --- /dev/null +++ b/docs/logs/t039-status-reporting.log @@ -0,0 +1,76 @@ +Status reporting (FR-026, FR-027, SC-005) and the look of a rolled-back device, 2026-10-30. +Board with slot B (fb19ed4) running, slot A retired by the scenario-B test, then a genuine bundle (6d5dbc6) +installed into A with the helper try_bundle, and a reboot. Console capture by the user; host clock in brackets. +EXCERPT: the status commands; the install's repeated lines and the kernel boot messages are omitted. + +=== A. rolled back: B running and good, A retired ================================================ +# rauc status (plain) +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.1 (B) +x [rootfs.1] (/dev/mmcblk0p3, ext4, booted) bootname: B boot status: good +o [rootfs.0] (/dev/mmcblk0p2, ext4, inactive) bootname: A boot status: bad +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A B +BOOT_A_LEFT=0 +BOOT_B_LEFT=3 +# rauc status --detailed (per slot, what RAUC recorded when it last wrote the slot) +rootfs.1 (B, booted) boot status: good bundle version=fb19ed4 installed 2026-10-29T11:26:44Z count=4 status=ok +rootfs.0 (A) boot status: bad bundle version=fb19ed4-hang installed 2026-10-29T11:10:52Z count=5 status=ok + +=== B. installed, not yet rebooted (pending) ================================================== +# try_bundle beaglebone_black-6d5dbc6-good.raucb + ... Marking target slot rootfs.0 as non-bootable (bad)... ... Marking target slot rootfs.0 as bootable (active/primary)... +boot-selection state: CHANGED before: BOOT_ORDER=A B BOOT_A_LEFT=0 BOOT_B_LEFT=3 + after: BOOT_ORDER=A B BOOT_A_LEFT=3 BOOT_B_LEFT=3 +RESULT: installed +# rauc status (plain) +Booted from: rootfs.1 (/dev/mmcblk0p3) +Activated: rootfs.0 (A) +o [rootfs.1] (/dev/mmcblk0p3, ext4, booted) bootname: B boot status: good +x [rootfs.0] (/dev/mmcblk0p2, ext4, inactive) bootname: A boot status: good +# rauc status --detailed +rootfs.1 (B, booted) boot status: good bundle version=fb19ed4 +rootfs.0 (A) boot status: good bundle version=6d5dbc6 installed 2026-10-30T05:34:19Z count=6 + +=== C. after the reboot, confirmed ================================================================ +[16:51:11] OTA: booting slot A, 2 attempts left +Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait omap_wdt.early_enable=1 +ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-29 18:00:18 UTC +ota-health: slot A confirmed good +# cat /etc/build-info +VERSION=6d5dbc6 +# rauc status +Booted from: rootfs.0 (/dev/mmcblk0p2) +Activated: rootfs.0 (A) +o [rootfs.1] ... inactive bootname: B boot status: good +x [rootfs.0] ... booted bootname: A boot status: good +# rauc status --detailed +rootfs.1 (B) boot status: good bundle version=fb19ed4 +rootfs.0 (A, booted) boot status: good bundle version=6d5dbc6 +# fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT +BOOT_ORDER=A B / BOOT_A_LEFT=3 / BOOT_B_LEFT=3 + +--- reading it against the requirements --------------------------------------------------------- +FR-027 (the console says which slot was chosen): MET. Every boot prints "OTA: booting slot A, 2 attempts + left" (here, and in every capture in this directory), and the kernel command line names the root. +Rolled back vs normal (US5 scenario 3): MET. After the retirement of A, `rauc status` shows the other + slot as `bad` where a normal device shows both `good`, and `--detailed` says what had been installed + there (fb19ed4-hang). It does not say WHY; the hung slot wrote no record (contracts/boot-interface.md). +FR-026 / SC-005 (one command: booted slot, both versions, both healths, pending confirmation): MET ONLY + PARTLY, and only by `rauc status --detailed`, not by the `rauc status` the contract and the README named. + 1. Versions are in `--detailed` only. Plain `rauc status` prints the booted slot and the health of + both slots and no version at all. + 2. The version is the one RAUC recorded when it last wrote the slot, which is the truth for any slot + an update has written. A card that has only been flashed has no record for slot A, so its version + would be missing exactly when someone first asks; this capture does not show that case. + 3. "Pending confirmation" is not stated anywhere. It can be inferred: "Activated" names a different + slot from "Booted from" (B above: installed, not yet run). Nothing says "waiting to be confirmed". + 4. `boot status: good` does not mean confirmed. In B the new slot A is `good` before it has ever + booted, because RAUC's U-Boot backend calls a slot good while it has attempts left. A slot that + has booted but not yet confirmed (BOOT_A_LEFT=2) is `good` too. Only the counter, and the + S99ota-health line, tell confirmed from merely eligible. +Also seen: a slot retired by exhausting its attempts stays in BOOT_ORDER with BOOT__LEFT=0 and + U-Boot skips it (A above). A slot that RAUC itself marks bad when an install starts is removed from + BOOT_ORDER (T030). The contract had said the first of these was "absent from BOOT_ORDER"; corrected. +The genuine control of T037 is closed by section B and C: it installed, booted, confirmed itself and + reports VERSION=6d5dbc6. diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index 7ea8dca..b5a5594 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -53,7 +53,7 @@ bootloader backend reads and writes `BOOT_ORDER` and `BOOT__LEFT` through | Command | Purpose | Requirement | |---|---|---| -| `rauc status` | booted slot, both slots' version and health, pending confirmation | FR-026, SC-005 | +| `rauc status --detailed` | booted slot, both slots' health and, per slot, the version RAUC recorded when it last wrote it. **Plain `rauc status` has no versions.** "Pending" is not printed; read it as `Activated` naming a slot other than `Booted from`. `boot status: good` means *eligible* (it has attempts left), not *confirmed* | FR-026, SC-005 (partly; see tasks T039) | | `rauc install /data/.raucb` | verify, then write the slot that is not running | FR-006, FR-010 | | `rauc status mark-good` | record the running slot good and restore its counter | FR-011 | | `rauc status mark-bad` | force the running slot bad, for testing rollback | SC-003 | @@ -106,8 +106,10 @@ A healthy ordinary boot writes nothing. The file is bounded: once it is over 64 What it cannot hold, and where to look instead: condition 1 (the init sequence reached the script) cannot fail from inside the script, and a slot that **hangs before** `S99ota-health` writes no record at all. -For such a slot the evidence is the boot-selection state: `fw_printenv BOOT__LEFT` at 0 and the -slot absent from `BOOT_ORDER`, and `rauc status` calling it `bad`. That records *that* it was retired, +For such a slot the evidence is the boot-selection state: `fw_printenv BOOT__LEFT` at 0, +and `rauc status` calling it `bad`. A slot retired by running out of attempts stays listed in `BOOT_ORDER` +with `BOOT__LEFT=0` and U-Boot skips it; only a slot that RAUC itself marked bad when an install began is +removed from `BOOT_ORDER`. That records *that* it was retired, not *why*; the reason is "it never confirmed". ## Watchdog diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index f4d5ba5..dde0164 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -68,11 +68,11 @@ board reads the build time, not the real time. Then: ```sh rauc install /data/beaglebone_black-.raucb fw_printenv BOOT_ORDER # "B A" -rauc status # rootfs.1 pending +rauc status # Activated: rootfs.1 while Booted from: rootfs.0 is what "pending" looks like reboot # after reboot cat /etc/build-info # the new VERSION -rauc status # booted rootfs.1, good; rootfs.0 still holds the old version +rauc status --detailed # booted rootfs.1, good; rootfs.0 still holds the old version (plain rauc status prints no versions) cat /data/keep # unchanged -> SC-006 ``` diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 781980a..774b3aa 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -413,7 +413,15 @@ output and confirm it answers all of that in one command. - [ ] T039 [US5] Verify (hardware): `rauc status` in one invocation reports the booted slot, both slots' versions and health, and any pending confirmation (FR-026, SC-005); the boot console identifies the selected slot (FR-027); and a rolled-back device is distinguishable from a - normal boot (SC-013) + normal boot (SC-013). **Run on hardware, 2026-10-30, and left open** + (`docs/logs/t039-status-reporting.log`). Met: the console names the chosen slot at every boot + (FR-027), and a rolled-back device shows the other slot as `bad` where a normal one shows both + `good`. **Only partly met: FR-026 / SC-005.** The single command is `rauc status --detailed`, not + plain `rauc status` (no versions), and even it does not say that an update awaits confirmation + (`Activated` differs from `Booted from` is the only sign), `boot status: good` means eligible and + not confirmed, and a card that was only flashed has no recorded version for slot A. Choice to + make: document `--detailed` and how to read it, or add a small `ota-status` command that prints + the booted slot, both versions, both healths, and an explicit pending/confirmed state --- From 005bca620bc14ed05d45ef14620b3b737978b571 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 17:02:44 +0700 Subject: [PATCH 54/61] board: add ota-status, one command that says where an A/B device stands rauc status has no versions, calls a slot good while it merely has attempts left, and never says that an update awaits confirmation. ota-status reads RAUC, the boot-selection state, /etc/build-info and a marker that S99ota-health writes when it confirms a boot, and says in words which slot runs, whether this boot is confirmed, whether an update is pending, and whether the other slot is standby, pending, retired, unusable or empty. Checked on the host against seven states; the board run is T039. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 4 + README.md | 5 +- .../rootfs_overlay/etc/init.d/S99ota-health | 2 + .../common/rootfs_overlay/usr/bin/ota-status | 124 ++++++++++++++++++ .../contracts/boot-interface.md | 6 +- specs/002-ab-ota-rauc/tasks.md | 8 +- 6 files changed, 144 insertions(+), 5 deletions(-) create mode 100755 board/ota/common/rootfs_overlay/usr/bin/ota-status diff --git a/CLAUDE.md b/CLAUDE.md index 8c31fcb..9139b0f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -147,6 +147,10 @@ Adding a board: create `board/ota//` and `configs/_defconfig`, the created *before* the image is built (this is why `check_keys` refuses to build without the keys); (5) `SOURCE_DATE_EPOCH` is deliberately not the floor, since a commit time can predate the certificate. Rationale and the one known gap: `specs/002-ab-ota-rauc/research.md` R8, FR-033. +- **`ota-status` is the status command.** Plain `rauc status` has no versions and calls any slot with attempts + left `good`, so `ota-status` (overlay `usr/bin`) says running / confirmed / pending / standby / retired / + unusable / empty in words. "Confirmed" comes from the marker `/run/ota-confirmed` that `S99ota-health` writes + when it passes; do not infer it from the counter or from RAUC's `good`. - **The bench network is a fixed address.** `beaglebone_black` has `192.168.0.2/24` in `rootfs_overlay/etc/network/interfaces`, for a board cabled straight to the build host (`192.168.0.1`), which serves bundles with `python3 -m http.server`. There is no DHCP server on that cable and no SSH server diff --git a/README.md b/README.md index ab94ae3..b8acfa3 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,8 @@ another install runs. After the reboot: ```bash cat /etc/build-info # the revision now running -rauc status --detailed # booted slot, health and installed version of each slot +ota-status # running slot, confirmed or not, pending update, each slot's state and version +rauc status --detailed # the raw RAUC view it is built on fw_printenv BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT # the raw state ``` @@ -269,7 +270,7 @@ reset within about 30 s and, having confirmed, keeps its attempts. Why a slot failed is in `/data/ota-health.log`, one line per event with the condition, the slot and the revision (format in [contracts/boot-interface.md](specs/002-ab-ota-rauc/contracts/boot-interface.md)). A slot that hung before the health script ran writes no line; its state, `BOOT__LEFT=0` and `bad` in -`rauc status`, is the evidence. `rauc status mark-bad` is meant for forcing a rollback while testing; the hardware runs of +`rauc status`, is the evidence, and `ota-status` says it in words (`RETIRED: it was tried and never confirmed`). `rauc status mark-bad` is meant for forcing a rollback while testing; the hardware runs of this feature rolled back by other means (a hanging slot, a pulled plug) and did not exercise it. ### Limits worth knowing diff --git a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health index c44b51f..c1202b4 100755 --- a/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health +++ b/board/ota/common/rootfs_overlay/etc/init.d/S99ota-health @@ -128,6 +128,8 @@ case "$1" in record mark-good "NOT CONFIRMED: rauc status mark-good failed" exit 1 fi + # Tell ota-status that this boot is confirmed. On tmpfs, so it never outlives the boot it describes. + echo "${booted}" > /run/ota-confirmed if [ -n "${last_resort}" ]; then record last-resort "confirmed good after a last-resort boot (no slot had attempts left)" else diff --git a/board/ota/common/rootfs_overlay/usr/bin/ota-status b/board/ota/common/rootfs_overlay/usr/bin/ota-status new file mode 100755 index 0000000..eb68769 --- /dev/null +++ b/board/ota/common/rootfs_overlay/usr/bin/ota-status @@ -0,0 +1,124 @@ +#!/bin/sh +# ota-status: where an A/B device stands, in one command, for someone holding it (FR-026, SC-005). +# +# `rauc status` alone does not say enough: it has no versions, it calls a slot "good" while the slot +# merely has attempts left (a slot that has been installed and never booted is "good"), and it never +# says that an update awaits confirmation. This reads RAUC's view, the boot-selection state and the +# marker that S99ota-health leaves when it confirms a slot, and says each of those in words. +# +# ota-status +# +# Board-independent (FR-029): slot names, devices and versions come from RAUC and /etc/build-info. +# Needs root, because rauc and fw_printenv do. +MARK=/run/ota-confirmed +LOG=/data/ota-health.log + +status="$(rauc status --detailed --output-format=shell 2> /dev/null)" +if [ -z "${status}" ]; then + echo "ota-status: 'rauc status' gave nothing; is this an A/B image, and are you root?" >&2 + exit 2 +fi +eval "${status}" + +# RAUC prints "(null)" for a value it does not have. +known() { + case "$1" in + '' | '(null)') return 1 ;; + esac + return 0 +} + +order="$(fw_printenv -n BOOT_ORDER 2> /dev/null)" +build="$(sed -n 's/^VERSION=//p' /etc/build-info 2> /dev/null)" +confirmed="$(cat "${MARK}" 2> /dev/null)" + +# First pass: which slot runs, and which one RAUC says boots next. Both as boot names (A, B). +booted= +primary= +i=0 +# shellcheck disable=SC2154 # set by the eval above +for s in ${RAUC_SYSTEM_SLOTS}; do + i=$((i + 1)) + eval "st=\${RAUC_SLOT_STATE_${i}:-}; bn=\${RAUC_SLOT_BOOTNAME_${i}:-}" + [ "${st}" = booted ] && booted="${bn}" + # shellcheck disable=SC2154 + [ "${s}" = "${RAUC_BOOT_PRIMARY:-}" ] && primary="${bn}" +done + +echo "Running slot : ${booted:-unknown} revision ${build:-unknown}" +if [ -n "${booted}" ] && [ "${confirmed}" = "${booted}" ]; then + echo "Confirmed : yes, this boot passed its health check" +else + echo "Confirmed : NO, not yet. The health check has not finished, or it failed: see ${LOG}" +fi +if [ -n "${primary}" ] && [ "${primary}" != "${booted}" ]; then + echo "Next boot : slot ${primary}. UPDATE PENDING: it is installed and has not been booted yet" +elif [ -n "${primary}" ]; then + echo "Next boot : slot ${primary} (the running one)" +else + echo "Next boot : none eligible: every slot is out of attempts, U-Boot will try slot A once" +fi +echo "Boot order : ${order:-unknown}" +echo + +# Second pass: one block per slot, in the order of their boot names. RAUC lists them in the order +# of a hash table, which is not stable. +slot_order="$( + i=0 + for s in ${RAUC_SYSTEM_SLOTS}; do + i=$((i + 1)) + eval "echo \"\${RAUC_SLOT_BOOTNAME_${i}:-} ${i}\"" + done | sort | cut -d' ' -f2 +)" +# shellcheck disable=SC2154 # dev and ver are assigned by the eval in the loop +for i in ${slot_order}; do + eval "dev=\${RAUC_SLOT_DEVICE_${i}:-}; bn=\${RAUC_SLOT_BOOTNAME_${i}:-}; ver=\${RAUC_SLOT_STATUS_BUNDLE_VERSION_${i}:-}; cnt=\${RAUC_SLOT_STATUS_INSTALLED_COUNT_${i}:-}" + left="$(fw_printenv -n "BOOT_${bn}_LEFT" 2> /dev/null)" + case " ${order} " in + *" ${bn} "*) listed=yes ;; + *) listed=no ;; + esac + + if [ "${bn}" = "${booted}" ]; then + if [ "${confirmed}" = "${bn}" ]; then + state="RUNNING, confirmed" + else + state="RUNNING, NOT CONFIRMED YET" + fi + elif [ -n "${primary}" ] && [ "${bn}" = "${primary}" ]; then + state="PENDING: installed, will boot next" + elif [ "${left}" = 0 ] && [ "${listed}" = yes ]; then + state="RETIRED: it was tried and never confirmed, and is out of boot attempts" + elif [ "${left}" = 0 ]; then + if known "${ver}"; then + state="UNUSABLE: marked bad and out of the boot order (an install into it did not finish, or it was marked by hand)" + else + state="EMPTY: nothing has been installed into it since the card was flashed" + fi + else + state="STANDBY: good, the fallback if the running slot fails" + fi + + echo "Slot ${bn} ${dev}" + echo " state : ${state}" + if [ "${bn}" = "${booted}" ] && [ "${left}" = 0 ]; then + echo " attempts : 0 left, in the boot order: ${listed} (a last-resort boot: U-Boot ran it without spending one)" + else + echo " attempts : ${left:-?} left, in the boot order: ${listed}" + fi + if [ "${bn}" = "${booted}" ]; then + echo " revision : ${build:-unknown} (this image's /etc/build-info)" + fi + if known "${ver}"; then + echo " installed : bundle ${ver}, update number ${cnt:-?} (RAUC's record of the last write)" + else + echo " installed : no record of an update" + fi +done + +if [ -s "${LOG}" ]; then + echo + echo "Health log : ${LOG}, $(wc -l < "${LOG}") record(s); the last one:" + echo " $(tail -n 1 "${LOG}")" +fi +exit 0 diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index b5a5594..8f8863f 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -53,7 +53,8 @@ bootloader backend reads and writes `BOOT_ORDER` and `BOOT__LEFT` through | Command | Purpose | Requirement | |---|---|---| -| `rauc status --detailed` | booted slot, both slots' health and, per slot, the version RAUC recorded when it last wrote it. **Plain `rauc status` has no versions.** "Pending" is not printed; read it as `Activated` naming a slot other than `Booted from`. `boot status: good` means *eligible* (it has attempts left), not *confirmed* | FR-026, SC-005 (partly; see tasks T039) | +| `ota-status` | **the one command for FR-026 / SC-005**: the running slot and its revision, whether this boot is confirmed, whether an update is pending and which slot boots next, the boot order, and for each slot its state in words (`RUNNING, confirmed` / `RUNNING, NOT CONFIRMED YET` / `PENDING` / `STANDBY` / `RETIRED` / `UNUSABLE` / `EMPTY`), its attempts left, and the bundle version RAUC recorded. Reads RAUC, `fw_printenv`, `/etc/build-info` and the marker `/run/ota-confirmed` that `S99ota-health` writes when it confirms a boot; needs root | FR-026, SC-005 | +| `rauc status --detailed` | the raw view `ota-status` is built on: booted slot, both slots' health and, per slot, the version RAUC recorded when it last wrote it. **Plain `rauc status` has no versions.** "Pending" is not printed; read it as `Activated` naming a slot other than `Booted from`. `boot status: good` means *eligible* (it has attempts left), not *confirmed* | FR-026, SC-005 (partly; see tasks T039) | | `rauc install /data/.raucb` | verify, then write the slot that is not running | FR-006, FR-010 | | `rauc status mark-good` | record the running slot good and restore its counter | FR-011 | | `rauc status mark-bad` | force the running slot bad, for testing rollback | SC-003 | @@ -106,7 +107,8 @@ A healthy ordinary boot writes nothing. The file is bounded: once it is over 64 What it cannot hold, and where to look instead: condition 1 (the init sequence reached the script) cannot fail from inside the script, and a slot that **hangs before** `S99ota-health` writes no record at all. -For such a slot the evidence is the boot-selection state: `fw_printenv BOOT__LEFT` at 0, +`ota-status` turns that into words (`RETIRED: it was tried and never confirmed, and is out of boot attempts`), so +the person holding the device does not have to read counters. For such a slot the underlying evidence is the boot-selection state: `fw_printenv BOOT__LEFT` at 0, and `rauc status` calling it `bad`. A slot retired by running out of attempts stays listed in `BOOT_ORDER` with `BOOT__LEFT=0` and U-Boot skips it; only a slot that RAUC itself marked bad when an install began is removed from `BOOT_ORDER`. That records *that* it was retired, diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 774b3aa..883c93f 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -421,7 +421,13 @@ output and confirm it answers all of that in one command. (`Activated` differs from `Booted from` is the only sign), `boot status: good` means eligible and not confirmed, and a card that was only flashed has no recorded version for slot A. Choice to make: document `--detailed` and how to read it, or add a small `ota-status` command that prints - the booted slot, both versions, both healths, and an explicit pending/confirmed state + the booted slot, both versions, both healths, and an explicit pending/confirmed state. + **Chosen: `ota-status`** (`board/ota/common/rootfs_overlay/usr/bin/ota-status`, plus the marker + `/run/ota-confirmed` that `S99ota-health` writes on confirmation). Written and checked on the host + against seven states (confirmed with the other slot retired, update pending, freshly flashed card, + booted but not yet confirmed, an interrupted install, last resort, no RAUC). **T039 stays open until + it is run on the board**: the pending, confirmed and retired states have to be seen there, and the + freshly flashed card is the one case no capture has shown --- From aac6c0e2b1b6d1bd3d43f406cf42e2c2c8086e6c Mon Sep 17 00:00:00 2001 From: mtriSE Date: Fri, 30 Oct 2026 17:16:24 +0700 Subject: [PATCH 55/61] docs: ota-status read on the board in four states, T039 closed Standby and running-confirmed, retired after a slot that hung, pending before the reboot and running-confirmed after it all read as designed, and the retired slot now says what was tried and that it never confirmed. The states seen only on the host, and the freshly flashed card, are listed as not seen. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t039-ota-status.log | 71 ++++++++++++++++++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 9 ++++- 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 docs/logs/t039-ota-status.log diff --git a/docs/logs/t039-ota-status.log b/docs/logs/t039-ota-status.log new file mode 100644 index 0000000..b44b6bc --- /dev/null +++ b/docs/logs/t039-ota-status.log @@ -0,0 +1,71 @@ +ota-status on the board, 2026-10-30. Image 005bca6 (which carries ota-status), installed over the air into +slot B and booted; then the hang bundle (fb19ed4-hang) into slot A and left alone for the watchdog to +retire it; then the new bundle into slot A again, looked at before the reboot and after it. +Console capture by the user; the bracketed prefix of the original is the capturing terminal's clock. + +=== 1. B running the new image, A the fallback ================================================ +# ota-status +Running slot : B revision 005bca6 +Confirmed : yes, this boot passed its health check +Next boot : slot B (the running one) +Boot order : B A +Slot A /dev/mmcblk0p2 state: STANDBY: good, the fallback if the running slot fails + attempts : 3 left, in the boot order: yes + installed : bundle 6d5dbc6, update number 6 (RAUC's record of the last write) +Slot B /dev/mmcblk0p3 state: RUNNING, confirmed + attempts : 3 left, in the boot order: yes + revision : 005bca6 (this image's /etc/build-info) + installed : bundle 005bca6, update number 5 (RAUC's record of the last write) + +=== 2. after three failed boots of the hanging slot A and the fall back to B =================== +# ota-status +Running slot : B revision 005bca6 +Confirmed : yes, this boot passed its health check +Next boot : slot B (the running one) +Boot order : A B +Slot A /dev/mmcblk0p2 state: RETIRED: it was tried and never confirmed, and is out of boot attempts + attempts : 0 left, in the boot order: yes + installed : bundle fb19ed4-hang, update number 7 (RAUC's record of the last write) +Slot B /dev/mmcblk0p3 state: RUNNING, confirmed (attempts 3 left, installed bundle 005bca6, update number 5) + +=== 3. the new bundle installed into A, not yet rebooted ======================================== +# ota-status +Running slot : B revision 005bca6 +Confirmed : yes, this boot passed its health check +Next boot : slot A. UPDATE PENDING: it is installed and has not been booted yet +Boot order : A B +Slot A /dev/mmcblk0p2 state: PENDING: installed, will boot next + attempts : 3 left, in the boot order: yes + installed : bundle 005bca6, update number 8 (RAUC's record of the last write) +Slot B /dev/mmcblk0p3 state: RUNNING, confirmed (attempts 3 left, installed bundle 005bca6, update number 5) + +=== 4. after the reboot =========================================================================== +# ota-status +Running slot : A revision 005bca6 +Confirmed : yes, this boot passed its health check +Next boot : slot A (the running one) +Boot order : A B +Slot A /dev/mmcblk0p2 state: RUNNING, confirmed (attempts 3 left, revision 005bca6, installed bundle 005bca6, update number 8) +Slot B /dev/mmcblk0p3 state: STANDBY: good, the fallback if the running slot fails + (attempts 3 left, installed bundle 005bca6, update number 5) + +--- reading it -------------------------------------------------------------------------------------- +Result: PASS for FR-026 and SC-005 as one command, and for telling a rolled-back device from a normal one. +1. One invocation gives the booted slot and its revision, the health state of both slots in words, the + version RAUC recorded for each, and an explicit statement that an update is pending (capture 3, line + 3 and the slot's own state), which plain `rauc status` did not give. +2. "Confirmed" is the marker S99ota-health writes. Capture 3 is the case where it matters most: slot A + would be `good` in `rauc status` before it has ever booted, and here it is PENDING. +3. The retirement of a slot that hung before the health check (capture 2) is now stated, with the version + that was tried. This is the reason FR-014 asked for, as far as a slot that never reached the health + script can give one: it was tried and never confirmed. It is derived from the counter, not recorded by the + slot, so it cannot say what went wrong inside. +4. The numbers are consistent across the four captures: slot A's update number goes 6, 7 (the hang bundle), + 8 (the new bundle) while slot B's stays 5, and the running slot's revision is the one in /etc/build-info. +5. Only the running slot shows a revision; the other shows the bundle version RAUC recorded. For a slot + written by an update the two are the same string, apart from labels such as fb19ed4-hang that a test + bundle carries in its manifest and not in its /etc/build-info. + +Not seen on hardware, only on the host with stubs: `RUNNING, NOT CONFIRMED YET` (it lasts about ten seconds +at boot), `UNUSABLE`, `EMPTY` and the last-resort note. The freshly flashed card, where slot A has no RAUC +record and slot B is EMPTY, is the case SC-005 most needs and no capture shows it. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 883c93f..a8d8fbd 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -410,7 +410,7 @@ output and confirm it answers all of that in one command. failure is for T035 or T039. **Open, not part of this task**: a slot that hangs before `S99ota-health` leaves no record of *why* (only the counter says it was retired), which is a narrower reading of FR-014 than the spec's wording -- [ ] T039 [US5] Verify (hardware): `rauc status` in one invocation reports the booted slot, both +- [X] T039 [US5] Verify (hardware): `rauc status` in one invocation reports the booted slot, both slots' versions and health, and any pending confirmation (FR-026, SC-005); the boot console identifies the selected slot (FR-027); and a rolled-back device is distinguishable from a normal boot (SC-013). **Run on hardware, 2026-10-30, and left open** @@ -427,7 +427,12 @@ output and confirm it answers all of that in one command. against seven states (confirmed with the other slot retired, update pending, freshly flashed card, booted but not yet confirmed, an interrupted install, last resort, no RAUC). **T039 stays open until it is run on the board**: the pending, confirmed and retired states have to be seen there, and the - freshly flashed card is the one case no capture has shown + freshly flashed card is the one case no capture has shown. + **Done, 2026-10-30** (`docs/logs/t039-ota-status.log`): `ota-status` run on the board in four + states, STANDBY and RUNNING confirmed after the over-the-air install, RETIRED after the hanging slot + was given up, and PENDING before the reboot and RUNNING confirmed after it. All four read as + designed. Not seen on hardware: `NOT CONFIRMED YET`, `UNUSABLE`, `EMPTY`, the last-resort note, and the + freshly flashed card (slot A without a RAUC record, slot B empty) --- From 5447d90ffc79cbe38f3ca0831b925a016211f0f1 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 00:03:48 +0700 Subject: [PATCH 56/61] board: last resort boots slot A, with ota_fallback_slot as the workaround The exhausted-slots path boots slot A without spending an attempt, not the first slot in BOOT_ORDER. Keep that, record the difference as a known issue, and let an operator name another slot with ota_fallback_slot (fw_setenv or the U-Boot prompt). Any value other than B means A, so a typo cannot strand the device. T031 is closed on that basis. The first board run showed "Unknown operator 'eq'": itest takes -eq or ==. Fixed to -eq. The fixed script has not been booted yet; recorded as such. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 6 +++++ board/ota/beaglebone_black/uboot-env.txt | 18 ++++++++++--- docs/logs/t031-last-resort-fallback-slot.log | 21 ++++++++++++++++ .../contracts/boot-interface.md | 16 ++++++++++-- specs/002-ab-ota-rauc/tasks.md | 25 ++++++++++++------- 5 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 docs/logs/t031-last-resort-fallback-slot.log diff --git a/README.md b/README.md index b8acfa3..2db97e9 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,12 @@ this feature rolled back by other means (a hanging slot, a pulled plug) and did - **The bootloader is never updated in the field.** `MLO` and `u-boot.img` are written when the card is flashed and no bundle touches them, nor the boot-selection region. A bootloader fix means reflashing. +- **The last resort is always slot A.** If every slot has run out of attempts, U-Boot says so on the + console and boots slot A once without spending an attempt, not the first slot in `BOOT_ORDER`. With + `BOOT_ORDER=B` and B exhausted that is A, which may be older or empty. To pick B instead, run + `fw_setenv ota_fallback_slot B` from Linux, or `setenv ota_fallback_slot B; saveenv` at the U-Boot + prompt (known issue and workaround: `specs/002-ab-ota-rauc/contracts/boot-interface.md`). The variable + is untested on hardware, and a card flashed before it existed needs its reserved region written again. - **Development images only.** `root` has no password and nothing is hardened; the signing material is development material. A bundle signed by it installs only on an image built with the same CA. - **The clock is a floor, not the real time.** The board has no battery-backed clock; at boot it is raised diff --git a/board/ota/beaglebone_black/uboot-env.txt b/board/ota/beaglebone_black/uboot-env.txt index dd19f12..71770f0 100644 --- a/board/ota/beaglebone_black/uboot-env.txt +++ b/board/ota/beaglebone_black/uboot-env.txt @@ -46,9 +46,19 @@ ota_try_B=setenv ota_slot B; setenv ota_part ${ota_part_B}; setenv ota_left ${BO # Try every slot named in BOOT_ORDER, in order. Falling out of the loop means each # listed slot is out of attempts, or BOOT_ORDER is empty because both were marked -# bad. Say so on the console, then try slot A once without touching any counter, -# rather than halting with no attempt at all. If that fails too, the U-Boot prompt is -# the right place to be: no automatic recovery can help from there. -ota_select=for s in ${BOOT_ORDER}; do run ota_try_${s}; done; echo OTA: no eligible slot, BOOT_ORDER=${BOOT_ORDER}; echo OTA: last resort, booting slot A without spending an attempt; setenv ota_slot A; setenv ota_part ${ota_part_A}; run ota_load_boot +# bad. Say so on the console, then boot the last-resort slot once without touching any +# counter, rather than halting with no attempt at all. If that fails too, the U-Boot +# prompt is the right place to be: no automatic recovery can help from there. +# +# KNOWN ISSUE (specs/002-ab-ota-rauc/tasks.md T031): the last-resort slot is ota_fallback_slot, +# which is A, not "the first slot in BOOT_ORDER". They differ when BOOT_ORDER starts with B and +# B is exhausted: the device then boots A, which may hold an older image or nothing at all. +# Workaround, no reflash: name the slot you want instead, from Linux with +# `fw_setenv ota_fallback_slot B` or at the U-Boot prompt with `setenv ota_fallback_slot B; +# saveenv`. Anything other than B boots A, so a mistyped value cannot leave the device with no +# last resort. This is not a second counter: the last-resort boot never spends an attempt. +ota_fallback_slot=A +ota_last_resort=echo OTA: no eligible slot, BOOT_ORDER=${BOOT_ORDER}; setenv ota_slot A; setenv ota_part ${ota_part_A}; if itest.s ${ota_fallback_slot} -eq B; then setenv ota_slot B; setenv ota_part ${ota_part_B}; fi; echo OTA: last resort, booting slot ${ota_slot} without spending an attempt; run ota_load_boot +ota_select=for s in ${BOOT_ORDER}; do run ota_try_${s}; done; run ota_last_resort bootcmd=run ota_select diff --git a/docs/logs/t031-last-resort-fallback-slot.log b/docs/logs/t031-last-resort-fallback-slot.log new file mode 100644 index 0000000..1f2bf22 --- /dev/null +++ b/docs/logs/t031-last-resort-fallback-slot.log @@ -0,0 +1,21 @@ +T031: last-resort path with ota_fallback_slot, first hardware boot, 2026-10-30 +Source: serial console capture pasted by the operator (timestamps are the host's). + +Image: the build whose ota_last_resort compared the variable with `itest.s ... eq B`. +BOOT_ORDER=A, slot A out of attempts. + +[2026-10-30 22:51:57] OTA: no eligible slot, BOOT_ORDER=A +[2026-10-30 22:51:57] Unknown operator 'eq' +[2026-10-30 22:51:57] OTA: last resort, booting slot A without spending an attempt +[2026-10-30 22:51:57] 7668208 bytes read in 489 ms (15 MiB/s) + +What it shows +1. The path still boots slot A with the default, because an `itest` that fails leaves the slot at A. + That is the fail-safe working, and the reason a mistyped value cannot strand the device. +2. The operator was wrong: U-Boot's itest accepts -lt -gt -eq -ne -ge -le and < > == != <> + (cmd/itest.c op_table), not `eq`. As built, ota_fallback_slot=B could never have taken effect. +3. A host `make check` and a green build did not see this; only the board did. + +Fix: `-eq`, the same spelling the script already uses for `-gt`. Rebuilt; the seeded uboot-env.bin +and the SPL both carry it. NOT yet run on a board: neither the default path with the fix nor +ota_fallback_slot=B has been booted since. diff --git a/specs/002-ab-ota-rauc/contracts/boot-interface.md b/specs/002-ab-ota-rauc/contracts/boot-interface.md index 8f8863f..fcd4ca2 100644 --- a/specs/002-ab-ota-rauc/contracts/boot-interface.md +++ b/specs/002-ab-ota-rauc/contracts/boot-interface.md @@ -37,8 +37,20 @@ Behaviour, in order: - otherwise decrement it, `saveenv`, announce the chosen slot on the console (FR-027), load `/boot/zImage` and the device tree from that slot's partition with `ext4load`, set `bootargs` with that slot as `root=`, mounted read-only, and boot. -2. If every slot is exhausted: announce it on the console, restore one attempt to the first slot in - `BOOT_ORDER` and try it, rather than halting at a prompt (the "both slots bad" edge case). +2. If every slot is exhausted: announce it on the console and boot the **last-resort slot** once, + without spending an attempt, rather than halting at a prompt (the "both slots bad" edge case). The + last-resort slot is `ota_fallback_slot`, which is `A` by default; any value other than `B` also + means `A`. If that boot fails, U-Boot is left at its prompt. + + **Known issue.** The last-resort slot is slot A, not "the first slot in `BOOT_ORDER`". The two differ + when `BOOT_ORDER` starts with B and B is exhausted: the device then boots A, which may hold an older + image or, on a card where B was the only updated slot, nothing useful. The choice was made on purpose + (A is the slot the factory image fills, and the path never touches a counter); what is missing is + following `BOOT_ORDER`. **Workaround, no reflash:** name the slot to use, from Linux with + `fw_setenv ota_fallback_slot B`, or at the U-Boot prompt with `setenv ota_fallback_slot B; saveenv`. + It only changes which slot the last-resort path boots; it is not a counter. A card flashed before + this variable existed keeps the stored environment it was flashed with, and so the old behaviour + (always A), until the reserved region is written again. `bootdelay` is reduced from the measured 2 s; see the boot-time budget in [plan.md](../plan.md). `CONFIG_BOOTCOUNT_LIMIT` and `CONFIG_BOOTCOUNT_AM33XX` are off, so `BOOT__LEFT` is the only diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index a8d8fbd..b6830f5 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -310,15 +310,22 @@ action, and the failure is recorded where it survives. **Independent Test**: install a bundle that cannot boot, reboot, and watch the device return to the previous slot on its own within the documented number of attempts. -- [ ] T031 [US3] Extend `board/ota/beaglebone_black/uboot-env.txt` with the exhausted-slots path: - when every slot is at 0 attempts, announce it on the console, restore one attempt to the first - slot in `BOOT_ORDER` and try it, rather than halting at a prompt. - **Open, found while closing US3**: the path exists and ran on hardware (`t025-mark-good.log`, - run 4), but it does not do what this task, and `boot-interface.md`, say: it boots slot **A** - without spending an attempt (`ota_select` in `uboot-env.txt`), not the first slot in - `BOOT_ORDER` with an attempt restored. They agree when A is first, which is the only case seen so - far; with `BOOT_ORDER=B` and B exhausted it would boot A. Either the script or the text - needs to change, and the choice has not been made +- [X] T031 [US3] Extend `board/ota/beaglebone_black/uboot-env.txt` with the exhausted-slots path: + when every slot is at 0 attempts, announce it on the console and boot rather than halting at a + prompt. **Decided 2026-10-30: the last-resort slot is A, not the first slot in `BOOT_ORDER`**, + and it boots without spending an attempt. The earlier text of this task ("restore one attempt to + the first slot in `BOOT_ORDER` and try it") is withdrawn; `boot-interface.md` now says what the + script does. The difference is a **known issue**, not a defect to fix: with `BOOT_ORDER=B` and B + exhausted the device boots A. **Workaround in the script**: `ota_fallback_slot` (default `A`) + names the last-resort slot; `fw_setenv ota_fallback_slot B` from Linux or `setenv + ota_fallback_slot B; saveenv` at the U-Boot prompt changes it, and any value other than `B` means + `A`. The default path ran on hardware (`t025-mark-good.log`, `boot-baseline-run4.log`). **First + board run (`docs/logs/t031-last-resort-fallback-slot.log`) found `Unknown operator 'eq'`**: + `itest` takes `-eq` or `==`; the path still booted A, as its fail-safe intends, but `B` could not + have worked. Fixed to `-eq`, rebuilt (SPL still links, `make check` passes, the seeded + `uboot-env.bin` carries it); **the fixed script has not been booted**, so the default path after + the fix and `ota_fallback_slot B` are untested. A card flashed earlier keeps its stored environment, so the variable exists only after + the reserved region is written again - [X] T032 [US3] **The kernel change of T014 is not sufficient on its own**: T016 measured 253 seconds at an idle shell with no watchdog client and no reset, so start by finding out what actually keeps the watchdog from firing (research.md R5 lists three candidates in order of From 54eaf729d6a250f70292f4a2b4c3d42e7a6b4022 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 00:04:58 +0700 Subject: [PATCH 57/61] docs: T031 last-resort path reported working on the board The operator ran the fixed script on the board and reported the last-resort path behaving as written. No console capture was attached and it is not stated whether ota_fallback_slot B was tried, so the log records the report as a report and does not claim that B boots. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t031-last-resort-fallback-slot.log | 5 +++++ specs/002-ab-ota-rauc/tasks.md | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/logs/t031-last-resort-fallback-slot.log b/docs/logs/t031-last-resort-fallback-slot.log index 1f2bf22..e87e474 100644 --- a/docs/logs/t031-last-resort-fallback-slot.log +++ b/docs/logs/t031-last-resort-fallback-slot.log @@ -19,3 +19,8 @@ What it shows Fix: `-eq`, the same spelling the script already uses for `-gt`. Rebuilt; the seeded uboot-env.bin and the SPL both carry it. NOT yet run on a board: neither the default path with the fix nor ota_fallback_slot=B has been booted since. + +Second board run, 2026-10-31, with the `-eq` fix +Reported by the operator in conversation: the last-resort path ran on the board and behaved as the new +script says. No console capture was attached, so there is no transcript here; what exactly was run +(default slot A only, or also ota_fallback_slot B) was not stated, and is therefore not claimed. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index b6830f5..a5966d9 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -323,8 +323,9 @@ previous slot on its own within the documented number of attempts. board run (`docs/logs/t031-last-resort-fallback-slot.log`) found `Unknown operator 'eq'`**: `itest` takes `-eq` or `==`; the path still booted A, as its fail-safe intends, but `B` could not have worked. Fixed to `-eq`, rebuilt (SPL still links, `make check` passes, the seeded - `uboot-env.bin` carries it); **the fixed script has not been booted**, so the default path after - the fix and `ota_fallback_slot B` are untested. A card flashed earlier keeps its stored environment, so the variable exists only after + `uboot-env.bin` carries it); **second board run, 2026-10-31: the operator reported the last-resort + path behaving as the new script says**, with no console capture attached (see the same log). Not + recorded as shown: that `ota_fallback_slot B` boots B, since the report does not say it was tried. A card flashed earlier keeps its stored environment, so the variable exists only after the reserved region is written again - [X] T032 [US3] **The kernel change of T014 is not sufficient on its own**: T016 measured 253 seconds at an idle shell with no watchdog client and no reset, so start by finding out what From a3814ce8ba73f4324196dd6723f81579c520d233 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 10:51:01 +0700 Subject: [PATCH 58/61] docs: T035 run on the board, a slot that cannot write the boot state is retired A bundle whose fw_env.config pointed at the wrong offsets failed the fourth health condition, never confirmed, ran out of attempts and was retired; the device came back on the other slot and the reason was readable from /data. The three reboots are the operator's account and only the last of six health log records was shown, and the log says so. Quickstart scenario 8 gets the recipe. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/t035-fw-env-wrong-offset.log | 54 ++++++++++++++++++++++++++ specs/002-ab-ota-rauc/quickstart.md | 8 ++++ specs/002-ab-ota-rauc/tasks.md | 8 +++- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 docs/logs/t035-fw-env-wrong-offset.log diff --git a/docs/logs/t035-fw-env-wrong-offset.log b/docs/logs/t035-fw-env-wrong-offset.log new file mode 100644 index 0000000..cffaf1c --- /dev/null +++ b/docs/logs/t035-fw-env-wrong-offset.log @@ -0,0 +1,54 @@ +T035 / quickstart scenario 8 / SC-013: the boot-selection state cannot be written from the slot +Hardware run by the operator on the BeagleBone Black, 2026-10-31. Timestamps are the host's. + +Setup (as described by the operator) +- A bundle built from a working tree where /etc/fw_env.config pointed at 0xc0000 and 0xe0000 instead + of 0x80000 and 0xa0000 (the gap before the first partition, so reads only). It carries the version + 54eaf72-dirty. U-Boot on the card is unchanged and still reads the real region. +- The board was running slot B (revision 005bca6, confirmed). The bundle was installed into slot A. + +What the operator reported +1. Slot A booted three times, and the board reset each time (three reboots). +2. Each time U-Boot printed "OTA: booting slot A" with BOOT_A_LEFT going down, and ota-health reported + the slot as not confirmed; fw_printenv printed a warning. +3. After the third attempt the board booted slot B on its own, and ota-status on B read as below. + No console transcript of the three attempts was attached; points 1 and 2 are the operator's + account, not a capture. The counts are therefore not shown here beyond "0 left" in the output. + +ota-status on slot B after the rollback (captured): + +[2026-10-31 10:46:10] # ota-status +[2026-10-31 10:46:13] Running slot : B revision 005bca6 +[2026-10-31 10:46:13] Confirmed : yes, this boot passed its health check +[2026-10-31 10:46:13] Next boot : slot B (the running one) +[2026-10-31 10:46:13] Boot order : A B +[2026-10-31 10:46:13] +[2026-10-31 10:46:13] Slot A /dev/mmcblk0p2 +[2026-10-31 10:46:13] state : RETIRED: it was tried and never confirmed, and is out of boot attempts +[2026-10-31 10:46:13] attempts : 0 left, in the boot order: yes +[2026-10-31 10:46:13] installed : bundle 54eaf72-dirty, update number 1 (RAUC's record of the last write) +[2026-10-31 10:46:13] Slot B /dev/mmcblk0p3 +[2026-10-31 10:46:13] state : RUNNING, confirmed +[2026-10-31 10:46:13] attempts : 3 left, in the boot order: yes +[2026-10-31 10:46:13] revision : 005bca6 (this image's /etc/build-info) +[2026-10-31 10:46:13] installed : bundle 005bca6, update number 1 (RAUC's record of the last write) +[2026-10-31 10:46:13] +[2026-10-31 10:46:13] Health log : /data/ota-health.log, 6 record(s); the last one: +[2026-10-31 10:46:13] 2026-10-31 03:33:56 UTC up=7s build=54eaf72-dirty slot=A condition=boot-state: NOT CONFIRMED: boot-selection state is unreadable (BOOT_A_LEFT) + +What it shows +- The condition that failed is the fourth one, boot-state, with the variable named in the record. + Scenario 8 expected exactly that; research on condition 2 (RAUC reading the same region) did not + pre-empt it. +- The slot with the bad bundle was never confirmed (RETIRED, 0 attempts left), the device returned to + slot B unaided, and the reason was read from /data after the reboot, by ota-status on B. +- Slot B kept its three attempts and is confirmed. + +What it does not show +- The log has 6 records and only the last one is shown. Three attempts would give three records of + this kind if nothing else wrote to it; what the other five are was not read. The file was not + catted in full. +- The U-Boot line for each of the three attempts, and the watchdog reset time per attempt (not + measured here; T034 holds the ~49 s figure). +- The warning text fw_printenv printed. +- The clock in the record (2026-10-31 03:33:56 UTC) is the device's floor plus uptime, not real time. diff --git a/specs/002-ab-ota-rauc/quickstart.md b/specs/002-ab-ota-rauc/quickstart.md index dde0164..20db2b8 100644 --- a/specs/002-ab-ota-rauc/quickstart.md +++ b/specs/002-ab-ota-rauc/quickstart.md @@ -239,6 +239,14 @@ Make `fw_setenv` fail (point `/etc/fw_env.config` at a wrong offset on a test im check must fail its fourth condition, the slot must never be marked good, the device must roll back, and the reason must survive the reboot in `/data`. +How it was run (2026-10-31, `docs/logs/t035-fw-env-wrong-offset.log`): edit the overlay's +`etc/fw_env.config` to `0xc0000` and `0xe0000` (the gap before the first partition: reads only, so +`fw_printenv` fails on a bad CRC and writes nothing), build, keep the bundle (its version ends in +`-dirty`), then `git checkout` the file. Do not run `make check` with the edit in place: it exists to +refuse exactly that mismatch. Install the bundle from the slot that is running, so RAUC uses the good +configuration; the new slot then fails its fourth condition. Expect three `OTA: booting slot` lines, a +reset of about 50 s each, and the other slot after the third. + ## 9. Footprint re-measured — SC-007 From the build host and the device, and then into the README: diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index a5966d9..5b0e23d 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -360,10 +360,16 @@ previous slot on its own within the documented number of attempts. (`docs/logs/t016-env-agreement.log`): 253 s at an idle shell, no reset, on a kernel without `early_enable`, which is the same cause found in the driver source (research R5); it was not taken on the final image -- [ ] T035 [US3] Verify (hardware): quickstart scenario 8 — with `/etc/fw_env.config` pointed at a +- [X] T035 [US3] Verify (hardware): quickstart scenario 8 — with `/etc/fw_env.config` pointed at a wrong offset on a test image, the health check must fail its fourth condition, the slot must never be marked good, the device must roll back, and the reason must survive the reboot in `/data` (SC-013) + **Run on hardware, 2026-10-31** (`docs/logs/t035-fw-env-wrong-offset.log`): a bundle whose + `fw_env.config` pointed at `0xc0000`/`0xe0000` was installed into the idle slot; that slot + failed condition 4 (`boot-state ... unreadable (BOOT_A_LEFT)`), ended `RETIRED` with 0 attempts + left, the device came back on the other slot unaided, and the reason was read from `/data` after + the reboot. The three reboots and the per-attempt U-Boot lines are the operator's account, not + a capture, and only the last of six health-log records was shown --- From 8f2448a861d5838f4e8fce0a6b8fe92d0091ec37 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 11:05:52 +0700 Subject: [PATCH 59/61] docs: boot time of the A/B image measured, 11.61 s against a 12.65 s budget Three grabserial runs on the board with S00ota-clock and S99ota-health in the image: 11.614 s from the SPL banner to the login prompt, spread 0.12%, 1.0% over the single-slot baseline. About 0.9 s sits before the health script's "confirmed good" line; that is read from neighbouring timestamps, not isolated. T043 is closed. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 14 +- docs/boot-baseline-beaglebone-black.md | 39 ++++ docs/logs/boot-baseline-run7.log | 301 +++++++++++++++++++++++++ docs/logs/boot-baseline-run8.log | Bin 0 -> 27314 bytes docs/logs/boot-baseline-run9.log | Bin 0 -> 27229 bytes specs/002-ab-ota-rauc/tasks.md | 10 +- 6 files changed, 353 insertions(+), 11 deletions(-) create mode 100644 docs/logs/boot-baseline-run7.log create mode 100644 docs/logs/boot-baseline-run8.log create mode 100644 docs/logs/boot-baseline-run9.log diff --git a/README.md b/README.md index 2db97e9..f5f7045 100644 --- a/README.md +++ b/README.md @@ -140,12 +140,12 @@ output with `dumpe2fs -h` and `mdir`, both in `output//host/`): | `sdcard.img` | 1313 MiB declared, **63.0 MiB** of real data | the rest are holes | fits a 2 GB card | | Kernel inside each slot (`/boot/zImage`) | 7.3 MiB | | | -Boot time of the A/B image is **not measured yet** with the method below. What exists are the one-second -host timestamps of the hardware captures in `docs/logs/`, which put the SPL banner to the login prompt at -about 11 to 12 s, against a budget of 12.65 s (10% over 11.50 s, SC-008). That is too close to call from -timestamps of that resolution; the `grabserial` runs, three of them, are still to be done on the board, and -the A/B image has gained `S00ota-clock`, `S99ota-health`, a static address, the RTC driver and SquashFS -since the baseline. +Boot time of the A/B image, with `S00ota-clock`, `S99ota-health`, the static address, the RTC driver and +SquashFS: **11.61 s** from the U-Boot SPL banner to the login prompt (mean of three `grabserial` runs, spread +0.12%), against a budget of 12.65 s and the 11.50 s single-slot baseline, so 1.0% slower. About a second of +that is the health script, which confirms the slot before the login prompt appears. Per-phase reading and +the raw logs (`boot-baseline-run7.log` to `run9.log`) are in +[docs/boot-baseline-beaglebone-black.md](docs/boot-baseline-beaglebone-black.md). Measured on GitHub-hosted runners for `beaglebone_black` (`build.yml`, 2026-10-26): @@ -162,7 +162,7 @@ artifact `sdcard.img.xz` is about 14.7 MB (`sdcard.img` is 76 MiB). Footprint of that image: `rootfs.ext4` is a 60 MiB filesystem (512 MiB partition) with about 39 MiB used (65%); the FAT16 boot partition has about 9.0 MiB of its 16 MiB used (56%). -Boot time on hardware: **11.50 s** from the U-Boot SPL banner to the login prompt (mean of three +Boot time of the original single-slot image on hardware: **11.50 s** from the U-Boot SPL banner to the login prompt (mean of three runs, spread 1.2%), about 12.0 s from power-on. Of that, 2.08 s is the `bootdelay` countdown and 5.89 s is kernel plus init. Method, per-phase breakdown and the serial logs are in [docs/boot-baseline-beaglebone-black.md](docs/boot-baseline-beaglebone-black.md); reproduce it with diff --git a/docs/boot-baseline-beaglebone-black.md b/docs/boot-baseline-beaglebone-black.md index 269eec3..ad9ed26 100644 --- a/docs/boot-baseline-beaglebone-black.md +++ b/docs/boot-baseline-beaglebone-black.md @@ -177,3 +177,42 @@ spent every attempt without a `rauc status mark-good`. It is kept because its lo This covers User Story 1 only. The health script and the watchdog feeder add work after init, so the figure is measured again, and the README baseline updated, once those exist. + +## With the health script, the watchdog and the clock floor (feature 002, T043) + +Measured on 2026-10-31 on `sdcard.img` built from commit `54eaf72` (clean tree; the commits after it +change documentation only), by the method above, from `docs/logs/boot-baseline-run7.log` to `run9.log`. +The card was freshly flashed and booted once to settle, which is not counted. Each run is a cold power +cycle, with slot A confirming at the end of it. The image now has `S00ota-clock`, `S99ota-health` (which +runs `rauc status`, reads and writes the boot state, probes `/data` and calls `mark-good` before the +login prompt), a static address, the RTC driver built in and SquashFS. + +| Run | "Starting kernel" | `ota-health: ... confirmed good` | Login prompt | +|---|---|---|---| +| 7 | 2.931 s | 11.490 s | 11.622 s | +| 8 | 2.935 s | 11.477 s | 11.608 s | +| 9 | 2.931 s | 11.482 s | 11.612 s | +| **mean** | 2.932 s | 11.483 s | **11.614 s** | + +The spread is 0.014 s (0.12%). The budget is 12.65 s, so this **passes with 1.04 s to spare**, and +against the 11.50 s baseline it is 0.114 s, or **1.0%**, slower (SC-008 allows 10%). Against the A/B +measurement before the health script (10.512 s, runs 4 to 6) it is 1.10 s slower. Both have the same +one-second `bootdelay` and the same "Starting kernel" time, so the difference is all after the kernel +starts. + +Where the extra second sits, read from the serial log (run 7; the others match): + +- Kernel start to login prompt is now 8.68 s, against 7.59 s before the health script. +- The line `ota-health: slot A confirmed good` comes **0.896 s** after `Starting crond: OK`, the line before + it. That gap is the script's checks (RAUC status, the boot-state read and write-back, the `/data` + probe with a `sync`, `mark-good`). It is read from timestamps of neighbouring lines, so it is the + script plus anything else init did in that window, not an isolated measurement of the script. +- The login prompt follows the confirmation by 0.13 s. +- `S00ota-clock` costs no visible time: its line arrives 0.156 s after the previous one, and the previous + one is the `/data` journal recovery (`EXT4-fs (mmcblk0p4): recovery complete`, 0.31 s), which is the + price of cutting the power on every run. A clean shutdown does not pay it. + +Two notes on the logs. Runs 8 and 9 start with a line at 0.459 and 0.449 s: that is ROM to SPL banner, +before the clock resets at the match, as in `run3`. It is not part of the figures above; adding it gives +about 12.1 s from power-on. Run 7 does not show it. And all three took the normal path, slot A with two +attempts left, so no last-resort boot is in this set. diff --git a/docs/logs/boot-baseline-run7.log b/docs/logs/boot-baseline-run7.log new file mode 100644 index 0000000..2401958 --- /dev/null +++ b/docs/logs/boot-baseline-run7.log @@ -0,0 +1,301 @@ +[0.000001 0.000001] +[0.000305 0.000304] U-Boot SPL 2026.07 (Oct 30 2026 - 15:55:14 +0000) +[0.003565 0.003565] Trying to boot from MMC1 +[0.667868 0.664304] +[0.668292 0.000423] +[0.668400 0.000109] U-Boot 2026.07 (Oct 30 2026 - 15:55:14 +0000) +[0.672891 0.004491] +[0.672935 0.000044] CPU : AM335X-GP rev 2.1 +[0.674150 0.001215] Model: TI AM335x BeagleBone Black +[0.675498 0.001348] DRAM: 512 MiB +[0.758857 0.083359] Core: 164 devices, 19 uclasses, devicetree: separate +[0.773225 0.014368] WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) +[0.780702 0.007477] NAND: 0 MiB +[1.183754 0.403053] MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 +[1.195733 0.011979] Loading Environment from MMC... Reading from redundant MMC(0)... OK +[1.317841 0.122108] Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in +[1.347311 0.029470] MAC de:ad:be:ef:00:01 +[1.349810 0.002499] HOST MAC de:ad:be:ef:00:00 +[1.350111 0.000301] RNDIS ready +[1.354485 0.004375] , eth3: usb_ether +[1.360020 0.005535] Hit any key to stop autoboot: 1Hit any key to stop autoboot: 0 +[2.369401 1.009381] Saving Environment to MMC... Writing to MMC(0)... OK +[2.383002 0.013602] OTA: booting slot A, 2 attempts left +[2.877416 0.494413] 7668208 bytes read in 489 ms (15 MiB/s) +[2.890529 0.013113] 70396 bytes read in 7 ms (9.6 MiB/s) +[2.896966 0.006437] Kernel image @ 0x82000000 [ 0x000000 - 0x7501f0 ] +[2.898339 0.001373] ## Flattened Device Tree blob at 88000000 +[2.903202 0.004863] Booting using the fdt blob at 0x88000000 +[2.906255 0.003054] Working FDT set to 88000000 +[2.910148 0.003892] Loading Device Tree to 9cf04000, end 9cf182fb ... OK +[2.915566 0.005419] Working FDT set to 9cf04000 +[2.930972 0.015406] +[2.931320 0.000348] Starting kernel ... +[2.931877 0.000557] +[4.626230 1.694353] [ 0.000000] Booting Linux on physical CPU 0x0 +[4.629480 0.003249] [ 0.000000] Linux version 6.18.38 (br@fbc8e87d4e0a) (arm-linux-gcc.br_real (Buildroot 2021.11-18033-g83947c7bb6) 14.3.0, GNU ld (GNU Binutils) 2.43.1) #5 SMP Thu Oct 29 11:03:14 UTC 2026 +[4.646266 0.016786] [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d +[4.656111 0.009845] [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache +[4.661511 0.005400] [ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black +[4.666157 0.004646] [ 0.000000] Memory policy: Data cache writeback +[4.671504 0.005346] [ 0.000000] cma: Reserved 16 MiB at 0x9e800000 +[4.677001 0.005497] [ 0.000000] Zone ranges: +[4.679654 0.002653] [ 0.000000] Normal [mem 0x0000000080000000-0x000000009fdfffff] +[4.685456 0.005802] [ 0.000000] HighMem empty +[4.688193 0.002738] [ 0.000000] Movable zone start for each node +[4.692883 0.004690] [ 0.000000] Early memory node ranges +[4.696753 0.003869] [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fdfffff] +[4.702193 0.005440] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fdfffff] +[4.708178 0.005985] [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges +[4.716110 0.007932] [ 0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT +[4.721915 0.005805] [ 0.000000] CPU: All CPU(s) started in SVC mode. +[4.727758 0.005843] [ 0.000000] AM335X ES2.1 (sgx neon) +[4.730297 0.002539] [ 0.000000] percpu: Embedded 17 pages/cpu s40396 r8192 d21044 u69632 +[4.736356 0.006059] [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait omap_wdt.early_enable=1 +[4.749831 0.013475] [ 0.000000] printk: log buffer data + meta data: 65536 + 204800 = 270336 bytes +[4.756110 0.006279] [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) +[4.763791 0.007680] [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) +[4.772063 0.008272] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130560 +[4.778331 0.006268] [ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off +[4.786087 0.007756] [ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[4.792116 0.006028] [ 0.000000] rcu: Hierarchical RCU implementation. +[4.798652 0.006537] [ 0.000000] rcu: RCU event tracing is enabled. +[4.800480 0.001828] [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. +[4.808695 0.008215] [ 0.000000] Tracing variant of Tasks RCU enabled. +[4.811952 0.003257] [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. +[4.820842 0.008890] [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1 +[4.825665 0.004824] [ 0.000000] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1. +[4.836692 0.011026] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 +[4.842155 0.005464] [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts +[4.848125 0.005969] [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. +[4.856216 0.008092] [ 0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000 +[4.865234 0.009017] [ 0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns +[4.874644 0.009410] [ 0.000026] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns +[4.881612 0.006968] [ 0.000472] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000 +[4.892735 0.011123] [ 0.001900] Console: colour dummy device 80x30 +[4.898072 0.005338] [ 0.001999] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736) +[4.903668 0.005595] [ 0.090578] CPU: Testing write buffer coherency: ok +[4.909288 0.005620] [ 0.090663] CPU0: Spectre v2: using BPIALL workaround +[4.912435 0.003147] [ 0.090673] pid_max: default: 32768 minimum: 301 +[4.919527 0.007092] [ 0.090851] LSM: initializing lsm=capability +[4.923218 0.003690] [ 0.091012] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.930099 0.006881] [ 0.091032] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) +[4.937447 0.007348] [ 0.092638] CPU0: thread -1, cpu 0, socket -1, mpidr 0 +[4.943065 0.005619] [ 0.092700] cacheinfo: Unable to detect cache hierarchy for CPU 0 +[4.948867 0.005801] [ 0.094702] Setting up static identity map for 0x80100000 - 0x80100078 +[4.954427 0.005561] [ 0.095019] rcu: Hierarchical SRCU implementation. +[4.959912 0.005484] [ 0.095030] rcu: Max phase no-delay instances is 1000. +[4.965302 0.005390] [ 0.096044] smp: Bringing up secondary CPUs ... +[4.971022 0.005720] [ 0.096090] smp: Brought up 1 node, 1 CPU +[4.975370 0.004348] [ 0.096101] SMP: Total of 1 processors activated (996.14 BogoMIPS). +[4.980005 0.004634] [ 0.096114] CPU: All CPU(s) started in SVC mode. +[4.985516 0.005511] [ 0.096353] Memory: 480864K/522240K available (11264K kernel code, 1172K rwdata, 2844K rodata, 1024K init, 258K bss, 23224K reserved, 16384K cma-reserved, 0K highmem) +[4.999036 0.013520] [ 0.097162] devtmpfs: initialized +[5.002013 0.002977] [ 0.112711] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 +[5.010277 0.008263] [ 0.113366] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns +[5.021316 0.011039] [ 0.113423] posixtimers hash table entries: 512 (order: 0, 4096 bytes, linear) +[5.027194 0.005879] [ 0.113449] futex hash table entries: 256 (16384 bytes on 1 NUMA nodes, total 16 KiB, linear). +[5.035685 0.008491] [ 0.114574] pinctrl core: initialized pinctrl subsystem +[5.042162 0.006477] [ 0.116676] NET: Registered PF_NETLINK/PF_ROUTE protocol family +[5.046906 0.004744] [ 0.119494] DMA: preallocated 256 KiB pool for atomic coherent allocations +[5.054838 0.007932] [ 0.120103] audit: initializing netlink subsys (disabled) +[5.060607 0.005769] [ 0.121703] thermal_sys: Registered thermal governor 'fair_share' +[5.066249 0.005642] [ 0.121720] thermal_sys: Registered thermal governor 'step_wise' +[5.071851 0.005602] [ 0.121731] thermal_sys: Registered thermal governor 'user_space' +[5.077658 0.005808] [ 0.121880] audit: type=2000 audit(0.120:1): state=initialized audit_enabled=0 res=1 +[5.085874 0.008216] [ 0.121915] cpuidle: using governor menu +[5.088797 0.002923] [ 0.143182] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.109077 0.020280] [ 0.144146] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.124835 0.015757] [ 0.146212] No ATAGs? +[5.125126 0.000292] [ 0.146250] hw-breakpoint: debug architecture 0x4 unsupported. +[5.133141 0.008015] [ 0.148948] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible. +[5.141842 0.008700] [ 0.154016] iommu: Default domain type: Translated +[5.144783 0.002941] [ 0.154039] iommu: DMA domain TLB invalidation policy: strict mode +[5.152838 0.008055] [ 0.161330] SCSI subsystem initialized +[5.155761 0.002924] [ 0.162181] pps_core: LinuxPPS API ver. 1 registered +[5.161227 0.005466] [ 0.162193] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti +[5.170019 0.008792] [ 0.162219] PTP clock support registered +[5.174078 0.004058] [ 0.171301] vgaarb: loaded +[5.175658 0.001581] [ 0.172073] clocksource: Switched to clocksource dmtimer +[5.181127 0.005469] [ 0.172788] VFS: Disk quotas dquot_6.6.0 +[5.186545 0.005418] [ 0.172849] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) +[5.192339 0.005794] [ 0.197692] NET: Registered PF_INET protocol family +[5.197782 0.005443] [ 0.198032] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) +[5.206016 0.008235] [ 0.199498] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) +[5.214396 0.008380] [ 0.199536] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) +[5.220525 0.006129] [ 0.199555] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) +[5.229577 0.009052] [ 0.199599] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) +[5.236956 0.007379] [ 0.199699] TCP: Hash tables configured (established 4096 bind 4096) +[5.242599 0.005643] [ 0.199823] UDP hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.248518 0.005919] [ 0.199859] UDP-Lite hash table entries: 256 (order: 2, 14336 bytes, linear) +[5.257147 0.008629] [ 0.200068] NET: Registered PF_UNIX/PF_LOCAL protocol family +[5.262155 0.005008] [ 0.212771] RPC: Registered named UNIX socket transport module. +[5.267858 0.005702] [ 0.212793] RPC: Registered udp transport module. +[5.273349 0.005491] [ 0.212799] RPC: Registered tcp transport module. +[5.276365 0.003016] [ 0.212803] RPC: Registered tcp-with-tls transport module. +[5.281980 0.005615] [ 0.212808] RPC: Registered tcp NFSv4.1 backchannel transport module. +[5.290376 0.008396] [ 0.212836] PCI: CLS 0 bytes, default 64 +[5.292996 0.002620] [ 0.214267] Initialise system trusted keyrings +[5.298415 0.005419] [ 0.215088] workingset: timestamp_bits=14 max_order=17 bucket_order=3 +[5.304123 0.005707] [ 0.215768] squashfs: version 4.0 (2009/01/31) Phillip Lougher +[5.309858 0.005735] [ 0.216894] NFS: Registering the id_resolver key type +[5.315380 0.005522] [ 0.216962] Key type id_resolver registered +[5.318422 0.003043] [ 0.216969] Key type id_legacy registered +[5.324339 0.005917] [ 0.217090] jffs2: version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc. +[5.329736 0.005397] [ 0.217568] Key type asymmetric registered +[5.334891 0.005155] [ 0.217588] Asymmetric key parser 'x509' registered +[5.340752 0.005861] [ 0.217660] io scheduler mq-deadline registered +[5.343802 0.003050] [ 0.217676] io scheduler kyber registered +[5.348871 0.005069] [ 0.217762] io scheduler bfq registered +[5.352125 0.003254] [ 0.219607] target-module@4b000000:target-module@140000:pmu@0:fck: device ID is greater than 24 +[5.360288 0.008162] [ 0.232216] ledtrig-cpu: registered to indicate activity on CPUs +[5.365723 0.005436] [ 0.235961] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled +[5.373966 0.008243] [ 0.278670] brd: module loaded +[5.377660 0.003694] [ 0.306572] loop: module loaded +[5.379872 0.002212] [ 0.307555] mtdoops: mtd device (mtddev=name/number) must be supplied +[5.385355 0.005483] [ 0.310692] i2c_dev: i2c /dev entries driver +[5.391489 0.006134] [ 0.311736] cpuidle: enable-method property 'ti,am3352' found operations +[5.396548 0.005058] [ 0.312369] sdhci: Secure Digital Host Controller Interface driver +[5.402942 0.006395] [ 0.312381] sdhci: Copyright(c) Pierre Ossman +[5.408078 0.005136] [ 0.312596] sdhci-pltfm: SDHCI platform and OF driver helper +[5.413335 0.005257] [ 0.314118] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 (8000000f) counters available +[5.422159 0.008824] [ 0.314653] Initializing XFRM netlink socket +[5.427150 0.004992] [ 0.314830] NET: Registered PF_INET6 protocol family +[5.430681 0.003530] [ 0.316811] Segment Routing with IPv6 +[5.437147 0.006466] [ 0.316898] In-situ OAM (IOAM) with IPv6 +[5.438626 0.001478] [ 0.316995] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver +[5.444232 0.005607] [ 0.317958] NET: Registered PF_PACKET protocol family +[5.449856 0.005624] [ 0.317985] NET: Registered PF_KEY protocol family +[5.455596 0.005739] [ 0.318110] Key type dns_resolver registered +[5.458351 0.002756] [ 0.318322] ThumbEE CPU extension supported. +[5.463733 0.005382] [ 0.318345] Registering SWP/SWPB emulation handler +[5.469962 0.006229] [ 0.318795] omap_voltage_late_init: Voltage driver support not added +[5.474872 0.004910] [ 0.319420] SmartReflex Class3 initialized +[5.478118 0.003246] [ 0.353181] Loading compiled-in X.509 certificates +[5.483956 0.005838] [ 0.395307] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.500654 0.016698] [ 0.401316] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.517238 0.016584] [ 0.421504] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.533852 0.016614] [ 0.422670] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.550766 0.016914] [ 0.426185] /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/clkout2-pins +[5.570196 0.019430] [ 0.426772] pinctrl-single 44e10800.pinmux: 142 pins, size 568 +[5.575783 0.005587] [ 0.465653] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec +[5.583977 0.008193] [ 0.470620] omap_rtc 44e3e000.rtc: registered as rtc0 +[5.589520 0.005543] [ 0.470699] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800) +[5.597808 0.008288] [ 0.473314] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.614844 0.017036] [ 0.518125] OMAP GPIO hardware version 0.1 +[5.617760 0.002916] [ 0.544303] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz +[5.623366 0.005606] [ 0.581064] 48000000.interconnect:segment@200000:target-module@0:mpu@0:fck: device ID is greater than 24 +[5.634320 0.010955] [ 0.581988] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.651659 0.017339] [ 0.585113] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.668435 0.016776] [ 0.585813] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[5.684796 0.016361] [ 0.585977] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[5.701615 0.016819] [ 0.593761] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[5.710013 0.008398] [ 0.594235] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[5.718262 0.008249] [ 0.672711] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 +[5.725663 0.007401] [ 0.829065] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 +[5.736176 0.010513] [ 0.829670] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4 +[5.740871 0.004695] [ 0.829690] cpsw-switch 4a100000.switch: ALE Table size 1024, Policers 0 +[5.746816 0.005944] [ 0.830017] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies) +[5.754933 0.008117] [ 0.830037] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec +[5.765888 0.010955] [ 0.830145] cpsw-switch 4a100000.switch: Detected MACID = 00:35:ff:9a:3f:14 +[5.774239 0.008350] [ 0.832185] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0) +[5.782759 0.008520] [ 0.851961] debugfs: '49000000.dma' already exists in 'dmaengine' +[5.788737 0.005978] [ 0.852008] edma 49000000.dma: TI EDMA DMA engine driver +[5.794556 0.005819] [ 0.915487] ti-sysc 44e31000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@44c00000/segment@200000/target-module@31000/timer@0 +[5.810630 0.016075] [ 0.915546] ti-sysc 48040000.target-module: Failed to create device link (0x180) with supplier ocp for /ocp/interconnect@48000000/segment@0/target-module@40000/timer@0 +[5.826989 0.016359] [ 0.920432] printk: legacy console [ttyS0] disabled +[5.830398 0.003409] [ 0.921329] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 36, base_baud = 3000000) is a 8250 +[5.840633 0.010235] [ 0.921418] printk: legacy console [ttyS0] enabled +[6.158691 0.318057] [ 2.453006] tps65217-pmic: Failed to locate of_node [id: -1] +[6.164295 0.005605] [ 2.459091] tps65217-bl: Failed to locate of_node [id: -1] +[6.171562 0.007266] [ 2.466536] platform tps65217-charger: DMA mask not set +[6.180343 0.008781] [ 2.473901] platform tps65217-pwrbutton: DMA mask not set +[6.186103 0.005760] [ 2.481288] tps65217 0-0024: TPS65217 ID 0xe version 1.2 +[6.190471 0.004369] [ 2.487359] /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70 +[6.209707 0.019236] [ 2.504752] /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70: Fixed dependency cycle(s) with /ocp/interconnect@48000000/segment@300000/target-module@e000/lcdc@0 +[6.226775 0.017068] [ 2.522173] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz +[6.234738 0.007962] [ 2.530093] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22) +[6.243522 0.008784] [ 2.538974] sdhci-omap 48060000.mmc: Got CD GPIO +[6.246863 0.003342] [ 2.544005] sdhci-omap 48060000.mmc: supply pbias not found, using dummy regulator +[6.258956 0.012093] [ 2.554128] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator +[6.265760 0.006804] [ 2.562545] sdhci-omap 481d8000.mmc: supply pbias not found, using dummy regulator +[6.276036 0.010276] [ 2.570516] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator +[6.291922 0.015885] [ 2.586809] clk: Disabling unused clocks +[6.294782 0.002860] [ 2.590984] PM: genpd: Disabling unused power domains +[6.303560 0.008779] [ 2.598487] check access for rdinit=/init failed: -2, ignoring +[6.315828 0.012268] [ 2.611035] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA +[6.322259 0.006431] [ 2.619337] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA +[6.331721 0.009462] [ 2.628229] Waiting for root device /dev/mmcblk0p2... +[6.377831 0.046110] [ 2.672947] mmc0: new high speed SDXC card at address 0001 +[6.382315 0.004483] [ 2.679802] mmcblk0: mmc0:0001 SD16G 58.7 GiB +[6.392318 0.010004] [ 2.687606] mmcblk0: p1 p2 p3 p4 +[6.427993 0.035675] [ 2.723270] mmc1: new high speed MMC card at address 0001 +[6.435524 0.007531] [ 2.730510] mmcblk1: mmc1:0001 M62704 3.56 GiB +[6.445676 0.010152] [ 2.739329] mmcblk1: p1 +[6.451935 0.006258] [ 2.743911] mmcblk1boot0: mmc1:0001 M62704 2.00 MiB +[6.468006 0.016071] [ 2.763024] mmcblk1boot1: mmc1:0001 M62704 2.00 MiB +[6.478945 0.010939] [ 2.774131] mmcblk1rpmb: mmc1:0001 M62704 512 KiB, chardev (248:0) +[6.516020 0.037075] [ 2.810938] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs +[6.522311 0.006291] [ 2.817802] EXT4-fs (mmcblk0p2): mounted filesystem f5cc7785-3158-49b9-9fac-c17161ab3129 ro with ordered data mode. Quota mode: none. +[6.534528 0.012217] [ 2.830120] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. +[6.541198 0.006670] [ 2.838456] devtmpfs: mounted +[6.546360 0.005162] [ 2.843314] Freeing unused kernel image (initmem) memory: 1024K +[6.555047 0.008687] [ 2.850017] Run /sbin/init as init process +[6.869587 0.314540] [ 3.164022] EXT4-fs (mmcblk0p4): recovery complete +[6.876288 0.006702] [ 3.171349] EXT4-fs (mmcblk0p4): mounted filesystem 04c4ad57-613b-437d-9908-58ff7cf6c24a r/w with ordered data mode. Quota mode: none. +[7.032267 0.155978] ota-clock: clock was 2000-01-01 00:00:03 UTC, raised to image build time 2026-10-31 03:38:15 UTC +[7.058836 0.026570] Seeding 256 bits without crediting +[7.061542 0.002705] Saving 256 bits of non-creditable seed for next boot +[7.070973 0.009432] Starting syslogd: OK +[7.094584 0.023610] Starting klogd: OK +[7.126209 0.031625] Running sysctl: OK +[7.204097 0.077888] Starting mdev... OK +[8.541051 1.336953] [ 4.835491] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 +[8.546580 0.005529] [ 4.841829] omap-aes 53500000.aes: will run requests pump with realtime priority +[8.608947 0.062367] [ 4.904275] remoteproc remoteproc0: wkup_m3 is available +[8.683787 0.074839] [ 4.978616] at24 2-0054: supply vcc not found, using dummy regulator +[8.719269 0.035482] [ 5.014499] at24 2-0055: supply vcc not found, using dummy regulator +[8.749874 0.030605] [ 5.045145] at24 2-0056: supply vcc not found, using dummy regulator +[8.780425 0.030551] [ 5.075675] at24 2-0057: supply vcc not found, using dummy regulator +[8.823633 0.043208] [ 5.118215] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write +[9.128154 0.304520] [ 5.422437] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 +[9.373723 0.245569] [ 5.667792] input: tps65217_pwrbutton as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +[9.436451 0.062728] [ 5.731620] omap_rng 48310000.rng: Random Number Generator ver. 20 +[9.444428 0.007977] [ 5.739744] random: crng init done +[9.487925 0.043497] [ 5.783224] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 +[9.494100 0.006175] [ 5.789444] omap-sham 53100000.sham: will run requests pump with realtime priority +[9.730601 0.236501] [ 6.024766] tda998x 0-0070: found TDA19988 +[9.752806 0.022205] [ 6.044559] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops [tda998x]) +[9.762371 0.009565] [ 6.057591] [drm] Initialized tilcdc 1.0.0 for 4830e000.lcdc on minor 0 +[9.769508 0.007137] [ 6.065137] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.778818 0.009311] [ 6.074145] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes +[9.792211 0.013392] [ 6.087455] gpio-537 (nxp,calib): gpiod_direction_output_nonotify: tried to set a GPIO tied to an IRQ as output +[9.824178 0.031967] [ 6.119092] tda9950 0-0034: TDA9950 CEC interface, hardware version 3.3 +[9.872153 0.047975] [ 6.167543] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.898835 0.026682] [ 6.194165] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests (id=vbus) +[9.979952 0.081117] [ 6.275289] usbcore: registered new interface driver usbfs +[9.983205 0.003253] [ 6.280932] usbcore: registered new interface driver hub +[9.990375 0.007170] [ 6.286530] usbcore: registered new device driver usb +[10.092191 0.101816] [ 6.387174] musb-hdrc musb-hdrc.1: MUSB HDRC host driver +[10.097196 0.005004] [ 6.392792] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 +[10.127584 0.030389] [ 6.422759] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18 +[10.133329 0.005745] [ 6.431125] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 +[10.141816 0.008487] [ 6.438534] usb usb1: Product: MUSB HDRC host driver +[10.148432 0.006616] [ 6.443578] usb usb1: Manufacturer: Linux 6.18.38 musb-hcd +[10.152968 0.004536] [ 6.449094] usb usb1: SerialNumber: musb-hdrc.1 +[10.165230 0.012262] [ 6.460559] hub 1-0:1.0: USB hub found +[10.183831 0.018601] [ 6.478072] hub 1-0:1.0: 1 port detected +[10.220918 0.037086] [ 6.516225] remoteproc remoteproc0: powering up wkup_m3 +[10.234610 0.013692] [ 6.530012] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 118004 +[10.241523 0.006913] [ 6.538644] remoteproc remoteproc0: remote processor wkup_m3 is now up +[10.249349 0.007827] [ 6.538675] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 +[10.273669 0.024320] [ 6.569027] PM: bootloader does not support rtc-only! +[10.332968 0.059299] Starting network: [ 6.740497] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac +[10.528735 0.195767] [ 6.823988] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL) +[10.583507 0.054772] OK +[10.593896 0.010389] Starting crond: OK +[11.489599 0.895702] ota-health: slot A confirmed good +[11.612602 0.123004] +[11.617016 0.004414] OTA embedded Linux beaglebone-black /dev/console +[11.622013 0.004997] +[11.622086 0.000073] beaglebone-black login: \ No newline at end of file diff --git a/docs/logs/boot-baseline-run8.log b/docs/logs/boot-baseline-run8.log new file mode 100644 index 0000000000000000000000000000000000000000..58a1ad20b124120c100c012f5fe4b5f883ffa299 GIT binary patch literal 27314 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 T>P}&ERubFvNDw4THSPTuZG#bz literal 0 HcmV?d00001 diff --git a/docs/logs/boot-baseline-run9.log b/docs/logs/boot-baseline-run9.log new file mode 100644 index 0000000000000000000000000000000000000000..511d86bb0ffdebe76393d9c7b26b5c0a8c96ecef GIT binary patch literal 27229 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 Date: Sat, 31 Oct 2026 11:29:49 +0700 Subject: [PATCH 60/61] docs: T033 run on the board, a kernel that cannot boot is retired and the device rolls back A signed bundle whose /boot/zImage is garbage (scripts/make-broken-kernel-bundle.sh) was installed into the idle slot. U-Boot refused the kernel each time, BOOT_B_LEFT went 3, 2, 1, 0 and the device ended on slot A, confirmed. One trial of three; the other two were waived by the user and are recorded as not run. Recorded as not met: the failed slot leaves no reason in /data, as its kernel never starts. Also recorded: the bad kernel falls through to the next slot in the same power-up, so A is refused confirmation twice and confirmed only on the third boot, and that confirmation is labelled last-resort although U-Boot did not take that path. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 1 + docs/logs/t033-broken-kernel-trial1.log | 101 ++++++++++++++++++++++++ scripts/make-broken-kernel-bundle.sh | 83 +++++++++++++++++++ specs/002-ab-ota-rauc/tasks.md | 12 ++- 4 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 docs/logs/t033-broken-kernel-trial1.log create mode 100755 scripts/make-broken-kernel-bundle.sh diff --git a/CLAUDE.md b/CLAUDE.md index 9139b0f..1d74830 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -57,6 +57,7 @@ external.desc, Config.in, external.mk BR2_EXTERNAL glue scripts/check.sh static checks behind `make check` (POSIX sh) scripts/gen-dev-keys.sh `make ota-dev-keys`: development CA + signing pair into keys/dev/ (gitignored) scripts/make-untrusted-bundles.sh the bundles a device must refuse (quickstart scenario 7); output/ only +scripts/make-broken-kernel-bundle.sh a signed bundle whose kernel is garbage (quickstart scenario 5); output/ only keys/dev/ development signing material, never committed specs/002-ab-ota-rauc/ A/B feature: spec, plan, research (R1-R9), contracts/, quickstart, tasks docs/logs/ hardware captures that back the claims in the spec and README diff --git a/docs/logs/t033-broken-kernel-trial1.log b/docs/logs/t033-broken-kernel-trial1.log new file mode 100644 index 0000000..e820c34 --- /dev/null +++ b/docs/logs/t033-broken-kernel-trial1.log @@ -0,0 +1,101 @@ +T033 / quickstart scenario 5 / SC-003, FR-013..FR-015: a bundle whose kernel is garbage, trial 1 of 3 +Hardware run by the operator on the BeagleBone Black, 2026-10-31. Timestamps are the host's, one-second +resolution. This is an EXCERPT of the operator's console capture: the Linux boot messages of each attempt +(about 250 lines each) are left out, every line below is as captured. Trials 2 and 3 were waived by the user and were not run. + +Bundle: output/beaglebone_black/broken/beaglebone_black-54eaf72-brokenkernel.raucb, built by +scripts/make-broken-kernel-bundle.sh: the image's rootfs with /boot/zImage replaced by 7668208 bytes of text, +filesystem checked clean, signed with the development material. Image on the card: 54eaf72, freshly flashed. + +--- before: slot A running and confirmed, slot B empty, BOOT_ORDER A +[11:18:46] Running slot : A revision 54eaf72 +[11:18:46] Confirmed : yes, this boot passed its health check +[11:18:46] Boot order : A +[11:18:46] Slot A state: RUNNING, confirmed; attempts: 3 left +[11:18:46] Slot B state: EMPTY: nothing has been installed into it since the card was flashed; attempts: 0 left + +--- install into B (the idle slot) from A +[11:19:28] rauc-Message: Verified detached signature by 'O = OTA development, CN = OTA development bundle signing - NOT FOR PRODUCTION' +[11:19:29] rauc-Message: Marking target slot rootfs.1 as non-bootable (bad)... +[11:19:39] rauc-Message: Marking target slot rootfs.1 as bootable (active/primary)... +[11:19:39] Installing `/data/update.raucb` succeeded +[11:20:41] BOOT_ORDER=B A +[11:20:41] BOOT_A_LEFT=3 +[11:20:41] BOOT_B_LEFT=3 + +--- reboot 1 (the console shows `reboot` and a clean shutdown) +[11:22:25] OTA: booting slot B, 2 attempts left +[11:22:26] 7668208 bytes read in 489 ms (15 MiB/s) +[11:22:26] 70396 bytes read in 7 ms (9.6 MiB/s) +[11:22:26] zimage: Bad magic! +[11:22:26] Saving Environment to MMC... Writing to redundant MMC(0)... OK +[11:22:26] OTA: booting slot A, 2 attempts left +[11:22:26] Starting kernel ... +[11:22:35] ota-health: NOT CONFIRMED: RAUC names slot 'B' as primary but 'A' is running +[11:22:59] Running slot : A revision 54eaf72 +[11:22:59] Confirmed : NO, not yet. The health check has not finished, or it failed: see /data/ota-health.log +[11:22:59] Next boot : slot B. UPDATE PENDING: it is installed and has not been booted yet +[11:22:59] Slot A state: RUNNING, NOT CONFIRMED YET; attempts: 2 left +[11:22:59] Slot B state: PENDING: installed, will boot next; attempts: 2 left +[11:22:59] Slot B installed: bundle 54eaf72-brokenkernel, update number 1 +[11:23:16] BOOT_ORDER=B A / BOOT_A_LEFT=2 / BOOT_B_LEFT=2 + (no one rebooted: the next line is the SPL banner, a watchdog reset; no shutdown messages) + +--- attempt 2 +[11:23:17] U-Boot SPL 2026.07 +[11:23:19] OTA: booting slot B, 1 attempts left +[11:23:20] zimage: Bad magic! +[11:23:20] OTA: booting slot A, 1 attempts left +[11:23:29] ota-health: NOT CONFIRMED: RAUC names slot 'B' as primary but 'A' is running +[11:23:34] Slot A state: RUNNING, NOT CONFIRMED YET; attempts: 1 left +[11:23:34] Slot B state: PENDING: installed, will boot next; attempts: 1 left +[11:23:49] BOOT_ORDER=B A / BOOT_A_LEFT=1 / BOOT_B_LEFT=1 + (watchdog reset again, no shutdown messages) + +--- attempt 3 +[11:24:34] U-Boot SPL 2026.07 +[11:24:36] OTA: booting slot B, 0 attempts left +[11:24:36] zimage: Bad magic! +[11:24:37] OTA: booting slot A, 0 attempts left +[11:24:46] ota-health: confirmed good after a last-resort boot (no slot had attempts left) + +--- after: ota-status, health log, state +[11:24:55] Running slot : A revision 54eaf72 +[11:24:55] Confirmed : yes, this boot passed its health check +[11:24:56] Next boot : slot A (the running one) +[11:24:56] Boot order : B A +[11:24:56] Slot A state: RUNNING, confirmed; attempts: 3 left +[11:24:56] Slot B state: RETIRED: it was tried and never confirmed, and is out of boot attempts +[11:24:56] Slot B attempts: 0 left, in the boot order: yes +[11:24:56] Slot B installed: bundle 54eaf72-brokenkernel, update number 1 +[11:25:08] /data/ota-health.log, 3 records, each "2026-10-31 03:38:19 UTC up=7s build=54eaf72 slot=A condition=...": + running-slot: NOT CONFIRMED: RAUC names slot 'B' as primary but 'A' is running (twice) + last-resort: confirmed good after a last-resort boot (no slot had attempts left) +[11:25:11] BOOT_ORDER=B A / BOOT_A_LEFT=3 / BOOT_B_LEFT=0 + +What it shows +1. The counter of B walked 3 -> 2 -> 1 -> 0 across three attempts ("OTA: booting slot B, 2 / 1 / 0 attempts + left"), and the device ended on slot A, confirmed, unaided. B is RETIRED with 0 attempts, and `ota-status` + says so in words. +2. U-Boot refused the kernel at once ("zimage: Bad magic!") and the same power-up went on to the next slot + in BOOT_ORDER. It did not wait for a watchdog. B's failure therefore needs no reset of its own. +3. The cost of that fall-through is the one the script reading predicted: slot A is tried in the same + power-up, so it spends an attempt per boot too, and the health check refuses to confirm it twice + ("RAUC names slot 'B' as primary") because B still had attempts. A is reset by the watchdog both times + and is confirmed only on the third boot, when both counters are 0 and RAUC names no primary. + A had exactly the three attempts it needed. +4. The third boot is labelled "last-resort" in the log and on the console, but U-Boot did not take its + last-resort path: there is no "OTA: no eligible slot" line, and A booted as an ordinary attempt + ("booting slot A, 0 attempts left"). The label comes from the health script, which sees no primary slot. + +What it does not show +- The reason slot B failed is not in /data. B's kernel never ran, so nothing of B could write a record. The + three records are about A (two refusals to confirm it, one confirmation). B's retirement is visible only + through its counter, `ota-status` and `rauc status`; FR-014's "reason readable from /data" is not met for + a slot that fails before userspace, as with the hang bundle of T034. +- Reset times. By the host clock the first window, from "Starting kernel" to the next SPL banner, is about + 51 s (documented: 49 s); the second is about 74 s. The second was not explained, and it is 1 s resolution + on a console someone was typing on. No conclusion is drawn. +- The three records carry the same timestamp (03:38:19, up=7s): the clock is the image's build-time floor + plus a few seconds of uptime, so they cannot be ordered by time (CLAUDE.md, "the target clock is a floor"). +- Trials 2 and 3 (waived by the user), and the mirror case (the broken bundle in A while B is running). diff --git a/scripts/make-broken-kernel-bundle.sh b/scripts/make-broken-kernel-bundle.sh new file mode 100755 index 0000000..333085f --- /dev/null +++ b/scripts/make-broken-kernel-bundle.sh @@ -0,0 +1,83 @@ +#!/bin/sh +# Builds the bundle that quickstart scenario 5 installs: genuine and signed by the project's +# material, but with the slot's kernel (/boot/zImage) replaced by garbage, so the slot installs +# cleanly and then cannot boot. Run in the build container after a build of the board and after +# `make ota-dev-keys`. +# +# sh scripts/make-broken-kernel-bundle.sh [board] # default: the selected board +# +# Output goes to output//broken/, which is ignored by git. The manifest version is the +# image's revision with "-brokenkernel" appended, so `ota-status` names the bundle for what it is; +# the /etc/build-info inside is unchanged. +set -eu + +BOARD="${1:-}" +[ -n "${BOARD}" ] || BOARD="$(sed -n 's/^BOARD=//p' .current_board 2> /dev/null || true)" +if [ -z "${BOARD}" ]; then + echo "usage: sh scripts/make-broken-kernel-bundle.sh (no board selected)" >&2 + exit 1 +fi + +BASE="output/${BOARD}" +IMAGES="${BASE}/images" +TARGET="${BASE}/target" +OUT="${BASE}/broken" +KEYS_DIR="${KEYS_DIR:-keys/dev}" +CERT="${OTA_SIGNING_CERT:-${KEYS_DIR}/dev-signing.cert.pem}" +KEY="${OTA_SIGNING_KEY:-${KEYS_DIR}/dev-signing.key.pem}" +SYSCONF="board/ota/${BOARD}/rootfs_overlay/etc/rauc/system.conf" + +for f in "${IMAGES}/rootfs.ext4" "${TARGET}/etc/build-info" "${BASE}/host/bin/rauc" "${SYSCONF}" "${CERT}" "${KEY}"; do + if [ ! -e "${f}" ]; then + echo "missing ${f}: build the board first (make ${BOARD}_defconfig && make build) and run make ota-dev-keys." >&2 + exit 1 + fi +done +command -v debugfs > /dev/null 2>&1 || { + echo "debugfs not found (e2fsprogs)" >&2 + exit 1 +} + +PATH="$(pwd)/${BASE}/host/bin:${PATH}" +VERSION="$(sed -n 's/^VERSION=//p' "${TARGET}/etc/build-info")" +COMPAT="$(sed -n 's/^compatible=//p' "${SYSCONF}")" +BUNDLE="${OUT}/${BOARD}-${VERSION}-brokenkernel.raucb" + +rm -rf "${OUT}" +mkdir -p "${OUT}/stage" +cp -L "${IMAGES}/rootfs.ext4" "${OUT}/stage/rootfs.ext4" + +# Replace the kernel with the same number of bytes of text, which is neither a zImage (U-Boot's +# bootz refuses it: bad magic) nor a file that is missing (ext4load would fail first). +size="$(debugfs -R 'stat /boot/zImage' "${OUT}/stage/rootfs.ext4" 2> /dev/null | sed -n 's/.*Size: \([0-9][0-9]*\).*/\1/p' | head -1)" +if [ -z "${size}" ] || [ "${size}" -le 0 ]; then + echo "/boot/zImage is not in ${IMAGES}/rootfs.ext4" >&2 + exit 1 +fi +yes 'NOT A KERNEL - scripts/make-broken-kernel-bundle.sh' | head -c "${size}" > "${OUT}/garbage.bin" +debugfs -w -R 'rm /boot/zImage' "${OUT}/stage/rootfs.ext4" > /dev/null 2>&1 +debugfs -w -R "write ${OUT}/garbage.bin /boot/zImage" "${OUT}/stage/rootfs.ext4" > /dev/null 2>&1 + +# Check what was done, rather than assuming it: same size, the garbage on top, a clean filesystem. +debugfs -R "dump /boot/zImage ${OUT}/zImage.check" "${OUT}/stage/rootfs.ext4" > /dev/null 2>&1 +if ! cmp -s "${OUT}/garbage.bin" "${OUT}/zImage.check"; then + echo "the kernel in the slot image does not read back as the garbage that was written" >&2 + exit 1 +fi +if ! e2fsck -fn "${OUT}/stage/rootfs.ext4" > "${OUT}/e2fsck.log" 2>&1; then + cat "${OUT}/e2fsck.log" >&2 + echo "e2fsck reports the modified slot image as damaged" >&2 + exit 1 +fi + +printf '[update]\ncompatible=%s\nversion=%s-brokenkernel\n\n[bundle]\nformat=plain\n\n[image.rootfs]\nfilename=rootfs.ext4\n' \ + "${COMPAT}" "${VERSION}" > "${OUT}/stage/manifest.raucm" +if ! rauc bundle --cert "${CERT}" --key "${KEY}" "${OUT}/stage" "${BUNDLE}" > "${OUT}/rauc.log" 2>&1; then + cat "${OUT}/rauc.log" >&2 + echo "rauc bundle failed" >&2 + exit 1 +fi +rm -rf "${OUT}/stage" "${OUT}/garbage.bin" "${OUT}/zImage.check" "${OUT}/e2fsck.log" + +printf '%s\n %s bytes, sha256 %s\n kernel replaced by %s bytes of text, filesystem checked clean\n' \ + "${BUNDLE}" "$(wc -c < "${BUNDLE}")" "$(sha256sum "${BUNDLE}" | cut -d' ' -f1)" "${size}" diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index 389bcbe..a6b950d 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -348,10 +348,20 @@ previous slot on its own within the documented number of attempts. waived, not passed, and SC-014's "3 of 3" is not demonstrated as written; each trial is the same chain of events and differs only in the counter, which is the argument for the waiver and not evidence -- [ ] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel +- [X] T033 [US3] Verify (hardware): quickstart scenario 5 — three trials with a bundle whose kernel is deliberately unusable; the counter must walk 3 → 2 → 1 → 0 across attempts, the device must then boot the previous slot unaided, and `rauc status` must show the failed slot bad with the reason readable from `/data` (SC-003, FR-014) + **Run on hardware, 2026-10-31, one trial of three** (`docs/logs/t033-broken-kernel-trial1.log`; + bundle from `scripts/make-broken-kernel-bundle.sh`): `BOOT_B_LEFT` went 3 -> 2 -> 1 -> 0 across + three attempts, U-Boot refused the kernel each time (`zimage: Bad magic!`) and the device ended on + slot A, confirmed, unaided; B reads `RETIRED`. **Trials 2 and 3 were waived by the user** and are not + run. **Not met as written**: the reason is not readable from `/data` for the failed slot, because a + kernel that never starts writes nothing; the three records there are about slot A. Found on the way: + the bad kernel falls through to the next slot in the same power-up, so A spends an attempt per boot + and is refused confirmation twice (B still has attempts) before it is confirmed on the third, with no + attempt to spare; and that third confirmation is labelled `last-resort` although U-Boot did not take + its last-resort path. Neither is fixed - [X] T034 [US3] Verify (hardware): quickstart scenario 6 — three trials with a slot made to hang after boot; the watchdog must reset the board within the documented window and the device must end on the previous good slot (SC-014). Capture a "before" run on the unmodified image too: From 0ea1e81eaebeb8f962f2d6d6e84f50c642039cbc Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 11:32:22 +0700 Subject: [PATCH 61/61] docs: index of the hardware evidence for feature 002, T044 closed docs/logs/README.md lists, per check, the logs behind it and whether each is a console capture, a report from the operator, waived, or not run. It also lists what is not shown anywhere: SC-002, SC-003 and SC-014 as written, FR-014 for a slot that fails before userspace, mark-bad, ota_fallback_slot B, and the mirror of T033. The nine defects that only the board showed are listed with their logs. All tasks of the feature are now closed. Co-Authored-By: Claude Sonnet 5.5 --- docs/logs/README.md | 76 ++++++++++++++++++++++++++++++++++ docs/logs/t039-ota-status.log | 5 +++ specs/002-ab-ota-rauc/tasks.md | 8 +++- 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 docs/logs/README.md diff --git a/docs/logs/README.md b/docs/logs/README.md new file mode 100644 index 0000000..713731a --- /dev/null +++ b/docs/logs/README.md @@ -0,0 +1,76 @@ +# Hardware evidence for feature 002 (A/B updates with RAUC) + +Every claim that needs a board is backed by a file in this directory, or is listed under *Not shown*. +A green `make check` and a clean build are not a boot test (constitution, Principle IV); the defects this +feature found only on hardware are listed at the end. + +All runs are on a BeagleBone Black booting from an SD card, serial console on J1, 115200 8N1. The +bracketed timestamps in the logs are the capturing terminal's clock, not the device's: the device clock +is the image's build time plus uptime (`CLAUDE.md`, research R8). + +## How to read the status column + +| Word | Meaning | +|---|---| +| **Shown** | the log is a console capture of the check, and the check's expected result is in it | +| **Reported** | the operator described the result; no capture, so nothing in it was observed by whoever wrote the log | +| **Waived** | the operator decided not to run it. It is not a pass | +| **Not run** | never done on hardware | + +## Result per check + +| Task | What it checks | Status | Log | Not shown, or not as written | +|---|---|---|---|---| +| T016 | The running system and the bootloader read the same boot-selection state; Linux writes it and U-Boot sees it | **Shown**, both directions | `t016-env-agreement.log`, with the write direction in `t024-us1-second-capture.log` | The write direction is proven with `rauc status mark-good` (counter set to 3, U-Boot then spends one), not with the literal `fw_setenv BOOT_A_LEFT 2` of the task | +| T024 | Scenario 1: flash, boot, slot A booted and good, slot B not bootable, root read-only, `/data` writable and surviving an unclean power loss, the console names the slot | **Shown** over two captures | `t024-us1-first-capture.log`, `t024-us1-second-capture.log` | The first capture found that an empty slot B was reported good; the second shows that fixed and found `seedrng` writing to a read-only `/var/lib`, whose fix is shown in `t025-mark-good.log` | +| T025 | Scenario 2: boot time, three `grabserial` runs (SC-008, budget 12.65 s) | **Shown**: 10.51 s before the health script, then 11.61 s with it (T043) | `boot-baseline-run4.log` to `run6.log`, then `run7.log` to `run9.log`; `t025-mark-good.log`; method and breakdown in `../boot-baseline-beaglebone-black.md` | The 0.9 s of the health script is read from neighbouring timestamps, not measured on its own | +| T028 | An install is refused while an earlier one is pending (FR-009) | **Shown** | `t028-refused-while-pending.log` | The second condition, two installs at once, is host-checked only | +| T029 | Scenario 3: install over the cable, slot switch, new version running, `/data` untouched (SC-006) | **Shown**, third attempt | `t029-install-and-switch.log`; the two failed attempts in `t029-first-install-attempt.log` | Three attempts were needed: `check-purpose` missing, then `mountprefix` and SquashFS missing, each fixed and re-flashed. Delivery and the static address (`t047-network-and-delivery.log`) are **Reported**, not captured | +| T030 | Scenario 4: power pulled during `rauc install`, five trials (SC-002) | 3 of 5 **Shown** (1, 2, 5); trials 3 and 4 **Waived** | `t030-power-cut-trials.log`; `edge-power-loss-before-first-boot.log` | "5 of 5" is not demonstrated. The closing uninterrupted install (FR-015) passed. The edge case "power lost between install and first boot" is **Reported** | +| T031 | The exhausted-slots path boots slot A without spending an attempt; `ota_fallback_slot` as workaround | Default path **Shown**; the fix of the `itest` operator **Reported** | `t031-last-resort-fallback-slot.log`, `boot-baseline-run4.log` | Booting B through `ota_fallback_slot B` was not stated as tried | +| T033 | Scenario 5: a bundle with an unusable kernel is retired and the device rolls back (SC-003, FR-014) | 1 of 3 trials **Shown**; trials 2 and 3 **Waived** | `t033-broken-kernel-trial1.log` | **FR-014 not met for the failed slot**: its kernel never runs, so no reason reaches `/data`; only the counter and `ota-status` say it was retired | +| T034 | Scenario 6: the watchdog resets a hung system and a slot that never confirms is retired (SC-014) | A: **Shown** (feeder killed: reset in 25 s; kernel panic with `echo c > /proc/sysrq-trigger`: 24 s). B: 1 of 3 trials **Shown**; the rest **Waived** | `t034-watchdog-feeder-killed.log` | The "before" run on the unmodified image was not repeated; `t016-env-agreement.log` (253 s, no reset) stands in for it. | +| T035 | Scenario 8: the boot state cannot be written from the new slot (SC-013) | **Shown** for the end state; the three reboots are **Reported** | `t035-fw-env-wrong-offset.log` | Only the last of six health-log records was shown; the per-attempt U-Boot lines are the operator's account | +| T037 | Scenario 7: five untrusted bundles refused, five distinct messages (SC-004, FR-016 to FR-019) | **Shown** | `t037-untrusted-bundles.log` | None of the five wrote anything; the control bundle installed, booted and confirmed | +| T039 | `ota-status` says where the device stands (FR-026, SC-005) | **Shown** in the states below | `t039-ota-status.log`, `t039-status-reporting.log`, and later `ota-status` output in `t033-broken-kernel-trial1.log` | See the list below | +| T043 | Footprint and boot time re-measured (SC-007, SC-008) | Sizes: from the build output. Boot time: **Shown** | README, `../boot-baseline-beaglebone-black.md`, `boot-baseline-run7.log` to `run9.log` | | +| T046, T027 | Clock floor at boot; the health script confirms a slot | **Shown** | `t046-t027-first-hardware-boot.log`, `t046-t027-second-hardware-boot.log` | The first boot found the RTC module overwriting the clock | + +### `ota-status` states + +Seen on the board: `RUNNING, confirmed`, `RUNNING, NOT CONFIRMED YET` (during the failed boots of +`t033-broken-kernel-trial1.log`), `STANDBY`, `PENDING`, `RETIRED`, `EMPTY`, and the freshly flashed card +(slot A with no RAUC record, slot B empty; same file). + +**Not seen**: `UNUSABLE`, and the note `a last-resort boot: U-Boot ran it without spending one`. + +## Not shown anywhere + +- `rauc status mark-bad`, the command meant for forcing a rollback: not exercised. +- The reason a slot that hangs or fails before `S99ota-health` was retired: derivable only from + `BOOT__LEFT`, `rauc status` and `ota-status`, never from `/data` (T033, T034). +- `ota_fallback_slot B` booting slot B (T031). +- The mirror of T033: the broken bundle in slot A while B runs. The default last-resort slot is A, so this + is where a further failure on the third boot would end at the U-Boot prompt. Reasoned from the script, + not seen. +- SC-002 as written (5 of 5), SC-003 as written (3 trials), SC-014 as written (3 trials). + +## What only the board showed + +Defects that a green `make check` and host-side stubs coexisted with, each found on a capture here. The +first seven are the list in `CLAUDE.md`; the last two were found afterwards. + +1. The RTC driver built as a module overwrote the clock set at boot (`t046-t027-first-hardware-boot.log`). +2. `RAUC_SYSTEM_BOOTED_BOOTNAME` held a device path, not a boot name (`t046-t027-first-hardware-boot.log`). +3. `check-purpose=codesign` missing: every bundle refused (`t029-first-install-attempt.log`). +4. `mountprefix` pointing at a read-only place (`t029-*.log`, second attempt). +5. SquashFS missing from the kernel, so a bundle could not be mounted (`t029-*.log`, second attempt). +6. No refusal of a second install while one was pending (`t028-refused-while-pending.log`). +7. The watchdog stopped by `omap_wdt` at probe, so nothing reset a hung board (`t016-env-agreement.log`). +8. `seedrng` writing into a read-only `/var/lib` (`t024-us1-second-capture.log`). +9. `itest` has no operator `eq` (`t031-last-resort-fallback-slot.log`). + +Found while running the board, and not fixed: a bad kernel falls through to the next slot in the same +power-up, so the good slot spends an attempt per boot and is refused confirmation until both counters are +0 (`t033-broken-kernel-trial1.log`); that third confirmation is labelled `last-resort` though U-Boot did not +take its last-resort path. diff --git a/docs/logs/t039-ota-status.log b/docs/logs/t039-ota-status.log index b44b6bc..086fbf7 100644 --- a/docs/logs/t039-ota-status.log +++ b/docs/logs/t039-ota-status.log @@ -69,3 +69,8 @@ Result: PASS for FR-026 and SC-005 as one command, and for telling a rolled-back Not seen on hardware, only on the host with stubs: `RUNNING, NOT CONFIRMED YET` (it lasts about ten seconds at boot), `UNUSABLE`, `EMPTY` and the last-resort note. The freshly flashed card, where slot A has no RAUC record and slot B is EMPTY, is the case SC-005 most needs and no capture shows it. + +Addendum, 2026-10-31: states seen later, in docs/logs/t033-broken-kernel-trial1.log. `RUNNING, NOT CONFIRMED YET` +(slot A during the failed boots), `PENDING` and `EMPTY` again, and the freshly flashed card: slot A +`RUNNING, confirmed` with `installed : no record of an update`, slot B `EMPTY`. Still not seen on the board: +`UNUSABLE` and the last-resort note. diff --git a/specs/002-ab-ota-rauc/tasks.md b/specs/002-ab-ota-rauc/tasks.md index a6b950d..6b18b73 100644 --- a/specs/002-ab-ota-rauc/tasks.md +++ b/specs/002-ab-ota-rauc/tasks.md @@ -499,9 +499,13 @@ output and confirm it answers all of that in one command. banner to the login prompt, spread 0.12%, inside the 12.65 s budget by 1.04 s and 1.0% over the 11.50 s baseline (SC-008). About 0.9 s of it is the gap before `ota-health: slot A confirmed good`; the README and `docs/boot-baseline-beaglebone-black.md` carry the figures -- [ ] T044 Record the hardware evidence from T016, T024, T025, T029, T030, T033, T034, T035, T037 +- [X] T044 Record the hardware evidence from T016, T024, T025, T029, T030, T033, T034, T035, T037 and T039 under `docs/logs/` and summarise it in the PR; Principle IV requires the evidence to - be stated, and a green check run is explicitly not a boot test + be stated, and a green check run is explicitly not a boot test. + **Done, 2026-10-31**: `docs/logs/README.md` indexes every log, says per check whether it is a + capture, a report from the operator, waived or not run, and lists what is not shown anywhere + (SC-002, SC-003 and SC-014 are not demonstrated as written; FR-014 is not met for a slot that + fails before userspace). The pull request description is to be taken from that file - [X] T045 Verify: `make docker-check` is green from a clean checkout, and `make beaglebone_black_defconfig && make savedefconfig` leaves no diff. **Done on a true clean checkout** (a fresh clone of `6d5dbc6` with the `buildroot` submodule, no