-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After bootstrap, drop to a shell if needed, then shut down cleanly
- Loading branch information
1 parent
133c054
commit 2a095a3
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-FileCopyrightText: 2024 Gábor Stefanik <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# After bootstrap, drop to a shell if needed, then shut down cleanly. | ||
|
||
. /steps/bootstrap.cfg | ||
. /steps/env | ||
|
||
if [ "${INTERACTIVE}" = True ]; then | ||
env - PATH=${PREFIX}/bin PS1="\w # " bash -i | ||
fi | ||
|
||
if [ "${CHROOT}" = False ]; then | ||
# ignore errors due to fstab or swapfile not existing | ||
swapoff -a &> /dev/null || true | ||
sync | ||
# sysrq to avoid device busy; then mount to wait for it to finish | ||
echo u > /proc/sysrq_trigger | ||
mount -o remount,ro / | ||
echo o > /proc/sysrq_trigger # power off | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters