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

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-08-27 18:46:48 +02:00
parent 672edf1502
commit e63f5415c0
2 changed files with 48 additions and 12 deletions

View File

@@ -19,6 +19,21 @@ guard_sourcing
# Linux ext4/btrfs | 8300 | Linux Filesystem (root, home)
#######################################
#######################################
# https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
# EFI System Partition, FAT32 | c12a7328-f81f-11d2-ba4b-00a0c93ec93b
# BIOS Boot Partition GRUB | 21686148-6449-6e6f-744e-656564454649
# Extended Boot Loader Partition | bc13c2ff-59e6-4262-a352-b275fd6f7172
# Linux Generic FS (ext4/btrfs) | 0fc63daf-8483-4772-8e79-3d69d8477de4
# Swap | 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
# / Partition (amd64/x86_64) | 4f68bce3-e8cd-4db1-96e7-fbcaf984b709
# /home | 933ac7e1-2eb4-4f13-b844-0e14e2aef915
# /srv | 3b8f8425-20e0-4f3b-907f-1a25a76f98e8
# /usr Partition (amd64/x86_64) | 8484680c-9521-48c6-9c11-b0720656f69e
# /var | 4d21b016-b534-45c2-a9fb-5c16e091fd2d
# /var/tmp | 7ec6f557-3bc5-4aca-b293-16ef5df639d1
#######################################
#######################################
# Function that generates each partition on each device according to the chosen recipe string and collects information about:
# - the mount path and whether to mount or not and in which order mounting must be done.
@@ -65,7 +80,8 @@ partitioning() {
declare var_dev="" var_part="" \
var_begin="" var_boot="" var_encryption="" var_end="" var_end_arg="" var_end_mib="" var_format="" var_fs="" \
var_label="" var_mount_path="" var_mount_true="" var_pri="" var_uuid=""
var_label="" var_mount_path="" var_mount_true="" var_pri="" var_uuid="" \
typecode="0fc63daf-8483-4772-8e79-3d69d8477de4"
declare -a ary_devs=() ary_parts=() ary_paths_unsorted=()
@@ -192,21 +208,20 @@ partitioning() {
### Assign the correct GPT typecode via sgdisk if the table is GPT.
if [[ "${VAR_RECIPE_TABLE,,}" == "gpt" ]]; then
declare typecode="8300" # Default: Linux FS
case "${var_fs,,}" in
fat32)
typecode="EF00" ;; ### EFI System Partition
typecode="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ;; ### EFI System Partition
swap)
typecode="8200" ;; ### Linux SWAP
typecode="0657fd6d-a4ab-43c4-84e5-0933c84b4f4f" ;; ### Linux SWAP [NOT Ephemeral Devices]
bios)
typecode="EF02" ;; ### BIOS Boot Partition
typecode="21686148-6449-6e6f-744e-656564454649" ;; ### BIOS Boot Partition
ext4|btrfs)
typecode="8300" ;; ### Linux native FS
typecode="0fc63daf-8483-4772-8e79-3d69d8477de4" ;; ### Linux native FS
*)
do_log "warn" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' unknown FS type: '${var_fs}', using default GPT FS '8300'."
@@ -214,6 +229,28 @@ partitioning() {
esac
case "${var_mount_path,,}" in
"/")
typecode="4f68bce3-e8cd-4db1-96e7-fbcaf984b709" ;; ### / Partition (amd64/x86_64)
"/home")
typecode="933ac7e1-2eb4-4f13-b844-0e14e2aef915" ;; ### /home Partition
"/srv")
typecode="3b8f8425-20e0-4f3b-907f-1a25a76f98e8" ;; ### /srv Partition
"/usr")
typecode="8484680c-9521-48c6-9c11-b0720656f69e" ;; ### /usr Partition (amd64/x86_64)
"/var")
typecode="4d21b016-b534-45c2-a9fb-5c16e091fd2d" ;; ### /var Partition
"/var/tmp")
typecode="7ec6f557-3bc5-4aca-b293-16ef5df639d1" ;; ### /var/tmp Partition
esac
if sgdisk --typecode="${var_part}:${typecode}" "/dev/${var_dev}" &>/dev/null; then
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' set for '${var_fs}'."