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:
ColorfulRhino
2024-06-19 13:59:06 +02:00
committed by Igor
parent f4b160abde
commit 497c6dce0e
16 changed files with 156 additions and 96 deletions

View File

@@ -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