diff --git a/config/redbear-bare.toml b/config/redbear-bare.toml index b9eafac4ae..6c30039f7b 100644 --- a/config/redbear-bare.toml +++ b/config/redbear-bare.toml @@ -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 diff --git a/local/scripts/build-redbear.sh b/local/scripts/build-redbear.sh index 8f6b6e8dcd..c6e5694333 100755 --- a/local/scripts/build-redbear.sh +++ b/local/scripts/build-redbear.sh @@ -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)}"