summaryrefslogtreecommitdiff
path: root/share/hydractl/provision
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-09-16 12:08:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-09-16 12:08:03 -0300
commit15ce1602dee881b076b52ab279c2d3502169f60d (patch)
tree4690e545cad17afdf79982f24167dd505eca0b0f /share/hydractl/provision
parent0dfd17373e9442f9f7e8e08abf074c8732bf8e5d (diff)
downloadhydra-15ce1602dee881b076b52ab279c2d3502169f60d.tar.gz
hydra-15ce1602dee881b076b52ab279c2d3502169f60d.tar.bz2
Updates provision
Diffstat (limited to 'share/hydractl/provision')
-rwxr-xr-xshare/hydractl/provision15
1 files changed, 12 insertions, 3 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 70e52e5..e186213 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -94,8 +94,8 @@ function hydra_provision_config {
hydra_user_config interactive y "Interactive mode? (y/n)"
hydra_user_config device /dev/sdb "Destination device"
- hydra_user_config root_size 20G "Size of root partition (-1 for all free space)"
hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)"
+ hydra_user_config root_size 20G "Size of root partition (-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)"
hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)"
hydra_user_config encrypt y "Encrypt volumes? (y/n)"
@@ -177,15 +177,17 @@ if ! vgdisplay $vg &> /dev/null; then
hydra_sudo_run vgcreate $vg $syst_device
fi
-# Create root partition.
+# Activate volume group
hydra_sudo_run vgchange -a y $vg
-hydra_provision_lvcreate root $root_size
# Create swap partition
if [ "$swap_size" != "0" ]; then
hydra_provision_lvcreate swap $swap_size
fi
+# Create root partition.
+hydra_provision_lvcreate root $root_size
+
# Create home partition.
if [ "$home_size" != "0" ]; then
hydra_provision_lvcreate home $home_size
@@ -446,6 +448,7 @@ hydra_provision_networking
# Ssh.
echo "Installing OpenSSH daemon..."
$APT_INSTALL openssh-server -y
+hydra_sudo_run chroot $WORK/ service ssh stop
# Accounts.
echo "Installing sudo..."
@@ -457,6 +460,12 @@ hydra_sudo_run chroot $WORK passwd root
# Fingerprints
hydra_provision_fingerprints
+# Turn off device
+hydra_sudo_run umount $WORK/sys $WORK/proc $WORK/dev $WORK
+hydra_sudo_run cryptsetup luksClose provision-swap
+hydra_sudo_run cryptsetup luksClose provision-root
+hydra_sudo_run vgchange -a n $vg
+
cat <<-EOF
Now proceeed with final steps: