From aeac5a6d9233a7d40dfaff1c6c8d3ac52f28911f Mon Sep 17 00:00:00 2001 From: Vasilito Date: Thu, 16 Apr 2026 12:46:07 +0100 Subject: [PATCH] Add cross-toolchain wrappers and update scripts Red Bear OS Team --- bin/x86_64-unknown-redox-ar | 16 +++++++++ bin/x86_64-unknown-redox-c++ | 16 +++++++++ bin/x86_64-unknown-redox-gcc | 16 +++++++++ bin/x86_64-unknown-redox-ld | 16 +++++++++ bin/x86_64-unknown-redox-ranlib | 16 +++++++++ local/scripts/apply-patches.sh | 10 ++++++ local/scripts/build-redbear.sh | 5 +-- local/scripts/integrate-redbear.sh | 8 +++++ local/scripts/test-baremetal.sh | 3 ++ local/scripts/test-phase4-wayland-qemu.sh | 15 +++++++++ local/scripts/test-phase4-wayland-runtime.sh | 35 +++++++++++++++++--- local/scripts/test-phase5-network-qemu.sh | 5 +++ 12 files changed, 154 insertions(+), 7 deletions(-) create mode 100755 bin/x86_64-unknown-redox-ar create mode 100755 bin/x86_64-unknown-redox-c++ create mode 100755 bin/x86_64-unknown-redox-gcc create mode 100755 bin/x86_64-unknown-redox-ld create mode 100755 bin/x86_64-unknown-redox-ranlib diff --git a/bin/x86_64-unknown-redox-ar b/bin/x86_64-unknown-redox-ar new file mode 100755 index 00000000..225ecd6f --- /dev/null +++ b/bin/x86_64-unknown-redox-ar @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +root_dir="$(CDPATH= cd -- "${script_dir}/.." && pwd)" + +sysroot="${REDBEAR_REDOX_SYSROOT:-${root_dir}/prefix/x86_64-unknown-redox/sysroot}" +tool="${sysroot}/bin/x86_64-unknown-redox-ar" + +if [ ! -x "${tool}" ]; then + echo "error: missing toolchain binary: ${tool}" >&2 + echo "hint: run 'make prefix' or otherwise populate ${sysroot}" >&2 + exit 1 +fi + +exec "${tool}" "$@" diff --git a/bin/x86_64-unknown-redox-c++ b/bin/x86_64-unknown-redox-c++ new file mode 100755 index 00000000..c414bb77 --- /dev/null +++ b/bin/x86_64-unknown-redox-c++ @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +root_dir="$(CDPATH= cd -- "${script_dir}/.." && pwd)" + +sysroot="${REDBEAR_REDOX_SYSROOT:-${root_dir}/prefix/x86_64-unknown-redox/sysroot}" +tool="${sysroot}/bin/x86_64-unknown-redox-c++" + +if [ ! -x "${tool}" ]; then + echo "error: missing toolchain binary: ${tool}" >&2 + echo "hint: run 'make prefix' or otherwise populate ${sysroot}" >&2 + exit 1 +fi + +exec "${tool}" "$@" diff --git a/bin/x86_64-unknown-redox-gcc b/bin/x86_64-unknown-redox-gcc new file mode 100755 index 00000000..0c610586 --- /dev/null +++ b/bin/x86_64-unknown-redox-gcc @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +root_dir="$(CDPATH= cd -- "${script_dir}/.." && pwd)" + +sysroot="${REDBEAR_REDOX_SYSROOT:-${root_dir}/prefix/x86_64-unknown-redox/sysroot}" +tool="${sysroot}/bin/x86_64-unknown-redox-gcc" + +if [ ! -x "${tool}" ]; then + echo "error: missing toolchain binary: ${tool}" >&2 + echo "hint: run 'make prefix' or otherwise populate ${sysroot}" >&2 + exit 1 +fi + +exec "${tool}" "$@" diff --git a/bin/x86_64-unknown-redox-ld b/bin/x86_64-unknown-redox-ld new file mode 100755 index 00000000..933f00cd --- /dev/null +++ b/bin/x86_64-unknown-redox-ld @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +root_dir="$(CDPATH= cd -- "${script_dir}/.." && pwd)" + +sysroot="${REDBEAR_REDOX_SYSROOT:-${root_dir}/prefix/x86_64-unknown-redox/sysroot}" +tool="${sysroot}/bin/x86_64-unknown-redox-ld" + +if [ ! -x "${tool}" ]; then + echo "error: missing toolchain binary: ${tool}" >&2 + echo "hint: run 'make prefix' or otherwise populate ${sysroot}" >&2 + exit 1 +fi + +exec "${tool}" "$@" diff --git a/bin/x86_64-unknown-redox-ranlib b/bin/x86_64-unknown-redox-ranlib new file mode 100755 index 00000000..89dc5059 --- /dev/null +++ b/bin/x86_64-unknown-redox-ranlib @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +root_dir="$(CDPATH= cd -- "${script_dir}/.." && pwd)" + +sysroot="${REDBEAR_REDOX_SYSROOT:-${root_dir}/prefix/x86_64-unknown-redox/sysroot}" +tool="${sysroot}/bin/x86_64-unknown-redox-ranlib" + +if [ ! -x "${tool}" ]; then + echo "error: missing toolchain binary: ${tool}" >&2 + echo "hint: run 'make prefix' or otherwise populate ${sysroot}" >&2 + exit 1 +fi + +exec "${tool}" "$@" diff --git a/local/scripts/apply-patches.sh b/local/scripts/apply-patches.sh index c503c7cb..aead0f9c 100755 --- a/local/scripts/apply-patches.sh +++ b/local/scripts/apply-patches.sh @@ -80,6 +80,8 @@ symlink "../../local/recipes/branding/redbear-release" "recipes/branding/redbear # Drivers mkdir -p recipes/drivers symlink "../../local/recipes/drivers/linux-kpi" "recipes/drivers/linux-kpi" +symlink "../../local/recipes/drivers/redbear-btusb" "recipes/drivers/redbear-btusb" +symlink "../../local/recipes/drivers/redbear-iwlwifi" "recipes/drivers/redbear-iwlwifi" symlink "../../local/recipes/drivers/redox-driver-sys" "recipes/drivers/redox-driver-sys" # GPU @@ -99,12 +101,16 @@ symlink "../../local/recipes/libs/libxcvt-stub" "recipes/libs/libxcvt-stu mkdir -p recipes/system symlink "../../local/recipes/system/cub" "recipes/system/cub" symlink "../../local/recipes/system/evdevd" "recipes/system/evdevd" +symlink "../../local/recipes/system/redbear-firmware" "recipes/system/redbear-firmware" symlink "../../local/recipes/system/firmware-loader" "recipes/system/firmware-loader" symlink "../../local/recipes/system/iommu" "recipes/system/iommu" symlink "../../local/recipes/system/redbear-hwutils" "recipes/system/redbear-hwutils" symlink "../../local/recipes/system/redbear-info" "recipes/system/redbear-info" +symlink "../../local/recipes/system/redbear-btctl" "recipes/system/redbear-btctl" symlink "../../local/recipes/system/redbear-netstat" "recipes/system/redbear-netstat" symlink "../../local/recipes/system/redbear-netctl" "recipes/system/redbear-netctl" +symlink "../../local/recipes/system/redbear-netctl-console" "recipes/system/redbear-netctl-console" +symlink "../../local/recipes/system/redbear-wifictl" "recipes/system/redbear-wifictl" symlink "../../local/recipes/system/redbear-traceroute" "recipes/system/redbear-traceroute" symlink "../../local/recipes/system/redbear-mtr" "recipes/system/redbear-mtr" symlink "../../local/recipes/system/redbear-nmap" "recipes/system/redbear-nmap" @@ -115,6 +121,10 @@ symlink "../../local/recipes/system/udev-shim" "recipes/system/udev-shim" mkdir -p recipes/core symlink "../../local/recipes/core/ext4d" "recipes/core/ext4d" +# Wayland additions +mkdir -p recipes/wip/wayland +symlink "../../../local/recipes/wayland/qt6-wayland-smoke" "recipes/wip/wayland/qt6-wayland-smoke" + # KDE / Phase 6 recipes mkdir -p recipes/kde symlink "../../local/recipes/kde/plasma-desktop" "recipes/kde/plasma-desktop" diff --git a/local/scripts/build-redbear.sh b/local/scripts/build-redbear.sh index f13693ea..a6e43839 100755 --- a/local/scripts/build-redbear.sh +++ b/local/scripts/build-redbear.sh @@ -4,6 +4,7 @@ # Usage: # ./local/scripts/build-redbear.sh # Default: redbear-desktop # ./local/scripts/build-redbear.sh redbear-minimal # Minimal validation baseline +# ./local/scripts/build-redbear.sh redbear-bluetooth-experimental # First bounded Bluetooth slice # ./local/scripts/build-redbear.sh redbear-full # Full Red Bear integration target # ./local/scripts/build-redbear.sh redbear-wayland # Wayland runtime validation profile # ./local/scripts/build-redbear.sh redbear-kde # KDE Plasma bring-up target @@ -24,11 +25,11 @@ JOBS="${JOBS:-$(nproc)}" APPLY_PATCHES="${APPLY_PATCHES:-1}" case "$CONFIG" in - redbear-desktop|redbear-minimal|redbear-full|redbear-wayland|redbear-kde|redbear-live) + redbear-desktop|redbear-minimal|redbear-bluetooth-experimental|redbear-full|redbear-wayland|redbear-kde|redbear-live) ;; *) echo "ERROR: Unknown config '$CONFIG'" - echo "Supported: redbear-desktop, redbear-minimal, redbear-full, redbear-wayland, redbear-kde, redbear-live" + echo "Supported: redbear-desktop, redbear-minimal, redbear-bluetooth-experimental, redbear-full, redbear-wayland, redbear-kde, redbear-live" exit 1 ;; esac diff --git a/local/scripts/integrate-redbear.sh b/local/scripts/integrate-redbear.sh index 3fa561ec..96672786 100755 --- a/local/scripts/integrate-redbear.sh +++ b/local/scripts/integrate-redbear.sh @@ -136,16 +136,22 @@ echo "" section "Ensuring custom recipe symlinks..." symlink "../../local/recipes/branding/redbear-release" "recipes/branding/redbear-release" symlink "../../local/recipes/drivers/linux-kpi" "recipes/drivers/linux-kpi" +symlink "../../local/recipes/drivers/redbear-btusb" "recipes/drivers/redbear-btusb" +symlink "../../local/recipes/drivers/redbear-iwlwifi" "recipes/drivers/redbear-iwlwifi" symlink "../../local/recipes/drivers/redox-driver-sys" "recipes/drivers/redox-driver-sys" symlink "../../local/recipes/gpu/amdgpu" "recipes/gpu/amdgpu" symlink "../../local/recipes/gpu/redox-drm" "recipes/gpu/redox-drm" symlink "../../local/recipes/system/evdevd" "recipes/system/evdevd" +symlink "../../local/recipes/system/redbear-firmware" "recipes/system/redbear-firmware" symlink "../../local/recipes/system/firmware-loader" "recipes/system/firmware-loader" symlink "../../local/recipes/system/iommu" "recipes/system/iommu" +symlink "../../local/recipes/system/redbear-btctl" "recipes/system/redbear-btctl" symlink "../../local/recipes/system/redbear-info" "recipes/system/redbear-info" symlink "../../local/recipes/system/redbear-hwutils" "recipes/system/redbear-hwutils" symlink "../../local/recipes/system/redbear-netstat" "recipes/system/redbear-netstat" symlink "../../local/recipes/system/redbear-netctl" "recipes/system/redbear-netctl" +symlink "../../local/recipes/system/redbear-netctl-console" "recipes/system/redbear-netctl-console" +symlink "../../local/recipes/system/redbear-wifictl" "recipes/system/redbear-wifictl" symlink "../../local/recipes/system/redbear-traceroute" "recipes/system/redbear-traceroute" symlink "../../local/recipes/system/redbear-mtr" "recipes/system/redbear-mtr" symlink "../../local/recipes/system/redbear-nmap" "recipes/system/redbear-nmap" @@ -154,6 +160,7 @@ symlink "../../local/recipes/system/udev-shim" "recipes/system/udev-shim" symlink "../../local/recipes/core/ext4d" "recipes/core/ext4d" symlink "../../local/recipes/tui/mc" "recipes/tui/mc" symlink "../../local/recipes/system/cub" "recipes/system/cub" +symlink "../../../local/recipes/wayland/qt6-wayland-smoke" "recipes/wip/wayland/qt6-wayland-smoke" # KDE / Phase 6 recipes mkdir -p recipes/kde @@ -216,6 +223,7 @@ section "Validating Red Bear configs..." declare -a redbear_configs=( "config/redbear-desktop.toml" "config/redbear-minimal.toml" + "config/redbear-bluetooth-experimental.toml" "config/redbear-full.toml" "config/redbear-wayland.toml" "config/redbear-live.toml" diff --git a/local/scripts/test-baremetal.sh b/local/scripts/test-baremetal.sh index a17ef70d..12569f04 100755 --- a/local/scripts/test-baremetal.sh +++ b/local/scripts/test-baremetal.sh @@ -224,5 +224,8 @@ echo "1. Safely eject or unplug the target device if your host requires it." echo "2. Insert the device into the AMD test machine and boot from it in UEFI mode." echo "3. Capture serial output during boot if available to diagnose early failures." echo "4. Check ACPI, SMP, framebuffer, and storage initialization on real hardware." +echo "5. If validating the Intel Wi-Fi path, run: redbear-phase5-wifi-check" +echo "6. For the strongest bounded Wi-Fi runtime path, also run: test-wifi-baremetal-runtime.sh" +echo "7. Preserve /tmp/redbear-phase5-wifi-capture.json from the target after the run." echo "" echo "If you need serial logs, connect your serial console before powering on the target system." diff --git a/local/scripts/test-phase4-wayland-qemu.sh b/local/scripts/test-phase4-wayland-qemu.sh index a8ffc55f..c37a53f6 100644 --- a/local/scripts/test-phase4-wayland-qemu.sh +++ b/local/scripts/test-phase4-wayland-qemu.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash # Launch the Phase 4 Wayland path in QEMU using the repo's Wayland profile. +# This script validates the current bounded software-path Wayland runtime slice. +# It does NOT currently prove a hardware-accelerated desktop path in QEMU. set -euo pipefail @@ -36,6 +38,11 @@ Examples: Expected runtime path: orbital -> orbital-wayland -> smallvil -> wayland-session + +Important: + the current harness uses '-vga std' and today still surfaces llvmpipe in-guest. + Treat this as a Phase 4 software-path/runtime smoke check and regression harness. + Hardware-accelerated desktop proof is a separate bare-metal/runtime-driver milestone. USAGE } @@ -93,6 +100,7 @@ echo " redbear-info --json" echo " netctl status" echo " redbear-phase4-wayland-check" echo " smallvil should be the primary compositor path" +echo " qt6-wayland-smoke should leave a success marker via wayland-session" echo if [[ "$check_mode" -eq 1 ]]; then @@ -110,6 +118,13 @@ expect "Red Bear OS Phase 4 Wayland Runtime Check" expect "orbital-wayland" expect "wayland-session" expect "smallvil" +expect "/home/root/.qt6-bootstrap-minimal.ok" +expect "/home/root/.qt6-plugin-minimal.ok" +expect "/home/root/.qt6-wayland-smoke-minimal.ok" +expect "/home/root/.qt6-wayland-smoke-offscreen.ok" +expect "/home/root/.qt6-wayland-smoke-wayland.ok" +expect "/home/root/.qt6-wayland-smoke.ok" +expect "qt6-wayland-smoke" expect "virtio_net_present" send "shutdown\r" expect eof diff --git a/local/scripts/test-phase4-wayland-runtime.sh b/local/scripts/test-phase4-wayland-runtime.sh index 770bf2b8..5fad3551 100644 --- a/local/scripts/test-phase4-wayland-runtime.sh +++ b/local/scripts/test-phase4-wayland-runtime.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Reference host-side copy of the guest-side Phase 4 Wayland runtime check. -# The actual in-guest command installed by the profile is `redbear-phase4-wayland-check`. +# Reference shell reimplementation of the guest-side Phase 4 Wayland runtime check. +# Run this inside the guest when `redbear-phase4-wayland-check` is unavailable for debugging. set -euo pipefail @@ -21,15 +21,40 @@ require_command() { require_command orbital-wayland "orbital-wayland launcher is installed" require_command wayland-session "wayland-session launcher is installed" require_command smallvil "smallvil compositor is installed" +require_command qt6-wayland-smoke "qt6-wayland-smoke is installed" +require_command qt6-bootstrap-check "qt6-bootstrap-check is installed" +require_command qt6-plugin-check "qt6-plugin-check is installed" require_command redbear-info "redbear-info is installed" +echo +for marker in \ + /home/root/.wayland-session.started \ + /home/root/.qt6-bootstrap-minimal.ok \ + /home/root/.qt6-plugin-minimal.ok \ + /home/root/.qt6-wayland-smoke-minimal.ok \ + /home/root/.qt6-wayland-smoke-offscreen.ok \ + /home/root/.qt6-wayland-smoke-wayland.ok \ + /home/root/.qt6-wayland-smoke.ok +do + if [[ -f "$marker" ]]; then + echo "✅ Marker present: $marker" + else + echo "❌ Marker missing: $marker" + exit 1 + fi +done + echo echo "=== redbear-info --json ===" -redbear-info --json +redbear-info --json | tee /tmp/redbear-phase4-info.json +if ! grep -q 'virtio_net_present' /tmp/redbear-phase4-info.json; then + echo "❌ redbear-info --json did not report virtio_net_present" + exit 1 +fi echo echo "=== Phase 4 launch surface ===" -echo "orbital-wayland and smallvil are present on the wayland profile." -echo "Run 'orbital-wayland' from a graphical VT to start the compositor path." +echo "orbital-wayland, smallvil, and the Qt6 Phase 4 smoke helpers are present on the wayland profile." +echo "Run this script inside the guest, or use redbear-phase4-wayland-check as the canonical validator." echo echo "=== Test Complete ===" diff --git a/local/scripts/test-phase5-network-qemu.sh b/local/scripts/test-phase5-network-qemu.sh index 067d5a88..154349fb 100644 --- a/local/scripts/test-phase5-network-qemu.sh +++ b/local/scripts/test-phase5-network-qemu.sh @@ -82,6 +82,11 @@ send "redbear-phase5-network-check\r" expect "Red Bear OS Phase 5 Networking Check" expect "dbus-daemon" expect "virtio_net_present" +expect "wifi_control_state=present" +expect "wifi_connect_result=present" +expect "PHASE5_WIFI_CHECK=pass" +expect "WIFICTL_INTERFACES=present" +expect "WIFICTL_CAPABILITIES=present" expect "DBUS_SYSTEM_BUS=" send "shutdown\r" expect eof