summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/infest/finalize.sh
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/4lib/infest/finalize.sh')
-rw-r--r--krebs/4lib/infest/finalize.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/krebs/4lib/infest/finalize.sh b/krebs/4lib/infest/finalize.sh
index ced5a4d4d..0039960c5 100644
--- a/krebs/4lib/infest/finalize.sh
+++ b/krebs/4lib/infest/finalize.sh
@@ -1,21 +1,30 @@
#! /bin/sh
set -eux
{
- umount /mnt/nix || [ $? -eq 32 ]
- umount /mnt/boot || [ $? -eq 32 ]
- umount /mnt/root || [ $? -eq 32 ]
- umount /mnt || [ $? -eq 32 ]
- umount /boot || [ $? -eq 32 ]
+ umount /mnt/nix
+ umount /mnt/root
+ umount /boot || :
+ umount /mnt/boot
+ umount /mnt
+
+ coreutils_path=$(set +f; for i in /nix/store/*coreutils*/bin; do :; done; echo $i)
+ sed_path=$(set +f; for i in /nix/store/*gnused*/bin; do :; done; echo $i)
+ PATH="$coreutils_path:$sed_path"
- PATH=$(set +f; for i in /nix/store/*coreutils*/bin; do :; done; echo $i)
export PATH
mkdir /oldshit
+ #fix bug where grub install cant find the /nix/store because its under a bind mount
+ if test -e /boot/grub/grub.cfg; then
+ sed -i 's,//store,/nix/store,g' /boot/grub/grub.cfg
+ fi;
+
mv /bin /oldshit/
mv /newshit/bin /
# TODO ensure /boot is empty
+ # skip boot
rmdir /newshit/boot
# skip /dev