Merge branch 'after' into bare-metal-full

This commit is contained in:
Gábor Stefanik 2024-01-08 05:20:28 +01:00
commit 7dcbb32178
2 changed files with 5 additions and 0 deletions

View file

@ -14,7 +14,11 @@ if [ "${INTERACTIVE}" = True ]; then
fi fi
if [ "${CHROOT}" = False ]; then if [ "${CHROOT}" = False ]; then
# ignore errors due to fstab or swapfile not existing
swapoff -a &> /dev/null || true
sync sync
# sysrq to avoid device busy; then mount to wait for it to finish
echo u > /proc/sysrq_trigger
mount -o remount,ro / mount -o remount,ro /
echo o > /proc/sysrq_trigger # power off echo o > /proc/sysrq_trigger # power off
fi fi

View file

@ -43,5 +43,6 @@ mkdir -p /rootonly
# This doesn't recursively mount - that's why we're able to copy everything over # This doesn't recursively mount - that's why we're able to copy everything over
mount --bind / /rootonly mount --bind / /rootonly
cp -ar /rootonly/* /newroot/ cp -ar /rootonly/* /newroot/
sed -e 's/newroot//' /rootonly/etc/mtab | grep -v 'rootonly' > /newroot/etc/mtab
umount /rootonly umount /rootonly
switch_root /newroot /init switch_root /newroot /init