#!/bin/bash usage() { cat < $ARCH_PUPPET_INITIAL_CONFIGURATION cat > $ARCH_HOST_SCRIPT < /tmp/root.x86_64/etc/pacman.d/mirrorlist DEVICE_STR=\$(cat /proc/mounts | grep "/dev/[sv]d.. /mnt/") DEVICE=\$(echo "\$DEVICE_STR" | cut -d' ' -f1) MOUNTPOINT=\$(echo "\$DEVICE_STR" | cut -d' ' -f2) umount "\$DEVICE" UUID=\$(lsblk -rno UUID "\$DEVICE") echo "\$UUID" > /tmp/root.x86_64/device_uuid cp /tmp/arch_chroot_script.sh /tmp/root.x86_64/ /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/ /arch_chroot_script.sh mount "\$DEVICE" cp /tmp/arch_install_script.sh "\$MOUNTPOINT/root/" cp /tmp/puppet_variables.json "\$MOUNTPOINT/root/" /tmp/root.x86_64/bin/arch-chroot "\$MOUNTPOINT" /root/arch_install_script.sh EOF cat > $ARCH_CHROOT_SCRIPT < /mnt/etc/fstab umount /mnt EOF cat > $ARCH_INSTALL_SCRIPT < $ARCH_PUPPET_CONFIGURATION_SCRIPT < $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <