diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-07-03 00:36:12 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-07-03 00:36:12 -0300 |
commit | df332569de1162bd9a4deeb4c2c5271cbfdee6ad (patch) | |
tree | 8a575864b51f0a993ca1b28525ef34b2d07c7476 /share/hydractl/provision | |
parent | d10c9ace6da2979e35901b369422348a92e5402c (diff) | |
download | hydra-df332569de1162bd9a4deeb4c2c5271cbfdee6ad.tar.gz hydra-df332569de1162bd9a4deeb4c2c5271cbfdee6ad.tar.bz2 |
Provision fixes
Diffstat (limited to 'share/hydractl/provision')
-rwxr-xr-x | share/hydractl/provision | 32 |
1 files changed, 25 insertions, 7 deletions
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 |