summaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/provision23
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