V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 50s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 50s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -60,23 +60,43 @@
|
|||||||
. ./var/early.var.sh
|
. ./var/early.var.sh
|
||||||
. ./lib/0010_guard_sourcing.sh
|
. ./lib/0010_guard_sourcing.sh
|
||||||
|
|
||||||
### CHECK FOR CONTACT, HELP, AND VERSION STRING
|
### CHECK FOR CONTACT, HELP, AND VERSION STRING.
|
||||||
for arg in "$@"; do case "${arg,,}" in -c|--contact) . ./lib/0001_contact.sh; contact; exit 0;; esac; done
|
for arg in "$@"; do case "${arg,,}" in -c|--contact) . ./lib/0001_contact.sh; contact; exit 0;; esac; done
|
||||||
for arg in "$@"; do case "${arg,,}" in -h|--help) . ./lib/0000_usage.sh; usage; exit 0;; esac; done
|
for arg in "$@"; do case "${arg,,}" in -h|--help) . ./lib/0000_usage.sh; usage; exit 0;; esac; done
|
||||||
for arg in "$@"; do case "${arg,,}" in -v|--version) . ./lib/0002_version.sh; version; exit 0;; esac; done
|
for arg in "$@"; do case "${arg,,}" in -v|--version) . ./lib/0002_version.sh; version; exit 0;; esac; done
|
||||||
|
|
||||||
# TODO: Check ok.
|
# TODO: Check till line #68 ok.
|
||||||
|
|
||||||
### PRE SCAN FOR DEBUG MODE
|
|
||||||
. ./meta_loader_debug.sh
|
|
||||||
pre_scan_debug "$@"
|
|
||||||
|
|
||||||
### SOURCING BASH OPTIONS
|
|
||||||
. ./var/bash.var.sh
|
|
||||||
umask 0022
|
|
||||||
|
|
||||||
### ALL CHECKS DONE. READY TO START THE SCRIPT.
|
### ALL CHECKS DONE. READY TO START THE SCRIPT.
|
||||||
declare -grx VAR_SETUP="true"
|
declare -grx VAR_SETUP="true"
|
||||||
|
umask 0022
|
||||||
|
|
||||||
|
### SOURCING FUNCTIONS, LIBRARIES, VARIABLES.
|
||||||
|
if [[ "${VAR_SETUP}" == "true" ]]; then
|
||||||
|
### SOURCING VARIABLES
|
||||||
|
. ./meta_loader_var.sh
|
||||||
|
### SOURCING FUNCTIONS
|
||||||
|
. ./meta_loader_func.sh
|
||||||
|
### SOURCING LIBRARIES
|
||||||
|
. ./meta_loader_lib.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
### PREPARING DIRECTORIES AND FILES
|
||||||
|
gen_dir_files
|
||||||
|
|
||||||
|
### ADVISORY LOCK
|
||||||
|
exec 127>/var/lock/ciss_debian_installer.lock || {
|
||||||
|
printf "%s❌ Cannot open lockfile for writing! Bye... %s%s" "${RED}" "${RES}" "${NL}" >&2
|
||||||
|
exit "${ERR_FLOCK_PROTECTED}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! flock -x -n 127; then
|
||||||
|
printf "%s❌ Another instance is running! Bye...%s%s" "${RED}" "${RES}" "${NL}" >&2
|
||||||
|
exit "${ERR_FLOCK_COLLISION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
### PRE SCAN FOR DEBUG MODE
|
||||||
|
pre_scan_debug "$@"
|
||||||
|
|
||||||
### CHECK FOR AUTO INSTALL MODE
|
### CHECK FOR AUTO INSTALL MODE
|
||||||
for arg in "$@"; do case "${arg,,}" in -a|--autoinstall) declare -gx VAR_AUTO_INSTALL="true";; esac; done; unset arg
|
for arg in "$@"; do case "${arg,,}" in -a|--autoinstall) declare -gx VAR_AUTO_INSTALL="true";; esac; done; unset arg
|
||||||
@@ -87,37 +107,11 @@ for arg in "$@"; do case "${arg,,}" in -a|--autoinstall) declare -gx VAR_AUTO_IN
|
|||||||
check_pkgs
|
check_pkgs
|
||||||
check_git
|
check_git
|
||||||
|
|
||||||
### ADVISORY LOCK
|
|
||||||
exec 127>/var/lock/ciss_debian_installer.lock || {
|
|
||||||
. ./meta_loader_early.sh
|
|
||||||
printf "%s❌ Cannot open lockfile for writing! Bye... %s%s" "${RED}" "${RES}" "${NL}" >&2
|
|
||||||
exit "${ERR_FLOCK_PROTECTED}"
|
|
||||||
}
|
|
||||||
|
|
||||||
if ! flock -x -n 127; then
|
|
||||||
. ./meta_loader_early.sh
|
|
||||||
printf "%s❌ Another instance is running! Bye...%s%s" "${RED}" "${RES}" "${NL}" >&2
|
|
||||||
exit "${ERR_FLOCK_COLLISION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### SOURCING FUNCTIONS, LIBRARIES, VARIABLES
|
|
||||||
if [[ "${VAR_SETUP}" == "true" ]]; then
|
|
||||||
### SOURCING FUNCTIONS
|
|
||||||
. ./meta_loader_func.sh
|
|
||||||
### SOURCING LIBRARIES
|
|
||||||
. ./meta_loader_lib.sh
|
|
||||||
### SOURCING VARIABLES
|
|
||||||
. ./meta_loader_var.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
### ACTIVATING TRAPS
|
### ACTIVATING TRAPS
|
||||||
trap 'trap_exit "$?"' EXIT
|
trap 'trap_exit "$?"' EXIT
|
||||||
trap 'trap_int' INT
|
trap 'trap_int' INT
|
||||||
trap 'trap_err "$?" "${BASH_SOURCE[0]}" "${LINENO}" "${FUNCNAME[0]:-main}" "${BASH_COMMAND}"' ERR
|
trap 'trap_err "$?" "${BASH_SOURCE[0]}" "${LINENO}" "${FUNCNAME[0]:-main}" "${BASH_COMMAND}"' ERR
|
||||||
|
|
||||||
### PREPARING DIRECTORIES AND FILES
|
|
||||||
gen_dir_files
|
|
||||||
|
|
||||||
### INTERACTIVE MODE NOTES AND KERNEL SELECTION
|
### INTERACTIVE MODE NOTES AND KERNEL SELECTION
|
||||||
# TODO: Update 0110_check_kernel.sh & sourcing
|
# TODO: Update 0110_check_kernel.sh & sourcing
|
||||||
# TODO: Update 0120_check_provider.sh & sourcing
|
# TODO: Update 0120_check_provider.sh & sourcing
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
# Generic safe wrapper for external commands.
|
# Generic safe wrapper for external commands.
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $*: full command (array, quoted!)
|
# *: full command (array, quoted!)
|
||||||
# $2: ERR_CONST on failure
|
# 2: ERR_CONST on failure
|
||||||
#######################################
|
#######################################
|
||||||
safe_exec() {
|
safe_exec() {
|
||||||
declare -a ary_cmd=("${@:1:$#-1}") # All but last arg.
|
declare -a ary_cmd=("${@:1:$#-1}") # All but last arg.
|
||||||
|
|||||||
@@ -16,12 +16,19 @@ guard_sourcing
|
|||||||
# Creates the DIRs, prepares the files and mounting paths for installation.
|
# Creates the DIRs, prepares the files and mounting paths for installation.
|
||||||
# Globals:
|
# Globals:
|
||||||
# DIR_LOG
|
# DIR_LOG
|
||||||
|
# LOG_DBS
|
||||||
# LOG_ERR
|
# LOG_ERR
|
||||||
# LOG_INS
|
# LOG_INS
|
||||||
# LOG_NIC
|
# LOG_NIC
|
||||||
|
# LOG_UID
|
||||||
|
# RECOVERY
|
||||||
|
# TARGET
|
||||||
# VAR_PRESEED
|
# VAR_PRESEED
|
||||||
|
# VAR_SAFE_MNT_BASE
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
|
# Returns:
|
||||||
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
gen_dir_files() {
|
gen_dir_files() {
|
||||||
### MAKE DIRS
|
### MAKE DIRS
|
||||||
@@ -41,5 +48,7 @@ gen_dir_files() {
|
|||||||
touch "${DIR_LOG}/cpu.log" && chmod 0600 "${DIR_LOG}/cpu.log"
|
touch "${DIR_LOG}/cpu.log" && chmod 0600 "${DIR_LOG}/cpu.log"
|
||||||
touch "${DIR_LOG}/ext4.log" && chmod 0600 "${DIR_LOG}/ext4.log"
|
touch "${DIR_LOG}/ext4.log" && chmod 0600 "${DIR_LOG}/ext4.log"
|
||||||
touch "${DIR_LOG}/sshd_config.log" && chmod 0600 "${DIR_LOG}/sshd_config.log"
|
touch "${DIR_LOG}/sshd_config.log" && chmod 0600 "${DIR_LOG}/sshd_config.log"
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ guard_sourcing
|
|||||||
# None
|
# None
|
||||||
#######################################
|
#######################################
|
||||||
pre_scan_debug() {
|
pre_scan_debug() {
|
||||||
# shellcheck disable=SC2155
|
|
||||||
declare script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
||||||
. "${script_dir}/0100_arg_mismatch.sh"
|
|
||||||
declare args=("$@")
|
declare args=("$@")
|
||||||
declare dbg_index=-1
|
declare dbg_index=-1
|
||||||
declare dbg_count=0
|
declare dbg_count=0
|
||||||
@@ -29,8 +26,7 @@ pre_scan_debug() {
|
|||||||
for i in "${!args[@]}"; do
|
for i in "${!args[@]}"; do
|
||||||
if [[ "${args[i]}" == "-d" || "${args[i]}" == "--debug" ]]; then
|
if [[ "${args[i]}" == "-d" || "${args[i]}" == "--debug" ]]; then
|
||||||
dbg_index=${i}
|
dbg_index=${i}
|
||||||
. "${script_dir}/0051_debug_var_dump.sh"
|
declare -grx LOG_VAR="{DIR_LOG}/ciss_debian_installer_$$_var.log"
|
||||||
declare -grx LOG_VAR="/tmp/ciss_debian_installer_$$_var.log"
|
|
||||||
touch "${LOG_VAR}" && chmod 0600 "${LOG_VAR}"
|
touch "${LOG_VAR}" && chmod 0600 "${LOG_VAR}"
|
||||||
dump_vars_initial
|
dump_vars_initial
|
||||||
break
|
break
|
||||||
@@ -43,14 +39,10 @@ pre_scan_debug() {
|
|||||||
case "${args[j],,}" in
|
case "${args[j],,}" in
|
||||||
xtrace)
|
xtrace)
|
||||||
declare -gx VAR_DEBUG_TRACE="true"
|
declare -gx VAR_DEBUG_TRACE="true"
|
||||||
. "${script_dir}/0052_debug_trace.sh"
|
|
||||||
. "${script_dir}/0053_debug_trace_header.sh"
|
|
||||||
debug_trace "$@"
|
debug_trace "$@"
|
||||||
;;
|
;;
|
||||||
trap)
|
trap)
|
||||||
declare -gx VAR_DEBUG_TRAP="true"
|
declare -gx VAR_DEBUG_TRAP="true"
|
||||||
. "${script_dir}/0054_debug_trap.sh"
|
|
||||||
. "${script_dir}/0055_debug_trap_header.sh"
|
|
||||||
trap 'debug_trap' DEBUG
|
trap 'debug_trap' DEBUG
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
dump_vars_initial() {
|
dump_vars_initial() {
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
declare -grx VAR_DUMP_VARS_INITIAL=$(mktemp)
|
declare -grx VAR_DUMP_VARS_INITIAL="$(mktemp --tmpdir --mode=0600 /tmp/var_dump_vars_initial.XXXXXXXX)"
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
{
|
{
|
||||||
declare var
|
declare var
|
||||||
@@ -43,7 +43,7 @@ dump_vars_initial() {
|
|||||||
dump_vars_exiting() {
|
dump_vars_exiting() {
|
||||||
### Capture the final snapshot of all variables (excluding '^(BASH|_).*')
|
### Capture the final snapshot of all variables (excluding '^(BASH|_).*')
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
declare var_dump_vars_final=$(mktemp)
|
declare var_dump_vars_final="$(mktemp --tmpdir --mode=0600 /tmp/var_dump_vars_final.XXXXXXXX)"
|
||||||
set +x
|
set +x
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
# SPDX-PackageName: CISS.debian.installer
|
# SPDX-PackageName: CISS.debian.installer
|
||||||
# SPDX-Security-Contact: security@coresecret.eu
|
# SPDX-Security-Contact: security@coresecret.eu
|
||||||
|
|
||||||
|
# TODO: Update this module
|
||||||
|
|
||||||
guard_sourcing
|
guard_sourcing
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
# SPDX-PackageName: CISS.debian.installer
|
# SPDX-PackageName: CISS.debian.installer
|
||||||
# SPDX-Security-Contact: security@coresecret.eu
|
# SPDX-Security-Contact: security@coresecret.eu
|
||||||
|
|
||||||
|
# TODO: Update this module
|
||||||
|
|
||||||
guard_sourcing
|
guard_sourcing
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
@@ -20,9 +22,9 @@ guard_sourcing
|
|||||||
check_provider() {
|
check_provider() {
|
||||||
clear
|
clear
|
||||||
cat << 'EOF' >| "${VAR_NOTES}"
|
cat << 'EOF' >| "${VAR_NOTES}"
|
||||||
Build: Master V8.03.768.2025.06.17
|
Build: Master V8.00.000.2025.06.17
|
||||||
|
|
||||||
Press 'EXIT' to continue with CISS.debian.live.builder.
|
Press 'EXIT' to continue with CISS.debian.installer.
|
||||||
|
|
||||||
When you provision ISO images using the Netcup provider, you MUST always supply a globally unique identifier
|
When you provision ISO images using the Netcup provider, you MUST always supply a globally unique identifier
|
||||||
for each image via the --control argument. If you omit this flag or reuse an existing identifier, Netcup's
|
for each image via the --control argument. If you omit this flag or reuse an existing identifier, Netcup's
|
||||||
@@ -58,7 +60,7 @@ EOF
|
|||||||
dialog --no-collapse \
|
dialog --no-collapse \
|
||||||
--ascii-lines \
|
--ascii-lines \
|
||||||
--clear \
|
--clear \
|
||||||
--backtitle "CISS.debian.live.builder" \
|
--backtitle "CISS.debian.installer" \
|
||||||
--title "Important Notes" \
|
--title "Important Notes" \
|
||||||
--scrollbar \
|
--scrollbar \
|
||||||
--textbox "${VAR_NOTES}" 32 128
|
--textbox "${VAR_NOTES}" 32 128
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
. ./lib/0050_debug_pre_scan.sh
|
|
||||||
. ./lib/0051_debug_var_dump.sh
|
|
||||||
. ./lib/0052_debug_trace.sh
|
|
||||||
. ./lib/0053_debug_trace_header.sh
|
|
||||||
. ./lib/0054_debug_trap.sh
|
|
||||||
. ./lib/0055_debug_trap_header.sh
|
|
||||||
|
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
|
||||||
@@ -14,6 +14,13 @@
|
|||||||
. ./lib/0020_gen_dir_files.sh
|
. ./lib/0020_gen_dir_files.sh
|
||||||
. ./lib/0030_check_pkgs.sh
|
. ./lib/0030_check_pkgs.sh
|
||||||
. ./lib/0031_check_git.sh
|
. ./lib/0031_check_git.sh
|
||||||
|
. ./lib/0040_check_var.sh
|
||||||
|
. ./lib/0050_debug_pre_scan.sh
|
||||||
|
. ./lib/0051_debug_var_dump.sh
|
||||||
|
. ./lib/0052_debug_trace.sh
|
||||||
|
. ./lib/0053_debug_trace_header.sh
|
||||||
|
. ./lib/0054_debug_trap.sh
|
||||||
|
. ./lib/0055_debug_trap_header.sh
|
||||||
. ./lib/0060_trap_err.sh
|
. ./lib/0060_trap_err.sh
|
||||||
. ./lib/0070_trap_exit.sh
|
. ./lib/0070_trap_exit.sh
|
||||||
. ./lib/0080_trap_int.sh
|
. ./lib/0080_trap_int.sh
|
||||||
@@ -23,6 +30,8 @@
|
|||||||
. ./lib/0102_arg_parser.sh
|
. ./lib/0102_arg_parser.sh
|
||||||
. ./lib/0103_arg_priority_check.sh
|
. ./lib/0103_arg_priority_check.sh
|
||||||
. ./lib/0104_arg_nuke_converter.sh
|
. ./lib/0104_arg_nuke_converter.sh
|
||||||
|
#. ./lib/0110_check_kernel.sh
|
||||||
|
#. ./lib/0120_check_provider.sh
|
||||||
. ./lib/0200_dialog_helper.sh
|
. ./lib/0200_dialog_helper.sh
|
||||||
|
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
# SPDX-PackageName: CISS.debian.installer
|
# SPDX-PackageName: CISS.debian.installer
|
||||||
# SPDX-Security-Contact: security@coresecret.eu
|
# SPDX-Security-Contact: security@coresecret.eu
|
||||||
|
|
||||||
|
. ./var/bash.var.sh
|
||||||
. ./var/colors.var.sh
|
. ./var/colors.var.sh
|
||||||
. ./var/errors.var.sh
|
. ./var/errors.var.sh
|
||||||
. ./var/global.var.sh
|
. ./var/global.var.sh
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ declare -grx VAR_SETUP_FULL="$(cd "$(dirname "${0}")" && pwd)/${0##*/}" # '/opt/
|
|||||||
|
|
||||||
### Initialize variables of different directories
|
### Initialize variables of different directories
|
||||||
declare -grx DIR_BAK="/tmp/.ciss/backup"
|
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_LOG="/tmp/.ciss/log"
|
||||||
declare -grx DIR_TMP="/tmp/.ciss/tmp"
|
declare -grx DIR_TMP="/tmp/.ciss/tmp"
|
||||||
|
declare -grx DIR_CNF="${VAR_SETUP_PATH}/.preseed"
|
||||||
|
declare -grx DIR_INS="${VAR_SETUP_PATH}"
|
||||||
|
|
||||||
### Initialize variables for logging
|
### Initialize variables for logging
|
||||||
declare -grx LOG_ERR="${DIR_LOG}/ciss_debian_installer_$$_error.log"
|
declare -grx LOG_ERR="${DIR_LOG}/ciss_debian_installer_$$_error.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user