diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-10 14:25:18 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-10 14:25:18 +0100 |
commit | d0258e95828760ae4ad0f4c6e62c2fcf9d9d7da8 (patch) | |
tree | f78442a36577c44400cd55f0f09a508e68088af3 /unofficial/modules/dieter | |
parent | 3bdc311b3623e12713420dd059970b61c3b17826 (diff) |
die when something fails when preparing block layer stuff
Diffstat (limited to 'unofficial/modules/dieter')
-rw-r--r-- | unofficial/modules/dieter/procedures/automatic | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/unofficial/modules/dieter/procedures/automatic b/unofficial/modules/dieter/procedures/automatic index 0bc5284..de58fd1 100644 --- a/unofficial/modules/dieter/procedures/automatic +++ b/unofficial/modules/dieter/procedures/automatic @@ -70,20 +70,21 @@ worker_prepare_disks () ,10,L,* ,,L EOF + [ $? -gt 0 ] && die_error "Could not sfdisk /dev/sda. Return code is $?" #TODO: when sfdisk is done, i still have an invalid partition table? - cryptsetup --batch-mode -c aes-xts-plain -y -s 512 luksFormat /dev/sda2 - cryptsetup luksOpen /dev/sda2 sda2_crypt - pvcreate /dev/mapper/sda2_crypt - vgcreate cryptpool /dev/mapper/sda2_crypt - lvcreate -L 2G -n swap cryptpool - lvcreate -L 500M -n tmp cryptpool - lvcreate -L 10G -n home cryptpool - lvcreate -L 10G -n root cryptpool - lvcreate -L 3G -n var cryptpool + cryptsetup --batch-mode -c aes-xts-plain -y -s 512 luksFormat /dev/sda2 || die_error "Cannot cryptsetup luksFormat /dev/sda2" + cryptsetup luksOpen /dev/sda2 sda2_crypt || die_error "Cannot cryptsetup luksOpen /dev/sda2" + pvcreate /dev/mapper/sda2_crypt || die_error "Cannot pvcreate the PV on the encrypted blockdevice" + vgcreate cryptpool /dev/mapper/sda2_crypt || die_error "Cannot create the VG an the PV on the encrypted blockdevice" + lvcreate -L 2G -n swap cryptpool && \ + lvcreate -L 500M -n tmp cryptpool && \ + lvcreate -L 10G -n home cryptpool && \ + lvcreate -L 10G -n root cryptpool && \ + lvcreate -L 3G -n var cryptpool || die_error "Could not create at least one of the LV's" for i in home root tmp var do mkdir -p $var_TARGET_DIR/$i - mke2fs -j /dev/cryptpool/$i && mount /dev/cryptpool/$i $var_TARGET_DIR/$i + mke2fs -j /dev/cryptpool/$i && mount /dev/cryptpool/$i $var_TARGET_DIR/$i || die_error "Could not format or mount $var_TARGET_DIR/$i" done #TODO fstab? auto-add to fstab with libs? auto mkdir's on target_dir? |