V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -442,7 +442,8 @@ locale:
|
|||||||
layout: "de"
|
layout: "de"
|
||||||
xkb_keymap: "de"
|
xkb_keymap: "de"
|
||||||
language: "en"
|
language: "en"
|
||||||
locale: # All locales specified via override MUST be set here, too.
|
locale: # All locales specified via override MUST be set here, too. A specified 'locale' take
|
||||||
|
# precedence over 'country' and 'language' settings.
|
||||||
- "en_US.UTF-8"
|
- "en_US.UTF-8"
|
||||||
- "de_DE.UTF-8"
|
- "de_DE.UTF-8"
|
||||||
override:
|
override:
|
||||||
@@ -453,7 +454,7 @@ locale:
|
|||||||
messages: "en_US.UTF-8" # System language for error messages.
|
messages: "en_US.UTF-8" # System language for error messages.
|
||||||
monetary: "en_US.UTF-8" # Currency format and symbol.
|
monetary: "en_US.UTF-8" # Currency format and symbol.
|
||||||
name: "en_US.UTF-8" # Format of personal names.
|
name: "en_US.UTF-8" # Format of personal names.
|
||||||
numeric: "en_US.UTF-8" # Number formatting, decimal/thousand separators.
|
numeric: "en_US.UTF-8" # Number formatting, decimal / a thousand separators.
|
||||||
paper: "de_DE.UTF-8" # Standard paper format.
|
paper: "de_DE.UTF-8" # Standard paper format.
|
||||||
telephone: "en_US.UTF-8" # Format for telephone numbers.
|
telephone: "en_US.UTF-8" # Format for telephone numbers.
|
||||||
time: "de_DE.UTF-8" # Date and time format, start of week.
|
time: "de_DE.UTF-8" # Date and time format, start of week.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ generate_subnetmask() {
|
|||||||
# None
|
# None
|
||||||
#######################################
|
#######################################
|
||||||
update_upgrade() {
|
update_upgrade() {
|
||||||
apt-get update -y
|
apt-get update
|
||||||
apt-get dist-upgrade -y
|
apt-get dist-upgrade -y
|
||||||
apt-get autoclean -y
|
apt-get autoclean -y
|
||||||
apt-get autopurge -y
|
apt-get autopurge -y
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
# Set locale, locale overrides and configure keyboard layout.
|
# Set locale, locale overrides and configure keyboard layout.
|
||||||
# Globals:
|
# Globals:
|
||||||
|
# ARY_LOCALE
|
||||||
# TARGET
|
# TARGET
|
||||||
# VAR_ARCHITECTURE
|
# VAR_ARCHITECTURE
|
||||||
# VAR_CODENAME
|
# VAR_CODENAME
|
||||||
@@ -22,7 +23,6 @@ guard_sourcing
|
|||||||
# locale_country
|
# locale_country
|
||||||
# locale_keyboard_xkb_keymap
|
# locale_keyboard_xkb_keymap
|
||||||
# locale_language
|
# locale_language
|
||||||
# locale_locale
|
|
||||||
# locale_override_address
|
# locale_override_address
|
||||||
# locale_override_collate
|
# locale_override_collate
|
||||||
# locale_override_ctype
|
# locale_override_ctype
|
||||||
@@ -63,8 +63,6 @@ setup_locales() {
|
|||||||
# SPDX-PackageName: CISS.debian.installer
|
# SPDX-PackageName: CISS.debian.installer
|
||||||
# SPDX-Security-Contact: security@coresecret.eu
|
# SPDX-Security-Contact: security@coresecret.eu
|
||||||
|
|
||||||
set -x
|
|
||||||
exec 2>/tmp/locale-hook-debug.log
|
|
||||||
set -Ceuo pipefail
|
set -Ceuo pipefail
|
||||||
|
|
||||||
declare -a ary_locale=()
|
declare -a ary_locale=()
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ guard_sourcing
|
|||||||
# Generate target '/etc/apt/sources.list' entries.
|
# Generate target '/etc/apt/sources.list' entries.
|
||||||
# Globals:
|
# Globals:
|
||||||
# TARGET
|
# TARGET
|
||||||
|
# VAR_ARCHITECTURE
|
||||||
|
# VAR_CODENAME
|
||||||
|
# VAR_VERSION
|
||||||
# apt_contrib
|
# apt_contrib
|
||||||
# apt_deb_sources
|
# apt_deb_sources
|
||||||
# apt_mirror_directory
|
# apt_mirror_directory
|
||||||
@@ -38,7 +41,7 @@ guard_sourcing
|
|||||||
generate_sources() {
|
generate_sources() {
|
||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
declare -a ary_components=()
|
declare -a ary_components=()
|
||||||
declare var_arch="" var_codename="" var_deb_src="" var_dir="" var_hostname="" var_hostsecure="" var_url var_surl=""
|
declare var_arch="" var_codename="" var_deb_src="" var_dir="" var_hostname="" var_hostsecure="" var_url="" var_surl=""
|
||||||
|
|
||||||
# shellcheck disable=SC2154 # "${architecture}"
|
# shellcheck disable=SC2154 # "${architecture}"
|
||||||
var_arch="${architecture,,}"
|
var_arch="${architecture,,}"
|
||||||
|
|||||||
@@ -25,12 +25,13 @@ guard_sourcing
|
|||||||
update_sources() {
|
update_sources() {
|
||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
declare -r var_logfile="${DIR_LOG}/4110_update_sources.sh"
|
declare -r var_logfile="${DIR_LOG}/4110_update_sources.sh"
|
||||||
|
touch "${var_logfile}" && chmod 0600 "${var_logfile}"
|
||||||
|
|
||||||
### Update generated sources.
|
### Update generated sources.
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
do_in_target "${TARGET}" script -q -c apt-get update -y /dev/null 2>&1 | tee -a "${var_logfile}"
|
do_in_target_script "${TARGET}" "apt-get update 2>&1 | tee -a ${var_logfile}; echo ExitCode: \$? >> ${var_logfile}"
|
||||||
|
|
||||||
do_log "info" "file_only" "4110() Sources updated successfully."
|
do_log "info" "file_only" "4110() Sources lists: updated successfully."
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
# Installation of the specified kernel.
|
# Installation of the specified kernel.
|
||||||
# Globals:
|
# Globals:
|
||||||
|
# DIR_LOG
|
||||||
# TARGET
|
# TARGET
|
||||||
# image
|
# image
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@@ -25,9 +26,9 @@ guard_sourcing
|
|||||||
installation_kernel() {
|
installation_kernel() {
|
||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
declare -r var_logfile="${DIR_LOG}/4120_installation_kernel.sh"
|
declare -r var_logfile="${DIR_LOG}/4120_installation_kernel.sh"
|
||||||
|
touch "${var_logfile}" && chmod 0600 "${var_logfile}"
|
||||||
|
|
||||||
# shellcheck disable=SC2312
|
do_in_target_script "${TARGET}" "apt-get install -y ${image} 2>&1 | tee -a ${var_logfile}; echo ExitCode: \$? >> ${var_logfile}"
|
||||||
do_in_target "${TARGET}" apt-get install -y "${image}" /dev/null 2>&1 | tee -a "${var_logfile}"
|
|
||||||
|
|
||||||
do_log "info" "file_only" "4120() Kernel image: '${image}' installed successfully."
|
do_log "info" "file_only" "4120() Kernel image: '${image}' installed successfully."
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
# Check and set up the minimum required tools for the next installation steps.
|
# Check and set up the minimum required tools for the next installation steps.
|
||||||
# Globals:
|
# Globals:
|
||||||
|
# DIR_LOG
|
||||||
# TARGET
|
# TARGET
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
@@ -79,10 +80,9 @@ installation_toolset() {
|
|||||||
|
|
||||||
declare -a ary_missing_pkgs=() ary_unique_pkgs=()
|
declare -a ary_missing_pkgs=() ary_unique_pkgs=()
|
||||||
declare -r var_logfile="${DIR_LOG}/4130_installation_toolset.sh"
|
declare -r var_logfile="${DIR_LOG}/4130_installation_toolset.sh"
|
||||||
declare var_bin="" var_bin=""
|
declare var_bin=""
|
||||||
|
|
||||||
### Installation most basic packages.
|
touch "${var_logfile}" && chmod 0600 "${var_logfile}"
|
||||||
do_in_target "${TARGET}" apt-get install -y --no-install-recommends locales tzdata debconf
|
|
||||||
|
|
||||||
### Collecting missing binaries.
|
### Collecting missing binaries.
|
||||||
for var_bin in "${!hmp_tool_pkg[@]}"; do
|
for var_bin in "${!hmp_tool_pkg[@]}"; do
|
||||||
@@ -101,8 +101,10 @@ installation_toolset() {
|
|||||||
mapfile -t ary_unique_pkgs < <(printf '%s\n' "${ary_missing_pkgs[@]}" | sort -u)
|
mapfile -t ary_unique_pkgs < <(printf '%s\n' "${ary_missing_pkgs[@]}" | sort -u)
|
||||||
do_log "debug" "file_only" "4130() [ary_unique_pkgs]='${ary_unique_pkgs[*]}'."
|
do_log "debug" "file_only" "4130() [ary_unique_pkgs]='${ary_unique_pkgs[*]}'."
|
||||||
|
|
||||||
# shellcheck disable=SC2312
|
do_in_target_script "${TARGET}" "
|
||||||
do_in_target "${TARGET}" script -q -c "apt-get install -y --no-install-recommends ${ary_unique_pkgs[*]}" /dev/null 2>&1 | tee -a "${var_logfile}"
|
apt-get install -y --no-install-recommends ${ary_unique_pkgs[*]} 2>&1 | tee -a ${var_logfile}
|
||||||
|
echo ExitCode: \$? >> ${var_logfile}
|
||||||
|
"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
# Ensure systemd is in place.
|
# Ensure systemd is in place.
|
||||||
# Globals:
|
# Globals:
|
||||||
|
# DIR_LOG
|
||||||
# TARGET
|
# TARGET
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
@@ -22,18 +23,25 @@ guard_sourcing
|
|||||||
# 0: on success
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
installation_systemd() {
|
installation_systemd() {
|
||||||
if ! do_in_target_script "${TARGET}" "command -v systemctl >/dev/null"; then
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
|
declare -r var_logfile="${DIR_LOG}/4131_installation_systemd.sh"
|
||||||
|
|
||||||
|
touch "${var_logfile}" && chmod 0600 "${var_logfile}"
|
||||||
|
|
||||||
|
if ! do_in_target_script "${TARGET}" "type -P systemctl >/dev/null"; then
|
||||||
do_log "info" "file_only" "4131() 'systemctl' NOT found, installing 'systemd' and dependencies."
|
do_log "info" "file_only" "4131() 'systemctl' NOT found, installing 'systemd' and dependencies."
|
||||||
do_in_target "${TARGET}" apt-get install -y --no-install-recommends systemd systemd-sysv dbus
|
do_in_target_script "${TARGET}" "
|
||||||
|
apt-get update 2>&1 | tee -a ${var_logfile}
|
||||||
|
apt-get install -y --no-install-recommends systemd systemd-sysv dbus 2>&1 | tee -a ${var_logfile}
|
||||||
|
echo ExitCode: \$? >> ${var_logfile}
|
||||||
|
"
|
||||||
else
|
else
|
||||||
|
do_log "info" "file_only" "4131() 'systemctl' found, skipping installation."
|
||||||
do_log "info" "file_only" "4131() 'systemctl' found, skipping installation of systemd."
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
do_in_target_script "${TARGET}" "systemctl --version | grep -qi 'systemd'"
|
do_in_target_script "${TARGET}" "
|
||||||
|
systemctl --version 2>&1 | tee -a ${var_logfile} | grep -qi 'systemd' || echo '[WARN]: systemd not verifiable' >> ${var_logfile}
|
||||||
|
"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,19 @@ installation_microcode() {
|
|||||||
declare var_microcode_pkgs="" var_whereiam="" var_cpu_vendor=""
|
declare var_microcode_pkgs="" var_whereiam="" var_cpu_vendor=""
|
||||||
|
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
var_whereiam=$(virt-what | head -n1)
|
if [[ -x "$(command -v virt-what)" ]]; then
|
||||||
[[ -z "${var_whereiam}" ]] && var_whereiam="baremetal"
|
var_whereiam=$(virt-what | head -n1)
|
||||||
|
else
|
||||||
|
var_whereiam=$(grep -iE 'kvm|vmware|qemu' /sys/class/dmi/id/product_name 2>/dev/null || echo "baremetal")
|
||||||
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
var_cpu_vendor=$(lscpu | awk -F: '/Vendor ID/ {print $2}' | xargs)
|
var_cpu_vendor=$(</proc/cpuinfo grep 'vendor_id' | head -n1 | cut -d: -f2 | xargs)
|
||||||
|
|
||||||
case "${var_cpu_vendor}" in
|
case "${var_cpu_vendor}" in
|
||||||
*AuthenticAMD*) var_microcode_pkgs="amd64-microcode" ;;
|
*AuthenticAMD*) var_microcode_pkgs="amd64-microcode" ;;
|
||||||
*GenuineIntel*) var_microcode_pkgs="intel-microcode" ;;
|
*GenuineIntel*) var_microcode_pkgs="intel-microcode" ;;
|
||||||
""|*ARM*|*arm*|*) var_microcode_pkgs=""; do_log "info" "file_only" "4140() ARM or unknown CPU detected, skipping microcode installation." ;;
|
*) do_log "info" "file_only" "4140() Unknown or unsupported CPU vendor: '${var_cpu_vendor}', skipping." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
@@ -42,8 +46,14 @@ installation_microcode() {
|
|||||||
###########################################################################################
|
###########################################################################################
|
||||||
if [[ "${var_whereiam}" != "kvm" && -n "${var_microcode_pkgs}" ]]; then
|
if [[ "${var_whereiam}" != "kvm" && -n "${var_microcode_pkgs}" ]]; then
|
||||||
|
|
||||||
if ! do_in_target_script "${TARGET}" "dpkg -l ${var_microcode_pkgs} >/dev/null 2>&1"; then
|
if ! do_in_target_script "${TARGET}" "dpkg -s ${var_microcode_pkgs} >/dev/null 2>&1"; then
|
||||||
|
|
||||||
do_in_target "${TARGET}" apt-get install -y "${var_microcode_pkgs}"
|
do_in_target "${TARGET}" apt-get install -y "${var_microcode_pkgs}"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
do_in_target "${TARGET}" apt-get install -y --only-upgrade "${var_microcode_pkgs}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -39,24 +39,26 @@ installation_chrony() {
|
|||||||
printf "# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh %b" "${NL}" >> "${var_of}"
|
printf "# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh %b" "${NL}" >> "${var_of}"
|
||||||
|
|
||||||
mkdir -p "${TARGET}/var/log/chrony"
|
mkdir -p "${TARGET}/var/log/chrony"
|
||||||
do_in_target "${TARGET}" apt-get install chrony -y
|
do_in_target_script "${TARGET}" "apt-get install -y --no-install-recommends chrony"
|
||||||
|
|
||||||
if [[ ! -e "${TARGET}/etc/systemd/system/multi-user.target.wants/chrony.service" ]]; then
|
if [[ ! -e "${TARGET}/etc/systemd/system/multi-user.target.wants/chrony.service" ]]; then
|
||||||
|
|
||||||
ln -s "${TARGET}/lib/systemd/system/chrony.service" "${TARGET}/etc/systemd/system/multi-user.target.wants/chrony.service"
|
do_in_target_script "${TARGET}" "systemctl enable chrony.service"
|
||||||
fi
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${DIR_BAK}/etc/chrony"
|
mkdir -p "${DIR_BAK}/etc/chrony"
|
||||||
mv "${TARGET}/etc/chrony/chrony.conf" "${DIR_BAK}/etc/chrony/chrony.conf.bak"
|
mv "${TARGET}/etc/chrony/chrony.conf" "${DIR_BAK}/etc/chrony/chrony.conf.bak"
|
||||||
|
|
||||||
install -D -m 0644 -o root -g root "${VAR_SETUP_PATH}/includes/etc/chrony/chrony.cnf" "${TARGET}/etc/chrony/chrony.conf"
|
install -D -m 0644 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/chrony/chrony.cnf" "${TARGET}/etc/chrony/chrony.conf"
|
||||||
cat "${var_of}" >> "${TARGET}/etc/chrony/chrony.conf"
|
cat "${var_of}" >> "${TARGET}/etc/chrony/chrony.conf"
|
||||||
|
|
||||||
|
do_log "debug" "file_only" "4150() Executing: [do_in_target ${TARGET} chronyd -Q -f /etc/chrony/chrony.conf]."
|
||||||
|
do_in_target "${TARGET}" chronyd -Q -f /etc/chrony/chrony.conf
|
||||||
|
|
||||||
do_log "info" "file_only" "4150() Chrony NTPsec client installed."
|
do_log "info" "file_only" "4150() Chrony NTPsec client installed."
|
||||||
|
|
||||||
rm -f "${var_of}"
|
rm -f "${var_of}"
|
||||||
unset var_of
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user