diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-30 11:16:53 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-30 11:16:53 -0200 |
commit | 5ba49bd0c44c2e3b6c92ab1c098f3a348f575fb3 (patch) | |
tree | c3532a623f60e5feb4cbc65ea10789ecd0edf1fa /share | |
parent | 54b58261516fbe6d1e06be441bf2d3f47bcd2a42 (diff) | |
download | hydra-5ba49bd0c44c2e3b6c92ab1c098f3a348f575fb3.tar.gz hydra-5ba49bd0c44c2e3b6c92ab1c098f3a348f575fb3.tar.bz2 |
Config file support for provision
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydractl/provision | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision index 8d6d686..b781178 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -20,7 +20,7 @@ source $APP_BASE/lib/hydra/functions || exit 1 hydra_config_load -# Create a logical volume +# Create a logical volume. function hydra_lvcreate { local volume="$1" local size="$2" @@ -45,7 +45,7 @@ function hydra_lvcreate { fi } -# Create a physical volume +# Create a physical volume. function hydra_create_volume { local volume="$1" @@ -72,21 +72,36 @@ function hydra_create_volume { fi } +# Ask user for install configuration. +function hydra_provision_askuser { + hydra_user_input device /dev/sdb "Destination device" + hydra_user_input root_size 20G "Size of root partition" + hydra_user_input swap_size 2000 "Swap size (in MB, 0 to not create it)" + hydra_user_input home_size 20G "Size of home partition (0 to not create it, -1 for all free space)" + hydra_user_input var_size 20G "Size of var partition (0 to not create it, -1 for all free space)" + hydra_user_input encrypt y "Encrypt volumes? (y/n)" + hydra_user_input garbage y "Pre-fill volumes with garbage? (y/n)" + hydra_user_input hostname $HOSTNAME "Hostname" + hydra_user_input domain example.com "Domain" + hydra_user_input arch amd64 "System arch" + hydra_user_input version wheezy "Distro version" + hydra_user_input vg vg "Temporary install vg" + hydra_user_input grub y "Setup GRUB? (y/n)" + hydra_user_input mirror http://http.debian.net/debian/ "Debian mirror" +} + # Setup. -hydra_user_input device /dev/sdb "Destination device" -hydra_user_input root_size 20G "Size of root partition" -hydra_user_input swap_size 2000 "Swap size (in MB, 0 to not create it)" -hydra_user_input home_size 20G "Size of home partition (0 to not create it, -1 for all free space)" -hydra_user_input var_size 20G "Size of var partition (0 to not create it, -1 for all free space)" -hydra_user_input encrypt y "Encrypt volumes? (y/n)" -hydra_user_input garbage y "Pre-fill volumes with garbage? (y/n)" -hydra_user_input hostname $HOSTNAME "Hostname" -hydra_user_input domain example.com "Domain" -hydra_user_input arch amd64 "System arch" -hydra_user_input version wheezy "Distro version" -hydra_user_input vg vg "Temporary install vg" -hydra_user_input grub y "Setup GRUB? (y/n)" -hydra_user_input mirror http://http.debian.net/debian/ "Debian mirror" +if [ ! -z "$1" ]; then + if [ -f "$1" ]; then + echo "Using configuration from file $1..." + source "$1" + else + echo "File not found: $1" + exit 1 + fi +else + hydra_provision_askuser +fi # Check for requirements. for req in debootstrap cryptsetup grub-pc lvm2 parted; do |