bootstrap: add stage0 image reuse for guix and simplify guix handoff flow

- add --stage0-image in rootfs.py for qemu to boot an existing kernel-bootstrap image
- when --stage0-image is combined with --build-guix-also, update BUILD_GUIX_ALSO in image config and sync /steps-guix into the image
- require stage0 /init to contain guix handoff marker instead of patching /init implicitly
- add run_steps_guix_if_requested() to make_bootable-generated /init so rebooted stage0 images can enter steps-guix directly
- run /steps-guix/0.sh with bash in after.sh
- make script-generator start mode convention-based: /steps stays kaem-first, alternate roots (e.g. /steps-guix) start in bash
- remove redundant explicit /steps config-root argument from seed/preseeded/reconfigure script-generator calls
This commit is contained in:
vxtls 2026-02-18 14:35:17 -05:00
parent 21ddab36c3
commit 6fcb8f4d4a
15 changed files with 1010 additions and 22 deletions

View file

@ -87,7 +87,32 @@ fi
if [ "${CHROOT}" = False ]; then
dhcpcd --waitip=4
fi
EOF
if [ "${BUILD_GUIX_ALSO}" = True ]; then
cat >> /init <<- 'EOF'
run_steps_guix_if_requested() {
if [ "${BUILD_GUIX_ALSO}" != True ]; then
return 1
fi
if [ ! -f /steps-guix/manifest ]; then
echo "BUILD_GUIX_ALSO is True but /steps-guix/manifest is missing." >&2
exit 1
fi
sed -i '/^BUILD_GUIX_ALSO=/d' /steps/bootstrap.cfg
echo 'BUILD_GUIX_ALSO=False' >> /steps/bootstrap.cfg
/script-generator /steps-guix/manifest /steps
bash /steps-guix/0.sh
return 0
}
run_steps_guix_if_requested || true
EOF
fi
cat >> /init <<- 'EOF'
if [ "${QEMU}" = True ] && [ "${BARE_METAL}" = False ]; then
if [ -c /dev/ttyS0 ]; then
env - PATH=${PREFIX}/bin PS1="\w # " bash -i </dev/ttyS0 >/dev/ttyS0 2>&1