fix(failure-flow): keep interactive shell handling in script-generator and make rootfs resume dispatch direct

This commit is contained in:
vxtls 2026-03-19 12:35:23 -04:00
parent ea9c3d64a7
commit d7093313d7
2 changed files with 4 additions and 51 deletions

View file

@ -170,21 +170,8 @@ _INIT_REGEN_BLOCK = (
+ 'fi\n'
+ 'fi\n'
+ 'if [ -n "${resume_entry}" ] && [ -f "${resume_entry}" ] && [ "${resume_entry}" != "$0" ]; then\n'
+ 'if ! bash "${resume_entry}"; then\n'
+ 'status=$?\n'
+ 'echo "bootstrap script failed with status ${status}; dropping to rescue shell" >&2\n'
+ 'PATH=/bin:/usr/bin:/sbin:/usr/sbin:${PREFIX}/bin:${PATH}\n'
+ 'while true; do\n'
+ 'if command -v bash >/dev/null 2>&1; then\n'
+ 'env PS1="[FAIL ${status}] \\w # " bash -i\n'
+ 'elif command -v sh >/dev/null 2>&1; then\n'
+ 'env PS1="[FAIL ${status}] \\w # " sh -i\n'
+ 'else\n'
+ 'sleep 60\n'
+ 'fi\n'
+ 'done\n'
+ 'fi\n'
+ 'exit 0\n'
+ 'bash "${resume_entry}"\n'
+ 'exit "$?"\n'
+ 'fi\n'
)