build-redbear.sh + redbear-bare: wire REDBEAR_BARE_INITFS to make

Round-25 fix landed the bare initfs conditional in
recipes/core/base-initfs/recipe.toml but the cookbook does NOT parse
[build.env] sections in TOML configs. The REDBEAR_BARE_INITFS=1
env var I put in redbear-bare.toml was silently ignored.

Fix: propagate REDBEAR_BARE_INITFS through build-redbear.sh's make live
invocation. When CONFIG=redbear-bare and the operator has not already
exported REDBEAR_BARE_INITFS, auto-set it to 1 so the bare initfs
branch is triggered. Also propagates any pre-existing REDBEAR_BARE_INITFS
through the make call (override-only).

Also rewrote the [build.env] section in redbear-bare.toml to a
comment-only section explaining the dispatch mechanism, since the
cookbook parser ignores it.

(NO AI attribution)
This commit is contained in:
2026-07-14 23:39:18 +09:00
parent 48a6f4c20b
commit b447c22da1
2 changed files with 24 additions and 8 deletions
+7 -4
View File
@@ -135,7 +135,10 @@ shell = "/usr/bin/zsh"
gid = 1
members = ["user"]
# Build override: trigger the bare-initfs branch in base-initfs/recipe.toml.
# The cookbook honors REDBEAR_BARE_INITFS in the env when invoking make.
[build.env]
REDBEAR_BARE_INITFS = "1"
# Build override note: the cookbook's [build.env] section is not parsed
# by the current config parser, so the REDBEAR_BARE_INITFS=1 env var is
# set automatically by local/scripts/build-redbear.sh when CONFIG_NAME
# is redbear-bare. See that script's per-target hook block.
#
# If you need to override or test the bare initfs directly:
# REDBEAR_BARE_INITFS=1 ./local/scripts/build-redbear.sh redbear-bare
+17 -4
View File
@@ -727,18 +727,31 @@ for src in relibc kernel base bootloader installer; do
fi
done
# Per-target env propagation. The cookbook's [build.env] section is not
# read by the current parser, so per-target env-var hooks must be set
# here in the dispatch script. Specifically the redbear-bare target
# reads REDBEAR_BARE_INITFS=1 in recipes/core/base-initfs/recipe.toml
# to switch from a 22-daemon initfs to a 7-daemon minimal initfs
# (init logd ramfs randd zerod ptyd getty). Auto-set when CONFIG is
# redbear-bare unless the operator has overridden the env var.
if [ "$CONFIG" = "redbear-bare" ] && [ -z "${REDBEAR_BARE_INITFS:-}" ]; then
REDBEAR_BARE_INITFS=1
export REDBEAR_BARE_INITFS
echo ">>> redbear-bare target: REDBEAR_BARE_INITFS=1 (auto-set; minimal 7-daemon initfs)"
fi
if [ "${REDBEAR_ALLOW_UPSTREAM:-0}" = "1" ]; then
echo ">>> WARNING: Upstream fetch ENABLED (REDBEAR_ALLOW_UPSTREAM=1)"
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 REDBEAR_BARE_INITFS="${REDBEAR_BARE_INITFS:-0}" make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
elif [ -n "${REDBEAR_RELEASE:-}" ]; then
echo ">>> Release mode: building from immutable archives (offline)"
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true CI=1 make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true CI=1 REDBEAR_BARE_INITFS="${REDBEAR_BARE_INITFS:-0}" make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
elif [ "$ALLOW_UPSTREAM" -eq 1 ]; then
echo ">>> Upstream recipe refresh enabled"
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
REPO_OFFLINE=0 COOKBOOK_OFFLINE=false CI=1 REDBEAR_BARE_INITFS="${REDBEAR_BARE_INITFS:-0}" make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
else
echo ">>> Upstream recipe refresh disabled (default: offline)"
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true CI=1 make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
REPO_OFFLINE=1 COOKBOOK_OFFLINE=true CI=1 REDBEAR_BARE_INITFS="${REDBEAR_BARE_INITFS:-0}" make live "CONFIG_NAME=$CONFIG" "JOBS=$JOBS" 2>&1
fi
ARCH="${ARCH:-$(uname -m)}"