aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-07-29 13:48:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-07-29 13:48:32 -0300
commit31677b3cfe55060f816ea68ab757388ef6ecd5fd (patch)
tree72c7cc54fa8609165ef2637c55c68e95cf9b65e0 /share
parent776eebfdccaf528a1421a2906c623ca5e7872a12 (diff)
downloadhydra-31677b3cfe55060f816ea68ab757388ef6ecd5fd.tar.gz
hydra-31677b3cfe55060f816ea68ab757388ef6ecd5fd.tar.bz2
Provision improvements
Diffstat (limited to 'share')
-rw-r--r--share/config/provision/tpc.conf5
-rwxr-xr-xshare/hydractl/provision23
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