X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=host%2Fpart-root-format;h=97e69d09d3816ba0583e5352c13f8076daf241b5;hp=b95950185068c08a09c0b78d0d5ec831442990ab;hb=0d705d8e2a919ee40866307aa3e18b1a5c4e7583;hpb=3ad6118386977e346d81042e924e5db9c5f15b7d diff --git a/host/part-root-format b/host/part-root-format index b959501..97e69d0 100755 --- a/host/part-root-format +++ b/host/part-root-format @@ -2,27 +2,27 @@ tool=$(readlink -e "${0%/*}/..") . "$tool"/host/lib.sh -if ! mount | grep -q "^$vm_dev_disk_root " +if ! mount | grep -q "^$local_dev_disk_root " then sudo cryptsetup luksFormat --hash=sha512 --key-size=512 \ - --cipher=aes-xts-essiv:sha256 --align-payload=8 $vm_dev_disk_root - sudo cryptsetup luksOpen $vm_dev_disk_root ${vm_lvm_lv}_root_deciphered - sudo mke2fs -t ext4 -c -c -m 5 -T ext4 -b $vm_e2fs_block_size \ - -E resize=30G${vm_e2fs_extended_options} \ - -L ${vm_lvm_lv}_root \ - /dev/mapper/${vm_lvm_lv}_root_deciphered - ! mountpoint -q /mnt/$vm_fqdn - sudo mount -v /dev/mapper/${vm_lvm_lv}_root_deciphered /mnt/$vm_fqdn + --cipher=aes-xts-essiv:sha256 --align-payload=8 $local_dev_disk_root + sudo cryptsetup luksOpen $local_dev_disk_root ${local_lvm_lv}_root_deciphered + sudo mke2fs -t ext4 -c -c -m 5 -T ext4 -b $local_e2fs_block_size \ + -E resize=30G${local_e2fs_extended_options} \ + -L ${local_lvm_lv}_root \ + /dev/mapper/${local_lvm_lv}_root_deciphered + ! mountpoint -q /mnt/$local_fqdn + sudo mount -v /dev/mapper/${local_lvm_lv}_root_deciphered /mnt/$local_fqdn sudo install -d -m 770 -o root -g root \ - /mnt/$vm_fqdn/boot \ - /mnt/$vm_fqdn/dev \ - /mnt/$vm_fqdn/home \ - /mnt/$vm_fqdn/proc \ - /mnt/$vm_fqdn/root \ - /mnt/$vm_fqdn/root/src \ - /mnt/$vm_fqdn/root/src/$vm \ - /mnt/$vm_fqdn/sys \ - /mnt/$vm_fqdn/var - sudo umount -v /mnt/$vm_fqdn - sudo cryptsetup luksClose ${vm_lvm_lv}_root_deciphered + /mnt/$local_fqdn/boot \ + /mnt/$local_fqdn/dev \ + /mnt/$local_fqdn/home \ + /mnt/$local_fqdn/proc \ + /mnt/$local_fqdn/root \ + /mnt/$local_fqdn/root/src \ + /mnt/$local_fqdn/root/src/$vm \ + /mnt/$local_fqdn/sys \ + /mnt/$local_fqdn/var + sudo umount -v /mnt/$local_fqdn + sudo cryptsetup luksClose ${local_lvm_lv}_root_deciphered fi