File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # SPDX-FileCopyrightText: 2024 Gábor Stefanik <[email protected] >
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
+
9
+ . /steps/bootstrap.cfg
10
+ . /steps/env
11
+
12
+ if [ " ${INTERACTIVE} " = True ]; then
13
+ env - PATH=${PREFIX} /bin PS1=" \w # " bash -i
14
+ fi
15
+
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
+ fi
Original file line number Diff line number Diff line change @@ -27,5 +27,6 @@ mkdir -p /rootonly
27
27
# This doesn't recursively mount - that's why we're able to copy everything over
28
28
mount --bind / /rootonly
29
29
cp -ar /rootonly/* /newroot/
30
+ sed -e ' s/newroot//' /rootonly/etc/mtab | grep -v ' rootonly' > /newroot/etc/mtab
30
31
umount /rootonly
31
32
switch_root /newroot /init
Original file line number Diff line number Diff line change @@ -182,3 +182,4 @@ build: binutils-2.41
182
182
build: gcc-13.1.0
183
183
improve: null_time ( FORCE_TIMESTAMPS == True )
184
184
improve: update_checksums ( UPDATE_CHECKSUMS == True )
185
+ improve: after
You can’t perform that action at this time.
0 commit comments