fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps - Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected) - Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared between hotplug handler and DriverConfig::probe() to stop infinite re-probing of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided) - Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON - Add driver-manager SIGTERM handler, ACPI bus registration, --status mode, driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
This commit is contained in:
@@ -1,5 +1,29 @@
|
||||
# RED BEAR OS — DERIVATIVE OF REDOX OS
|
||||
|
||||
## INTERNAL-FIRST POLICY
|
||||
|
||||
When building packages, resolving dependencies, or choosing between implementations,
|
||||
**always prefer internal Red Bear recipes and patched sources** over upstream or
|
||||
third-party alternatives. This applies at every decision point:
|
||||
|
||||
| Decision | Always prefer |
|
||||
|----------|--------------|
|
||||
| Recipe location | `local/recipes/` over `recipes/` (upstream) |
|
||||
| Patch source | `local/patches/` over in-tree edits or ad-hoc sed |
|
||||
| Source tarball | Patched archive in `sources/redbear-0.1.0/tarballs/` over re-download |
|
||||
| Implementation | Red Bear Rust implementation over upstream C port |
|
||||
| Config | `config/redbear-*.toml` over mainline `config/*.toml` |
|
||||
| Scripts | `local/scripts/` over ad-hoc shell commands |
|
||||
|
||||
**Concretely:** if `local/recipes/<category>/<name>/` exists and is symlinked into the
|
||||
recipe tree, that is the authoritative recipe — never fall back to the upstream
|
||||
`recipes/` version. If a local recipe has a `redox.patch`, that patch is the
|
||||
maintained Red Bear delta — never work around it by editing the source tree directly.
|
||||
|
||||
**Rationale:** the local overlay is the durable, version-controlled, release-safe layer.
|
||||
Upstream recipes are disposable and may be overwritten by `make distclean` or release
|
||||
provisioning. Only `local/` survives across rebuilds and releases.
|
||||
|
||||
## TUI CONVENTION — `-i` INTERACTIVE SWITCH
|
||||
|
||||
All Red Bear desktop applications that offer a TUI mode MUST use `-i`/`--interactive`
|
||||
@@ -50,6 +74,58 @@ files, Wayland protocol stubs, D-Bus service stubs, and any other layer of the s
|
||||
|
||||
**No exceptions. No "temporary." No "until we fix it properly."**
|
||||
|
||||
## BUILD DURABILITY AND CASCADE POLICY
|
||||
|
||||
### Every Build Lands in the Repo
|
||||
|
||||
Every successful `repo cook <package>` MUST produce two durable artifacts:
|
||||
|
||||
1. **Package in the repo**: `repo/x86_64-unknown-redox/<name>.pkgar` + `<name>.toml`
|
||||
2. **Patched source form**: All source modifications mirrored to `local/patches/<component>/`
|
||||
|
||||
A build is **not complete** until both exist. Verify after every cook:
|
||||
|
||||
```bash
|
||||
./target/release/repo find <package> # Must find the package
|
||||
ls repo/x86_64-unknown-redox/<package>.toml # Manifest must exist
|
||||
ls repo/x86_64-unknown-redox/<package>.pkgar # Archive must exist
|
||||
```
|
||||
|
||||
If a package was built but the repo artifacts are missing, the build did not complete.
|
||||
If source patches exist only in `recipes/*/source/` but not in `local/patches/`,
|
||||
the patches are not durable (see Source-of-Truth Rule below).
|
||||
|
||||
### Cascade Rebuild Rule
|
||||
|
||||
When a low-level package changes, **all packages that transitively depend on it
|
||||
must be rebuilt**. A stale dependent silently produces link errors, ABI mismatches,
|
||||
or runtime crashes.
|
||||
|
||||
```bash
|
||||
# Rebuild relibc and everything that depends on it
|
||||
./local/scripts/rebuild-cascade.sh relibc
|
||||
|
||||
# Dry run: show what would be rebuilt without building
|
||||
./local/scripts/rebuild-cascade.sh --dry-run relibc
|
||||
|
||||
# Multiple root packages
|
||||
./local/scripts/rebuild-cascade.sh relibc ncurses
|
||||
```
|
||||
|
||||
The script performs BFS over reverse dependencies: it finds all packages whose
|
||||
`recipe.toml` lists the target in `dependencies`, transitively expands, then builds
|
||||
root-first followed by dependents.
|
||||
|
||||
**Always use cascade rebuilds after changing:**
|
||||
- relibc (headers, ABI, any patches)
|
||||
- Kernel (syscall ABI changes)
|
||||
- Shared libraries (ncurses, zlib, openssl, etc.)
|
||||
- Any package listed in other packages' `dependencies`
|
||||
|
||||
**Example:** Changing relibc's `sys/types/internal.h` header requires rebuilding
|
||||
bison, m4, flex, and every other gnulib-based package that includes system headers
|
||||
through the relibc include chain.
|
||||
|
||||
## DESIGN PRINCIPLE
|
||||
|
||||
Red Bear OS is a **full fork** based on frozen Redox OS snapshots:
|
||||
@@ -73,10 +149,21 @@ make all CONFIG_NAME=redbear-full
|
||||
→ mk/config.mk resolves to the active desktop/graphics compile target
|
||||
→ Desktop/graphics are available only on redbear-full
|
||||
→ repo cook builds all packages from local sources (offline by default)
|
||||
→ Each successful cook produces repo/<arch>/<name>.pkgar + <name>.toml
|
||||
→ mk/disk.mk creates harddrive.img with Red Bear branding
|
||||
→ REDBEAR_RELEASE=0.1.0 ensures immutable, archived sources
|
||||
```
|
||||
|
||||
Cascade rebuild flow (when a low-level package changes):
|
||||
```
|
||||
./local/scripts/rebuild-cascade.sh <package>
|
||||
→ Finds all packages whose recipe.toml lists <package> in dependencies
|
||||
→ BFS expands the reverse dependency graph
|
||||
→ Builds root package first, then dependents in dependency order
|
||||
→ Pushes all rebuilt packages to sysroot
|
||||
→ Every rebuilt package lands in repo/ (.pkgar + .toml)
|
||||
```
|
||||
|
||||
Release flow:
|
||||
```
|
||||
# Sources are immutable — build from archives, never from network
|
||||
@@ -259,6 +346,7 @@ redox-master/ ← git pull updates mainline Redox
|
||||
│ │ └── images/ ← Red Bear OS icon (1254x1254) + loading bg (1536x1024)
|
||||
│ ├── firmware/ ← GPU firmware blobs (gitignored, fetched)
|
||||
│ ├── scripts/
|
||||
│ │ ├── rebuild-cascade.sh ← Rebuild package + all dependents (BFS reverse-dep graph)
|
||||
│ │ ├── provision-release.sh ← Provision new release from Redox ref
|
||||
│ │ ├── build-redbear.sh ← Unified Red Bear OS build script
|
||||
│ │ ├── fetch-firmware.sh ← Download bounded AMD or Intel firmware subsets from linux-firmware
|
||||
@@ -311,6 +399,10 @@ scripts/build-iso.sh redbear-full # Full desktop live ISO
|
||||
scripts/build-iso.sh redbear-mini # Text-only mini (default)
|
||||
scripts/build-iso.sh redbear-grub # Text-only + GRUB
|
||||
|
||||
# Rebuild a package and all its dependents (cascade)
|
||||
./local/scripts/rebuild-cascade.sh relibc # Rebuild relibc + all dependents
|
||||
./local/scripts/rebuild-cascade.sh --dry-run ncurses # Show cascade without building
|
||||
|
||||
# VM-network baseline validation helpers
|
||||
./local/scripts/validate-vm-network-baseline.sh
|
||||
./local/scripts/test-vm-network-qemu.sh redbear-mini
|
||||
|
||||
Reference in New Issue
Block a user