Files
CISS.debian.installer/var/global.var.sh
Marc S. Weidner fa70e33161
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m24s
V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
2025-06-25 18:09:24 +02:00

126 lines
4.8 KiB
Bash

#!/bin/bash
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
# SPDX-PackageName: CISS.debian.installer
# SPDX-Security-Contact: security@coresecret.eu
### Definition of MUST set global Variables
# shellcheck disable=SC2155
declare -grx VAR_KERNEL_INF="$(mktemp)"
declare -grx VAR_KERNEL_TMP="$(mktemp)"
declare -grx VAR_KERNEL_SRT="$(mktemp)"
declare -grx VAR_NOTES="$(mktemp)"
declare -grx LOG_ERROR="/tmp/ciss_debian_installer_$$_error.log"
declare -grx VAR_SETUP_CONF="preseed.yaml"
declare -grx VAR_SETUP_PART="partitioning.yaml"
declare -grx VAR_SETUP_FILE="${0##*/}" # 'setup.sh'
declare -grx VAR_SETUP_PATH="$(cd "$(dirname "${0}")" && pwd)" # '/opt/git/CISS.debian.installer'
declare -grx VAR_SETUP_FULL="$(cd "$(dirname "${0}")" && pwd)/${0##*/}" # '/opt/git/CISS.debian.installer/setup.sh'
### Initialize variables of different directories
declare -grx DIR_BAK="/tmp/.ciss/backup"
declare -grx DIR_CNF="${VAR_SETUP_PATH}/.preseed"
declare -grx DIR_INS="${VAR_SETUP_PATH}"
declare -grx DIR_LOG="/tmp/.ciss/log"
declare -grx DIR_TMP="/tmp/.ciss/tmp"
### Initialize variables for logging
declare -grx LOG_ERR="${DIR_LOG}/ciss_debian_installer_$$_error.log"
declare -grx LOG_INS="${DIR_LOG}/ciss_debian_installer_$$_install.log"
declare -grx LOG_NIC="${DIR_LOG}/ciss_debian_installer_$$_nic.log"
### Initialize variable of imported and cleaned 'YAML' -> 'BASH-variable'-file.
declare -grx VAR_PRESEED="${DIR_TMP}/combined.var"
### Base mount paths for debootstrap.
declare -grx TARGET="/target"
declare -grx RECOVERY="/recovery"
### Default log level.
declare -gx DEFAULT_LOG_LEVEL="info"
### 2040_grub_helper.sh:
### Variable to finish GRUB CMDLINE strings.
declare -grx VAR_H='"'
### 2050_yaml_parser.sh:
### Indexed Arrays for 'Debian Packages' to install and 'NTPSec Server' to use.
declare -agx ARY_PACKAGES=()
declare -agx ARY_NTPSRVR=()
### 2051_yaml_reader.sh:
### Variable for highest device count e.g., /dev/sdf = "f"
declare -gx VAR_RECIPE_DEV_COUNTER=""
### Variable for firmware ("UEFI" || "BIOS")
declare -gx VAR_RECIPE_FIRMWARE=""
### Variable for active recipe (e.g., "gben0afx256")
declare -gx VAR_RECIPE_STRING=""
### Variable partition table ("gpt" || "mbr")
declare -gx VAR_RECIPE_TABLE=""
### Assoziative Array (HashMap) for devices and accompanying partitions
declare -Ag HMP_RECIPE_DEV_PARTITIONS
### 3200_partitioning.sh
### Assoziative Array (HashMap) to store UUIDs for each partition
### HMP_UUID_PARTITION["UUID_${var_dev}${var_part}"]="${var_uuid}"
declare -Ag HMP_UUID_PARTITION
### 3220_partition_encryption.sh
### Assoziative Array (HashMap) to store Ephemeral Device for each Mount Path
### HMP_EPHEMERAL_DEV["${var_mount_path}"]="/dev/${var_dev}${var_part}"
declare -Ag HMP_EPHEMERAL_DEV
### Assoziative Array (HashMap) to store Ephemeral Device Encryption Label for each Mount Path
### HMP_EPHEMERAL_ENCLABEL["${var_mount_path}"]="${var_encryption_label}"
declare -Ag HMP_EPHEMERAL_ENCLABEL
### Assoziative Array (HashMap) to store UUID for each Encryption Label
### HMP_ENCRYPTIONLABEL_UUID["${var_encryption_label}"]="${var_uuid}"
declare -Ag HMP_ENCRYPTIONLABEL_UUID
### Assoziative Array (HashMap) to store Encryption Label for each Mount Path
### HMP_MOUNTPATH_ENCRYPTIONLABEL["${var_mount_path}"]="${var_encryption_label}"
declare -Ag HMP_MOUNTPATH_ENCRYPTIONLABEL
### TODO
# [3_5_1_functions_installation_partition_encryption()] Create a hashmap to store the device path for each ephemeral partition
# MAP_EPHEMERAL_DEV["${MOUNT_PATH}"]="/dev/${DEV}${PARTITION}"
declare -g -A MAP_EPHEMERAL_DEV=()
# [3_5_1_functions_installation_partition_encryption()] Create a hashmap to store the encryption label for each ephemeral partition
# MAP_EPHEMERAL_ENCLABEL["${MOUNT_PATH}"]="${ENCRYPTION_LABEL}"
declare -g -A MAP_EPHEMERAL_ENCLABEL=()
# [3_5_1_functions_installation_partition_encryption()] Create a hashmap to store UUIDs for each encrypted partition
# MAP_UUID_CRYPT["${ENCRYPTION_LABEL}"]="${UUID}"
declare -g -A MAP_UUID_CRYPT=()
# [3_5_1_functions_installation_partition_encryption()] Create a hashmap to store the device path for each encrypted partition
# MAP_PATH_CRYPT["${MOUNT_PATH}"]="${ENCRYPTION_LABEL}"
declare -g -A MAP_PATH_CRYPT=()
# [3_6_0_functions_installation_setup_filesystem()] Create a hashmap to store the mount paths of each partition
declare -g -A MAP_MOUNTPATH_DEV=()
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh