Phase 2A — Edition bumps (5 programs, edition 2021 → 2024):
- redbear-accessibility
- redbear-ime
- redbear-keymapd
- redbear-tui-theme
- redbear-compositor
Per AGENTS.md: 'edition = 2024' is mandatory for new Rust code. These 5
were the last stragglers on edition 2021 in the redbear-* scope.
Phase 2B — license + repository + description metadata (35 files):
All redbear-* source/Cargo.toml files now have:
license = 'MIT'
repository = 'https://gitea.redbearos.org/vasilito/RedBear-OS'
description = '<one-line purpose>'
103 fields added total across 35 files. redbear-tui-theme already had the
fields (skipped). redbear-hid-core already had license+description (only
got repository). No version fields modified.
Phase 2E — tokio minimal feature set (5 programs):
- redbear-notifications
- redbear-polkit
- redbear-sessiond
- redbear-statusnotifierwatcher
- redbear-udisks
Migrated from features=['full'] to:
default-features = false
features = ['rt', 'rt-multi-thread', 'macros', 'net', 'time', 'sync']
'features = ["full"]' pulls in signal-handler code that crashes on Redox.
The minimal set matches redbear-upower's existing pattern (already used
the right config). redbear-sessiond's vendored tokio patch
(local/patches/tokio/vendored) is unaffected — only the consumer feature
declaration changed, the [patch.crates-io] override still points to the
same vendored path.
Verified: 'features = ["full"]' returns 0 matches across the 5 target
programs. sync-versions.sh --check passes (75 Cat 1 crates, 0 drift).
Round 15 audit cleanup. Three production paths were discarding
process / filesystem errors via bare 'let _ = ...'. Each silently
swallowed the error and the caller had no way to know the cleanup
failed — leading to zombie children (greeter), stale active-profile
symlinks (netctl), or unreaped USB device drivers (hotplugd).
1. local/recipes/system/redbear-greeter/source/src/main.rs — the
kill_child() helper now logs on kill() and wait() failure (with
debug-level success log) instead of 'let _ = process.kill();
let _ = process.wait();'. A failing kill() now produces an
eprintln so the operator sees it; wait() outcome is logged
at debug level.
2. local/recipes/system/redbear-netctl/source/src/main.rs — both
'let _ = fs::remove_file(active_profile_path());' sites (line 201
in stop_profile and line 224 in disable_profile) now log on
failure via eprintln. A failed remove_file previously left a
dangling 'active' symlink that subsequent boot would re-activate
silently.
3. local/recipes/system/redbear-usb-hotplugd/source/src/main.rs —
the 'if let Some(ref mut child) = dev.child { let _ = child.kill(); }'
in the disconnect path now logs on kill() failure (log::warn) so
a leaked USB driver child produces a visible warning.
Found by the Round 14 audit (local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md §10).
Runtime log output is user-visible system surface; cross-references to
other operating systems belong in code comments and commit messages
(per project convention), not in runtime logs. The debounce parameters
and the comment-level references stay unchanged.
Systemic fix: all local recipes (~150 references across 40+ Cargo.toml files)
now resolve libredox, redox_syscall, and redox-scheme through
recipes/core/base/ symlinks instead of local/sources/ paths.
Eliminates lockfile collision between Cargo's resolution of the same
package through different path strings (local/sources/ vs recipes/core/base/).
This is required because the base recipe's workspace Cargo.toml resolves
these deps through recipes/core/base/ (via symlink chain from the
recipe copy location), and Cargo treats different path strings to the
same directory as different packages.
usb-core spawn.rs:
- class_driver_for_usb_class() extended to cover all Red Bear class drivers:
Audio(0x01)→redbear-usbaudiod, CDC ACM(0x02/0x02)→redbear-acmd,
CDC ECM(0x02/0x06)→redbear-ecmd, HID(0x03)→usbhidd,
Mass Storage(0x08)→usbscsid, Hub(0x09)→usbhubd,
Vendor(0xFF)→redbear-ftdi
- Subclass-aware matching (Audio Control vs Streaming, CDC ACM vs ECM)
- is_trusted_usb_driver() whitelist extended with all 7 driver binaries
- Test suite updated with new assertions (11/11 pass)
redbear-usb-hotplugd:
- DRIVER_MAP extended to 11 entries with subclass-aware matching
- Recursive port scanning: scan_ports_recursive() traverses child
hub port directories (handles port1.port2.port3 paths)
- extract_port_id() parses full port paths to extract controller
name and port string for child hub ports
- Protocol-aware extra arg: Storage passes protocol byte (0x50/0x62),
all other classes pass interface number
- Skips CDC Data interfaces (0x0A) and hub interfaces (0x09) when
reading descriptors — matches Linux's interface matching logic
- Improved disconnect detection via descriptor accessibility heuristic
- Cleaner structure: find_driver(), scan_controllers(), scan_ports(),
try_read_descriptors(), main loop with connect/disconnect tracking
All 7 Red Bear USB class drivers now auto-spawning on device connect:
usbhidd, usbscsid, usbhubd, redbear-acmd, redbear-ecmd,
redbear-usbaudiod, redbear-ftdi
Cross-referenced with Linux 7.1 drivers/usb/core/hub.c port event
handling and drivers/usb/core/driver.c device-driver binding.
New daemon (216 lines) that watches USB controllers for device
attachment/detachment and auto-spawns the appropriate class driver.
Architecture:
- Polls /scheme/usb/ every 1000ms for controller directories
- For each controller, enumerates root hub ports
- Reads device descriptors (class/subclass/protocol) via XhciClientHandle
- Maps class to driver binary: HID(0x03)→usbhidd, Storage(0x08)→usbscsid,
Hub(0x09)→usbhubd
- Spawns driver with <scheme> <port> <protocol> arguments
- Tracks spawned Child processes in HashMap<port_path, TrackedDevice>
- Detects disconnection (descriptor read fails) → kills driver + removes
from tracking
- Detects driver exit (try_wait) → removes from tracking
- Skips hub interfaces (usbhubd handles its own children)
Config:
- Added to redbear-mini.toml (inherited by redbear-full)
- Auto-started via 02_usb_hotplug.service (oneshot_async, after base.target
and pcid-spawner)
Driver map supports: HID (0x03), Mass Storage (0x08 with BOT protocol),
Hub (0x09). Additional class drivers extendable via DRIVER_MAP constant.