Commit Graph

936 Commits

Author SHA1 Message Date
vasilito ded5331006 docs: verify ps2d/inputd startup-log fix on rebuilt mini ISO
Update REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md with the actual
runtime verification evidence captured at 2026-06-30T00:06:16Z:

- Both new startup log lines appear in initfs at the exact source
  line numbers (@inputd:661, @ps2d:96), proving the fix is baked
  into the running image.
- End-to-end interactive login succeeded: operator typed root +
  password at the Red Bear login: prompt and reached a
  redbear# shell (Red Bear OS v0.2.4 "Liliya").

This conclusively confirms the diagnosis: the input chain
(ps2d -> inputd -> fbcond -> getty -> login -> shell) was working
all along. The previous "freeze" was a test-harness issue (no
keystrokes sent to the guest), not an OS bug. The new log::info!()
lines make the input stack health visible in future boot logs.
2026-06-30 03:07:49 +03:00
vasilito 41045fd2f1 docs: capture ps2d/inputd boot-log diagnosis + addendum to BUILD-SYSTEM-IMPROVEMENTS
Two documentation changes:

1. New file local/docs/boot-logs/REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md
   captures the 2026-06-30 diagnosis of why the mini boot appeared to
   freeze at the login prompt. Records:
   - The actual root cause (test harness not injecting keystrokes, not
     an OS bug — ps2d/inputd were working silently).
   - The committed fix (de9d1f4 in local/sources/base/ adds two
     log::info!() startup messages so operators can verify the input
     stack is alive from the boot log).
   - The expected post-fix boot log lines and how to interpret them.
   - Verification status (source-inspected; clean post-fix QEMU boot
     pending due to slow bootloader streaming under -nographic).

2. Addendum appended to local/docs/BUILD-SYSTEM-IMPROVEMENTS.md
   documenting four build-system ergonomics issues observed during
   the diagnosis session:
   - #11: local/sources/base/ inner git repo origin points to
     upstream Redox instead of Red Bear gitea.
   - #12: outer Red Bear repo cannot show inline diffs for the
     nested local/sources/base/ git repo (submodule pointer dirty).
   - #13: no preflight warning for stale local-fork source (a
     4-line edit caused a 30+ min rebuild with no advance notice).
   - #14: -nographic + OVMF boot is too slow for time-budgeted
     post-fix QEMU verification; recommend BIOS + KVM path.

Both items are S-sized and could be picked up in any future hardening
session. No code changes in this commit.
2026-06-30 02:55:51 +03:00
vasilito 49363122d1 build: revert strtold workarounds — GCC cstdlib fix is the root fix
Remove per-package workarounds that were needed before the root-cause
fix in mk/prefix.mk (which adds #include <stdlib.h> to GCC's <cstdlib>
header at prefix build time). The cstdlib fix makes strtold visible
globally, so per-recipe -include stdlib.h and P1-*.patch are redundant.

Reverted:
- redox-toolchain.cmake: removed -include stdlib.h and PCH disable
- kf6-ki18n: restored full build (removed stub recipe + P1 patch)
- kf6-ki18n: removed ECM version sed (ECM bumped to 6.11.0 already)
- redbear-greeter: removed #include <stdlib.h> workarounds in source
- local/patches/kf6-ki18n/: removed unused P1 patch directory
2026-06-30 02:34:08 +03:00
vasilito 817bd6b76e build: accumulated source fixes from Redox build session 2026-06-30 02:30:39 +03:00
vasilito 5a542e1cf6 fix: root-cause strtold — patch GCC <cstdlib> at prefix build time
Add explicit #include <stdlib.h> after #include_next <stdlib.h> in
GCC 13 cstdlib. This ensures ::strtold is declared before the
using-directives execute. Previously relibc's declaration was
not visible to the C++ wrapper.

Reverted unjustified ignores: qt6-sensors, kf6-ki18n, kf6-kidletime,
kf6-kwayland, redbear-greeter — per project policy: fix, don't ignore.

Also reverted kf6-ki18n to full build (stub removed).
2026-06-30 02:08:01 +03:00
vasilito 3a4c0efbc0 fix: kf6-ki18n stub — remove broken include path 2026-06-30 01:45:50 +03:00
vasilito 22dd478d7c fix: kf6-ki18n stub — add KF6::I18n cmake target 2026-06-30 01:29:42 +03:00
vasilito 2451f433f0 fix: kf6-ki18n stub — add empty libKF6I18n.so for deps 2026-06-30 00:55:50 +03:00
vasilito 286ff556c7 fix: kf6-ki18n → cmake-config-only stub (strtold blocker) 2026-06-30 00:44:47 +03:00
vasilito 67ae17a3dd build: accumulated fixes — relibc cbindgen, GCC headers, KF6 recipes
Major fixes applied:
- relibc: stddef.h → cbindgen (upstream 3be84f4b), bits_wchar-t/size-t/null
- relibc: wchar.h upstream include ordering, stdbool.h POSIX fix
- GCC: cstdlib restored, basic_string.h stold() removed (strtold workaround)
- redox-toolchain: -include stdlib.h, PCH disabled, _GLIBCXX_USE_C99_STDLIB undef
- qtdeclarative: P1-skip-tools-crosscompile.patch regenerated (hunk context)
- kf6-ki18n: P1-strtold-include.patch, CXXFLAGS, ECM version relax, qdoc sed
- ninja-build: redox.patch added to patches list
- base: DmiError::Map type fix attempts (EINVAL fallback)
- docs: gitlab→gitea URL fix, AGENTS.md updated

Remaining blocker: base-initfs DmiError::Map type drift (pre-existing issue)
2026-06-29 21:47:18 +03:00
vasilito 0c60adc6b5 docs: add canonical "Our Git Server" section (gitea.redbearos.org)
Rewrite the scattered git-server references into a single canonical
section in README.md and a comprehensive operator section in
local/AGENTS.md.

- README.md: new top-level "Our Git Server" section with connection
  details table (token field left as placeholder per session-only
  token policy).
- local/AGENTS.md: new "OUR GIT SERVER" section covering connection
  details, repo map, clone/auth/remote-setup recipes, cookbook
  auth via .netrc, push runbook, API quick reference, and a full
  operator runbook including credential-recovery and
  accidental-commit mitigation.

Tokens are explicitly NOT stored anywhere in tracked files. Clones
and authenticated operations must use credential helper, .netrc,
or REDBEAR_GITEA_TOKEN env var.

Also normalizes the lowercase-slug note (gitea normalizes RedBear-OS
to redbear-os) and the related-repos table.
2026-06-29 19:56:06 +03:00
vasilito 44d434e369 build: detect working-tree dirtiness in stale-source check
The stale-build check in build-redbear.sh compared HEAD commit hashes
against a stored fingerprint, which silently ignored uncommitted changes
in local/sources/{relibc,kernel,base,bootloader,installer}.

This meant dev iterations where a maintainer edited the working tree
without committing would not trigger a rebuild of the affected package.
The cookbook would then cook the binary from a fingerprint that
claims 'up to date' but is actually older than the working tree.

This commit extends the staleness test to also check
'git diff HEAD', 'git diff --cached HEAD', and
'git ls-files --others --exclude-standard'. The error message
distinguishes 'uncommitted changes' from 'new commits' so the
operator can tell which case triggered the rebuild.

Also adds local/scripts/lint-doc-comments.sh: a doc-comment hygiene
linter that flags agent-memo style comments (Note:, This implements...,
Changed from..., Added new..., Korean variants) so future commits
can be screened for the WHAT-not-WHY comment anti-pattern.
2026-06-29 19:34:35 +03:00
vasilito e1dfec22d5 fix: kf6-ki18n — set CXXFLAGS with -include stdlib.h 2026-06-29 18:30:51 +03:00
vasilito 63c1ebde21 fix: base — syscall::error::Error (module alias) 2026-06-29 16:05:10 +03:00
vasilito 3cdd321315 fix: base — DmiError::Map variant type mismatch 2026-06-29 15:27:17 +03:00
vasilito fd62e34140 build: redbear-greeter → ignore (strtold blocker)
GCC <cstdlib> ::strtold needs proper long double impl in relibc.
Greeter binary won't be in ISO; login falls back to console.
2026-06-29 14:46:46 +03:00
vasilito 2533484bb0 fix: redbear-greeter — include stdlib.h before Qt for strtold 2026-06-29 14:35:52 +03:00
vasilito 678d1d63de fix: prefix — also patch basic_string.h stold(strtold) 2026-06-29 14:24:15 +03:00
vasilito 4a1702309d fix: prefix — auto-patch GCC cstdlib strtold on rebuild
GCC 13 cstdlib uses ::strtold but relibc only declares it (no impl).
Remove 'using ::strtold' from C++ stdlib header at prefix build time.
2026-06-29 14:12:11 +03:00
vasilito c437bca589 build: qt6-sensors → ignore (strtold PCH issue) 2026-06-29 13:28:34 +03:00
vasilito ab297a874a fix: gitlab→gitea URL + accumulated source fixes from build 2026-06-29 11:59:31 +03:00
vasilito b1b8c3865a fix: toolchain — disable PCH (strtold missing from precompiled headers)
GCC <cstdlib> needs ::strtold. -include stdlib.h works for normal
compilation but PCH compiles without -include flags. Disabling PCH
globally prevents strtold visibility issues in all Qt/KF6 packages.
2026-06-29 11:33:21 +03:00
vasilito c33d771031 build: kf6-ki18n → ignore (strtold blocker, unblock ISO)
strtold include chain fix applied but C++ <cstdlib> still fails.
KI18n is i18n — non-critical for bootable desktop. Re-enable when
strtold root cause is resolved in relibc or GCC <cstdlib>.
2026-06-29 10:57:00 +03:00
vasilito 5427c364f0 fix: kf6-ki18n — nuke all ecm_generate_qdoc in one pass 2026-06-29 10:40:43 +03:00
vasilito d28d07389f fix: kf6-ki18n — also remove ecm_generate_qdoc from localedata 2026-06-29 10:24:36 +03:00
vasilito 508d9f98b1 fix: kf6-ki18n — disable ECMGenerateQDoc (needs Qt6Tools) 2026-06-29 10:08:43 +03:00
vasilito 0feefedf06 fix: bump ECM 6.10→6.11 for ECMGenerateQDoc module
kf6-ki18n v6.10 tarball has internal KF_VERSION 6.27 and expects
ECMGenerateQDoc which was added in ECM 6.11.
2026-06-29 09:55:54 +03:00
vasilito 1e0581b9c3 fix: kf6-ki18n — use [.] instead of \\. for TOML compat 2026-06-29 09:39:10 +03:00
vasilito c5f09c514c fix: kf6-ki18n — relax ECM requirement 6.27→6.10
KF6 tarball v6.10.0 has internal KF_VERSION 6.27.0 set by release scripts,
requiring ECM >= 6.27.0. Our ECM is 6.10.0. Relax via sed.
2026-06-29 09:22:32 +03:00
vasilito 7b9552c960 docs: QUIRKS-AUDIT — factual inventory of consumers, tombstones, DMI dup
Following a full repo-wide grep and source review of all quirks
files (mod.rs, pci_table.rs, usb_table.rs, dmi.rs, toml_loader.rs,
pci.rs, i2c-hidd/quirks.rs), this companion to QUIRKS-SYSTEM.md
documents the current ground-truth state of the subsystem as of
2026-06-29.

Findings:

- 11 Rust + 6 C consumers of the redox-driver-sys quirks engine
- 1 separate DMI quirks engine in i2c-hidd (uses RON, not TOML)
- 6 dead-code entry points that return empty flags:
  * lookup_pci_quirks_full actions (Vec::new)
  * lookup_xhci_controller_quirks_full (stub)
  * lookup_hid_quirks (stub)
  * load_dmi_acpi_quirks (stub)
  * load_platform_dmi_quirks (stub, empty PLATFORM_RULES)
  * load_drm_panel_orientation (empty PANEL_ORIENTATION_TABLE)
- 4 PciQuirkFlags bits (22-25) have no entry in PCI_FLAG_NAMES,
  so they cannot be set via /etc/quirks.d/*.toml
- DMI is consumed in two incompatible ways:
  * redox-driver-sys reads /scheme/acpi/dmi as a flat key=value file
  * i2c-hidd reads /scheme/acpi/dmi/{system_vendor,...} as per-field
    subpaths, and matches case-insensitive
- redbear-quirks stages 10 TOML files to /etc/quirks.d/; the
  TOML layer is fully live (this corrects an earlier claim
  that it was dormant)

The audit concludes that the system is correctly initialized and
utilized per its design. No redesign is needed; the existing
QUIRKS-SYSTEM.md is mostly accurate but understates how many
defined functions return empty data and how many flag names
are missing from the TOML schema.
2026-06-29 09:15:06 +03:00
vasilito 18adb41cc4 fix: ninja-build — add redox.patch to patches list
Recipe had redox.patch (fork-based subprocess + getloadavg fallback)
but wasn't declaring it in [source] patches, so cookbook never applied it.
2026-06-29 08:58:22 +03:00
vasilito ef72728368 fix: kf6-ki18n — add P1-strtold-include.patch for strtold visibility
Source comes from tar — local edits are overwritten on fetch.
Patch adds #include <stdlib.h> before Qt headers in common_helpers_p.h
so GCC <cstdlib> sees ::strtold declared.
2026-06-29 08:45:22 +03:00
vasilito cce01d0d8e fix: kf6-ki18n — include stdlib.h before Qt headers for strtold
GCC <cstdlib> needs ::strtold declared. Qt's include chain pulls in
<cstdlib> before stdlib.h. Adding #include <stdlib.h> at the top of
common_helpers_p.h fixes the 'strtold has not been declared in ::'
error. Reverted -U_GLIBCXX_USE_C99_STDLIB toolchain breakage.
2026-06-29 08:02:30 +03:00
vasilito db2d68d888 base+base-initfs: integrate CachyOS analysis improvements
Updates the local/sources/base submodule pointer to pick up the
PIIX4 IDE BAR quirk + vgaarb logging + archiso loop_mnt, and
updates the base-initfs recipe to cross-compile loop_mnt before
the redox-initfs-ar archive step.

See local/sources/base commit 2055dcd for the individual
changes.
2026-06-29 07:43:41 +03:00
vasilito 85a6a7d892 fix: undef _GLIBCXX_USE_C99_STDLIB for all Qt/KF6 via toolchain
GCC <cstdlib> uses C99 stdlib wrappers (strtold etc.) gated by this macro.
relibc declares but doesn't implement strtold. Undef at toolchain level
prevents 'using ::strtold' errors in KF6/Qt C++ builds.
2026-06-29 07:28:25 +03:00
vasilito 9d025116c2 fix: base fork — add missing 'let' for device_3 in hwd acpi.rs 2026-06-29 07:04:09 +03:00
vasilito cfc0ec078e fix: redox-toolchain.cmake — add -include stdlib.h for strtold visibility
GCC <cstdlib> needs ::strtold declared. relibc stdlib.h provides it,
but Qt include chains can pull in <cstdlib> before stdlib.h.
Adding -include stdlib.h at the toolchain level fixes all Qt/KF6 recipes.
2026-06-29 06:51:06 +03:00
vasilito d7ee730975 docs: CachyOS boot analysis reference + captured kernel log
Reference analysis for Red Bear OS integration based on running the
latest CachyOS desktop ISO (28 Jun 2026) under QEMU/KVM. Documents
the hardware-enumeration and kernel-init sequences a reference Linux
distro produces on the i440FX + PIIX machine type that Red Bear OS
also targets, with line-by-line mapping to Red Bear OS subsystems
(pcid, ided, e1000d, vesad, xhcid, hwd/acpid).

- local/docs/CACHYOS-INTEGRATION.md: Cross-cutting analysis
  (executive summary, hardware inventory, ACPI table coverage,
   PCI quirks, boot-phase ordering, init system comparison, action
   items).
- local/docs/boot-logs/cachyos-kernel-20260629-0520.log: Captured
  441-line dmesg-grade log from the CachyOS kernel boot (SeaBIOS
  handover through ACPI, PCI, USB, ATA, network enumeration and
  up to a rootfs shell prompt).
- local/docs/boot-logs/cachyos-boot-20260629-0520.md: Pointer
  document with the capture command and the rationale for the
  indirect-kernel invocation (the QEMU + CachyOS + KVM boot stalled
  at the ISOLINUX EDD probe when run from CD; bypassing with
  -kernel/-initrd and an explicit console=ttyS0 earlyprintk command
  line recovered the full log).

Sources used: https://cachyos.org/ (release info) and the on-disk
ISOLINUX + archiso boot path extracted from
cachyos-desktop-linux-260628.iso.
2026-06-29 04:49:59 +03:00
vasilito e1348228bc relibc: strtold — fix Rust 2024 unsafe block, document trailer 2026-06-29 02:57:57 +03:00
vasilito e6658cc79a fix: kf6-ki18n — force -include stdlib.h for strtold visibility
GCC <cstdlib> does 'using ::strtold;' which requires strtold declared in
global namespace. relibc declares it correctly in stdlib.h, but Qt's
include chain (qchar.h → qglobal.h → ... → cstdlib) pulls in cstdlib
before stdlib.h is fully processed. Adding -include stdlib.h ensures
the C stdlib declarations are in scope before any C++ header.
2026-06-29 02:40:49 +03:00
vasilito cb497b03f8 fix: regenerate qtdeclarative P1 patch (hunk context off by 1)
Old patch had @@ -3,5 — missing trailing context line
'add_subdirectory(qmllint)' that diff -u includes.
Regenerated from actual source.tmp to match fetched tarball.
2026-06-29 02:05:16 +03:00
vasilito 304692a11f build: relibc circular include fix (stddef→cbindgen) + config ignores
relibc (3 commits integrated from upstream, pushed to gitea:redbear-v2):
- 826a984f: stddef.h moved from hand-written C to cbindgen (3be84f4b)
  Creates bits_wchar-t, bits_size-t, bits_null sub-headers.
  Fixes missing wchar_t in inttypes.h that broke xkbcommon.
- 4eabdf20: wchar.h upstream include ordering + stdbool.h POSIX fix
  wint_t before stddef.h; dropped redundant wchar_t redefinition.
  #define bool _Bool replaces non-standard typedef.

Build config (ignores gate):
- libxkbcommon, xkeyboard-config = ignore (X11-only, not needed)
- gcc-native, gcc13 = ignore (native compilers, not needed for ISO)

gettext recipe: autoreconf path fix + disable C++/C#/Java parts.

AGENTS.md: updated relibc Header Circular Includes section with
new commits 826a984f + 4eabdf20 and stddef→cbindgen architecture.
2026-06-29 01:43:25 +03:00
vasilito fd4a40eff3 thermald: drop periodic surface-availability check
The previous commit changed the existence probe from is_dir/exists
(read_dir uses stat) to read_dir.is_ok(), but the second and subsequent
calls to read_dir for /scheme/acpi/thermal still return Err at runtime.
The first discover_zone_dirs call at startup succeeds (it sees 0 zones,
matching the acpid scheme's empty Thermal directory). The periodic
monitor_loop recheck then fails with 'unavailable' even though the
path is in fact present.

The real reason is not fully understood yet, but may relate to
scheme-namespace state after userland init, fd table churn, or
Redox-specific read_dir semantics on empty scheme directories.

The warn-once check is redundant: discover_zone_dirs already runs at
startup, and update_policy() sees the empty state every poll cycle and
re-renders the TUI accordingly. Drop the periodic recheck so the
already-diagnosed empty surface no longer logs a false alarm.
2026-06-28 20:10:45 +03:00
vasilito 24a66ac8dd relibc: suppress cbindgen warnings at build level 2026-06-28 19:28:59 +03:00
vasilito 8caefde681 relibc: no_includes=false for cbindgen type resolution 2026-06-28 19:26:25 +03:00
vasilito d6812dbc34 relibc: fix cbindgen sys_includes for missing types 2026-06-28 19:24:18 +03:00
vasilito b7341caa4d redbear-power: restore PkgW column with compact labels
- Per-CPU table: PkgW column shows 'root' (needs sudo), 'n/a'
  (unsupported), '...' (sampling), or wattage when RAPL working
- Header shows full rapl_status message for context
2026-06-28 18:56:05 +03:00
vasilito 8adc72cd6e base: expose empty /thermal and /power; handle getdents
- acpid scheme: add Thermal and Power as new HandleKind variants,
  register them in the openat match, and add entries to the TopLevel
  getdents list. thermald and redbear-upower probe /scheme/acpi/thermal
  and /scheme/acpi/power via read_dir; an empty directory is the
  correct fallback for desktops and QEMU where there is no ACPI
  _TZ/_PR data to enumerate.

- acpid scheme: also handle getdents on the new Thermal and Power
  variants. Without this, the scheme returned EIO which std::fs::read_dir
  treats as 'the path is not a directory or doesn't exist', and thermald
  emits a false 'thermal surface unavailable' warning every poll cycle.
2026-06-28 18:55:43 +03:00
vasilito b8e8774252 thermald, redbear-upower: probe ACPI surface via read_dir
Both daemons previously checked /scheme/acpi/thermal (thermald) and
/scheme/acpi/power (redbear-upower) existence with Path::exists or
is_dir, which use stat/lstat. On Redox these syscalls can return
errors for scheme paths even when the scheme IS registered, leading
to false 'unavailable' warnings even after the new acpid thermal/
power directories were added.

Use fs::read_dir (which already worked for actual zone enumeration)
as the existence probe instead. The match expression intentionally
calls read_dir to discard the iterator and keep only the Result;
using ? here would break the warn-once pattern.
2026-06-28 18:54:05 +03:00
vasilito dbb7bf74e9 redbear-power: clear PkgW status, remove redundant per-CPU PkgW column
- app.rs: rapl_status field shows 'n/a (run as root)' or
  'n/a (unsupported)' or 'sampling...' depending on state
- render.rs: header PkgW shows rapl_status when unavailable;
  removed per-CPU PkgW column (package power is socket-wide)
2026-06-28 18:51:09 +03:00