function hydra_provision_fingerprints {
echo "OpenSSH fingerprints:"
- hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
+ #hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub
hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub
hydra_user_config device /dev/sdb "Physical device(s) (more than one auto sets RAID mode)"
hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)"
hydra_user_config root_size 20G "Size of root partition (-1 for all free space)"
- hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)"
- hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)"
+
+ if [ "$root_size" != "-1" ]; then
+ hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)"
+ else
+ home_size="0"
+ fi
+
+ if [ "$root_size" != "-1" ] && [ "$home_size" != "-1" ]; then
+ hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)"
+ else
+ var_size="0"
+ fi
+
hydra_user_config encrypt y "Encrypt volumes? (if RAID, then encryption is default) (y/n)"
- hydra_user_config garbage y "Pre-fill volumes with garbage? (y/n)"
- hydra_user_config random_swap y "Random swap? (y/n)"
+
+ if [ "$encrypt" == "y" ]; then
+ hydra_user_config garbage y "Pre-fill volumes with garbage? (y/n)"
+ fi
+
+ if [ "$swap_size" != "0" ]; then
+ hydra_user_config random_swap y "Random swap? (y/n)"
+ fi
+
hydra_user_config disable_zeroing n "Disable zeroing of LVM volumes? (y/n)"
hydra_user_config hostname machine "Hostname"
hydra_user_config domain example.org "Domain"
# Apt
if [ "$version" != "sid" ]; then
- echo "deb http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee $WORK/etc/apt/sources.list
- echo "deb-src http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee $WORK/etc/apt/sources.list
+ echo "deb http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee -a $WORK/etc/apt/sources.list
+ echo "deb-src http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee -a $WORK/etc/apt/sources.list
fi
# Initial upgrade.
echo "Setting up GRUB..."
$APT_INSTALL grub-pc -y
- sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor"' \
+ sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor/"' \
$WORK/etc/default/grub
hydra_sudo_run chroot $WORK/ update-grub