After bootstrap, drop to a shell if needed, then shut down cleanly

This commit is contained in:
Gábor Stefanik 2024-01-01 23:36:13 +01:00
parent 133c05426c
commit 2a095a3301
3 changed files with 26 additions and 0 deletions

View file

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