From cb541993499912adf2d55eec96a277011a96670a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 20 Nov 2010 14:08:49 -0200 Subject: Provision: partition information --- lib/hydra/misc | 6 +++--- share/hydractl/provision | 51 +++++++++++++++++++++++++++++++++--------------- 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 -- cgit v1.2.3