aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-08-14 19:13:40 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-08-14 19:13:40 -0300
commit10957b57107f62f7786c6ee6caa5dfbc782bce5b (patch)
tree2c269321818b9af4eaa2f5f0fed74cb8d9f5f248
parentaaf8a8e2568e8d06cc15508cb15a6e8a9605ec80 (diff)
downloadhydra-10957b57107f62f7786c6ee6caa5dfbc782bce5b.tar.gz
hydra-10957b57107f62f7786c6ee6caa5dfbc782bce5b.tar.bz2
No msdos label support anymore, adding bios_grub partition and fixing cswap config
-rwxr-xr-xshare/hydractl/provision31
1 files changed, 17 insertions, 14 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 5fac217..6863431 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -87,7 +87,6 @@ function hydra_provision_config {
hydra_user_config interactive y "Interactive mode? (y/n)"
hydra_user_config device /dev/sdb "Destination device"
- hydra_user_config device_label gpt "Device disk label"
hydra_user_config root_size 20G "Size of root partition"
hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)"
hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)"
@@ -134,27 +133,31 @@ fi
# Disk partitioning.
if [ "$swap" != "0" ]; then
boot_end=$(($swap_size + 200))
- hydra_safe_run parted -s -- $device mklabel $device_label
+ hydra_safe_run parted -s -- $device mklabel gpt
+ hydra_safe_run parted -s -- $device unit MB mkpart primary non-fs 0 2
hydra_safe_run parted -s -- $device unit MB mkpart primary linux-swap 2 $swap_size
hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 $swap_size $boot_end
hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 $boot_end -1
+ hydra_safe_run parted -s -- $device set 1 bios_grub on
+ hydra_safe_run parted -s -- $device set 3 boot on
+ hydra_safe_run parted -s -- $device set 4 lvm on
+
+ # Change devices to absolute path names.
+ swap_device="$device"2
+ boot_device="$device"3
+ syst_device="$device"4
+else
+ hydra_safe_run parted -s -- $device mklabel gpt
+ hydra_safe_run parted -s -- $device unit MB mkpart primary non-fs 0 2
+ hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 2 200
+ hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 200 -1
+ hydra_safe_run parted -s -- $device set 1 bios_grub on
hydra_safe_run parted -s -- $device set 2 boot on
hydra_safe_run parted -s -- $device set 3 lvm on
# Change devices to absolute path names.
- swap_device="$device"1
boot_device="$device"2
syst_device="$device"3
-else
- hydra_safe_run parted -s -- $device mklabel $device_label
- hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 2 200
- hydra_safe_run parted -s -- $device unit MB mkpart primary ext2 200 -1
- hydra_safe_run parted -s -- $device set 1 boot on
- hydra_safe_run parted -s -- $device set 2 lvm on
-
- # Change devices to absolute path names.
- boot_device="$device"1
- syst_device="$device"2
fi
# Create volumes.
@@ -302,7 +305,7 @@ fi
if [ "$swap" != "0" ]; then
cat >> /tmp/debootstrap/etc/crypttab <<-EOF
-cswap $swap_device /dev/random swap,cipher=aes-xts-plain64:sha256
+cswap $swap_device /dev/random luks,swap
EOF
fi