V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m58s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-10-21 22:21:06 +01:00
parent 76e50cd59e
commit 9d0b38ba93
2 changed files with 26 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ func_debootstrap() {
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/hooks"
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/keys"
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/log"
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/log/pre-env"
mv -T "${var_target}/debootstrap" "${var_target}/root/.ciss/cdi/debootstrap"

View File

@@ -12,6 +12,21 @@
guard_sourcing
#######################################
# Copy pre-debootstrap-environment logs into target system.
# Globals:
# DIR_LOG
# TARGET
# Arguments:
# None
#######################################
copy_logs() {
cp -af "${DIR_LOG}"/* "${TARGET}/root/.ciss/cdi/log/pre-env"
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f copy_logs
#######################################
# Trap function to be called on 'EXIT'.
# Handles also Errors like unbound variables, as they are not caught by Trap on 'ERR'.
@@ -43,11 +58,15 @@ trap_exit() {
fi
if (( var_exit_code == 0 )); then
copy_logs
trap_exit_zero "${var_exit_code}"
else
trap_exit_non_zero "${var_exit_code}" "${var_exit_scrt}" "${var_exit_line}" "${var_exit_func}" "${var_exit_cmmd}"
fi
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f trap_exit
#######################################
# Trap on Exit Handler for '0' Exit-Code.
@@ -104,6 +123,9 @@ trap_exit_zero() {
fi
exit "${var_trap_exit_zero_code}"
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f trap_exit_zero
#######################################
# Trap on Exit Handler for 'Non-0' Exit-Code.
@@ -214,4 +236,7 @@ trap_exit_non_zero() {
exit "${var_code}"
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f trap_exit_non_zero
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh