summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unofficial/modules/dieter/procedures/automatic9
1 files changed, 7 insertions, 2 deletions
diff --git a/unofficial/modules/dieter/procedures/automatic b/unofficial/modules/dieter/procedures/automatic
index de07432..09269b5 100644
--- a/unofficial/modules/dieter/procedures/automatic
+++ b/unofficial/modules/dieter/procedures/automatic
@@ -35,13 +35,18 @@ phase_finish ()
worker_prepare_disks ()
{
+ modprobe dm-crypt || die_error "Cannot modprobe dm-crypt"
+ modprobe -q aes-x86-64 || modprobe aes-i586 || die_error "Cannot modprobe aes-x86-64 or aes-i586"
+
+ # Cleanup whatever state the disk is in (that includes previous, failed runs of this script)
+ cryptsetup luksClose sda2_crypt 2>/dev/null
+ dd if=/dev/urandom of=/dev/sda bs=512 count=1
+
#TODO: integrate this stuff into the functions in the libs + do error checking and handling
sfdisk /dev/sda 2>&1 | grep -v 'not have an msdos signature' << EOF
,10,L,*
,,L
EOF
- modprobe dm-crypt || die_error "Cannot modprobe dm-crypt"
- modprobe -q aes-x86-64 || modprobe aes-i586 || die_error "Cannot modprobe aes-x86-64 or aes-i586"
cryptsetup --batch-mode -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 sda2_crypt
pvcreate /dev/mapper/sda2_crypt