]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - scripts/ovh_vps_ssd/arch_chroot_script.sh
Move scripts to separate chunks
[perso/Immae/Projets/Puppet.git] / scripts / ovh_vps_ssd / arch_chroot_script.sh
diff --git a/scripts/ovh_vps_ssd/arch_chroot_script.sh b/scripts/ovh_vps_ssd/arch_chroot_script.sh
new file mode 100755 (executable)
index 0000000..9dc5c46
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+pacman-key --init
+pacman-key --populate archlinux
+
+UUID=$(cat /device_uuid)
+PART="/dev/disk/by-uuid/$UUID"
+DEVICE=$(realpath "$PART")
+
+# mkfs.ext4 -F -U "$UUID" "$DEVICE"
+mount "$DEVICE" /mnt
+
+##### FIXME: mkfs.ext4 would be better ####
+for i in /mnt/*; do
+  if [ "$i" = "/mnt/boot" ]; then
+    # keep /boot/grub
+    rm -f $i/*
+  else
+    rm -rf $i
+  fi
+done
+##### /FIXME ####
+
+pacstrap /mnt base git puppet
+
+echo "$PART / auto defaults 0 1" > /mnt/etc/fstab
+
+umount /mnt
+