V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -51,26 +51,26 @@ partitioning() {
|
||||
### All current data for the respective device will be deleted.
|
||||
if ! blkdiscard "/dev/${var_dev}"; then
|
||||
|
||||
do_log "warn" "file_only" "Partition table: '/dev/${var_dev}' deletion failed with: 'blkdiscard' trying 'sgdisk' fallback."
|
||||
do_log "warn" "file_only" "3200() Partition table: '/dev/${var_dev}' deletion failed with: 'blkdiscard' trying 'sgdisk' fallback."
|
||||
|
||||
if command -v sgdisk >/dev/null && sgdisk --zap-all "/dev/${var_dev}"; then
|
||||
|
||||
do_log "info" "file_only" "Partition table: '/dev/${var_dev}' wiped with 'sgdisk --zap-all'."
|
||||
do_log "info" "file_only" "3200() Partition table: '/dev/${var_dev}' wiped with 'sgdisk --zap-all'."
|
||||
|
||||
elif dd if=/dev/zero of="/dev/${var_dev}" bs=1M count=8 status=none; then
|
||||
|
||||
do_log "info" "file_only" "Partition table: '/dev/${var_dev}' overwritten with zeros."
|
||||
do_log "info" "file_only" "3200() Partition table: '/dev/${var_dev}' overwritten with zeros."
|
||||
|
||||
else
|
||||
|
||||
do_log "fatal" "file_only" "Partition table: '/dev/${var_dev}' deletion failed with: [blkdiscard, sgdisk and dd]."
|
||||
do_log "fatal" "file_only" "3200() Partition table: '/dev/${var_dev}' deletion failed with: [blkdiscard, sgdisk and dd]."
|
||||
return "${ERR_TABLE_DELETE}"
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
do_log "info" "file_only" "Partition table: '/dev/${var_dev}' discarded (blkdiscard)."
|
||||
do_log "info" "file_only" "3200() Partition table: '/dev/${var_dev}' discarded (blkdiscard)."
|
||||
|
||||
fi
|
||||
|
||||
@@ -79,16 +79,16 @@ partitioning() {
|
||||
gpt|mbr)
|
||||
if ! parted -s "/dev/${var_dev}" mklabel "${VAR_RECIPE_TABLE,,}"; then
|
||||
|
||||
do_log "fatal" "file_only" "Partition table: '/dev/${var_dev}' creation failed."
|
||||
do_log "fatal" "file_only" "3200() Partition table: '/dev/${var_dev}' creation failed."
|
||||
return "${ERR_TABLE_CREATE}"
|
||||
|
||||
fi
|
||||
|
||||
do_log "info" "file_only" "Partition table: '/dev/${var_dev}' generated: '${VAR_RECIPE_TABLE}'."
|
||||
do_log "info" "file_only" "3200() Partition table: '/dev/${var_dev}' generated: '${VAR_RECIPE_TABLE}'."
|
||||
;;
|
||||
|
||||
*)
|
||||
do_log "fatal" "file_only" "No valid partition table chosen. String was '${VAR_RECIPE_TABLE}'."
|
||||
do_log "fatal" "file_only" "3200() No valid partition table chosen. String was '${VAR_RECIPE_TABLE}'."
|
||||
return "${ERR_PARTITIONTBL}"
|
||||
;;
|
||||
|
||||
@@ -118,12 +118,12 @@ partitioning() {
|
||||
|
||||
if ! parted -s "/dev/${var_dev}" mkpart "${var_pri}" "${var_fs}" "${var_begin}" "${var_end_arg}"; then
|
||||
|
||||
do_log "fatal" "file_only" "Partition: '/dev/${var_dev}${var_part}' creation failed."
|
||||
do_log "fatal" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' creation failed."
|
||||
return "${ERR_PART_CREATE}"
|
||||
|
||||
fi
|
||||
|
||||
do_log "info" "file_only" "Partition: '/dev/${var_dev}${var_part}' generated | begin: '${var_begin}' | end: '${var_end_arg}'."
|
||||
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.
|
||||
if [[ "${VAR_RECIPE_TABLE,,}" == "gpt" ]]; then
|
||||
@@ -131,25 +131,25 @@ partitioning() {
|
||||
|
||||
case "${var_fs,,}" in
|
||||
fat32)
|
||||
typecode="EF00" ;; # EFI System Partition
|
||||
typecode="EF00" ;; ### EFI System Partition
|
||||
swap)
|
||||
typecode="8200" ;; # Linux SWAP
|
||||
typecode="8200" ;; ### Linux SWAP
|
||||
bios)
|
||||
typecode="EF02" ;; # BIOS Boot Partition
|
||||
typecode="EF02" ;; ### BIOS Boot Partition
|
||||
ext4|btrfs)
|
||||
typecode="8300" ;; # Linux native FS
|
||||
typecode="8300" ;; ### Linux native FS
|
||||
*)
|
||||
do_log "warn" "file_only" "Partition: '/dev/${var_dev}${var_part}' unknown FS type: '${var_fs}', using default GPT FS '8300'."
|
||||
do_log "warn" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' unknown FS type: '${var_fs}', using default GPT FS '8300'."
|
||||
;;
|
||||
esac
|
||||
|
||||
if sgdisk --typecode="${var_part}:${typecode}" "/dev/${var_dev}" &>/dev/null; then
|
||||
|
||||
do_log "info" "file_only" "Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' set for '${var_fs}'."
|
||||
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' set for '${var_fs}'."
|
||||
|
||||
else
|
||||
|
||||
do_log "warn" "file_only" "Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' failed to set."
|
||||
do_log "warn" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' failed to set."
|
||||
|
||||
fi
|
||||
|
||||
@@ -162,13 +162,13 @@ partitioning() {
|
||||
|
||||
gpt:uefi|mbr:uefi)
|
||||
|
||||
do_log "info" "file_only" "Partition: '/dev/${var_dev}${var_part}' | [${VAR_RECIPE_TABLE^^}:UEFI] no bootable flag required."
|
||||
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' | [${VAR_RECIPE_TABLE^^}:UEFI] no bootable flag required."
|
||||
;;
|
||||
|
||||
gpt:bios|mbr:bios)
|
||||
|
||||
parted -s "/dev/${var_dev}" set "${var_part}" boot on
|
||||
do_log "info" "file_only" "Partition: '/dev/${var_dev}${var_part}' | [${VAR_RECIPE_TABLE^^}:BIOS] marked as bootable."
|
||||
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' | [${VAR_RECIPE_TABLE^^}:BIOS] marked as bootable."
|
||||
;;
|
||||
|
||||
esac
|
||||
@@ -183,7 +183,7 @@ partitioning() {
|
||||
done
|
||||
|
||||
if [[ -z "${var_uuid}" ]]; then
|
||||
do_log "fatal" "file_only" "Partition: '/dev/${var_dev}${var_part}' could not read PARTUUID."
|
||||
do_log "fatal" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' could not read PARTUUID."
|
||||
return "${ERR_PART_READ}"
|
||||
else
|
||||
HMP_PATH_PARTUUID["PARTUUID_${var_mount_path}"]="${var_uuid}"
|
||||
|
||||
Reference in New Issue
Block a user