V8.00.000.2025.06.17
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:
2025-07-25 20:23:29 +02:00
parent 91640426b1
commit 0612406a3c
3 changed files with 70 additions and 6 deletions

View File

@@ -18,6 +18,12 @@ recipe:
# f=fixed size || a=automatic size (yet not supported) # f=fixed size || a=automatic size (yet not supported)
# x256=size of device in GiB # x256=size of device in GiB
# r=rescue partition || n=no rescue partition # r=rescue partition || n=no rescue partition
#######################################
# EFI System Partition | EF00 | UEFI Bootloader (ESP, FAT32) | filesystem.version: fat32
# BIOS Boot Partition | EF02 | BIOS Bootloader area (GRUB) | filesystem.version: BIOS
# Linux SWAP | 8200 | Linux Swap | filesystem.version: SWAP
# Linux ext4/btrfs | 8300 | Linux Filesystem (root, home)| filesystem.version: ext4 || btrfs
#######################################
active: true # Choose this recipe. active: true # Choose this recipe.
control: control:
description: "CISS 2025 - GPT - BTRFS - Ephemeral - non RAID - 256GiB - rescue" description: "CISS 2025 - GPT - BTRFS - Ephemeral - non RAID - 256GiB - rescue"
@@ -34,7 +40,7 @@ recipe:
table: "gpt" # MUST be "gpt" for "UEFI" || "msdos": table: "gpt" # MUST be "gpt" for "UEFI" || "msdos":
syntax: true # This is set to "false" by default, otherwise if the recipe is tested by the authors to "true". syntax: true # This is set to "false" by default, otherwise if the recipe is tested by the authors to "true".
### Version of the specific recipe. ### Version of the specific recipe.
version: "1.1.2" version: "1.1.3"
dev: dev:
sda: sda:
1: 1:
@@ -276,8 +282,8 @@ recipe:
path: "/home" path: "/home"
primary: primary primary: primary
8: 8:
begin: "42GiB" begin: "84GiB"
end: "84GiB" end: "126GiB"
bootable: false bootable: false
encryption: encryption:
enable: true enable: true

View File

@@ -168,10 +168,15 @@ yaml_reader
### PARTITIONING ### PARTITIONING
echo "MAIN PROGRAM SEQUENCE: partitioning()" echo "MAIN PROGRAM SEQUENCE: partitioning()"
partitioning partitioning
echo "MAIN PROGRAM SEQUENCE: partition_encryption()"
partition_encryption partition_encryption
echo "MAIN PROGRAM SEQUENCE: partition_formatting()"
partition_formatting partition_formatting
echo "MAIN PROGRAM SEQUENCE: setup_filesystem()"
setup_filesystem setup_filesystem
echo "MAIN PROGRAM SEQUENCE: mount_partition()"
mount_partition mount_partition
echo "MAIN PROGRAM SEQUENCE: uuid_logger()"
uuid_logger uuid_logger
### DEBOOTSTRAP ### DEBOOTSTRAP

View File

@@ -12,6 +12,13 @@
guard_sourcing guard_sourcing
#######################################
# EFI System Partition | EF00 | UEFI Bootloader (ESP, FAT32)
# BIOS Boot Partition | EF02 | BIOS Bootloader area (GRUB)
# Linux SWAP | 8200 | Linux Swap
# Linux ext4/btrfs | 8300 | Linux Filesystem (root, home)
#######################################
####################################### #######################################
# Function that generates each partition on each device according to the chosen recipe string. # Function that generates each partition on each device according to the chosen recipe string.
# Globals: # Globals:
@@ -100,7 +107,7 @@ partitioning() {
var_pri=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.primary" "${VAR_SETUP_PART}") var_pri=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.primary" "${VAR_SETUP_PART}")
var_mount_path=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.mount.path" "${VAR_SETUP_PART}") var_mount_path=$(yq_val ".recipe.${VAR_RECIPE_STRING}.dev.${var_dev}.${var_part}.mount.path" "${VAR_SETUP_PART}")
### Generate partition. ### Assign the landing zone of each partition.
if [[ "${var_end}" == "-1" ]]; then if [[ "${var_end}" == "-1" ]]; then
var_end_arg="100%" var_end_arg="100%"
else else
@@ -108,16 +115,62 @@ partitioning() {
fi fi
if ! parted -s "/dev/${var_dev}" mkpart "${var_pri}" "${var_fs}" "${var_begin}" "${var_end_arg}"; then 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" "Partition: '/dev/${var_dev}${var_part}' creation failed."
return "${ERR_PART_CREATE}" return "${ERR_PART_CREATE}"
fi 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" "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
declare typecode="8300" # Default: Linux FS
case "${var_fs,,}" in
fat32)
typecode="EF00" ;; # EFI System Partition
swap)
typecode="8200" ;; # Linux SWAP
bios)
typecode="EF02" ;; # BIOS Boot Partition
ext4|btrfs)
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'."
;;
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}'."
else
do_log "warn" "file_only" "Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' failed to set."
fi
fi
### Set the bootable flag if necessary. ### Set the bootable flag if necessary.
if [[ "${var_boot,,}" == "true" ]]; then if [[ "${var_boot,,}" == "true" ]]; then
parted -s "/dev/${var_dev}" set "${var_part}" boot on
do_log "info" "file_only" "Partition: '/dev/${var_dev}${var_part}' marked as bootable." case "${VAR_RECIPE_TABLE,,}:${VAR_FIRMWARE_TYPE,,}" in
gpt:uefi|mbr:uefi)
do_log "info" "file_only" "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."
;;
esac
fi fi
### Store PARTUUID of the partition. ### Store PARTUUID of the partition.