b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
3.5 KiB
3.5 KiB
Red Bear OS — Build & Boot Fix Summary
Date: 2026-05-03 Oracle-reviewed: Yes (3 rounds)
Applied Fixes
1. Cookbook Stage Cleanup (src/cook/cook_build.rs)
- Line 506, 715:
remove_all(&stage_dir)beforerename(stage.tmp, stage) - Prevents "Directory not empty" during incremental builds
2. Cargo Install --Force (src/cook/script.rs)
- Line 155:
--forceflag oncargo install --root - Prevents "binary already exists" errors
3. KF6 Config (config/redbear-full.toml)
kf6-kwayland,kf6-kidletime→"ignore"(TEMPORARY — blocked on libwayland)31_debug_console.service:/scheme/debug/no-preserve -Jwithrespawn = true
4. POSIX Named Semaphores (recipes/core/relibc/)
sem_open: shm-backed viashm_open+mmap+sem_initsem_close:munmapwrappersem_unlink:shm_unlinkwrappersem_trywait: Returns -1 with EAGAIN when acquire failssem_wait: Returns -1 with EINVAL on errorsem_timedwait/sem_clockwait: Return -1 with ETIMEDOUT on timeout- Fixed
Semaphore::wait(): Was returning success when count was 0 (inverted condition) - Durable patch:
local/patches/relibc/P5-named-semaphores.patch(249 lines) - Recipe symlink:
recipes/core/relibc/P5-named-semaphores.patch→local/
5. Documentation
GRAPHICAL-BOOT-ASSESSMENT-2026-05-03.md: Updated with current state- This file: Comprehensive fix summary
- 20 stale docs archived in
local/docs/archived/
Known Limitations (Honest Assessment)
Semaphore Completeness
sem_waiterrno: Sets EINVAL for any error from underlyingwait(), which can only returnErr(())for invalid clock_id. Correct in practice for the current code paths.sem_timedwait/sem_clockwait: Set ETIMEDOUT for all errors; cannot distinguish timeout from invalid clock_id with currentwait()return type. Conservative: ETIMEDOUT covers the common case.- Named semaphore size: Uses
size_of::<sem_t>()(4 bytes) forftruncate/mmap, butRlctSemaphoremay be larger. Works currently because internal representation fits.
Relibc Patch Chain
recipes/core/relibc/recipe.tomlcurrently lists onlyP5-named-semaphores.patch- Pre-existing relibc modifications (waitid, eventfd, signalfd, etc.) exist in the live source tree but are NOT captured in patches
- A clean
repo fetch relibcwould lose those changes — this is a pre-existing condition, not introduced by this work - Full relibc patch audit needed as separate task
Console/Login Surface
- Console login: Available on framebuffer VT2 (
getty 2), not serial - Serial port: Shows daemon logs and stderr output; does not show login prompt in QEMU
-display nonemode - To access VT2 login: Use
-display gtkor similar with QEMU
Build Verification
✅ redbear-full: 0 failed recipes, 4GB image
✅ redbear-mini: 0 failed recipes
✅ nm -D libc.so: 11 sem_* symbols exported
✅ Serial console: All daemon output visible (D-Bus, sessiond, greeter, keymapd)
✅ Init chain: Serial probes confirm all services start
✅ Semaphore wait: Fixed inverted condition in sync/semaphore.rs
✅ cbindgen.toml: SEM_FAILED macro exported
Remaining Work (Not In Scope)
- libwayland: Implement MSG_NOSIGNAL and open_memstream in relibc
- KF6 re-enable: When libwayland builds, un-ignore kf6-kwayland/kf6-kidletime
- Relibc patch audit: Capture all pre-existing relibc changes as durable patches
- Runtime POSIX tests: Run test-posix-runtime.sh for behavioral verification
- QML gate: Long-term blocker for KWin/Plasma desktop