Refresh build infrastructure scripts and cross-tool wrappers
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+63
-5
@@ -1,14 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build Red Bear OS live ISO
|
||||
# Usage: ./scripts/build-iso.sh [CONFIG_NAME] [ARCH]
|
||||
# Usage: ./scripts/build-iso.sh [--upstream] [CONFIG_NAME] [ARCH]
|
||||
# CONFIG_NAME - build config (default: redbear-live)
|
||||
# ARCH - target architecture (default: x86_64)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
CONFIG_NAME="${1:-redbear-live}"
|
||||
ARCH="${2:-x86_64}"
|
||||
CONFIG_NAME="redbear-live"
|
||||
ARCH="x86_64"
|
||||
ALLOW_UPSTREAM=0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $(basename "$0") [OPTIONS] [CONFIG_NAME] [ARCH]
|
||||
|
||||
Build a Red Bear OS live ISO.
|
||||
|
||||
Options:
|
||||
--upstream Allow Redox/upstream recipe source refresh during build
|
||||
-h, --help Show this help
|
||||
|
||||
Defaults:
|
||||
CONFIG_NAME=redbear-live
|
||||
ARCH=x86_64
|
||||
EOF
|
||||
}
|
||||
|
||||
POSITIONAL=()
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--upstream)
|
||||
ALLOW_UPSTREAM=1
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
POSITIONAL+=("$@")
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
POSITIONAL+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ ${#POSITIONAL[@]} -gt 2 ]; then
|
||||
echo "ERROR: Too many positional arguments" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ ${#POSITIONAL[@]} -ge 1 ] && CONFIG_NAME="${POSITIONAL[0]}"
|
||||
[ ${#POSITIONAL[@]} -ge 2 ] && ARCH="${POSITIONAL[1]}"
|
||||
|
||||
if [ -z "${CI:-}" ] && { [ ! -t 0 ] || [ ! -t 1 ]; }; then
|
||||
export CI=1
|
||||
@@ -17,8 +70,13 @@ fi
|
||||
echo "Building Red Bear OS ISO"
|
||||
echo " config: ${CONFIG_NAME}"
|
||||
echo " arch: ${ARCH}"
|
||||
|
||||
make live CONFIG_NAME="${CONFIG_NAME}" ARCH="${ARCH}"
|
||||
if [ "$ALLOW_UPSTREAM" -eq 1 ]; then
|
||||
echo " upstream recipe refresh: enabled"
|
||||
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false make live CONFIG_NAME="${CONFIG_NAME}" ARCH="${ARCH}"
|
||||
else
|
||||
echo " upstream recipe refresh: disabled (pass --upstream to enable)"
|
||||
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true make live CONFIG_NAME="${CONFIG_NAME}" ARCH="${ARCH}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Done: build/${ARCH}/${CONFIG_NAME}.iso"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# blake3. Falls back to file-size comparison when no blake3 is recorded.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/fetch-all-sources.sh # Fetch for default desktop config
|
||||
# ./scripts/fetch-all-sources.sh # Fetch for the tracked KWin default config
|
||||
# ./scripts/fetch-all-sources.sh redbear-full # Fetch for a specific config
|
||||
# ./scripts/fetch-all-sources.sh --all-configs # Fetch for every config
|
||||
# ./scripts/fetch-all-sources.sh --recipe kernel # Fetch a single recipe
|
||||
@@ -32,7 +32,7 @@ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
REPO_BIN="./target/release/repo"
|
||||
CONFIG_NAME="${1:-desktop}"
|
||||
CONFIG_NAME="${1:-redbear-kde}"
|
||||
ACTION="fetch"
|
||||
|
||||
# ── Colors (disabled when not a terminal) ───────────────────────────
|
||||
@@ -58,8 +58,8 @@ usage() {
|
||||
echo " --force Force re-download even if checksums match"
|
||||
echo " --help Show this help"
|
||||
echo ""
|
||||
echo "Configs: desktop, redbear-full, redbear-minimal, server, minimal, wayland, x11"
|
||||
echo "Default config: desktop"
|
||||
echo "Configs: redbear-kde, redbear-live, redbear-full, redbear-minimal, redbear-wayland"
|
||||
echo "Default config: redbear-kde"
|
||||
}
|
||||
|
||||
ALL_CONFIGS=0
|
||||
@@ -481,7 +481,7 @@ case "$ACTION" in
|
||||
preflight)
|
||||
build_repo
|
||||
if [ "$ALL_CONFIGS" -eq 1 ]; then
|
||||
for cfg in desktop redbear-full redbear-minimal server minimal wayland x11; do
|
||||
for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; 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 desktop redbear-full redbear-minimal server minimal wayland x11; do
|
||||
for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; 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 desktop redbear-full redbear-minimal server minimal wayland x11; do
|
||||
for cfg in redbear-kde redbear-live redbear-full redbear-minimal redbear-wayland; do
|
||||
fetch_for_config "$cfg" 2>/dev/null || {
|
||||
echo " WARNING: failed to fetch for $cfg (some recipes may not exist)"
|
||||
echo ""
|
||||
|
||||
+11
-1
@@ -7,6 +7,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
CONFIG_NAME="redbear-full"
|
||||
ARCH="$(uname -m)"
|
||||
BUILD=0
|
||||
ALLOW_UPSTREAM=0
|
||||
QEMU_EXTRA_ARGS=()
|
||||
|
||||
usage() {
|
||||
@@ -19,12 +20,14 @@ 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-minimal # Build minimal + run
|
||||
$(basename "$0") -- QEMUFLAGS="-m 8G" # Run with 8G RAM
|
||||
$(basename "$0") -b -- serial=yes # Build + run with serial console
|
||||
@@ -38,6 +41,7 @@ while [ $# -gt 0 ]; do
|
||||
-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 ;;
|
||||
@@ -62,7 +66,13 @@ if [ "$BUILD" -eq 1 ]; then
|
||||
cargo build --release
|
||||
|
||||
echo "==> Building Red Bear OS ($CONFIG_NAME, $ARCH)..."
|
||||
CI=1 make all "CONFIG_NAME=$CONFIG_NAME" ARCH="$ARCH"
|
||||
if [ "$ALLOW_UPSTREAM" -eq 1 ]; then
|
||||
echo "==> Upstream recipe refresh: enabled"
|
||||
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 make 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 all "CONFIG_NAME=$CONFIG_NAME" ARCH="$ARCH"
|
||||
fi
|
||||
echo "==> Build complete."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user