Files
CISS.debian.live.builder/var/global.var.sh
2025-05-30 00:28:39 +02:00

84 lines
3.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
# SPDX-FileCopyrightText: 20242025; 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.live.builder
# SPDX-Security-Contact: security@coresecret.eu
# shellcheck disable=SC2155
declare -gr SYSTEM_VAR="$(uname -a)"
# shellcheck disable=SC2155
declare -gr ISO8601="$(date +%Y_%m_%d_%H_%M_%S)"
# shellcheck disable=SC2155
declare -gr KERNEL_INF="$(mktemp)"
# shellcheck disable=SC2155
declare -gr KERNEL_TMP="$(mktemp)"
# shellcheck disable=SC2155
declare -gr KERNEL_SRT="$(mktemp)"
# shellcheck disable=SC2155
declare -gr notes="$(mktemp)"
if "${EARLY_DEBUG}"; then
declare -gr VAR_LOG="/tmp/ciss_live_builder_$$_var.log"
touch "${VAR_LOG}" && chmod 0600 "${VAR_LOG}"
fi
declare -gr ERROR_LOG="/tmp/ciss_live_builder_$$_error.log"
touch "${ERROR_LOG}" && chmod 0600 "${ERROR_LOG}"
declare -g HANDLER_ARCHITECTURE=""
declare -g HANDLER_BUILD_DIR=""
declare -g HANDLER_CDI=""
declare -g HANDLER_DHCP=""
declare -g HANDLER_SPLASH=""
declare -g HANDLER_SSHPORT=""
declare -g HANDLER_SSHPUBKEY=""
declare -g handler_success=""
declare -g HANDLER_PRIORITY=""
declare -g handler_netcup_ipv6=""
declare -g handler_netcup_ipv6_array=""
declare -g HASHED_PWD=""
declare -g HANDLER_STA=""
declare -g REIONICE_CLASS=""
declare -g REIONICE_PRIORITY=""
declare -gr CHROOT_DIR="chroot"
declare -gr PACKAGES_FILE="chroot.packages.live"
declare -ga handler_jumphost=()
declare -ga handler_jumphost_unique=()
### Definition of error codes
declare -gir ERR_UNCRITICAL=127
declare -gir ERR_NOT_USER_0=128 # Not running as root
declare -gir ERR_FLOCK_WRTG=129 # Cannot open lockfile for writing
declare -gir ERR_FLOCK_COLL=130 # Script is already running
declare -gir ERR_SPLASH_PNG=200 # --change-splash MUST be 'club' or 'hexagon'
declare -gir ERR_CONTROL_CT=201 # --control MUST be an integer between '1' and '65535'
declare -gir ERR_RENICE_PRI=202 # --renice-priority MUST an integer between '-19' and '19'
declare -gir ERR_REIONICE_P=203 # --reionice-priority no values provided.
declare -gir ERR_REIO_P_VAL=204 # --reionice-priority PRIORITY MUST be an integer between '0' and '7'
declare -gir ERR_REIO_C_VAL=205 # --reionice-priority CLASS MUST be an integer between '1' and '3'
declare -gir ERR_MISS_PWD_P=206 # --root-password-file missing password file path argument
declare -gir ERR_MISS_PWD_F=207 # --root-password-file password file does not exist
declare -gir ERR_OWNS_PWD_F=208 # --root-password-file failed to set owner root:root on the PWD file
declare -gir ERR_RGHT_PWD_F=209 # --root-password-file failed to set permissions 0400 on the PWD file
declare -gir ERR_PASS_LENGH=210 # --root-password-file password MUST be between 20 and 64 characters
declare -gir ERR_PASS_PLICY=211 # --root-password-file password MUST NOT contain double quotes
declare -gir ERR__SSH__PORT=212 # --ssh-port MUST be an integer between '1' and '65535'
declare -gir ERR_ARG_MSMTCH=213 # Wrong Number of optional Arguments provided
declare -gir ERR_INVLD_CHAR=253 # Invalid Character
declare -gir ERR_UNBOUNDVAR=254 # Unbound Variable
declare -gir ERR_UNSPPTBASH=255 # Unsupported Bash
### Definition of error trap vars
declare -g errcode="" # = $? = $1 = ERRCODE
declare -g errscrt="" # = ${BASH_SOURCE[0]} = $2 = ERRSCRT
declare -g errline="" # = ${LINENO} = $3 = ERRLINE
declare -g errfunc="" # = ${FUNCNAME[0]:-main} = $4 = ERRFUNC
declare -g errcmmd="" # = ${$BASH_COMMAND} = $5 = ERRCMMD
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh