V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-08-06 20:23:16 +02:00
parent 273fa46bf0
commit a179912187
10 changed files with 45 additions and 27 deletions

View File

@@ -58,7 +58,7 @@ partitioning() {
# shellcheck disable=SC2034
declare -ag ARY_FORMT_MOUNT_PATHS=() # Used in: 3240() - Only entries [/paths] for filesystem generation.
# shellcheck disable=SC2034
declare -ag ARY_FSTAB_MOUNT_PATHS=() # Used in: 4200() - Only entries [/paths] for '/etc/fstab' generation.
declare -ag ARY_FSTAB_MOUNT_PATHS=() # Used in: 4200() - Only entries [/paths] for the '/etc/fstab' generation.
# shellcheck disable=SC2034
declare -ag ARY_PATHS_SORTED=() # Used in: 3280() - All entries [/paths] in a mount ordering scheme.
# Used in: 4200() - All entries [/paths] in a mount ordering scheme.
@@ -69,7 +69,7 @@ partitioning() {
declare -a ary_devs=() ary_parts=() ary_paths_unsorted=()
declare -i i=0 var_dev_size=0 var_dev_end=0 var_multi_boot=0 var_multi_esp=0
declare -i i=0 var_dev_size=0 var_dev_end=0 var_sec_size=512
### Iterate over all devices in the recipe.
# shellcheck disable=SC2312
@@ -141,7 +141,7 @@ partitioning() {
var_mount_true=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.mount.enable" "${VAR_SETUP_PART}")
var_encryption=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.encryption.enable" "${VAR_SETUP_PART}")
### Assign the start zone of the first partition and skip the first 2 MiB as best practice.
### Assign the start zone of the first partition and skip the first 2 MiB as the best practice.
if [[ "${var_begin,,}" == "min" ]]; then
var_begin="2MiB"
fi
@@ -150,8 +150,9 @@ partitioning() {
### There is no mandatory upper limit, but for particularly critical systems (FDE, RAID-6 setups, dm-integrity, etc.),
### more generous reserves between 32 and 64 MiB are recommended.
if [[ "${var_end,,}" == "max" ]]; then
var_sec_size=$(blockdev --getpbsz "/dev/${var_dev}")
var_dev_size=$(blockdev --getsize64 "/dev/${var_dev}")
var_dev_end=$(( var_dev_size - 64 * 1024 * 1024 ))
var_dev_end=$(( var_dev_size - (64 * 1024 * 1024) ))
var_end_mib=$(( var_dev_end / 1024 / 1024 ))
var_end_arg="${var_end_mib}MiB"
else
@@ -187,7 +188,7 @@ partitioning() {
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' generated | begin: '${var_begin}' | end: '${var_end_arg}'."
### Assign the correct GPT typecode via sgdisk if table is GPT.
### Assign the correct GPT typecode via sgdisk if the table is GPT.
if [[ "${VAR_RECIPE_TABLE,,}" == "gpt" ]]; then
declare typecode="8300" # Default: Linux FS