mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 11:36:32 +01:00
fix(failure-flow): keep interactive shell handling in script-generator and make rootfs resume dispatch direct
This commit is contained in:
parent
ea9c3d64a7
commit
d7093313d7
2 changed files with 4 additions and 51 deletions
17
rootfs.py
17
rootfs.py
|
|
@ -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'
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue