Commit graph

8 commits

Author SHA1 Message Date
vxtls
6fcb8f4d4a 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
2026-02-18 14:35:17 -05:00
vxtls
21ddab36c3 script-generator: support explicit manifest/config roots and wire all callers 2026-02-18 10:14:17 -05:00
Dor Askayo
f91002b681 Abort execution on non-0 exit status from "after" scripts
Failures in "after" scripts do not currently result in bootstrap
failures since "find" ignores the exit code of commands that it
executes.

There are no simple options in "find" to both propagate non-0 exit
statuses of executed commands and also abort its command execution
sequence in such an event. As such, use "find" only for listing
script names and otherwise use a simple loop to execute them.

While at it, execute scripts in numerical order according to their
basename. This gives consumers control over the execution order of
their scripts. For example, 50-sign.sh will be executed before
51-upload.sh.
2025-02-26 09:08:54 +00:00
Gábor Stefanik
c73d8c9dc1 Add extension mechanism to execute .sh files dropped in /steps/after
These are executed at the end of the bootstrap, if /steps/after exists.
In interactive mode, they run before the interactive prompt is displayed.
2024-04-16 20:53:52 +02:00
Gábor Stefanik
8fca0973ab Fix "no job control in this shell" in final Bash prompt 2024-01-30 02:50:36 +01:00
Gábor Stefanik
36c1925742 Fix panic due to after.sh prematurely quitting on shutdown
The sysrq shutdown trigger takes some time to fully shut down the system,
during which init is expected to continue running. Since after.sh is the
last step in our init, if it quits before shutdown is complete, Linux will
panic with "Attempted to kill init".

Add an infinite loop after shutdown is issued via sysrq to prevent this.
2024-01-12 19:55:10 +01:00
Gábor Stefanik
82062143a4 Fix spelling of sysrq-trigger in after.sh 2024-01-08 12:43:31 +01:00
Gábor Stefanik
2a095a3301 After bootstrap, drop to a shell if needed, then shut down cleanly 2024-01-08 05:19:19 +01:00