Commit Graph

1707 Commits

Author SHA1 Message Date
vasilito 05f18e5f9b chore: track kernel pointer (dup2 refresh diag) 2026-07-18 17:21:59 +09:00
vasilito de44b9324e feat: build-system resilience (fetch retry, strict cache parse, auto_deps preserve, Tier 1 messages)
Tier 3 code improvements (from BUILD-SYSTEM-ASSESSMENT-2026-07-18 Part 6.2):

- Q2: Add run_command_with_retry() helper with exponential backoff (1s, 2s, 4s).
  Wrap download_wget and git clone with 3 attempts. Git clone closure cleans
  partial tmp dir between retries (git refuses non-empty clone targets).

- Q3: Preserve auto_deps.toml alongside dep_hashes.toml in binary store publish
  (repo_builder.rs). Restore path prefers the preserved copy, falling back to
  declared-depends-only reconstruction only when the preserved copy is absent
  (e.g. published by an older cookbook). Preserves full ELF dynamic dep graph.

- Q4: DepHashes::read now returns Result<Option<Self>, String> discriminating
  'missing' (legitimate first build, fall back to mtime) from 'corrupt' (loud
  WARN + force rebuild). Closes a silent-swallow gap where a corrupt
  dep_hashes.toml produced an incorrect mtime-fallback rebuild.

- Q6: Standardize error reporting in repo.rs nonstop path to {:#} format,
  matching the pattern established in the earlier Tier 1 message commit.

Tier 1 message fixes (remaining items from assessment Part 5.3/5.4):

- M26: build-redbear.sh:569 '30-60 minutes' -> config-dependent range
- A6/A8: Makefile container messages add remediation hint
- B3: mk/config.mk sccache hint adds install guidance
- H2: mk/qemu.mk Unsupported ARCH lists supported values
- mk/redbear.mk comment 'fully-patched' -> 'versioned'

Verification: cargo check 0 errors, cargo test --lib 35/35 passed,
cargo clippy 0 new warnings vs baseline, make -n live + validate clean.
2026-07-18 16:54:24 +09:00
vasilito 0d5043f3fc chore: track relibc pointer (non-fatal filetable refresh) 2026-07-18 16:34:46 +09:00
vasilito 1528e04b09 docs: consolidate build-system docs + Tier 1 message fixes
Phase 2 of the build-system assessment:

Tier 1 (user-facing message fixes):
- mk/podman.mk: 'mk/config.mk' -> '.config' (the actual config location)
- mk/prefix.mk: vague 're-run the build' -> specific 'make prefix' guidance
- mk/virtualbox.mk: 'RedBearOS directory' -> 'Red Bear OS VM directory'
- src/bin/repo.rs: '{:?}' -> '{:#}' anyhow chain format + 'repo: ' prefix

Tier 2 (doc consolidation):
- Archive BUILD-SYSTEM-IMPROVEMENTS.md to local/docs/archived/ (self-labeled
  'HISTORICAL POST-MORTEM', no longer current).
- Add local/docs/BUILD-SYSTEM-ASSESSMENT-2026-07-18.md (459-line
  comprehensive assessment: architecture, quality, robustness, gaps).
- docs/README.md: refresh status note (2026-05-01 -> 2026-07-18, v4.0 ->
  v6.0); fix 'as an full fork' grammar.
- docs/07-RED-BEAR-OS-IMPLEMENTATION-PLAN.md: add status header noting
  canonical/secondary split vs CONSOLE-TO-KDE-DESKTOP-PLAN.md; fix grammar.
- HARDWARE.md: remove nonexistent PROFILE-MATRIX.md reference; repoint to
  README.md and the canonical desktop plan.
- local/docs/LOCAL-FORK-SUPREMACY-POLICY.md: 'currently 0.1.0' -> 'currently
  branch 0.3.1; legacy release archive at sources/redbear-0.1.0/'.
- local/docs/GRUB-INTEGRATION-PLAN.md: 'make all CONFIG_NAME=redbear-grub'
  -> canonical './local/scripts/build-redbear.sh redbear-grub'.
- recipes/AGENTS.md, recipes/core/AGENTS.md: replace upstream-Redox-pattern
  content with proper redirects to root AGENTS.md reflecting the local
  fork / path-fork model actually used by Red Bear.
- CONTRIBUTING.md: full rewrite for local fork workflow (Gitea, single-repo
  rule, path-fork model, patch governance, build-redbear.sh as canonical
  entry point, no AI attribution policy).
- README.md: add BUILD-SYSTEM-ASSESSMENT-2026-07-18.md to Documentation list.

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline).
2026-07-18 16:32:19 +09:00
vasilito c2f5bb09fc feat: build-system hardening (validate gate, cache safeguards, status sync)
Phase 1 remediation of the build-system assessment:

- Makefile: wire 'validate' target into build/live/reimage flows; surface
  lint-config and init-service validators as a first-class gate.
- mk/disk.mk: add 'validate' target running lint-config, init-service
  validator, and file-ownership validator; suppress noisy unmount warnings
  that masked real failures.
- mk/redbear.mk: add source-fingerprint tracking so integrate-redbear.sh
  re-runs when local/recipes, local/Assets, or local/firmware change.
- src/cook/cook_build.rs: atomic dep_hashes.toml write (tmp + rename) to
  prevent torn-write cache corruption; binary-store restore now checks
  dep_hashes before silent restore; fix production bug in
  collect_files_recursive that silently dropped subdirectories whose
  name matched an exclude pattern.
- src/cook/fetch.rs, src/cook/fetch_repo.rs: harden atomic patch
  application and protected-recipe gating.
- AGENTS.md, local/AGENTS.md, local/docs/COLLISION-DETECTION-STATUS.md:
  sync collision-detection status to 'implemented (Phase 15.0)' now that
  CollisionTracker is wired across all four installer layers
  (installer submodule pointer tracked separately in 13cc6fb0c3).

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline), make -n validate, make -n live.
2026-07-18 16:30:23 +09:00
vasilito 13cc6fb0c3 chore: track installer pointer (collision-tracker WIP) 2026-07-18 16:08:15 +09:00
vasilito 26cdbe4ac5 chore: track kernel pointer (conservative dup2 refresh) 2026-07-18 15:58:51 +09:00
vasilito c2ca67f7d0 chore: track kernel+relibc pointers (filetable-refresh fd fix); shell back to brush 2026-07-18 14:59:12 +09:00
vasilito f4ca523afd docs: update TOOLS.md for release-bump pipeline (5 new tools)
Add documentation for the 5 new release-bump tools:
- bump-release.sh (canonical orchestrator)
- check-external-versions.sh (external version reporter)
- bump-graphics-recipes.sh (map-driven graphics bumper)
- post-checkout-version-sync.sh (opt-in branch hook)
- install-git-hooks.sh (idempotent hook installer)

Bump tool count 10 -> 15, round 13 -> 14.
Apply drift fixes at lines 94-96 and 204.
2026-07-18 14:48:53 +09:00
vasilito 99e5641127 feat: release-bump pipeline + external graphics version sync
Pipeline (3 operator asks):
- bump-release.sh: canonical orchestrator (forks + sources + external)
- upgrade-forks.sh --to=<tag>: rebase forks with diverged-mode guard
- bump-graphics-recipes.sh: map-driven group-aware graphics bumps
- check-external-versions.sh: drift checker for Qt6/KF6/Plasma/Mesa/Wayland
- refresh-fork-upstream-map.sh: append-only map updater with --check
- post-checkout-version-sync.sh + install-git-hooks.sh: opt-in branch hook
- external_version_lib.py: shared version-parsing/bumping library
- external-upstream-map.toml: ~80 external package entries
- bump-fork.sh: deprecated (REDBEAR_I_KNOW_BUMP_FORK_IS_DEPRECATED=1)
- RELEASE-BUMP-WORKFLOW.md: operator runbook

Quality fixes (8 defects from two independent audits):
- blake2b stable cache keys (was hash(), non-portable)
- atomic cache writes via os.replace
- version_sort_key pre-release demotion (was sorting after finals)
- apply_ver_transform re.error tolerance
- grep || true (pipefail abort)
- cd failure detection in upgrade-forks
- sed URL escape (injection hardening)
- refresh-fork-upstream-map last-row drop fix

Doc cleanup:
- Archive 5 obsolete plans to local/docs/archived/
- Remove 14 stale/superseded docs
- Update 18 docs to reference bump-release.sh and fix inbound links
- TOOLS.md drift fixes
2026-07-18 14:45:41 +09:00
vasilito 7b004272a3 chore: track userutils pointer (termios cast fix) 2026-07-18 14:35:26 +09:00
vasilito 27e97a1132 chore: track userutils pointer (canonical terminal reset before shell) 2026-07-18 14:33:41 +09:00
vasilito 59357561f9 chore: track userutils pointer (blocking console fds before shell) 2026-07-18 13:05:05 +09:00
vasilito 170cbe65fb chore: track userutils pointer (skip login ns restriction test) 2026-07-18 12:52:55 +09:00
vasilito e9f37fa2ab chore: track userutils pointer (getty fwd diag) 2026-07-18 12:42:08 +09:00
vasilito a92f698849 chore: track base pointer (fbcond keyboard CR->LF) 2026-07-18 12:02:48 +09:00
vasilito 246ebdfc4b chore: track userutils pointer (login chdir-before-mkns fix) 2026-07-18 11:01:26 +09:00
vasilito 4c610e6555 chore: track base+userutils pointers (init CWD fix) + clean brush patch 2026-07-18 10:43:18 +09:00
vasilito ab2ca5399a chore: track userutils pointer (spawn diag) 2026-07-18 10:26:53 +09:00
vasilito 74bea85fe7 chore: track userutils pointer (login CWD fix) 2026-07-18 10:17:13 +09:00
vasilito 302ae880da chore: track base submodule pointer (revert logger Warn) 2026-07-18 09:47:28 +09:00
vasilito c843db2682 chore: base gitlink (console log quiet) + durable brush redox patch
- Track base submodule pointer for output_level Warn console-quiet change.
- Capture brush entry.rs redox edits (tokio current-thread runtime, default
  minimal input backend) as patches/brush-redox-runtime-and-input.patch and
  apply it in the recipe, so a clean source re-fetch keeps the Redox port.
2026-07-18 08:55:55 +09:00
vasilito dc97454734 chore: track base submodule pointer for switch_root chdir restore 2026-07-18 08:24:20 +09:00
vasilito f8d269c4b6 chore: track userutils submodule pointer for spawn_shell diagnostics 2026-07-18 08:09:05 +09:00
vasilito 688645bf98 feat(serial): headless serial console for mini/bare via fbcond mirror
Track base e9342b78 (fbcond bidirectional serial mirror) + kernel 229046c6
(debug fevent readable). Disable the standalone 31_debug_console getty since
fbcond now owns the serial/debug console (avoids competing for the shared debug
input queue and duplicated output). Gives headless serial login on mini + bare.
2026-07-18 07:23:58 +09:00
vasilito eddc5c737d fix(mesa): disable gbm (needs DRM/KMS platform; not on Redox surfaceless/llvmpipe) 2026-07-18 04:17:51 +09:00
vasilito b2c174875c fix(full+build): unblock glib/mesa/libinput; close fork-staleness gap
- build-redbear.sh: detect changes to the 4 forks the staleness loop missed
  (userutils pkgar; syscall/libredox/redox-scheme crate path-deps force a full
  userspace relink) — prevents stale-binary skew (bash -n validated).
- glib: drop the stale '#undef AT_FDCWD' Redox workaround — relibc now provides
  faccessat()/AT_FDCWD, and glib's HAVE_FACCESSAT path needs AT_FDCWD.
- mesa: remove the dropped '-Dosmesa=true' meson option (unknown option) and
  guard the osmesa.pc pkg-config edit.
- libinput: unblocked by syncing the fresh relibc libc.a (with timerfd_*) into
  the stale prefix sysroot (prefix-sysroot staleness — see notes).
2026-07-18 03:36:01 +09:00
vasilito 79e7f24f00 docs: remove completed submodule-normalization handoff
The fork branch normalization it described is done — all local/sources forks are
on submodule/* branches (submodule/relibc, submodule/base, ... in active use).
Unreferenced one-time handoff; recoverable from git history if needed.
2026-07-18 03:11:56 +09:00
vasilito 061184a64c fix(libinput): disable lua-plugins (no lua-5.4 in Redox sysroot) to unblock build 2026-07-18 02:52:57 +09:00
vasilito 76d609a39e fix(timerfd): base ptr — compile sys_timerfd so timerfd_* link (unblocks Wayland) 2026-07-18 02:51:37 +09:00
vasilito ff49356d58 fix(full): unblock desktop stack build
- relibc ptr 3b40cc8e: sys/timerfd.h compiles in C (unblocks libwayland + glib)
- redbear-meta: add [package].version = 0.3.1 (cookbook couldn't guess it)
- pam-redbear: regenerate Cargo.lock (in-house crate version drift vs --locked)
- (glib corrupted partial source cleaned to force a fresh re-fetch)
2026-07-18 01:57:26 +09:00
vasilito 72351f2a6a fix(boot): base ptr (net warning cleanup + e1000e) + quieter sessiond dbus retry
Track base 01200174 (smolnetd empty-router/broadcast warnings silenced, e1000e
82574 NIC support). redbear-sessiond: suppress the harmless first dbus connect
retry so it does not print an alarming line on every boot.
2026-07-18 00:50:04 +09:00
vasilito 7462574f3c docs: remove completed one-time doc-cleanup session log
SESSION-2026-07-13-DOC-CLEANUP.md was an explicitly-transient session handoff
log (marked not-edit-me) recording a past cleanup; its content is fully
historical. Durable records (post-mortems, policy, resolved-plan implementation
notes) are intentionally kept.
2026-07-18 00:36:56 +09:00
vasilito 5b49b36724 fix(boot): base submodule ptr (bare/mini warning cleanup) + bare serial console
Track base 1769b083 (condition_path_exists for optional daemons, ahcid no-media,
netstack no-NIC idle, dhcpd fast-fail). Re-enable the serial debug console on
the bare target so it has a headless-visible login prompt (matching mini up to
login).
2026-07-18 00:30:00 +09:00
vasilito c415829a12 fix(relibc): F_DUPFD_CLOEXEC ABI translation -> tokio runtime works on Redox
Track relibc submodule pointer 733da068 (translate POSIX F_DUPFD_CLOEXEC 1030 to
Redox syscall value 5, so OwnedFd::try_clone and thus tokio Runtime::build stop
failing with EINVAL). Also revert the ineffective epoll_ctl retry.

Remove temporary tokio/sessiond EINVAL diagnostics now that the root cause is
fixed.
2026-07-17 23:00:23 +09:00
vasilito e0d62330ac kernel: track event kdup fix (tokio Runtime EINVAL root cause); build: only re-cook userspace when relibc/base change
The kernel event scheme now implements kdup, so dup() of an epoll fd works
and tokio's registry.try_clone() succeeds — fixing the tokio runtime EINVAL
that killed every zbus daemon and the brush login shell.

build-redbear.sh: gate the userspace build/sysroot clean on relibc/base
(the forks userspace links) instead of any low-level fork, so a kernel-only
change rebuilds the kernel + initfs + image without a full userspace re-cook.
2026-07-17 21:47:32 +09:00
vasilito 053d10276f sessiond: fix DIAG probe crate name (redox_syscall) 2026-07-17 18:18:40 +09:00
vasilito d61b878d03 sessiond: syscall-level DIAG — register pipe vs uds_stream fd with /scheme/event 2026-07-17 18:13:54 +09:00
vasilito 333f1ac023 build: invalidate ALL relibc consumers on relibc change (bulletproof)
relibc is statically linked into every userspace binary, so a relibc change
invalidates every consumer, not just the 4 initfs-critical packages the old
ABI_CRITICAL_PKGS list covered. A stale consumer silently bakes in old relibc
behaviour; diagnosing against such stale binaries wastes enormous time. Now:
if relibc rebuilds, ALL package pkgars + recipe build trees are invalidated
for a clean relink; otherwise any consumer pkgar older than relibc.pkgar (the
interrupted-build skew that shipped a broken login image) is invalidated.

Also add a temporary SESSIOND_DIAG probe that tries each tokio runtime config
and logs which one EINVALs, to pinpoint the tokio-runtime failure.
2026-07-17 09:42:41 +09:00
vasilito ccccf94fb5 relibc: track epoll EINVAL/EBADF retry pointer; bare: brush login shell
Track relibc submodule at the epoll_ctl transient-retry fix (415fa3c8),
which lets tokio runtimes (the zbus daemons and the brush login shell)
build past the transient /scheme/event EINVAL/EBADF during early-boot
scheme churn.

redbear-bare.toml: switch [users.root]/[users.user] to /usr/bin/brush and
add the brush package, so bare and mini share an identical boot-to-login
shell (bare = minimal boot-test surface, mini = +app payload).
2026-07-17 00:32:09 +09:00
vasilito 9c97cefc57 recipes: adopt brush shell into local/recipes with Redox port patches
Port the brush shell (reubeno/brush) to Redox and adopt the recipe as a
Red Bear local recipe under local/recipes/shells/brush, with the standard
recipes/shells/brush -> ../../local/recipes/shells/brush overlay symlink so
it takes priority over any upstream WIP copy (per local/AGENTS.md "Local
recipe priority vs upstream WIP"). Removes the old recipes/wip/shells/brush.

The dependency tree did not build for Redox: nix 0.31 only partially
cfg-enables Redox and the libc crate's Redox module omits POSIX symbols that
relibc provides. Fixes are reviewable unified diffs under
local/recipes/shells/brush/patches/:

  nix-0.31-redox.patch   cfg-enable resource/Id/waitid/from_siginfo, rlimit
                         import + repr(i32), SaFlags width casts, pty.
  libc-0.2-redox.patch   add idtype_t, P_*/CLD_*, rusage, getrusage/waitid/
                         forkpty externs, siginfo child accessors.
  brush-umask-redox.patch  mode_t is signed on Redox; cast, not u32::from.

The recipe runs `cargo fetch` to materialise registry sources before
patching (they are only unpacked during the build), resolves the right
crate version from Cargo.lock (brush pulls both nix 0.26 and 0.31), and
applies each patch idempotently, failing loudly on version drift. The
binary target is named `brush` (not `brush-shell`), so install it
explicitly. Verified: cooks from a pristine cargo cache using only the
patch files. brush is shipped in redbear-mini as a package for in-image
validation; the login shell stays zsh until brush is runtime-proven.
2026-07-16 23:23:37 +09:00
vasilito 81a1d7d565 track relibc pointer: waitid unsafe fix 2026-07-16 22:08:37 +09:00
vasilito 0c3b769b24 track submodule pointers: relibc waitid, fbcond scrollback, bootloader color 2026-07-16 22:04:37 +09:00
vasilito 4afefcd8e1 base: 00_tmp idempotent mkdir + audiod/pcid/smolnetd non-blocking (pointer c14a577d) 2026-07-16 20:05:55 +09:00
vasilito 1ebc92f51f base: 20_audiod.service oneshot_async (pointer f5f726ca) 2026-07-16 18:39:28 +09:00
vasilito 19470fb444 boot: make bare/base driver-manager + netstack non-blocking; changelog
Base submodule 1f826240: 00_pcid-spawner (/usr) and 10_smolnetd base-default
init units switched to oneshot_async so init never blocks the boot-to-login
path on PCI driver enumeration or a network adapter binding. Adds the
2026-07-16 CHANGELOG entry (mini login restored, kernel MSR #GP guard,
build-system staleness/lock/override fixes).
2026-07-16 12:48:57 +09:00
vasilito d5561184f0 boot: restore mini ISO to a working login prompt + build-system fixes
Mini now boots (q35/KVM) all the way to the getty "Red Bear login:" prompt
on VT2 with zero kernel panics. Root-cause fixes across submodules + config:

- config: 00_base.service zsh->mkdir (a full shell startup hangs an init
  oneshot; the earlier 'echo/mkdir also hang' result was a silent config
  override running zsh). 00_ptyd.service notify->{scheme=pty} (ptyd signals
  readiness via its scheme fd; notify made init block on a byte forever).
- kernel: wrmsr_safe/rdmsr_safe #GP recovery so /scheme/sys/msr can't panic
  the kernel (cpufreqd's P-state MSR write #GP'd on KVM, halting the boot
  before login). base: ptyd scheme type + hwd ACPI enum -> debug (noise).
  installer: warn on config [[files]] override. relibc/bootloader: prior
  getrlimit + warning-demotion pointers.
- build-redbear.sh: fix host-fstools staleness (installer/redoxfs never
  rebuilt on source change), prefix rebuild-every-build (touch libc.a), add
  concurrent-build flock.

Submodule pointers: base 8aa8616d, installer 460d9530, kernel 155d01b1,
relibc a7663b3a, bootloader 6e119641.
2026-07-16 12:20:14 +09:00
vasilito 2b64199007 fix: track clean kernel+base pointers (FileTableVerb::Resize fix, diagnostics removed) 2026-07-15 15:40:21 +09:00
vasilito 543cdfb962 chore: track kernel submodule pointer for PROCMGR write-mirror diag 2026-07-15 13:25:55 +09:00
vasilito b81ff59197 chore: track base submodule pointer for procmgr diagnostic 2026-07-15 13:06:03 +09:00