# Setup.
hydra_user_input device /dev/sdb "Destination device"
+hydra_user_input swap_device /dev/sda1 "Final swap device"
hydra_user_input garbage y "Pre-fill volumes with garbage? (y/n)"
hydra_user_input hostname $HOSTNAME "Hostname"
hydra_user_input domain example.com "Domain"
chroot /tmp/debootstrap/ apt-get install locales cryptsetup lvm2 initramfs-tools -y
# Crypttab.
-swap="$device"1
echo "Configuring crypttab..."
cat > /tmp/debootstrap/etc/crypttab <<-EOF
# <target name> <source device> <key file> <options>
root /dev/mapper/vg-root none luks,cipher=aes-cbc-essiv:sha256
-cswap $swap /dev/random swap,cipher=aes-cbc-essiv:sha256
+cswap $swap_device /dev/random swap,cipher=aes-cbc-essiv:sha256
EOF
# Fstab.