V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -35,8 +35,8 @@ partition_encryption() {
|
||||
declare -Ag HMP_EPHEMERAL_DEV HMP_EPHEMERAL_ENCLABEL HMP_EPHEMERAL_FS_LABEL HMP_PATH_LUKSUUID HMP_PATH_ENCLABEL
|
||||
declare var_dev var_part \
|
||||
var_encryption_enable var_encryption_ephemeral var_encryption_integrity var_encryption_cipher \
|
||||
var_encryption_hash var_encryption_iter var_encryption_key var_encryption_label var_encryption_meta \
|
||||
var_encryption_pbkdf var_encryption_rng var_filesystem_label var_mount_path var_uuid
|
||||
var_encryption_hash var_encryption_iter var_encryption_key var_encryption_label var_encryption_meta var_encryption_cores \
|
||||
var_encryption_slot var_encryption_pbkdf var_encryption_rng var_filesystem_label var_mount_path var_uuid var_fs
|
||||
declare -a ary_devs=() ary_parts=() ary_luks_opts=()
|
||||
|
||||
### Iterate over all devices in the recipe.
|
||||
@@ -60,17 +60,20 @@ partition_encryption() {
|
||||
var_encryption_hash=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.hash" "${VAR_SETUP_PART}")
|
||||
var_encryption_iter=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.itertime" "${VAR_SETUP_PART}")
|
||||
var_encryption_key=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.key" "${VAR_SETUP_PART}")
|
||||
var_encryption_label=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.label" "${VAR_SETUP_PART}")
|
||||
var_encryption_slot=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.keyslotssize" "${VAR_SETUP_PART}")
|
||||
var_encryption_meta=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.metadatasize" "${VAR_SETUP_PART}")
|
||||
var_encryption_pbkdf=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.pbkdf" "${VAR_SETUP_PART}")
|
||||
var_encryption_cores=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.pbkdfparallel" "${VAR_SETUP_PART}")
|
||||
var_encryption_rng=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.rng" "${VAR_SETUP_PART}")
|
||||
var_filesystem_label=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.filesystem.label" "${VAR_SETUP_PART}")
|
||||
var_fs=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.filesystem.version" "${VAR_SETUP_PART}")
|
||||
var_mount_path=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.mount.path" "${VAR_SETUP_PART}")
|
||||
|
||||
if [[ "${var_encryption_enable,,}" != "true" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
var_encryption_label=$(get_label "${var_mount_path}" "${var_fs}" "luks")
|
||||
|
||||
if [[ "${var_mount_path,,}" == "/boot" ]]; then
|
||||
ary_luks_opts=( --key-file "${DIR_CNF}/password_luks_boot.txt" )
|
||||
else
|
||||
@@ -79,13 +82,15 @@ partition_encryption() {
|
||||
|
||||
ary_luks_opts+=(
|
||||
--type luks2
|
||||
--cipher "${var_encryption_cipher}"
|
||||
--hash "${var_encryption_hash}"
|
||||
--iter-time "${var_encryption_iter}"
|
||||
--key-size "${var_encryption_key}"
|
||||
--cipher "${var_encryption_cipher:-aes-xts-plain64}"
|
||||
--hash "${var_encryption_hash:-sha512}"
|
||||
--iter-time "${var_encryption_iter:-3000}"
|
||||
--key-size "${var_encryption_key:-512}"
|
||||
--label "${var_encryption_label}"
|
||||
--luks2-metadata-size "${var_encryption_meta}"
|
||||
--pbkdf "${var_encryption_pbkdf}"
|
||||
--luks2-keyslots-size "${var_encryption_slot:-16777216}"
|
||||
--luks2-metadata-size "${var_encryption_meta:-4194304}"
|
||||
--pbkdf "${var_encryption_pbkdf:-argon2id}"
|
||||
--pbkdf-parallel "${var_encryption_cores:-1}"
|
||||
"--${var_encryption_rng}"
|
||||
--batch-mode
|
||||
--verbose
|
||||
@@ -99,6 +104,8 @@ partition_encryption() {
|
||||
|
||||
SWAP|/tmp)
|
||||
|
||||
var_filesystem_label=$(get_label "${var_mount_path}" "${var_fs}" "file")
|
||||
|
||||
mkfs.ext4 -L "${var_filesystem_label}" "/dev/${var_dev}${var_part}" 1M
|
||||
do_log "info" "file_only" "3220() Ephemeral: '${var_mount_path}' prepared on: '/dev/${var_dev}${var_part}'."
|
||||
|
||||
@@ -106,9 +113,9 @@ partition_encryption() {
|
||||
HMP_EPHEMERAL_ENCLABEL["${var_mount_path}"]="${var_encryption_label}"
|
||||
HMP_EPHEMERAL_FS_LABEL["${var_mount_path}"]="${var_filesystem_label}"
|
||||
|
||||
do_log "info" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_DEV] : '${var_mount_path}' -> '${HMP_EPHEMERAL_DEV["${var_mount_path}"]}'"
|
||||
do_log "info" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_ENCLABEL]: '${var_mount_path}' -> '${HMP_EPHEMERAL_ENCLABEL["${var_mount_path}"]}'"
|
||||
do_log "info" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_FS_LABEL]: '${var_mount_path}' -> '${HMP_EPHEMERAL_FS_LABEL["${var_mount_path}"]}'"
|
||||
do_log "debug" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_DEV] : '${var_mount_path}' -> '${HMP_EPHEMERAL_DEV["${var_mount_path}"]}'"
|
||||
do_log "debug" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_ENCLABEL]: '${var_mount_path}' -> '${HMP_EPHEMERAL_ENCLABEL["${var_mount_path}"]}'"
|
||||
do_log "debug" "file_only" "3220() Stored in HashMap [HMP_EPHEMERAL_FS_LABEL]: '${var_mount_path}' -> '${HMP_EPHEMERAL_FS_LABEL["${var_mount_path}"]}'"
|
||||
continue
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user