V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m36s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m36s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -17,20 +17,20 @@ guard_sourcing
|
||||
# Globals:
|
||||
# DIR_BAK
|
||||
# DIR_CNF
|
||||
# HMP_ENCRYPTIONLABEL_UUID
|
||||
# HMP_EPHEMERAL_DEV
|
||||
# HMP_EPHEMERAL_ENCLABEL
|
||||
# HMP_MOUNTPATH_ENCRYPTIONLABEL
|
||||
# HMP_PATH_LUKSUUID
|
||||
# VAR_CRYPT_ROOT
|
||||
# VAR_RECIPE_STRING
|
||||
# VAR_SETUP_PART
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: Successful
|
||||
#######################################
|
||||
partition_encryption() {
|
||||
### Declare Arrays and Variables.
|
||||
declare -Ag HMP_EPHEMERAL_DEV HMP_EPHEMERAL_ENCLABEL
|
||||
declare -Ag HMP_ENCRYPTIONLABEL_UUID HMP_MOUNTPATH_ENCRYPTIONLABEL
|
||||
declare -Ag HMP_EPHEMERAL_DEV HMP_EPHEMERAL_ENCLABEL HMP_PATH_LUKSUUID
|
||||
declare var_dev var_part \
|
||||
var_encryption_enable var_encryption_ephemeral var_encryption_integrity var_encryption_nuke var_encryption_cipher \
|
||||
var_encryption_hash var_encryption_iter var_encryption_key var_encryption_label var_encryption_meta \
|
||||
@@ -134,22 +134,18 @@ partition_encryption() {
|
||||
cryptsetup luksHeaderBackup --header-backup-file="${DIR_BAK}/luks_header_${var_dev}${var_part}.bak" "/dev/${var_dev}${var_part}"
|
||||
do_log "info" "false" "Partition: '/dev/${var_dev}${var_part}' LUKS Header saved: '${DIR_BAK}/luks_header_${var_dev}${var_part}.bak'."
|
||||
|
||||
### Opening encrypted partition.
|
||||
### Opening encrypted container.
|
||||
cryptsetup luksOpen "/dev/${var_dev}${var_part}" \
|
||||
--key-file="${DIR_CNF}/password.txt" \
|
||||
"${var_encryption_label}"
|
||||
do_log "info" "false" "Partition: '/dev/${var_dev}${var_part}' opened as '/dev/mapper/${var_encryption_label}'."
|
||||
|
||||
### Store UUID of the encrypted partition
|
||||
### Store UUID of the LUKS container.
|
||||
# shellcheck disable=SC2155
|
||||
declare var_uuid=$(blkid -s UUID -o value "/dev/mapper/${var_encryption_label}")
|
||||
# shellcheck disable=SC2155
|
||||
[[ "${var_mount_path}" == "/" ]] && declare -grx VAR_CRYPT_ROOT="${var_uuid}"
|
||||
|
||||
HMP_ENCRYPTIONLABEL_UUID["${var_encryption_label}"]="${var_uuid}"
|
||||
HMP_MOUNTPATH_ENCRYPTIONLABEL["${var_mount_path}"]="${var_encryption_label}"
|
||||
do_log "info" "false" "Saved in HashMap [HMP_ENCRYPTIONLABEL_UUID] : '${var_encryption_label}' -> '${HMP_ENCRYPTIONLABEL_UUID["${var_encryption_label}"]}'"
|
||||
do_log "info" "false" "Saved in HashMap [HMP_MOUNTPATH_ENCRYPTIONLABEL] : '${var_mount_path}' -> '${HMP_MOUNTPATH_ENCRYPTIONLABEL["${var_mount_path}"]}'"
|
||||
HMP_PATH_LUKSUUID["UUID_${var_mount_path}"]="${var_uuid}"
|
||||
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user