summaryrefslogtreecommitdiffstats
path: root/infest.d/cac-CentOS-7-64bit/finalize.sh
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-06-24 14:36:59 +0200
committertv <tv@shackspace.de>2015-06-24 15:01:23 +0200
commit45a0cb01d37e64b4d4d56a7a6769aba61d0fd8f2 (patch)
treedb07acb0a8baa7ee67460e1743461a06a87c0adc /infest.d/cac-CentOS-7-64bit/finalize.sh
parentbb7343cd89115e0768baaa426c68e49d399f6c6f (diff)
rewrite infest-cac-CentOS-7-64bit
Diffstat (limited to 'infest.d/cac-CentOS-7-64bit/finalize.sh')
-rw-r--r--infest.d/cac-CentOS-7-64bit/finalize.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/infest.d/cac-CentOS-7-64bit/finalize.sh b/infest.d/cac-CentOS-7-64bit/finalize.sh
new file mode 100644
index 000000000..b70276b33
--- /dev/null
+++ b/infest.d/cac-CentOS-7-64bit/finalize.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+set -eu
+{
+ umount /mnt2
+ umount /mnt/nix
+ umount /mnt/boot
+ umount /mnt
+ umount /boot
+
+ 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 /
+
+ # TODO ensure /home is empty
+ rmdir /newshit/home
+
+ # 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 /tmp
+ # TODO rmdir /newshit/tmp
+
+ mv /usr /oldshit/
+ mv /newshit/usr /
+
+ mv /var /oldshit/
+ mv /newshit/var /
+
+ mv /root /oldshit/
+ mv /newshit/root /
+
+ mv /lib /oldshit/
+ mv /lib64 /oldshit/
+ mv /sbin /oldshit/
+ mv /mnt2 /oldshit/
+ mv /srv /oldshit/
+ mv /opt /oldshit/
+
+
+ mv /newshit /root/ # TODO this one shoult be empty
+ mv /oldshit /root/
+
+ sync
+}