summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/infest/4finalize
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-09-18 03:04:39 +0200
committerlassulus <lass@aidsballs.de>2015-09-18 03:04:39 +0200
commitab946ab7c12a5f25c62c0abfea5fa38189411e7b (patch)
treec4c10e7d107e87b232c9460f5beb062f012adf0d /krebs/4lib/infest/4finalize
parent03263a58d870229b61430c80f21cb178ee251cc6 (diff)
add "make infest"
Diffstat (limited to 'krebs/4lib/infest/4finalize')
-rw-r--r--krebs/4lib/infest/4finalize65
1 files changed, 65 insertions, 0 deletions
diff --git a/krebs/4lib/infest/4finalize b/krebs/4lib/infest/4finalize
new file mode 100644
index 000000000..d095fa31b
--- /dev/null
+++ b/krebs/4lib/infest/4finalize
@@ -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=$(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
+}