From df332569de1162bd9a4deeb4c2c5271cbfdee6ad Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 3 Jul 2018 00:36:12 -0300 Subject: Provision fixes --- share/hydractl/provision | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'share') diff --git a/share/hydractl/provision b/share/hydractl/provision index 938b28e..e7877c3 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -96,11 +96,29 @@ function hydra_provision_config { hydra_user_config device /dev/sdb "Physical device(s) (more than one auto sets RAID mode)" hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)" hydra_user_config root_size 20G "Size of root partition (-1 for all free space)" - hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)" - hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)" + + if [ "$root_size" != "-1" ]; then + hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)" + else + home_size="0" + fi + + if [ "$root_size" != "-1" ] && [ "$home_size" != "-1" ]; then + hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)" + else + var_size="0" + fi + hydra_user_config encrypt y "Encrypt volumes? (if RAID, then encryption is default) (y/n)" - hydra_user_config garbage y "Pre-fill volumes with garbage? (y/n)" - hydra_user_config random_swap y "Random swap? (y/n)" + + if [ "$encrypt" == "y" ]; then + hydra_user_config garbage y "Pre-fill volumes with garbage? (y/n)" + fi + + if [ "$swap_size" != "0" ]; then + hydra_user_config random_swap y "Random swap? (y/n)" + fi + hydra_user_config disable_zeroing n "Disable zeroing of LVM volumes? (y/n)" hydra_user_config hostname machine "Hostname" hydra_user_config domain example.org "Domain" @@ -336,8 +354,8 @@ hydra_sudo_run mv $WORK/etc/hosts.new $WORK/etc/hosts # Apt if [ "$version" != "sid" ]; then - echo "deb http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee $WORK/etc/apt/sources.list - echo "deb-src http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee $WORK/etc/apt/sources.list + echo "deb http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee -a $WORK/etc/apt/sources.list + echo "deb-src http://security.debian.org/ $version/updates main contrib non-free" | $SUDO tee -a $WORK/etc/apt/sources.list fi # Initial upgrade. @@ -466,7 +484,7 @@ if [ "$grub" == "y" ]; then echo "Setting up GRUB..." $APT_INSTALL grub-pc -y - sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor"' \ + sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor/"' \ $WORK/etc/default/grub hydra_sudo_run chroot $WORK/ update-grub -- cgit v1.2.3