summaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl')
-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: