···11+# AC Native OS Boot Regression Report
22+33+**Date:** 2026-03-21
44+**Affected Machine:** ThinkPad Yoga 11e Gen 5 (Intel Gemini Lake, UHD 600/605)
55+**Symptom:** "no DRM device" — `/dev/dri/card0` never appears
66+**Last Working Build:** ~March 19, 2026 (devcontainer builds)
77+**Broken Since:** March 20, 2026 (oven builds began)
88+99+---
1010+1111+## Root Cause Analysis
1212+1313+The boot regression has **three compounding causes**, all introduced between March 19-21:
1414+1515+### 1. Firmware Loading Changed (HIGH IMPACT)
1616+1717+**Before (working):**
1818+```
1919+CONFIG_EXTRA_FIRMWARE="iwlwifi-9260-th-b0-jf-b0-46.ucode iwlwifi-cc-a0-77.ucode ..."
2020+CONFIG_EXTRA_FIRMWARE_DIR="/workspaces/aesthetic-computer/fedac/native/build/firmware"
2121+```
2222+WiFi firmware was **compiled directly into the kernel binary**. While this was for WiFi, the kernel's firmware loading infrastructure was tested and working at early boot.
2323+2424+**After (broken):**
2525+```
2626+CONFIG_EXTRA_FIRMWARE=""
2727+CONFIG_EXTRA_FIRMWARE_DIR=""
2828+```
2929+Changed to load firmware from initramfs at runtime. This was done to fix the oven build (the oven doesn't have the firmware at the devcontainer path). But it may have broken early firmware loading for i915 GPU, which also needs firmware blobs (DMC, GuC, HuC) before it can probe the GPU.
3030+3131+**Why this matters for the Yoga 11e:** Gemini Lake GPUs (GLK) require `glk_dmc_ver1_04.bin` firmware to initialize the display. If the firmware loader can't find it early enough, i915 fails to probe and `/dev/dri/card0` is never created.
3232+3333+### 2. Init Script Complexity (MEDIUM IMPACT)
3434+3535+**Before (working):** 35 lines
3636+```sh
3737+#!/bin/sh
3838+mount -t devtmpfs devtmpfs /dev
3939+mkdir -p /dev/pts /tmp /run
4040+# ... basic mounts ...
4141+# Wait for GPU (up to 1 second)
4242+while [ ! -e /dev/dri/card0 ] && [ $i -lt 100 ]; do
4343+ usleep 10000; i=$((i+1))
4444+done
4545+exec /ac-native /piece.mjs
4646+```
4747+4848+**After (broken):** 163+ lines with:
4949+- USB device detection and logging
5050+- Crash recovery loop (5 retries)
5151+- Claude credentials restoration
5252+- seatd/cage Wayland setup
5353+- zram swap with error checking
5454+- cpufreq governor setting
5555+- Diagnostic dump on failure
5656+5757+The added complexity introduces more failure points. Commands like `mkdir`, `sleep`, `mount` need to work — and when busybox is missing or shared libs are broken, the init fails silently.
5858+5959+### 3. Busybox vs Dynamic Binaries (MEDIUM IMPACT)
6060+6161+**Before (working):** Statically-linked busybox provided `/bin/sh` and all shell utilities. Zero shared library dependencies for basic commands.
6262+6363+**After (broken, local builds):** The devcontainer's `build-and-flash-initramfs.sh` copies individual Fedora binaries (bash, coreutils) which are dynamically linked and need `libc.so.6`, `libtinfo.so.6`, `libffi.so.8`, etc. If any lib is missing, basic commands like `sleep` and `mkdir` fail.
6464+6565+**After (broken, oven builds):** The oven correctly uses busybox (statically linked), but the binary (`ac-native`) is compiled with `musl-gcc` while shared libraries are glibc — they're incompatible. Later fixed to use `gcc`, but the initramfs was still missing the glibc dynamic linker initially.
6666+6767+---
6868+6969+## Timeline of Changes
7070+7171+| Date | Commit | Change | Impact |
7272+|------|--------|--------|--------|
7373+| Mar 19 | `1358c1f28` | Last known working build | Baseline |
7474+| Mar 20 | `1d8a56758` | Added `ac-os pull` command | Minor |
7575+| Mar 20 | `efeec75dc` | Oven build race condition fix | Started oven builds |
7676+| Mar 20 | `11bb20c2f` | Cleared CONFIG_EXTRA_FIRMWARE | **BROKE firmware loading** |
7777+| Mar 21 | `c847d82c2` | Added apt/Ubuntu package install | Fixed oven deps |
7878+| Mar 21 | `8dc9ead1b` | musl linker fix attempt | Partial fix |
7979+| Mar 21 | `d804c9776` | Switched to gcc from musl-gcc | Fixed linking |
8080+| Mar 21 | `c4398bccd` | Added AMD/Nvidia/simpledrm GPU drivers | Added complexity |
8181+| Mar 21 | `1df5dba77` | Created /dev/console in initramfs | Partial fix |
8282+| Mar 21 | `97ec7cf23` | Added crash recovery to init | Added complexity |
8383+| Mar 21 | `f9c4999da` | Fixed zstd firmware decompression | Fixed firmware format |
8484+| Mar 21 | Multiple | Various init script changes | More complexity |
8585+8686+---
8787+8888+## The Fix
8989+9090+### Option A: Revert to Simple (Recommended)
9191+1. **Restore `CONFIG_EXTRA_FIRMWARE`** with i915 GLK firmware added alongside WiFi firmware
9292+2. **Revert init to the simple 35-line version** that was working
9393+3. **Ensure busybox is always used** as `/bin/sh` (statically linked)
9494+4. Add features back incrementally, testing on the Yoga 11e each time
9595+9696+### Option B: Fix Forward
9797+1. Add `CONFIG_FW_LOADER_COMPRESS_ZSTD=y` to kernel config so firmware can load from compressed initramfs files
9898+2. Ensure initramfs firmware is at `/lib/firmware/` accessible before i915 probes
9999+3. Keep crash recovery but make it more robust (no shared lib deps in crash path)
100100+4. Test with QEMU smoke test before every flash
101101+102102+### Option C: Hybrid
103103+1. Build i915 firmware INTO the kernel (`CONFIG_EXTRA_FIRMWARE`) for reliability
104104+2. Load other firmware (WiFi) from initramfs (less critical, happens after boot)
105105+3. Keep simple init for boot, add features as post-boot services
106106+107107+---
108108+109109+## Oven vs Devcontainer Build Differences
110110+111111+| Aspect | Devcontainer (Fedora) | Oven (Ubuntu) |
112112+|--------|----------------------|---------------|
113113+| Compiler | gcc (glibc) | gcc (glibc) — was musl-gcc |
114114+| Busybox | Not installed by default | Installed, statically linked |
115115+| Shared libs | Fedora .so files | Ubuntu .so files |
116116+| Mesa/GPU | Full Mesa stack available | Mesa installed via apt |
117117+| Firefox | Available | Not available |
118118+| Claude Code | Available (225MB) | Available |
119119+| Kernel compile | 2 cores, ~15 min | 8 cores, ~2 min |
120120+| Initramfs size | ~287MB (with Firefox+Claude) | ~200MB (no Firefox) |
121121+122122+---
123123+124124+## Recommended Next Steps
125125+126126+1. **Immediate:** Flash a build from the `1358c1f28` commit (last known working) to confirm the Yoga 11e still works with old code
127127+2. **Then:** Apply Option C (hybrid) — bake GPU firmware in, load WiFi firmware from initramfs
128128+3. **Then:** Add features back one at a time, testing each on the Yoga 11e
129129+4. **Long-term:** QEMU smoke test in oven pipeline catches boot failures before upload