V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 53s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 53s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -22,11 +22,9 @@ guard_sourcing
|
||||
# 0: on success
|
||||
#######################################
|
||||
minimal_toolset() {
|
||||
declare var_bin
|
||||
|
||||
### Define HashMap: command -> package
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
# shellcheck disable=SC2154
|
||||
declare -A hmp_tool_pkg=(
|
||||
declare -A hmp_tool_pkg=(
|
||||
[awk]="gawk"
|
||||
[busybox]="busybox"
|
||||
[cat]="coreutils"
|
||||
@@ -48,12 +46,42 @@ minimal_toolset() {
|
||||
[zsh]="zsh"
|
||||
)
|
||||
|
||||
declare var_bin=""
|
||||
|
||||
for var_bin in "${!hmp_tool_pkg[@]}"; do
|
||||
|
||||
if ! do_in_target_script "${TARGET}" "command -v ${var_bin} >/dev/null"; then
|
||||
|
||||
do_in_target "${TARGET}" apt-get install -y "${hmp_tool_pkg[${var_bin}]}"
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
### Ensure systemd and machine-id are in place
|
||||
if ! do_in_target_script "${TARGET}" "command -v systemctl >/dev/null"; then
|
||||
|
||||
do_log "info" "file_only" "4090() 'systemctl' not found — installing 'systemd' and dependencies."
|
||||
do_in_target "${TARGET}" apt-get install -y systemd systemd-sysv dbus
|
||||
|
||||
else
|
||||
|
||||
do_log "info" "file_only" "4090() 'systemctl' found — skipping installation of systemd."
|
||||
|
||||
fi
|
||||
|
||||
### Generate machine-id if missing
|
||||
if ! do_in_target_script "${TARGET}" "[[ -s /etc/machine-id ]]"; then
|
||||
|
||||
do_log "info" "file_only" "4090() Generating /etc/machine-id via systemd-machine-id-setup."
|
||||
do_in_target "${TARGET}" systemd-machine-id-setup
|
||||
|
||||
else
|
||||
|
||||
do_log "info" "file_only" "4090() Existing machine-id found — no action needed."
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user