V8.13.392.2025.11.07
Some checks failed
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Successful in 1m5s
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m15s
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Failing after 1m23s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-11-07 17:12:52 +01:00
parent 4e5bc1aa84
commit 051361abbb
79 changed files with 359 additions and 160 deletions

View File

@@ -10,42 +10,50 @@
# SPDX-PackageName: CISS.debian.live.builder
# SPDX-Security-Contact: security@coresecret.eu
guard_sourcing
guard_sourcing || return "${ERR_GUARD_SRCE}"
#######################################
# Print Error Message for Trap on 'ERR' in ${ERROR_LOG}
# Globals:
# BASHOPTS
# EPOCHREALTIME
# ERRCMMD
# ERRCODE
# ERRFUNC
# ERRLINE
# ERRSCRT
# EUID
# LOG_DEBUG
# LOG_ERROR
# LOG_VAR
# SECONDS
# SHELLOPTS
# UID
# VAR_ARG_SANITIZED
# VAR_BASH_VER
# VAR_DS_VER
# VAR_EARLY_DEBUG
# VAR_GIT_REL
# VAR_LB_VER
# VAR_PARAM_COUNT
# VAR_PARAM_STRNG
# VAR_SYSTEM
# VAR_VERSION
# VAR_VER_BASH
# VAR_VER_DS
# VAR_VER_LB
# Arguments:
# None
#######################################
print_file_err() {
{
printf "❌ CISS.debian.live.builder Script failed. \n"
printf "❌ Trap on 'ERR' : CISS.debian.live.builder Script failed. \n"
printf "❌ Git Commit : %s \n" "${VAR_GIT_REL}"
printf "❌ Version : %s \n" "${VAR_VERSION}"
printf "❌ Epoch : %s \n" "${EPOCHREALTIME}"
printf "❌ Bash : %s \n" "${VAR_VER_BASH}"
printf "❌ Live-Build : %s \n" "${VAR_VER_LB}"
printf "❌ Debootstrap : %s \n" "${VAR_VER_DS}"
printf "❌ UID : %s \n" "${UID}"
printf "❌ EUID : %s \n" "${EUID}"
printf "❌ Hostsystem : %s \n" "${VAR_SYSTEM}"
printf "❌ Bash : %s \n" "${VAR_BASH_VER}"
printf "❌ Live-Build : %s \n" "${VAR_LB_VER}"
printf "❌ Debootstrap : %s \n" "${VAR_DS_VER}"
printf "❌ Error : %s \n" "${ERRCODE}"
printf "❌ Line : %s \n" "${ERRLINE}"
printf "❌ Script : %s \n" "${ERRSCRT}"
@@ -55,6 +63,8 @@ print_file_err() {
printf "❌ Arguments Counter : %s \n" "${VAR_PARAM_COUNT}"
printf "❌ Arguments Original : %s \n" "${VAR_PARAM_STRNG}"
printf "❌ Arguments Sanitized : %s \n" "${VAR_ARG_SANITIZED}"
printf "❌ Bashopts : %s \n" "${BASHOPTS}"
printf "❌ Shellopts : %s \n" "${SHELLOPTS}"
if "${VAR_EARLY_DEBUG}"; then
@@ -72,7 +82,7 @@ print_file_err() {
readonly -f print_file_err
#######################################
# Print Error Message for Trap on 'ERR' on Terminal
# Print Error Message for Trap on 'ERR' on Terminal.
# Globals:
# ERRCMMD
# ERRCODE
@@ -84,26 +94,29 @@ readonly -f print_file_err
# LOG_VAR
# SECONDS
# VAR_ARG_SANITIZED
# VAR_BASH_VER
# VAR_DS_VER
# VAR_EARLY_DEBUG
# VAR_GIT_REL
# VAR_LB_VER
# VAR_PARAM_COUNT
# VAR_PARAM_STRNG
# VAR_SYSTEM
# VAR_VERSION
# VAR_VER_BASH
# VAR_VER_DS
# VAR_VER_LB
# Arguments:
# None
#######################################
print_scr_err() {
printf "\e[91m❌ CISS.debian.live.builder Script failed. \e[0m\n" >&2
printf "\e[91m❌ Trap on 'ERR' : CISS.debian.live.builder Script failed. \e[0m\n" >&2
printf "\e[91m❌ Git Commit : %s \e[0m\n" "${VAR_GIT_REL}" >&2
printf "\e[91m❌ Version : %s \e[0m\n" "${VAR_VERSION}" >&2
printf "\e[91m❌ Epoch : %s \e[0m\n" "${EPOCHREALTIME}" >&2
printf "\e[91m❌ Bash : %s \e[0m\n" "${VAR_VER_BASH}" >&2
printf "\e[91m❌ Live-Build : %s \e[0m\n" "${VAR_VER_LB}" >&2
printf "\e[91m❌ Debootstrap : %s \e[0m\n" "${VAR_VER_DS}" >&2
printf "\e[91m❌ UID : %s \e[0m\n" "${UID}" >&2
printf "\e[91m❌ EUID : %s \e[0m\n" "${EUID}" >&2
printf "\e[91m❌ Hostsystem : %s \e[0m\n" "${VAR_SYSTEM}" >&2
printf "\e[91m❌ Bash : %s \e[0m\n" "${VAR_BASH_VER}" >&2
printf "\e[91m❌ Live-Build : %s \e[0m\n" "${VAR_LB_VER}" >&2
printf "\e[91m❌ Debootstrap : %s \e[0m\n" "${VAR_DS_VER}" >&2
printf "\e[91m❌ Error : %s \e[0m\n" "${ERRCODE}" >&2
printf "\e[91m❌ Line : %s \e[0m\n" "${ERRLINE}" >&2
printf "\e[91m❌ Script : %s \e[0m\n" "${ERRSCRT}" >&2
@@ -113,6 +126,8 @@ print_scr_err() {
printf "\e[91m❌ Arguments Counter : %s \e[0m\n" "${VAR_PARAM_COUNT}" >&2
printf "\e[91m❌ Arguments Original : %s \e[0m\n" "${VAR_PARAM_STRNG}" >&2
printf "\e[91m❌ Arguments Sanitized : %s \e[0m\n" "${VAR_ARG_SANITIZED}" >&2
printf "\e[91m❌ Bashopts : %s \e[0m\n" "${BASHOPTS}" >&2
printf "\e[91m❌ Shellopts : %s \e[0m\n" "${SHELLOPTS}" >&2
printf "\e[91m❌ Error Log saved at : %s \e[0m\n" "${LOG_ERROR}" >&2
printf "\e[91m❌ batcat --pager='less -r' %s \e[0m\n" "${LOG_ERROR}" >&2
@@ -124,7 +139,8 @@ print_scr_err() {
fi
printf "\n"
print_stacktrace
printf "%b" "${NL}"
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
@@ -216,4 +232,49 @@ dump_user_vars() {
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f dump_user_vars
#######################################
# Print function() stacktrace.
# Globals:
# BASH_LINENO
# BASH_SOURCE
# FUNCNAME
# LINENO
# LOG_ERROR
# NL
# RED
# RES
# Arguments:
# None
#######################################
print_stacktrace() {
declare -i i=0
printf "%b❌ %b%b" "${RED}" "${RES}" "${NL}"
printf "❌ %b" "${NL}" >> "${LOG_ERROR}"
printf "%b❌ Raw Stacktrace : %b%b" "${RED}" "${RES}" "${NL}"
printf "❌ Raw Stacktrace : %b" "${NL}" >> "${LOG_ERROR}"
for ((i=0; i<${#FUNCNAME[@]}-1; i++)); do
if (( i == 0 )); then
printf "%b❌ ➥ %s() at: [%s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${LINENO:-?}" "${RES}" "${NL}"
printf "❌ ➥ %s() at: [%s:%s] %b" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${LINENO:-?}" "${NL}" >> "${LOG_ERROR}"
else
printf "%b❌ ➥ %s() at: [%s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${BASH_LINENO[i-1]:-?}" "${RES}" "${NL}"
printf "❌ ➥ %s() at: [%s:%s] %b" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${BASH_LINENO[i-1]:-?}" "${NL}" >> "${LOG_ERROR}"
fi
done
printf "%b" "${NL}"
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f print_stacktrace
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh