-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
networking: main-config: introduce NETWORKING_STACK
to control network exts; allow "none"; fix typo
#6786
Merged
igorpecovnik
merged 2 commits into
armbian:main
from
rpardini:pr/networking-main-config-introduce-NETWORKINGSTACK-to-control-network-exts-allow-none-fix-typo
Jun 24, 2024
Merged
networking: main-config: introduce NETWORKING_STACK
to control network exts; allow "none"; fix typo
#6786
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,15 +61,44 @@ function do_main_configuration() { | |
|
||
declare -g SKIP_EXTERNAL_TOOLCHAINS="${SKIP_EXTERNAL_TOOLCHAINS:-yes}" # don't use any external toolchains, by default. | ||
|
||
# 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 "net-systemd-neworkd" | ||
enable_extension "net-systemd-timesyncd" | ||
# Network stack to use, default to network-manager; configuration can override this. | ||
declare -g NETWORKING_STACK="${NETWORKING_STACK}" | ||
# If empty, default depending on BUILD_MINIMAL; if yes, use systemd-networkd; if no, use network-manager. | ||
if [[ -z "${NETWORKING_STACK}" ]]; then | ||
igorpecovnik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
display_alert "NETWORKING_STACK not set" "Calculating defaults" "debug" | ||
# 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 | ||
display_alert "BUILD_MINIMAL is set to yes" "Using systemd-networkd" "debug" | ||
NETWORKING_STACK="systemd-networkd" | ||
else | ||
display_alert "BUILD_MINIMAL not set to yes" "Using network-manager" "debug" | ||
NETWORKING_STACK="network-manager" | ||
fi | ||
else | ||
enable_extension "net-network-manager" | ||
enable_extension "net-chrony" | ||
display_alert "NETWORKING_STACK is preset during configuration" "NETWORKING_STACK: ${NETWORKING_STACK}" "debug" | ||
fi | ||
# Now make it read-only, as further changes would make the whole thing inconsistent. | ||
# Individual networking extensions should _check_ this to make there's no spurious enablement. | ||
display_alert "Using NETWORKING_STACK" "NETWORKING_STACK: ${NETWORKING_STACK}" "info" | ||
declare -g -r NETWORKING_STACK="${NETWORKING_STACK}" | ||
|
||
# Now enable extensions according to the configuration. | ||
case "${NETWORKING_STACK}" in | ||
"network-manager") | ||
display_alert "Adding networking extensions" "net-network-manager, net-chrony" "info" | ||
enable_extension "net-network-manager" | ||
enable_extension "net-chrony" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I specifically separated networking from time synching to make it more modular 😅 |
||
;; | ||
"systemd-networkd") | ||
display_alert "Adding networking extensions" "net-systemd-networkd, net-systemd-timesyncd" "info" | ||
enable_extension "net-systemd-networkd" | ||
enable_extension "net-systemd-timesyncd" | ||
;; | ||
"none" | *) | ||
display_alert "NETWORKING_STACK=${NETWORKING_STACK}" "Not adding networking extensions" "info" | ||
;; | ||
esac | ||
|
||
# Timezone | ||
if [[ -f /etc/timezone ]]; then # Timezone for target is taken from host, if it exists. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sanity check might be couterproductive, since its perfectly valid to use both networking extensions at the same time if one wishes to.