mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-14 19:41:04 +01:00
Updated decryption process
This commit is contained in:
parent
b60b0c0d2b
commit
67a76814b0
@ -51,7 +51,7 @@ set_root_variables(){
|
|||||||
root_mapper_path="/dev/mapper/$root_mapper_name" || error
|
root_mapper_path="/dev/mapper/$root_mapper_name" || error
|
||||||
}
|
}
|
||||||
|
|
||||||
mount_partitions(){
|
decrypt_root(){
|
||||||
if [ "$(blkid "$root_partition_path" -s TYPE -o value)" == "crypto_LUKS" ]
|
if [ "$(blkid "$root_partition_path" -s TYPE -o value)" == "crypto_LUKS" ]
|
||||||
then
|
then
|
||||||
set_root_variables &&
|
set_root_variables &&
|
||||||
@ -59,6 +59,9 @@ mount_partitions(){
|
|||||||
sudo cryptsetup -v luksOpen "$root_partition_path" "$root_mapper_name" ||
|
sudo cryptsetup -v luksOpen "$root_partition_path" "$root_mapper_name" ||
|
||||||
error
|
error
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_partitions(){
|
||||||
info "Mount boot and root partition..." &&
|
info "Mount boot and root partition..." &&
|
||||||
mount -v "$boot_partition_path" "$boot_mount_path" &&
|
mount -v "$boot_partition_path" "$boot_mount_path" &&
|
||||||
mount -v "$root_mapper_path" "$root_mount_path" &&
|
mount -v "$root_mapper_path" "$root_mount_path" &&
|
||||||
|
@ -14,6 +14,8 @@ make_mount_folders
|
|||||||
|
|
||||||
set_partition_paths
|
set_partition_paths
|
||||||
|
|
||||||
|
decrypt_root
|
||||||
|
|
||||||
mount_partitions
|
mount_partitions
|
||||||
|
|
||||||
mount_chroot_binds
|
mount_chroot_binds
|
||||||
|
@ -244,7 +244,7 @@ if [ "$transfer_image" = "y" ]
|
|||||||
then
|
then
|
||||||
info "Formating $root_partition_path with LUKS..." &&
|
info "Formating $root_partition_path with LUKS..." &&
|
||||||
sudo cryptsetup -v luksFormat -c aes-xts-plain64 -s 512 -h sha512 --use-random -i 1000 "$root_partition_path" &&
|
sudo cryptsetup -v luksFormat -c aes-xts-plain64 -s 512 -h sha512 --use-random -i 1000 "$root_partition_path" &&
|
||||||
set_root_variables || error
|
decrypt_root || error
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Format root partition..." &&
|
info "Format root partition..." &&
|
||||||
@ -293,6 +293,7 @@ if mount | grep -q "$boot_partition_path"
|
|||||||
then
|
then
|
||||||
info "$root_mapper_path is allready mounted..."
|
info "$root_mapper_path is allready mounted..."
|
||||||
else
|
else
|
||||||
|
decrypt_root
|
||||||
mount_partitions
|
mount_partitions
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user