From d6a81598403a3cf8bf44b537f207693387364946 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 27 Jul 2026 19:49:47 +0900 Subject: [PATCH] docs+scripts: fix stale redbear-minimal references; xwayland patch cleanup; Mesa surface.h stale comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Round 10 audit cleanup. Six fixes across nine files: 1. config/redbear-netctl.toml: stale comment referenced three non-existent configs (redbear-minimal, redbear-desktop, redbear-kde). Replaced with accurate include-chain note. 2. scripts/run.sh, build.sh, scripts/fetch-all-sources.sh: replaced all 'redbear-minimal' references with the actual canonical config names (redbear-mini, redbear-grub, redbear-wifi-experimental, redbear-bluetooth-experimental). Three previously listed configs (redbear-kde, redbear-live, redbear-wayland) never existed; removed them from the loop that preflights/scans/fetches 'ALL_CONFIGS' so those broken references no longer abort the script. 3. local/recipes/wayland/xwayland/recipe.toml: - removed stale '#TODO wayland-client, fix linux/input, wayland-scanner shim' (the workarounds are now real fixes). - added redbear-input-headers to dependencies so the uncommented include in xwayland-input.c resolves via Red Bear's in-tree input-headers recipe (per local/AGENTS.md LINUX KERNEL SOURCE POLICY). 4. local/recipes/wayland/xwayland/redox.patch: - stripped diff -ruwN timestamps from all ---/+++ headers (AGENTS.md patch format policy). - dropped the three xwayland-glamor.h / xwayland-window.h/c DRM-only hunks: they commented out xf86drm.h + drmDevice fields, but the recipe's mesonflags already sets '-Ddrm=false -Dglamor=false' so those code paths never compile. Removing them eliminates dead commented-out code that future maintainers would misread as 'in-progress'. - replaced hardcoded 0x110/0x112/0x111 button constants with the symbolic BTN_LEFT/BTN_MIDDLE/BTN_RIGHT names (the include is now real), matching upstream style and making the intent self-documenting. 5. local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/ redox_drm_surface.h: rewrote the stale header comment that still claimed 'the actual present path is a no-op until kernel-side scanout ioctls are added' — REDOX_SCANOUT_FLIP is wired and working; the comment now describes the real implementation. 6. local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md: marked redbear-wifi-experimental.toml and redbear-bluetooth- experimental.toml as FIXED 2026-07-27 in the config status table (the redbear-minimal → redbear-mini typo was corrected earlier). 7. local/docs/NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md: struck through Findings 14, 18, 18b, C-21, C-22 and the corresponding 'Config cleanup' todo — all resolved by the rename to redbear-mini.toml. 9 files changed, +45/-115. --- build.sh | 2 +- config/redbear-netctl.toml | 3 +- local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md | 4 +- ...-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md | 20 ++-- .../winsys/redox/drm/redox_drm_surface.h | 24 ++--- local/recipes/wayland/xwayland/recipe.toml | 4 +- local/recipes/wayland/xwayland/redox.patch | 93 +++---------------- scripts/fetch-all-sources.sh | 8 +- scripts/run.sh | 2 +- 9 files changed, 45 insertions(+), 115 deletions(-) diff --git a/build.sh b/build.sh index 62a4b0c1b8..e82ed83323 100755 --- a/build.sh +++ b/build.sh @@ -22,7 +22,7 @@ usage() echo " i686. ARCH is not checked, so you can add a new architecture." echo " Defaults to the directory containing the FILESYSTEM_CONFIG file," echo " or x86_64 if no FILESYSTEM_CONFIG is specified." -echo " -c CONFIG: The name of the config, e.g. redbear-full or redbear-minimal." +echo " -c CONFIG: The name of the config, e.g. redbear-full or redbear-mini." echo " Determines the name of the image, build/ARCH/CONFIG/harddrive.img" echo " e.g. build/x86_64/redbear-full/harddrive.img" echo " Determines the name of FILESYSTEM_CONFIG if none is specified." diff --git a/config/redbear-netctl.toml b/config/redbear-netctl.toml index b2196d1978..e0011682a7 100644 --- a/config/redbear-netctl.toml +++ b/config/redbear-netctl.toml @@ -1,6 +1,7 @@ # Red Bear OS shared network profile wiring # -# Shared by redbear-minimal, redbear-desktop, redbear-full, and redbear-kde. +# Shared by redbear-mini.toml and redbear-full.toml (the latter inherits +# via redbear-mini.toml). [[files]] path = "/etc/netctl" diff --git a/local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md b/local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md index 9bd5a14108..53d7999906 100644 --- a/local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md +++ b/local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md @@ -397,8 +397,8 @@ bootloader (UEFI x86_64; sets FRAMEBUFFER_* + RSDP_* + kernel env) | `redbear-mini.toml` | 633 | **ACTIVE** — text-only with overridden init services | ✅ | | `redbear-grub.toml` | 16 | **ACTIVE** — adds `grub = {}` + bootloader=grub | ✅ | | `redbear-bare.toml` | (small) | **ACTIVE** — stripped kernel+zsh login | ✅ | -| `redbear-wifi-experimental.toml` | — | **BROKEN** — typo `redbear-minimal.toml` should be `redbear-mini.toml` at line 9 | ❌ never wired | -| `redbear-bluetooth-experimental.toml` | — | **BROKEN** — same typo at line 10 | ❌ never wired | +| `redbear-wifi-experimental.toml` | — | **FIXED 2026-07-27** — typo corrected; line 9 now reads `include = ["redbear-mini.toml"]` (was `redbear-minimal.toml`). Config is buildable; not yet wired into a default `redbear-*` target | ✅ ready | +| `redbear-bluetooth-experimental.toml` | — | **FIXED 2026-07-27** — same typo at line 10 now reads `include = ["redbear-mini.toml", "redbear-bluetooth-services.toml"]`. Config is buildable; not yet wired into a default `redbear-*` target | ✅ ready | | `desktop.toml`, `desktop-minimal.toml`, `wayland.toml`, `x11.toml`, `dev.toml` | various | **DEAD** — never referenced by any redbear config; `wayland.toml` + `desktop-minimal.toml` contain `/usr/lib/init.d/` init path violations | ❌ | | `redoxer.toml`, `redoxer-gui.toml`, `acid.toml`, `auto-test.toml`, `os-test.toml`, `tests.toml`, `sys-build.toml` | various | **DEAD** — Redoxer/CI tooling inherited from upstream; not Red Bear | ❌ | | `aarch64/`, `i586/`, `riscv64gc/` and subdirs | ~20 files | **DEAD** — Red Bear is x86_64 only | ❌ | diff --git a/local/docs/NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md b/local/docs/NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md index 59ffe93fa4..890ad8492e 100644 --- a/local/docs/NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md +++ b/local/docs/NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md @@ -80,7 +80,7 @@ This is the canonical **CODE-focused** systematic assessment of every networking 13. **CRITICAL: Zero test coverage on most critical modules** — TCP scheme, Router, EthernetLink, BufferPool, DHCP, all NIC drivers, iwlwifi ISR/RX/TLV parsers, IOMMU page table walks. -14. **CRITICAL: Two config files reference non-existent `redbear-minimal.toml`** — `redbear-wifi-experimental.toml:9`, `redbear-bluetooth-experimental.toml:10`. Builds will fail. +14. ~~**CRITICAL: Two config files reference non-existent `redbear-minimal.toml`**~~ — **RESOLVED 2026-07-27**: `redbear-wifi-experimental.toml:9` and `redbear-bluetooth-experimental.toml:10` now both read `include = ["redbear-mini.toml"]`. See 3D-DESKTOP-COMPREHENSIVE-PLAN.md § config-table for the post-fix state. 15. **CRITICAL: `redbear-passwd/recipe.toml` has no `[source]` section** — cookbook cannot find source code. @@ -497,16 +497,17 @@ fn next_tid() -> u16 { ### 3.6 Test + Build Config (A6) -#### Finding 18 — CRITICAL: redbear-wifi-experimental.toml references non-existent redbear-minimal.toml +#### Finding 18 — CRITICAL: ~~redbear-wifi-experimental.toml references non-existent redbear-minimal.toml~~ **RESOLVED 2026-07-27** **File:** `config/redbear-wifi-experimental.toml:9` ```toml -include = ["redbear-minimal.toml"] +include = ["redbear-mini.toml"] ``` -**Defect:** Correct file is `redbear-mini.toml`. Build will fail. -**Fix:** Rename reference to `redbear-mini.toml`. +**Original defect:** Correct file is `redbear-mini.toml`. Build would have failed. +**Fix applied:** Renamed reference to `redbear-mini.toml`. Config now builds. -#### Finding 18b — CRITICAL: redbear-bluetooth-experimental.toml same broken include +#### Finding 18b — ~~CRITICAL: redbear-bluetooth-experimental.toml same broken include~~ **RESOLVED 2026-07-27** **File:** `config/redbear-bluetooth-experimental.toml:10` +Same fix: `include = ["redbear-mini.toml", "redbear-bluetooth-services.toml"]`. #### Finding 19 — CRITICAL: redbear-passwd recipe.toml missing [source] **File:** `local/recipes/system/redbear-passwd/recipe.toml` @@ -917,8 +918,8 @@ A P0/P1/P2/P3 item is **signed off** when: | C-18 | `local/recipes/system/iommu/source/src/` | Zero IOMMU tests | | C-19 | `local/recipes/system/redbear-dnsd/source/src/transport.rs:42-58` | unsafe static mut DNS_TID data race | | C-20 | `local/recipes/system/redbear-dnsd/source/src/main.rs:83-125` | Loopback listener has no shared cache | -| C-21 | `config/redbear-wifi-experimental.toml:9` | References non-existent redbear-minimal.toml | -| C-22 | `config/redbear-bluetooth-experimental.toml:10` | Same broken include | +| C-21 | ~~`config/redbear-wifi-experimental.toml:9`~~ | **RESOLVED** — now `include = ["redbear-mini.toml"]` | +| C-22 | ~~`config/redbear-bluetooth-experimental.toml:10`~~ | **RESOLVED** — same | | C-23 | `local/recipes/system/redbear-passwd/recipe.toml` | Missing [source] section entirely | | C-24 | `config/redbear-device-services.toml:1-1137` | Firmware fallback blocks duplicated ~14 times | @@ -1103,8 +1104,7 @@ focus on the **defects themselves** (not just documentation): 1. **CRITICAL fixes** (§6.2) — actual code changes for F001, F002, F005-F012. 2. **HIGH FFI soundness** (§3.4) — implement TCP SendMsg, MSG_NOSIGNAL, fix option collision. 3. **HIGH error handling** (§3.5) — convert `LinkDevice::send/recv` to `Result`, fix conntrack `is_orig`. -4. **Config cleanup** — fix `redbear-wifi-experimental.toml` / `redbear-bluetooth-experimental.toml` - references to non-existent `redbear-minimal.toml` (move to `redbear-mini.toml`). +4. ~~**Config cleanup**~~ — **RESOLVED** — `redbear-wifi-experimental.toml` and `redbear-bluetooth-experimental.toml` references to non-existent `redbear-minimal.toml` were renamed to `redbear-mini.toml` (see Finding 18/18b). 5. **Recipe.toml versioning** — sync 30+ recipe.toml `version = "0.1.0"` to `0.3.1` per `local/AGENTS.md § VERSION CONVENTIONS`. diff --git a/local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/redox_drm_surface.h b/local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/redox_drm_surface.h index 1b4c08a75a..f0a2b95e46 100644 --- a/local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/redox_drm_surface.h +++ b/local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/redox_drm_surface.h @@ -1,17 +1,13 @@ /* * Redox gallium winsys — surface (front buffer / drawable) * - * A "surface" in gallium is a swapchain / front-buffer binding. - * Redox doesn't yet expose per-window surface primitives via the - * kernel DRM ABI; for now we treat each pipe_resource used as a - * scanout target as a self-contained surface, with the framebuffer - * page-flipped by directly programming the kernel-side display - * device through a future surface-flush ioctl. + * A "surface" in gallium is a swapchain / front-buffer binding. Each + * pipe_resource used as a scanout target is wrapped as a surface and + * flipped to the kernel-side display device via REDOX_SCANOUT_FLIP. * - * For now, this module implements only the minimum surface concept - * required by pipe_screen_ops.surface_flush (called by Mesa when - * a front buffer should be presented). The actual present path is - * a no-op until kernel-side scanout ioctls are added. + * Per-resource flush wires the BO through ADDFB (cached) and + * REDOX_SCANOUT_FLIP. The fence is created by the caller using + * redox_drm_fence_create(seqno) which polls the same ring. * * SPDX-License-Identifier: MIT */ @@ -23,11 +19,7 @@ struct redox_drm_surface { struct pipe_surface base; - /* The GEM handle that backs the surface's primary buffer. - * The kernel-side display device scans out from this buffer - * via drmModeAddFB / drmModeSetCrtc once those ioctls are - * redirected to the redox-drm scheme (TODO). - */ + /* The GEM handle that backs the surface's primary buffer. */ uint32_t fb_gem_handle; uint32_t width, height; /* The CRTC that the surface is bound to. Mesa's frontend @@ -65,4 +57,4 @@ redox_drm_bo_flip_to_crtc(struct redox_drm_winsys *rws, uint32_t crtc_id, struct pipe_resource *fb); -#endif /* REDOX_DRM_SURFACE_H */ +#endif /* REDOX_DRM_SURFACE_H */ \ No newline at end of file diff --git a/local/recipes/wayland/xwayland/recipe.toml b/local/recipes/wayland/xwayland/recipe.toml index 895f9f761b..2514a8b074 100644 --- a/local/recipes/wayland/xwayland/recipe.toml +++ b/local/recipes/wayland/xwayland/recipe.toml @@ -2,7 +2,6 @@ name = "xwayland" version = "24.1.8" -#TODO wayland-client, fix linux/input, wayland-scanner shim [source] tar = "https://www.x.org/releases/individual/xserver/xwayland-24.1.8.tar.xz" patches = [ @@ -32,6 +31,9 @@ dependencies = [ "libxcvt", "libxdmcp", "libxshmfence", + # redbear-input-headers provides (BTN_LEFT/MIDDLE/RIGHT). + # Per local/AGENTS.md LINUX KERNEL SOURCE POLICY: Linux as reference only. + "redbear-input-headers", ] mesonflags = [ "-Ddrm=false", diff --git a/local/recipes/wayland/xwayland/redox.patch b/local/recipes/wayland/xwayland/redox.patch index 8d1d32f5ea..2bd889a295 100644 --- a/local/recipes/wayland/xwayland/redox.patch +++ b/local/recipes/wayland/xwayland/redox.patch @@ -1,6 +1,6 @@ diff -ruwN source/hw/xwayland/meson.build source-new/hw/xwayland/meson.build ---- source/hw/xwayland/meson.build 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/hw/xwayland/meson.build 2025-10-01 07:51:14.456575515 +0700 +--- a/source/hw/xwayland/meson.build ++++ b/source-new/hw/xwayland/meson.build @@ -30,8 +30,7 @@ '../../mi/miinitext.h', ] @@ -23,50 +23,29 @@ diff -ruwN source/hw/xwayland/meson.build source-new/hw/xwayland/meson.build code = generator(scanner, output : '@BASENAME@-protocol.c', -diff -ruwN source/hw/xwayland/xwayland-glamor.h source-new/hw/xwayland/xwayland-glamor.h ---- source/hw/xwayland/xwayland-glamor.h 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/hw/xwayland/xwayland-glamor.h 2025-10-01 08:01:01.409102814 +0700 -@@ -31,7 +31,7 @@ - #include - - #include --#include -+// #include - - #include "xwayland-types.h" - -@@ -103,7 +103,7 @@ - /* Called to get the DRM device of the primary GPU that this backend - * is set up on. - */ -- drmDevice *(*get_main_device)(struct xwl_screen *xwl_screen); -+ // drmDevice *(*get_main_device)(struct xwl_screen *xwl_screen); - - /* Direct hook to create the backing pixmap for a window */ - PixmapPtr (*create_pixmap_for_window)(struct xwl_window *xwl_window); diff -ruwN source/hw/xwayland/xwayland-input.c source-new/hw/xwayland/xwayland-input.c ---- source/hw/xwayland/xwayland-input.c 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/hw/xwayland/xwayland-input.c 2025-10-01 08:02:59.681082380 +0700 +--- a/source/hw/xwayland/xwayland-input.c ++++ b/source-new/hw/xwayland/xwayland-input.c @@ -26,7 +26,7 @@ #include -#include -+// #include ++#include #include #include @@ -758,6 +758,7 @@ xwl_seat->xwl_screen->serial = serial; - + switch (button) { -+ case 0x110: /* BTN_LEFT */ ++ case BTN_LEFT: + index = 1; + break; -+ case 0x112: /* BTN_MIDDLE */ ++ case BTN_MIDDLE: + index = 2; + break; -+ case 0x111: /* BTN_RIGHT */ ++ case BTN_RIGHT: + index = 3; + break; default: @@ -75,14 +54,12 @@ diff -ruwN source/hw/xwayland/xwayland-input.c source-new/hw/xwayland/xwayland-i index = 8 + button - 0x113 /* BTN_SIDE */; break; } - - valuator_mask_zero(&mask); @@ -1057,7 +1057,7 @@ state_rec = xwl_seat->keyboard->key->xkbInfo->state; xkb_state = (XkbStateFieldFromRec(&state_rec) & 0xff); - -+ /* ++/* if (((key == KEY_LEFTSHIFT || key == KEY_RIGHTSHIFT) && (xkb_state & ControlMask)) || ((key == KEY_LEFTCTRL || key == KEY_RIGHTCTRL) && (xkb_state & ShiftMask))) { @@ -90,55 +67,13 @@ diff -ruwN source/hw/xwayland/xwayland-input.c source-new/hw/xwayland/xwayland-i if (xwl_window) xwl_window_rootful_update_title(xwl_window); } -+ */ ++*/ } static void -diff -ruwN source/hw/xwayland/xwayland-window.c source-new/hw/xwayland/xwayland-window.c ---- source/hw/xwayland/xwayland-window.c 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/hw/xwayland/xwayland-window.c 2025-10-01 08:00:07.858324820 +0700 -@@ -1102,7 +1102,7 @@ - for (int j = 0; j < dev_formats->num_formats; j++) - free(dev_formats->formats[j].modifiers); - free(dev_formats->formats); -- drmFreeDevice(&dev_formats->drm_dev); -+ // drmFreeDevice(&dev_formats->drm_dev); - } - - void -diff -ruwN source/hw/xwayland/xwayland-window.h source-new/hw/xwayland/xwayland-window.h ---- source/hw/xwayland/xwayland-window.h 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/hw/xwayland/xwayland-window.h 2025-10-01 08:00:40.464798537 +0700 -@@ -38,7 +38,7 @@ - #include - #include - #include --#include -+// #include - - #include "xwayland-types.h" - -@@ -55,7 +55,7 @@ - }; - - struct xwl_device_formats { -- drmDevice *drm_dev; -+ // drmDevice *drm_dev; - int supports_scanout; - uint32_t num_formats; - struct xwl_format *formats; -@@ -75,7 +75,7 @@ - struct xwl_dmabuf_feedback { - struct zwp_linux_dmabuf_feedback_v1 *dmabuf_feedback; - struct xwl_format_table format_table; -- drmDevice *main_dev; -+ // drmDevice *main_dev; - /* - * This will be filled in during wl events and copied to - * dev_formats on dmabuf_feedback.tranche_done diff -ruwN source/os/access.c source-new/os/access.c ---- source/os/access.c 2024-01-16 16:38:49.000000000 +0700 -+++ source-new/os/access.c 2025-10-01 07:22:43.931644468 +0700 +--- a/source/os/access.c ++++ b/source-new/os/access.c @@ -446,7 +446,7 @@ int family; register HOST *host; @@ -156,4 +91,4 @@ diff -ruwN source/os/access.c source-new/os/access.c +#if !defined(WIN32) && !defined(__redox__) uname(&name); #else - gethostname(name.nodename, sizeof(name.nodename)); + gethostname(name.nodename, sizeof(name.nodename)); \ No newline at end of file diff --git a/scripts/fetch-all-sources.sh b/scripts/fetch-all-sources.sh index 7e49260d38..ac55974ea9 100755 --- a/scripts/fetch-all-sources.sh +++ b/scripts/fetch-all-sources.sh @@ -58,7 +58,7 @@ usage() { echo " --force Force re-download even if checksums match" echo " --help Show this help" echo "" - echo "Configs: redbear-full, redbear-minimal, redbear-live-full, redbear-live-minimal" + echo "Configs: redbear-full, redbear-mini, redbear-grub, redbear-wifi-experimental, redbear-bluetooth-experimental" echo "Default config: redbear-full" } @@ -481,7 +481,7 @@ case "$ACTION" in preflight) build_repo if [ "$ALL_CONFIGS" -eq 1 ]; then - for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; do + for cfg in redbear-full redbear-mini redbear-grub redbear-wifi-experimental redbear-bluetooth-experimental; do preflight_scan "$cfg" || true done else @@ -491,7 +491,7 @@ case "$ACTION" in list) build_repo if [ "$ALL_CONFIGS" -eq 1 ]; then - for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; do + for cfg in redbear-full redbear-mini redbear-grub redbear-wifi-experimental redbear-bluetooth-experimental; do list_for_config "$cfg" 2>/dev/null || true done else @@ -506,7 +506,7 @@ case "$ACTION" in elif [ "$ALL_CONFIGS" -eq 1 ]; then echo "==> Fetching sources for ALL configs" echo " This ensures every recipe needed by any config is downloaded." - for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; do + for cfg in redbear-full redbear-mini redbear-grub redbear-wifi-experimental redbear-bluetooth-experimental; do fetch_for_config "$cfg" 2>/dev/null || { echo " WARNING: failed to fetch for $cfg (some recipes may not exist)" echo "" diff --git a/scripts/run.sh b/scripts/run.sh index 1aed2d5e1d..8fbdea595b 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -29,7 +29,7 @@ Examples: $(basename "$0") # Run existing image $(basename "$0") --build # Build + run $(basename "$0") --build --upstream # Build + run with upstream source refresh enabled - $(basename "$0") -b -c redbear-minimal # Build minimal + run + $(basename "$0") -b -c redbear-mini # Build minimal + run $(basename "$0") -- QEMUFLAGS="-m 8G" # Run with 8G RAM $(basename "$0") -b -- serial=yes # Build + run with serial console $(basename "$0") -b -- gpu=virtio kvm=no # Build + run with virtio GPU, no KVM