]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision improvements
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 29 Jul 2016 16:48:32 +0000 (13:48 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 29 Jul 2016 16:48:32 +0000 (13:48 -0300)
share/config/provision/tpc.conf
share/hydractl/provision

index b5d4f1bf23e2a9cc05a2efb53ee2952b95cdcb62..602bdfb6db081716f319dbfac4a0a3c60371d9a0 100644 (file)
@@ -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?
index 35021c9f2c05007d749f77e0c4ff9ff6784e293c..c7be798f7f3d8cc13db991522bfdaf80bd9b18ad 100755 (executable)
@@ -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