summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/infest/finalize.sh
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-17 15:48:53 +0200
committerlassulus <lass@aidsballs.de>2015-10-17 15:48:53 +0200
commit72d15b226620c5d3248dd545748cff6c0bfcc049 (patch)
tree5f34949a7bfc90e091e8aad997cf878c81bfd582 /krebs/4lib/infest/finalize.sh
parentfb945f741d709ec198cbf534ad0da2c623abac76 (diff)
krebs 4 infest: add arch-infest and refactor
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