logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

after.sh (797B)


  1. #!/bin/sh
  2. #
  3. # SPDX-FileCopyrightText: 2024 Gábor Stefanik <netrolller.3d@gmail.com>
  4. #
  5. # SPDX-License-Identifier: GPL-3.0-or-later
  6. #
  7. # After bootstrap, drop to a shell if needed, then shut down cleanly.
  8. . /steps/bootstrap.cfg
  9. . /steps/env
  10. if [ -d /steps/after ]; then
  11. find /steps/after -maxdepth 1 -name '*.sh' -exec bash {} \;
  12. fi
  13. if [ "${INTERACTIVE}" = True ]; then
  14. env - PATH=${PREFIX}/bin PS1="\w # " setsid openvt -fec1 -- bash -i
  15. fi
  16. if [ "${CHROOT}" = False ]; then
  17. # ignore errors due to fstab or swapfile not existing
  18. swapoff -a &> /dev/null || true
  19. sync
  20. # sysrq to avoid device busy; then mount to wait for it to finish
  21. echo u > /proc/sysrq-trigger
  22. mount -o remount,ro /
  23. echo o > /proc/sysrq-trigger # power off
  24. while true; do sleep 1; done
  25. fi