diff options
author | makefu <github@syntax-fehler.de> | 2015-09-27 19:41:01 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-09-27 19:41:01 +0200 |
commit | bc2bd6e2f6e9295b14e641b82bff62b40641988d (patch) | |
tree | 8bc4b655c12b4e0bc33051116a3adb3003463d34 /krebs/3modules/build/infest/finalize.sh | |
parent | c65614cdef66c38ff2939928e9072873e19e1c37 (diff) | |
parent | 170191034e51fb7e80ff6e6ddcac103ec7527afd (diff) |
Merge branch 'before-merge'
Diffstat (limited to 'krebs/3modules/build/infest/finalize.sh')
-rw-r--r-- | krebs/3modules/build/infest/finalize.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/krebs/3modules/build/infest/finalize.sh b/krebs/3modules/build/infest/finalize.sh new file mode 100644 index 000000000..ced5a4d4d --- /dev/null +++ b/krebs/3modules/build/infest/finalize.sh @@ -0,0 +1,65 @@ +#! /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 ] + + PATH=$(set +f; for i in /nix/store/*coreutils*/bin; do :; done; echo $i) + export PATH + + mkdir /oldshit + + mv /bin /oldshit/ + mv /newshit/bin / + + # TODO ensure /boot is empty + rmdir /newshit/boot + + # skip /dev + rmdir /newshit/dev + + mv /etc /oldshit/ + mv /newshit/etc / + + # skip /nix (it's already there) + rmdir /newshit/nix + + # skip /proc + rmdir /newshit/proc + + # skip /run + rmdir /newshit/run + + # skip /sys + rmdir /newshit/sys + + # skip /root + rmdir /newshit/root + + # skip /tmp + # TODO rmdir /newshit/tmp + + mv /home /oldshit/ + mv /newshit/home / + + mv /usr /oldshit/ + mv /newshit/usr / + + mv /var /oldshit/ + mv /newshit/var / + + mv /lib /oldshit/ + mv /lib64 /oldshit/ + mv /sbin /oldshit/ + mv /srv /oldshit/ + mv /opt /oldshit/ + + + mv /newshit /root/ # TODO this one shoult be empty + mv /oldshit /root/ + + sync +} |