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

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-09-05 22:43:57 +02:00
parent 8467a8b43c
commit efcae27368
3 changed files with 40 additions and 51 deletions

View File

@@ -78,7 +78,7 @@ apt:
# Basic settings
################################################################################################################################
architecture: "amd64" # MUST be one of "amd64" or "arm64".
chroot_debug: "true" # Enable debug mode in the chroot environment in case of errors.
chroot_debug: "false" # Enable debug mode in the chroot environment in case of errors.
debootstrap: # Provide a mirror for downloading the Debian packages for debootstrap.
# Specify the packages to be included in the debootstrapping process. Include a comma-separated
# list of official Debian packages.
@@ -543,13 +543,38 @@ software:
##############################################################################################################################
### Installed by 4000_debootstrap.sh
##############################################################################################################################
# adduser
# apt
# apt-utils
# base-files
# base-passwd
# bash
# bsdutils
# busybox
# ca-certificates
# coreutils
# cpio
# cron
# dash
# debconf
# debian-archive-keyring
# debianutils
# dhcpcd-base
# diffutils
# e2fsprogs
# fdisk
# findutils
# grep
# gzip
# hostname
# ifupdown
# iproute2
# iputils-ping
# kmod
# less
# locales
# login
# logrotate
# nano
# openssl
# passwd
@@ -579,22 +604,15 @@ software:
# dmsetup
# dosfstools
# efibootmgr
# fdisk
# file
# gawk
# gdisk
# gnupg
# grep
# gzip
# haveged
# initramfs-tools
# iproute2
# iputils-ping
# jq
# kbd
# keyutils
# libpam-pwquality
# logrotate
# lsb-release
# parted
# pciutils
@@ -729,6 +747,7 @@ software:
- figlet
- htop
- keychain
- keyutils
- python3
- virt-what

View File

@@ -36,65 +36,35 @@ installation_toolset() {
[btrfs]="btrfs-progs"
[bunzip2]="bzip2"
[setupcon]="console-setup"
[base64]="coreutils"
[cat]="coreutils"
[chmod]="coreutils"
[chown]="coreutils"
[cp]="coreutils"
[echo]="coreutils"
[ln]="coreutils"
[mkdir]="coreutils"
[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"
[lsblk]="util-linux"
[findmnt]="util-linux"
[mount]="util-linux"
[umount]="util-linux"
[xxd]="vim-common"
[wget]="wget"
[whois]="whois"
[zsh]="zsh"
[zstd]="zstd"
)
declare -a ary_missing_pkgs=() ary_unique_pkgs=()

View File

@@ -15,9 +15,12 @@ guard_sourcing
#######################################
# Check for required deb packages to run the script.
# Globals:
# DIR_LOG
# VAR_AUTO_INSTALL
# Arguments:
# None
# Returns:
# 0: on success
#######################################
check_pkgs() {
### Declare Arrays, HashMaps, and Variables.
@@ -37,29 +40,22 @@ check_pkgs() {
[file]="file"
[awk]="gawk"
[gdisk]="gdisk"
[grep]="grep"
[gzip]="gzip"
[ip]="iproute2"
[ping]="iputils-ping"
[jq]="jq"
[lsb_release]="lsb-release"
[parted]="parted"
[chpasswd]="passwd"
[chsh]="passwd"
[pwgen]="pwgen"
[sed]="sed"
[tar]="tar"
[tree]="tree"
[unzip]="unzip"
[blkid]="util-linux"
[wget]="wget"
[whois]="whois"
[zsh]="zsh"
[zstd]="zstd"
)
declare -a ary_missing_pkgs=() ary_unique_pkgs=()
declare var_bin=""
touch "${DIR_LOG}/0030_check_pkgs.log"
### Collecting missing binaries.
for var_bin in "${!hmp_tool_pkg[@]}"; do
@@ -79,7 +75,8 @@ check_pkgs() {
# shellcheck disable=SC2312
mapfile -t ary_unique_pkgs < <(printf '%s\n' "${ary_missing_pkgs[@]}" | sort -u)
do_log "debug" "file_only" "0030() [ary_unique_pkgs]='${ary_unique_pkgs[*]}'."
apt-get install -y --no-install-recommends --no-install-suggests "${ary_unique_pkgs[*]}" >| "${DIR_LOG}/0030_check_pkgs.log"
# shellcheck disable=SC2312
apt-get install -y --no-install-recommends --no-install-suggests "${ary_unique_pkgs[*]}" 2>&1 | tee -a "${DIR_LOG}/0030_check_pkgs.log"
fi
@@ -87,14 +84,17 @@ check_pkgs() {
if grep -RqsE '^[[:space:]]*deb .*backports' /etc/apt/sources.list /etc/apt/sources.list.d; then
# shellcheck disable=SC2155
declare codename=$(lsb_release -sc)
apt-get install -y -t "${codename}-backports" debootstrap >> "${DIR_LOG}/0030_check_pkgs.log"
# shellcheck disable=SC2312
apt-get install -y -t "${codename}-backports" debootstrap 2>&1 | tee -a "${DIR_LOG}/0030_check_pkgs.log"
else
apt-get install -y debootstrap >> "${DIR_LOG}/0030_check_pkgs.log"
# shellcheck disable=SC2312
apt-get install -y debootstrap 2>&1 | tee -a "${DIR_LOG}/0030_check_pkgs.log"
fi
fi
if [[ -z "$(command -v dialog || true)" ]]; then
if ! "${VAR_AUTO_INSTALL}"; then apt-get install -y --no-install-recommends dialog >> "${DIR_LOG}/0030_check_pkgs.log"; fi
# shellcheck disable=SC2312
if ! "${VAR_AUTO_INSTALL}"; then apt-get install -y --no-install-recommends dialog 2>&1 | tee -a "${DIR_LOG}/0030_check_pkgs.log"; fi
fi
guard_dir && return 0