mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
extension: net: Refactor, fix and improve network extensions
- Rename extensions with "net-*" prefix - Put the extensions into their own folder - Split off time sync packages into their own extensions to be able to be used separately - Put their config files into directories instead of using inline `cat <<- EOF >` - Move some other NetworkManager related stuff into the extension - Remove unneeded steps - Install iproute2 by default on all images (for the `ip` command)
This commit is contained in:
@@ -61,11 +61,14 @@ function do_main_configuration() {
|
||||
|
||||
declare -g SKIP_EXTERNAL_TOOLCHAINS="${SKIP_EXTERNAL_TOOLCHAINS:-yes}" # don't use any external toolchains, by default.
|
||||
|
||||
# Network manager for CLI and desktop, systemd-networkd for minimal
|
||||
# Network-manager and Chrony for standard CLI and desktop, systemd-networkd and systemd-timesyncd for minimal
|
||||
# systemd-timesyncd is slimmer and less resource intensive than Chrony, see https://unix.stackexchange.com/questions/504381/chrony-vs-systemd-timesyncd-what-are-the-differences-and-use-cases-as-ntp-cli
|
||||
if [[ ${BUILD_MINIMAL} == yes ]]; then
|
||||
enable_extension "systemd-neworkd"
|
||||
enable_extension "net-systemd-neworkd"
|
||||
enable_extension "net-systemd-timesyncd"
|
||||
else
|
||||
enable_extension "network-manager"
|
||||
enable_extension "net-network-manager"
|
||||
enable_extension "net-chrony"
|
||||
fi
|
||||
|
||||
# Timezone
|
||||
|
||||
@@ -476,6 +476,14 @@ function enable_extension() {
|
||||
extension_dir="${extension_base_path}" # this is misleading. only directory-based extensions should have this.
|
||||
extension_file="${extension_floating_file}"
|
||||
break
|
||||
else
|
||||
# Search for the extension file in any subdirectory
|
||||
extension_file=$(find "${extension_base_path}" -type f -name "${extension_name}.sh" | head -n 1) # Example format: extensions/network/net-network-manager.sh
|
||||
if [[ -n "${extension_file}" ]]; then
|
||||
# Extract extension dir from file, e.g. from "extensions/network/net-network-manager.sh" the dir "extensions/network/" gets extracted
|
||||
extension_dir="${extension_file%/*}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user