V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 2m4s
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:
@@ -19,6 +19,21 @@ guard_sourcing
|
|||||||
# Linux ext4/btrfs | 8300 | Linux Filesystem (root, home)
|
# 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:
|
# 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.
|
# - 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="" \
|
declare var_dev="" var_part="" \
|
||||||
var_begin="" var_boot="" var_encryption="" var_end="" var_end_arg="" var_end_mib="" var_format="" var_fs="" \
|
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=()
|
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.
|
### Assign the correct GPT typecode via sgdisk if the table is GPT.
|
||||||
if [[ "${VAR_RECIPE_TABLE,,}" == "gpt" ]]; then
|
if [[ "${VAR_RECIPE_TABLE,,}" == "gpt" ]]; then
|
||||||
declare typecode="8300" # Default: Linux FS
|
|
||||||
|
|
||||||
case "${var_fs,,}" in
|
case "${var_fs,,}" in
|
||||||
|
|
||||||
fat32)
|
fat32)
|
||||||
typecode="EF00" ;; ### EFI System Partition
|
typecode="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ;; ### EFI System Partition
|
||||||
|
|
||||||
swap)
|
swap)
|
||||||
typecode="8200" ;; ### Linux SWAP
|
typecode="0657fd6d-a4ab-43c4-84e5-0933c84b4f4f" ;; ### Linux SWAP [NOT Ephemeral Devices]
|
||||||
|
|
||||||
bios)
|
bios)
|
||||||
typecode="EF02" ;; ### BIOS Boot Partition
|
typecode="21686148-6449-6e6f-744e-656564454649" ;; ### BIOS Boot Partition
|
||||||
|
|
||||||
ext4|btrfs)
|
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'."
|
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
|
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
|
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}'."
|
do_log "info" "file_only" "3200() Partition: '/dev/${var_dev}${var_part}' GPT typecode '${typecode}' set for '${var_fs}'."
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ EOF
|
|||||||
### Generate '${TARGET}/etc/crypttab' entries.
|
### Generate '${TARGET}/etc/crypttab' entries.
|
||||||
for var_key in "${!HMP_PATH_LUKSUUID[@]}"; do
|
for var_key in "${!HMP_PATH_LUKSUUID[@]}"; do
|
||||||
|
|
||||||
|
[[ "${var_key}" == "/recovery" ]] && continue
|
||||||
|
|
||||||
var_encryption_label="${HMP_PATH_ENCLABEL["${var_key}"]}"
|
var_encryption_label="${HMP_PATH_ENCLABEL["${var_key}"]}"
|
||||||
var_luks_uuid="${HMP_PATH_LUKSUUID["${var_key}"]}"
|
var_luks_uuid="${HMP_PATH_LUKSUUID["${var_key}"]}"
|
||||||
|
|
||||||
[[ "${var_key}" == "/recovery" ]] && continue
|
|
||||||
|
|
||||||
if [[ "${VAR_DROPBEAR}" == "true" ]]; then
|
if [[ "${VAR_DROPBEAR}" == "true" ]]; then
|
||||||
|
|
||||||
if [[ "${var_key}" == "/" ]]; then
|
if [[ "${var_key}" == "/" ]]; then
|
||||||
@@ -117,17 +117,16 @@ EOF
|
|||||||
for var_key in "${!HMP_EPHEMERAL_ENCLABEL[@]}"; do
|
for var_key in "${!HMP_EPHEMERAL_ENCLABEL[@]}"; do
|
||||||
|
|
||||||
var_ephemeral_enclabel="${HMP_EPHEMERAL_ENCLABEL["${var_key}"]}"
|
var_ephemeral_enclabel="${HMP_EPHEMERAL_ENCLABEL["${var_key}"]}"
|
||||||
var_host_uuid="${HMP_PATH_PARTUUID["${var_key}"]}"
|
var_host_fs_label="${HMP_PATH_PARTUUID["${var_key}"]}"
|
||||||
|
|
||||||
|
|
||||||
case "${var_key}" in
|
case "${var_key}" in
|
||||||
|
|
||||||
SWAP)
|
SWAP)
|
||||||
write_crypttab "${var_ephemeral_enclabel}" "UUID=${var_host_uuid}" "/dev/random" "plain,offset=2048,cipher=aes-xts-plain64,size=512,sector-size=4096,discard,swap"
|
write_crypttab "${var_ephemeral_enclabel}" "LABEL=${var_host_fs_label}" "/dev/random" "plain,offset=2048,cipher=aes-xts-plain64,size=512,sector-size=4096,discard,swap"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
/tmp)
|
/tmp)
|
||||||
write_crypttab "${var_ephemeral_enclabel}" "UUID=${var_host_uuid}" "/dev/random" "plain,offset=2048,cipher=aes-xts-plain64,size=512,sector-size=4096,discard,tmp=ext4"
|
write_crypttab "${var_ephemeral_enclabel}" "LABEL=${var_host_fs_label}" "/dev/random" "plain,offset=2048,cipher=aes-xts-plain64,size=512,sector-size=4096,discard,tmp=ext4"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user