diff options
-rw-r--r-- | share/config/provision/tpc.conf | 5 | ||||
-rwxr-xr-x | share/hydractl/provision | 23 |
2 files changed, 17 insertions, 11 deletions
diff --git a/share/config/provision/tpc.conf b/share/config/provision/tpc.conf index b5d4f1b..602bdfb 100644 --- a/share/config/provision/tpc.conf +++ b/share/config/provision/tpc.conf @@ -4,10 +4,13 @@ # interactive="n" # Interactive mode? +swap_size="20G" # Size of swap partition +home_size="0" # Size of home partition +var_size="0" # Size of var partition encrypt="y" # Encrypt volumes? garbage="n" # Pre-fill volumes with garbage? disable_zeroing="n" # Disable zeroing of lvm volumes? -random_swap="n" # Random swap? +random_swap="y" # Random swap? arch="amd64" # System arch version="wheezy" # Distro version grub="y" # Setup GRUB? diff --git a/share/hydractl/provision b/share/hydractl/provision index 35021c9..c7be798 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -273,9 +273,12 @@ if [ "$var_size" != "0" ]; then fi fi +# Non-interactive installation +APT_INSTALL="hydra_sudo_run LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $WORK/ apt-get install" + # Initial system install. echo "Installing base system..." -hydra_sudo_run DEBIAN_FRONTEND=noninteractive debootstrap --arch=$arch $version $WORK/ $mirror +hydra_sudo_run LC_ALL=C DEBIAN_FRONTEND=noninteractive debootstrap --arch=$arch $version $WORK/ $mirror # Initial configuration. echo "Applying initial configuration..." @@ -304,7 +307,7 @@ hydra_sudo_run mv $WORK/etc/hosts.new $WORK/etc/hosts echo "Applying initial upgrades..." hydra_sudo_run chroot $WORK/ apt-get update hydra_sudo_run chroot $WORK/ apt-get upgrade -y -hydra_sudo_run chroot $WORK/ apt-get install locales cryptsetup lvm2 initramfs-tools -y +$APT_INSTALL locales cryptsetup lvm2 initramfs-tools -y # Crypttab. echo "Configuring crypttab..." @@ -393,12 +396,12 @@ if [ "$grub" == "y" ]; then fi echo "Setting up GRUB..." - hydra_sudo_run chroot $WORK/ apt-get install grub-pc -y + $APT_INSTALL grub-pc -y if [ "$encrypt" == "y" ]; then - echo '' >> $WORK/etc/default/grub - echo '# Full Disk Encryption Support' >> $WORK/etc/default/grub - echo 'GRUB_ENABLE_CRYPTODISK=y' >> $WORK/etc/default/grub + echo '' | $SUDO tee -a $WORK/etc/default/grub > /dev/null + echo '# Full Disk Encryption Support' | $SUDO tee -a $WORK/etc/default/grub > /dev/null + echo 'GRUB_ENABLE_CRYPTODISK=y' | $SUDO tee -a $WORK/etc/default/grub > /dev/null hydra_sudo_run chroot $WORK/ update-grub hydra_sudo_run chroot $WORK/ grub-install $device fi @@ -426,7 +429,7 @@ else fi # Kernel. -hydra_sudo_run chroot $WORK apt-get install linux-image-$kernel_arch -y +$APT_INSTALL linux-image-$kernel_arch -y # Initramfs. echo "Creating initramfs..." @@ -434,18 +437,18 @@ hydra_sudo_run chroot $WORK update-initramfs -v -u # Utils. echo "Installing basic utilities..." -hydra_sudo_run chroot $WORK apt-get install screen cron lsb-release openssl -y +$APT_INSTALL screen cron lsb-release openssl -y # Networking. hydra_provision_networking # Ssh. echo "Installing OpenSSH daemon..." -hydra_sudo_run chroot $WORK apt-get install openssh-server -y +$APT_INSTALL openssh-server -y # Accounts. echo "Installing sudo..." -hydra_sudo_run chroot $WORK apt-get install sudo -y +$APT_INSTALL sudo -y echo "Choose a root password." hydra_sudo_run chroot $WORK passwd root |