summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-20 14:08:49 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-20 14:08:49 -0200
commitcb541993499912adf2d55eec96a277011a96670a (patch)
tree5adffa2db873dcb8f6e6239a99ae66149fa4624f
parentada53cf0229bace8e0f9f7ad191a7f77332e8c6c (diff)
downloadhydra-cb541993499912adf2d55eec96a277011a96670a.tar.gz
hydra-cb541993499912adf2d55eec96a277011a96670a.tar.bz2
Provision: partition information
-rw-r--r--lib/hydra/misc6
-rwxr-xr-xshare/hydractl/provision51
2 files changed, 38 insertions, 19 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 26d03ea..77f717d 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -131,7 +131,7 @@ function hydra_usage_hydractl {
}
# Read a parameter from user
-function hydra_read {
+function hydra_user_input {
local input
param="$1"
default="$2"
@@ -139,8 +139,8 @@ function hydra_read {
read -rep "$* (defaults to $default): " input
if [ -z "$input" ]; then
- declare $param=$default
+ export $param=$default
else
- declare $param=$input
+ export $param=$input
fi
}
diff --git a/share/hydractl/provision b/share/hydractl/provision
index d056641..6d0c9ae 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -8,21 +8,35 @@ source $APP_BASE/lib/hydra/functions || exit 1
hydra_config_load
# Setup.
-hydra_read device /dev/sdb "Destination device"
-hydra_read garbage y "Pre-fill volumes with garbage? (y/n)"
-hydra_read hostname $HOSTNAME "Hostname"
-hydra_read domain example.com "Domain"
-hydra_read arch amd64 "System arch"
-hydra_read version lenny "Distro version"
-hydra_read vg vg "Temporary install vg"
-hydra_read grub n "Setup GRUB? (y/n)"
+hydra_user_input device /dev/sdb "Destination device"
+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 lenny "Distro version"
+hydra_user_input vg vg "Temporary install vg"
+hydra_user_input grub n "Setup GRUB? (y/n)"
# Warning.
-echo ""
-echo "Make sure you have chosen the right parameters"
-echo "and that $device has the needed partitions."
-echo ""
-echo "Press ENTER to continue, Ctrl-C to abort."
+cat <<-EOF
+Make sure you have chosen the right parameters and that $device has the needed partitions:
+
+ # fdisk -l $device
+ Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
+ 255 heads, 63 sectors/track, 121601 cylinders
+ Units = cilindros of 16065 * 512 = 8225280 bytes
+ Disk identifier: 0x00000000
+
+ Dispositivo Boot Start End Blocks Id System
+ ${device}1 1 249 2000061 82 Linux swap
+ ${device}2 * 250 273 192780 83 Linux
+ ${device}3 274 121601 974567160 8e Linux LVM
+
+The number of blocks are figurative: the important thing is to have the
+partition layout listed above.
+
+Press ENTER to continue, Ctrl-C to abort."
+EOF
read answer
# Create volumes.
@@ -150,7 +164,12 @@ chroot /tmp/debootstrap apt-get install sudo
echo "Choose a root password."
chroot /tmp/debootstrap passwd root
-# Final steps:
-# Create an user account with sudo privileges.
-# Network setup.
+cat <<-EOF
+
+Now proceeed with final steps:
+ - Create an user account with sudo privileges.
+ - Network setup.
+
+See http://padrao.sarava.org/install for more information.
+EOF