armbian-build/lib/functions/host/basic-deps.sh
Ricardo Pardini 6cb12a3397
armbian-next: [focal-host] try to support focal-like host OS's again, via python3.9 (and drop buster completely)
- completely remove support for building under `buster` -- that's way too old, sorry.
- de-hardcode `python3` invocations, instead use `python3_binary_path` set by `prepare_python3_binary_for_python_tools()`
- juggle `$HOSTRELEASE`: read from actual host, or determined from Docker image name (during Dockerfile build)
- TL;DR: include and use `python3.9` for focal-like host OS's
2023-02-18 07:41:47 -03:00

43 lines
1.3 KiB
Bash

#!/usr/bin/env bash
# prepare_host_basic
#
# * installs only basic packages
#
function prepare_host_basic() {
# command:package1 package2 ...
# list of commands that are neeeded:packages where this command is
local check_pack install_pack
local checklist=(
"dialog:dialog"
"fuser:psmisc"
"getfacl:acl"
"uuidgen:uuid-runtime"
"curl:curl"
"gpg:gnupg"
"gawk:gawk"
"linux-version:linux-base"
"locale-gen:locales"
"git:git"
)
for check_pack in "${checklist[@]}"; do
if ! which ${check_pack%:*} > /dev/null; then local install_pack+=${check_pack#*:}" "; fi
done
if [[ -n $install_pack ]]; then
# This obviously only works on Debian or Ubuntu.
if [[ ! -f /etc/debian_version ]]; then
exit_with_error "Missing packages -- can't install basic packages on non Debian/Ubuntu"
fi
local sudo_prefix="" && is_root_or_sudo_prefix sudo_prefix # nameref; "sudo_prefix" will be 'sudo' or ''
display_alert "Updating and installing basic packages on host" "${sudo_prefix}: ${install_pack}"
run_host_command_logged "${sudo_prefix}" apt-get -qq update
run_host_command_logged "${sudo_prefix}" apt-get install -qq -y --no-install-recommends $install_pack
else
display_alert "basic-deps are already installed on host" "nothing to be done" "debug"
fi
}