diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-07-29 13:48:32 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-07-29 13:48:32 -0300 |
commit | 31677b3cfe55060f816ea68ab757388ef6ecd5fd (patch) | |
tree | 72c7cc54fa8609165ef2637c55c68e95cf9b65e0 /share/hydractl | |
parent | 776eebfdccaf528a1421a2906c623ca5e7872a12 (diff) | |
download | hydra-31677b3cfe55060f816ea68ab757388ef6ecd5fd.tar.gz hydra-31677b3cfe55060f816ea68ab757388ef6ecd5fd.tar.bz2 |
Provision improvements
Diffstat (limited to 'share/hydractl')
-rwxr-xr-x | share/hydractl/provision | 23 |
1 files changed, 13 insertions, 10 deletions
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 |