d6a8159840
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 <linux/input.h> 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.
100 lines
3.3 KiB
Bash
Executable File
100 lines
3.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
CONFIG_NAME="redbear-full"
|
|
ARCH="$(uname -m)"
|
|
BUILD=0
|
|
ALLOW_UPSTREAM=0
|
|
QEMU_EXTRA_ARGS=()
|
|
MAKE_ENV=()
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: $(basename "$0") [OPTIONS]
|
|
|
|
Red Bear OS — build and run in QEMU.
|
|
|
|
Options:
|
|
-b, --build Build full OS before running
|
|
-c, --config NAME Config name (default: redbear-full)
|
|
-a, --arch ARCH Target architecture (default: host arch)
|
|
--upstream Allow Redox/upstream recipe source refresh during build
|
|
-- ARGS Pass remaining args to make qemu (e.g. -- QEMUFLAGS="-m 8G")
|
|
-h, --help Show this help
|
|
|
|
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-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
|
|
EOF
|
|
exit 0
|
|
}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
-b|--build) BUILD=1 ;;
|
|
-c|--config) CONFIG_NAME="$2"; shift ;;
|
|
-a|--arch) ARCH="$2"; shift ;;
|
|
--upstream) ALLOW_UPSTREAM=1 ;;
|
|
-h|--help) usage ;;
|
|
--) shift; QEMU_EXTRA_ARGS=("$@"); break ;;
|
|
*) echo "Unknown option: $1"; exit 1 ;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
cd "$PROJECT_ROOT"
|
|
|
|
# Auto-disable TUI when stdout is not a terminal (prevents repo cook panic)
|
|
if [ -z "${CI:-}" ] && { [ ! -t 0 ] || [ ! -t 1 ]; }; then
|
|
export CI=1
|
|
fi
|
|
|
|
if [ "$BUILD" -eq 1 ]; then
|
|
echo "==> Ensuring .config is set for native build..."
|
|
if ! grep -q 'PODMAN_BUILD?=0' .config 2>/dev/null; then
|
|
echo 'PODMAN_BUILD?=0' > .config
|
|
fi
|
|
|
|
echo "==> Applying Red Bear OS patches..."
|
|
if [ -f local/scripts/apply-patches.sh ]; then
|
|
bash local/scripts/apply-patches.sh
|
|
fi
|
|
|
|
echo "==> Building cookbook..."
|
|
cargo build --release
|
|
|
|
if [ "$(id -u)" -ne 0 ] && command -v fakeroot >/dev/null 2>&1; then
|
|
echo "==> Rootless build detected; using fakeroot redox_installer wrapper"
|
|
MAKE_ENV+=("INSTALLER=fakeroot build/fstools/bin/redox_installer")
|
|
fi
|
|
|
|
echo "==> Building Red Bear OS ($CONFIG_NAME, $ARCH)..."
|
|
if [ "$ALLOW_UPSTREAM" -eq 1 ]; then
|
|
echo "==> Upstream recipe refresh: enabled"
|
|
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 make "${MAKE_ENV[@]}" all "CONFIG_NAME=$CONFIG_NAME" ARCH="$ARCH"
|
|
else
|
|
echo "==> Upstream recipe refresh: disabled (pass --upstream to enable)"
|
|
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true CI=1 make "${MAKE_ENV[@]}" all "CONFIG_NAME=$CONFIG_NAME" ARCH="$ARCH"
|
|
fi
|
|
echo "==> Build complete."
|
|
fi
|
|
|
|
BUILD_DIR="build/$ARCH/$CONFIG_NAME"
|
|
if [ ! -f "$BUILD_DIR/harddrive.img" ]; then
|
|
echo "ERROR: $BUILD_DIR/harddrive.img not found. Run with --build first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "==> Launching Red Bear OS in QEMU ($CONFIG_NAME, $ARCH)..."
|
|
echo ""
|
|
|
|
exec make qemu "CONFIG_NAME=$CONFIG_NAME" ARCH="$ARCH" CI=1 "${QEMU_EXTRA_ARGS[@]}"
|