]> gitweb.fluxo.info Git - hydra.git/commitdiff
Support for any vg name on provision and usability changes 0.2.1
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 19:21:07 +0000 (16:21 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Feb 2014 19:21:07 +0000 (16:21 -0300)
share/hydractl/provision

index 59323bb624ea23b088cfd3da1e3df54a4cc10238..5a885901da7960ff2770b5a8947a94daa3ef1797 100755 (executable)
@@ -91,7 +91,7 @@ function hydra_provision_config {
   hydra_user_config domain example.com "Domain"
   hydra_user_config arch amd64 "System arch"
   hydra_user_config version wheezy "Distro version"
-  hydra_user_config vg vg "Temporary install vg"
+  hydra_user_config vg vg "Install vg"
   hydra_user_config grub y "Setup GRUB? (y/n)"
   hydra_user_config mirror http://http.debian.net/debian/ "Debian mirror"
 }
@@ -117,7 +117,8 @@ done
 
 # Warning.
 if [ "$interactive" == "y" ]; then
-  echo "WARNING: about to partition $device!"
+  echo "WARNING: about to create partitions on $device!"
+  echo "WARNING: make sure you have backups of the important data from this device!"
   echo "Press ENTER to continue, Ctrl-C to abort."
   read answer
 fi
@@ -275,19 +276,19 @@ echo "# <target name> <source device>   <key file>  <options>" > /tmp/debootstra
 
 if [ "$encrypt" == "y" ]; then
   cat > /tmp/debootstrap/etc/crypttab <<-EOF
-root            /dev/mapper/vg-root      none            luks,cipher=aes-cbc-essiv:sha256  
+root            /dev/mapper/$vg-root      none            luks,cipher=aes-cbc-essiv:sha256
 EOF
 fi
 
 if [ "$home_size" != "0" ] && [ "$encrypt" == "y" ]; then
   cat >> /tmp/debootstrap/etc/crypttab <<-EOF
-home            /dev/mapper/vg-home      none            luks,cipher=aes-cbc-essiv:sha256
+home            /dev/mapper/$vg-home      none            luks,cipher=aes-cbc-essiv:sha256
 EOF
 fi
 
 if [ "$var_size" != "0" ] && [ "$encrypt" == "y" ]; then
   cat >> /tmp/debootstrap/etc/crypttab <<-EOF
-var             /dev/mapper/vg-var       none            luks,cipher=aes-cbc-essiv:sha256
+var             /dev/mapper/$vg-var       none            luks,cipher=aes-cbc-essiv:sha256
 EOF
 fi
 
@@ -312,7 +313,7 @@ if [ "$encrypt" == "y" ]; then
 EOF
 else
   cat >> /tmp/debootstrap/etc/fstab <<-EOF
-/dev/mapper/vg-root   /              ext4  defaults,errors=remount-ro         0 1
+/dev/mapper/$vg-root   /              ext4  defaults,errors=remount-ro         0 1
 EOF
 fi
 
@@ -323,7 +324,7 @@ if [ "$home_size" != "0" ]; then
 EOF
   else
   cat >> /tmp/debootstrap/etc/fstab <<-EOF
-/dev/mapper/vg-home   /home          ext4  defaults,errors=remount-ro         0 2
+/dev/mapper/$vg-home   /home          ext4  defaults,errors=remount-ro         0 2
 EOF
   fi
 fi
@@ -335,7 +336,7 @@ if [ "$var_size" != "0" ]; then
 EOF
   else
   cat >> /tmp/debootstrap/etc/fstab <<-EOF
-/dev/mapper/vg-var    /var           ext4  defaults,errors=remount-ro         0 2
+/dev/mapper/$vg-var    /var           ext4  defaults,errors=remount-ro         0 2
 EOF
   fi
 fi
@@ -406,6 +407,7 @@ Now proceeed with final steps:
 
   - Create an user account with sudo privileges.
   - Network setup.
+  - Rename volume group $vg if needed, updating fstab and crypttab accordingly.
 
 See http://padrao.sarava.org/install for more information.
 EOF