V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -32,17 +32,24 @@ update_sources() {
|
||||
### Update generated sources.
|
||||
# shellcheck disable=SC2312
|
||||
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 lists: updated successfully."
|
||||
|
||||
|
||||
### Update unattended, security or no unattended updates at all.
|
||||
if [[ "${apt_updates_policy,,}" == "unattended" ]]; then
|
||||
|
||||
do_in_target "${TARGET}" apt-get install -y unattended-upgrades
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-suggests unattended-upgrades 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
do_log "info" "file_only" "4110() The update policy was set at installation time to: '${apt_updates_policy}'."
|
||||
|
||||
elif [[ "${apt_updates_policy,,}" == "security" ]]; then
|
||||
|
||||
do_in_target "${TARGET}" apt-get install -y unattended-upgrades
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-suggests unattended-upgrades 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
sed -i 's/^[[:space:]]*"origin=Debian,codename=\${distro_codename},label=Debian";/\/\/ &/' "${TARGET}/etc/apt/apt.conf.d/50unattended-upgrades"
|
||||
|
||||
@@ -29,10 +29,29 @@ installation_kernel() {
|
||||
|
||||
touch "${TARGET}${var_logfile}" && chmod 0600 "${TARGET}${var_logfile}"
|
||||
|
||||
do_in_target_script "${TARGET}" "apt-get install -y ${image} 2>&1 | tee -a ${var_logfile}; echo ExitCode: \$? >> ${var_logfile}"
|
||||
if [[ -n "${VAR_KERNEL}" ]]; then
|
||||
|
||||
do_log "info" "file_only" "4120() Kernel image: '${image}' installed successfully."
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ${VAR_KERNEL} 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
do_log "info" "file_only" "4120() Kernel image: '${VAR_KERNEL}' installed successfully."
|
||||
|
||||
return 0
|
||||
|
||||
else
|
||||
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ${image} 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
do_log "info" "file_only" "4120() Kernel image: '${image}' installed successfully."
|
||||
|
||||
return 0
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -26,11 +26,14 @@ installation_toolset() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
# shellcheck disable=SC2154
|
||||
declare -A hmp_tool_pkg=(
|
||||
[apt-show-versions]="apt-show-versions"
|
||||
[bc]="bc"
|
||||
[dig]="bind9-dnsutils"
|
||||
[host]="bind9-dnsutils"
|
||||
[hexdump]="bsdmainutils"
|
||||
[btrfs]="btrfs-progs"
|
||||
[busybox]="busybox"
|
||||
[bunzip2]="bzip2"
|
||||
[base64]="coreutils"
|
||||
[cat]="coreutils"
|
||||
[chmod]="coreutils"
|
||||
@@ -39,31 +42,47 @@ installation_toolset() {
|
||||
[echo]="coreutils"
|
||||
[ln]="coreutils"
|
||||
[mkdir]="coreutils"
|
||||
[cryptsetup]="cryptsetup-initramfs"
|
||||
[cryptsetup]="cryptsetup"
|
||||
[cryptsetup-initramfs]="cryptsetup-initramfs"
|
||||
[curl]="curl"
|
||||
[dirmngr]="dirmngr"
|
||||
[dmsetup]="dmsetup"
|
||||
[fsck.vfat]="dosfstools"
|
||||
[mkfs.vfat]="dosfstools"
|
||||
[e2label]="e2fsprogs"
|
||||
[tune2fs]="e2fsprogs"
|
||||
[fsck]="e2fsprogs"
|
||||
[efibootmgr]="efibootmgr"
|
||||
[fdisk]="fdisk"
|
||||
[file]="file"
|
||||
[awk]="gawk"
|
||||
[gdisk]="gdisk"
|
||||
[gnupg]="gnupg"
|
||||
[grep]="grep"
|
||||
[gzip]="gzip"
|
||||
[haveged]="haveged"
|
||||
[update-initramfs]="initramfs-tools"
|
||||
[ip]="iproute2"
|
||||
[ping]="iputils-ping"
|
||||
[jq]="jq"
|
||||
[loadkeys]="kbd"
|
||||
[setfont]="kbd"
|
||||
[keyctl]="keyutils"
|
||||
[modprobe]="kmod"
|
||||
[libpam-pwquality]="libpam-pwquality"
|
||||
[logrotate]="logrotate"
|
||||
[lsb_release]="lsb-release"
|
||||
[parted]="parted"
|
||||
[chpasswd]="passwd"
|
||||
[chsh]="passwd"
|
||||
[lspci]="pciutils"
|
||||
[sysctl]="procps"
|
||||
[pwgen]="pwgen"
|
||||
[sed]="sed"
|
||||
[sudo]="sudo"
|
||||
[tar]="tar"
|
||||
[tree]="tree"
|
||||
[unzip]="unzip"
|
||||
[lsusb]="usbutils"
|
||||
[blkid]="util-linux"
|
||||
[dmesg]="util-linux"
|
||||
@@ -102,7 +121,7 @@ installation_toolset() {
|
||||
do_log "debug" "file_only" "4130() [ary_unique_pkgs]='${ary_unique_pkgs[*]}'."
|
||||
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends ${ary_unique_pkgs[*]} 2>&1 | tee -a ${var_logfile}
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ${ary_unique_pkgs[*]} 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
|
||||
@@ -30,13 +30,17 @@ installation_systemd() {
|
||||
|
||||
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_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}
|
||||
apt-get install -y --no-install-recommends --no-install-suggests systemd systemd-sysv dbus 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
else
|
||||
|
||||
do_log "info" "file_only" "4131() 'systemctl' found, skipping installation."
|
||||
|
||||
fi
|
||||
|
||||
do_in_target_script "${TARGET}" "
|
||||
|
||||
@@ -23,7 +23,10 @@ guard_sourcing
|
||||
#######################################
|
||||
installation_microcode() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare var_microcode_pkgs="" var_whereiam="" var_cpu_vendor=""
|
||||
declare var_microcode_pkgs="" var_whereiam="" var_cpu_vendor=""
|
||||
declare -r var_logfile="/root/.ciss/cdi/log/4140_installation_microcode.log"
|
||||
|
||||
touch "${TARGET}${var_logfile}" && chmod 0600 "${TARGET}${var_logfile}"
|
||||
|
||||
# shellcheck disable=SC2312
|
||||
if [[ -x "$(command -v virt-what)" ]]; then
|
||||
@@ -48,17 +51,23 @@ installation_microcode() {
|
||||
|
||||
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_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ${var_microcode_pkgs} 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
else
|
||||
|
||||
do_in_target "${TARGET}" apt-get install -y --only-upgrade "${var_microcode_pkgs}"
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends --no-install-suggests --only-upgrade ${var_microcode_pkgs} 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
do_log "info" "file_only" "4140() Skipping microcode install (${var_whereiam}, ${var_microcode_pkgs:-none})"
|
||||
do_log "info" "file_only" "4140() Skipping microcode install [${var_whereiam}, ${var_microcode_pkgs:-none}]."
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -28,7 +28,10 @@ guard_sourcing
|
||||
installation_chrony() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
# shellcheck disable=SC2155
|
||||
declare var_of=$(mktemp var_of.XXXXXXXX) var_ntp_server=""
|
||||
declare var_of=$(mktemp var_of.XXXXXXXX) var_ntp_server=""
|
||||
declare -r var_logfile="/root/.ciss/cdi/log/4150_installation_chrony.log"
|
||||
|
||||
touch "${TARGET}${var_logfile}" && chmod 0600 "${TARGET}${var_logfile}"
|
||||
|
||||
for var_ntp_server in "${ARY_NTPSRVR[@]}"; do
|
||||
|
||||
@@ -39,7 +42,11 @@ installation_chrony() {
|
||||
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"
|
||||
do_in_target_script "${TARGET}" "apt-get install -y --no-install-recommends chrony"
|
||||
|
||||
do_in_target_script "${TARGET}" "
|
||||
apt-get install -y --no-install-recommends --no-install-suggests chrony 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
if [[ ! -e "${TARGET}/etc/systemd/system/multi-user.target.wants/chrony.service" ]]; then
|
||||
|
||||
@@ -53,8 +60,11 @@ installation_chrony() {
|
||||
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"
|
||||
|
||||
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 "debug" "file_only" "4150() Executing: [do_in_target_script ${TARGET} chronyd -Q -f /etc/chrony/chrony.conf]."
|
||||
do_in_target_script "${TARGET}" "
|
||||
chronyd -Q -f /etc/chrony/chrony.conf 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode: \$? >> ${var_logfile}
|
||||
"
|
||||
|
||||
do_log "info" "file_only" "4150() Chrony NTPsec client installed."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user