diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-07-03 10:16:31 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-07-03 10:16:31 -0300 |
commit | b7311dc95f4fb020580be7be7d5c0e8a278e326b (patch) | |
tree | a7e6348340502f2505e4e32ba58e85c1af55ae93 /share | |
parent | df332569de1162bd9a4deeb4c2c5271cbfdee6ad (diff) | |
download | hydra-b7311dc95f4fb020580be7be7d5c0e8a278e326b.tar.gz hydra-b7311dc95f4fb020580be7be7d5c0e8a278e326b.tar.bz2 |
Provision improvements and fixes
Diffstat (limited to 'share')
-rw-r--r-- | share/config/provision/nas.conf | 2 | ||||
-rw-r--r-- | share/config/provision/router.conf | 2 | ||||
-rw-r--r-- | share/config/provision/stick.conf | 18 | ||||
-rw-r--r-- | share/config/provision/tpc.conf | 2 | ||||
-rwxr-xr-x | share/hydra/provision | 6 | ||||
-rwxr-xr-x | share/hydractl/provision | 17 |
6 files changed, 38 insertions, 9 deletions
diff --git a/share/config/provision/nas.conf b/share/config/provision/nas.conf index 5916383..a48e3d6 100644 --- a/share/config/provision/nas.conf +++ b/share/config/provision/nas.conf @@ -9,6 +9,6 @@ garbage="y" # Pre-fill volumes with garbage? disable_zeroing="n" # Disable zeroing of lvm volumes? random_swap="y" # Random swap? arch="amd64" # System arch -version="wheezy" # Distro version +version="stretch" # Distro version grub="n" # Setup GRUB? mirror="http://http.debian.net/debian/" # Debian mirror diff --git a/share/config/provision/router.conf b/share/config/provision/router.conf index f3b763a..14d2597 100644 --- a/share/config/provision/router.conf +++ b/share/config/provision/router.conf @@ -9,6 +9,6 @@ garbage="n" # Pre-fill volumes with garbage? disable_zeroing="n" # Disable zeroing of lvm volumes? random_swap="n" # Random swap? arch="amd64" # System arch -version="wheezy" # Distro version +version="stretch" # Distro version grub="y" # Setup GRUB? mirror="http://http.debian.net/debian/" # Debian mirror diff --git a/share/config/provision/stick.conf b/share/config/provision/stick.conf new file mode 100644 index 0000000..b47f38b --- /dev/null +++ b/share/config/provision/stick.conf @@ -0,0 +1,18 @@ +# +# Sample configuration for provisioning a machine in a USB stick. +# The machine's disk is unencrypted. +# + +interactive="n" # Interactive mode? +swap_size="0" # Swap size +root_size="-1" # Root size +encrypt="n" # Encrypt volumes? +disable_zeroing="n" # Disable zeroing of lvm volumes? +domain="example.org" # Domain +hostname="debian" # Hostname +arch="amd64" # System arch +version="stretch" # Distro version +grub="y" # Setup GRUB? +mirror="http://http.debian.net/debian/" # Debian mirror +vg="debian" # Install vg +ssh="n" # Install openssh-server? diff --git a/share/config/provision/tpc.conf b/share/config/provision/tpc.conf index 5c209a0..89faa5e 100644 --- a/share/config/provision/tpc.conf +++ b/share/config/provision/tpc.conf @@ -13,7 +13,7 @@ garbage="n" # Pre-fill volumes with garbage? disable_zeroing="n" # Disable zeroing of lvm volumes? random_swap="n" # Random swap? arch="amd64" # System arch -version="jessie" # Distro version +version="stretch" # Distro version grub="y" # Setup GRUB? mirror="http://http.debian.net/debian/" # Debian mirror ssh="n" # Install openssh-server? diff --git a/share/hydra/provision b/share/hydra/provision index 4c59b3d..a025a8e 100755 --- a/share/hydra/provision +++ b/share/hydra/provision @@ -34,5 +34,9 @@ if [ -z "$NODE" ]; then ( cd $CONFIG && tree ) exit 1 else - hydractl $BASENAME $NODE + if [ -e "$CONFIG/$NODE.conf" ]; then + hydractl $BASENAME $CONFIG/$NODE.conf + elif [ -e "$APP_BASE/share/config/provision/$NODE.conf" ]; then + hydractl $BASENAME $APP_BASE/share/config/provision/$NODE.conf + fi fi diff --git a/share/hydractl/provision b/share/hydractl/provision index e7877c3..96784c5 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -98,13 +98,13 @@ function hydra_provision_config { hydra_user_config root_size 20G "Size of root partition (-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)" + 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)" + 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 @@ -112,11 +112,11 @@ function hydra_provision_config { hydra_user_config encrypt y "Encrypt volumes? (if RAID, then encryption is default) (y/n)" if [ "$encrypt" == "y" ]; then - hydra_user_config garbage y "Pre-fill volumes with garbage? (y/n)" + 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)" + hydra_user_config random_swap y "Random swap? (y/n)" fi hydra_user_config disable_zeroing n "Disable zeroing of LVM volumes? (y/n)" @@ -484,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/"' \ + hydra_sudo_run 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 @@ -499,6 +499,8 @@ if [ "$grub" == "y" ]; then # Fix menu entry hydra_sudo_run sed -i -e "s|root=/dev/mapper/provision-root|root=/dev/mapper/root|g" $WORK/boot/grub/grub.cfg hydra_sudo_run sed -i -e "s|root=/dev/mapper/$hostname-unlocked|root=/dev/mapper/root|g" $WORK/boot/grub/grub.cfg + else + hydra_sudo_run chroot $WORK/ grub-install --recheck --force $device fi fi @@ -531,6 +533,11 @@ if [ "$ssh" == "y" ]; then fi echo "Umounting installation device..." + +if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then + hydra_sudo_run umount $WORK/boot +fi + hydra_sudo_run umount $WORK/sys $WORK/proc $WORK/dev $WORK if [ "$swap_size" != "0" ]; then |