From 72d15b226620c5d3248dd545748cff6c0bfcc049 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 17 Oct 2015 15:48:53 +0200 Subject: krebs 4 infest: add arch-infest and refactor --- krebs/4lib/infest/finalize.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'krebs/4lib/infest/finalize.sh') 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 -- cgit v1.2.3