1 Commits

Author SHA1 Message Date
e27ef70980 polkit: add owner annotations to all actions
this allows one to (optionally) run NetworkManager as a user named
"networkmanager" instead of root without breaking NM-initiated polkit
queries. dbus interactions for an operation like
`nmcli device wifi rescan` look like this:

```
nmcli device wifi rescan
(sent from pid=1234, uid=1000)
  |
  v
org.freedesktop.NetworkManager.Device.Wireless.RequestScan { }
(fielded by NetworkManager.service)
  |
  v
org.freedesktop.PolicyKit1.Authority.CheckAuthorization {
  pid = 1234
  start-time = ...;
  uid = 1000;
  "org.freedesktop.NetworkManager.wifi.scan"
}
(fielded by polkit.service)
```

ordinarily, polkit will check the details of whoever invoked `nmcli`
against its database and tell NetworkManager whether the request is
authorized or not. however if NetworkManager isn't running as root then
polkit will instead reply with:

> ErrorName=org.freedesktop.PolicyKit1.Error.NotAuthorized
> "Only trusted callers (e.g. uid 0 or an action owner) can use
> CheckAuthorization() for subjects belonging to other identities"

to solve this we encode the action owner into the policy so that when
polkit sees the CheckAuthorization message, it knows the caller is
allowed to ask for that.

running NetworkManager as root is unaffected by this patch.
2024-06-02 04:52:25 +00:00
755 changed files with 52281 additions and 81964 deletions

4
.gitignore vendored
View File

@@ -84,9 +84,6 @@ test-*.trs
/data/org.freedesktop.NetworkManager.policy.in /data/org.freedesktop.NetworkManager.policy.in
/data/nm-sudo.service /data/nm-sudo.service
/data/nm-priv-helper.service /data/nm-priv-helper.service
/data/NetworkManager-config-initrd.service
/data/NetworkManager-initrd.service
/data/NetworkManager-wait-online-initrd.service
/docs/api/version.xml /docs/api/version.xml
/docs/api/settings-spec.html /docs/api/settings-spec.html
@@ -186,7 +183,6 @@ test-*.trs
/src/nm-online/nm-online /src/nm-online/nm-online
/m4/build-to-host.m4
/m4/codeset.m4 /m4/codeset.m4
/m4/gettext.m4 /m4/gettext.m4
/m4/glibc2.m4 /m4/glibc2.m4

File diff suppressed because it is too large Load Diff

View File

@@ -19,8 +19,8 @@ Regenerate the yml by running `ci-fairy generate-template`.
There are also tests for checking that the yml is correct: There are also tests for checking that the yml is correct:
1) run `tools/check-gitlab-ci.sh` 1) run `tools/check-gitlab-ci.sh`
2) run `meson test check-local-gitlab-ci`, which runs 1). This also 2) run `make check-local-gitlab-ci`, which runs 1). This also
runs as part of `meson test`. runs as part of `make check`.
In both cases, the test is skipped if `ci-fairy` is not in the path. In both cases, the test is skipped if `ci-fairy` is not in the path.
Install the correct `ci-fairy` version. Install the correct `ci-fairy` version.

View File

@@ -16,7 +16,7 @@
# see https://docs.gitlab.com/ee/ci/yaml/#includefile # see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3 .templates_sha: &template_sha 184ca628f89f3193c249b4e34e45afee2773a833
{# Group distros by their common (name,) tuples.#} {# Group distros by their common (name,) tuples.#}
{% set distro_groups = [] %} {% set distro_groups = [] %}
@@ -43,8 +43,6 @@ include:
ref: *template_sha ref: *template_sha
file: '/templates/{{distro_group.name}}.yml' file: '/templates/{{distro_group.name}}.yml'
{% endfor %} {% endfor %}
- project: 'freedesktop/ci-templates'
file: '/templates/ci-fairy.yml'
stages: stages:
- prep - prep
@@ -53,7 +51,6 @@ stages:
- tier3 - tier3
- deploy - deploy
- triage - triage
- coverity
variables: variables:
FDO_UPSTREAM_REPO: NetworkManager/NetworkManager FDO_UPSTREAM_REPO: NetworkManager/NetworkManager
@@ -88,7 +85,6 @@ variables:
- NetworkManager-1*.tar.xz - NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm - NetworkManager-1*.src.rpm
- nm-test.log - nm-test.log
- testlog.txt
.nm_artifacts_debug: .nm_artifacts_debug:
artifacts: artifacts:
@@ -96,7 +92,6 @@ variables:
when: always when: always
paths: paths:
- nm-test.log - nm-test.log
- testlog.txt
################################################################# #################################################################
# # # #
@@ -118,13 +113,8 @@ tier{{distro.tier}}:{{distro.name}}:{{version}}@prep:
FDO_DISTRIBUTION_VERSION: '{{version}}' FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC
rules: {% if distro.tier > 1 %}
{% if distro.tier == 1 %} when: manual
- if: $CI_PIPELINE_SOURCE != 'schedule' || $SCHEDULED_PIPELINE_NAME == "weekly"
{% else %}
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
@@ -161,10 +151,12 @@ t_{{distro.name}}:{{version}}:
parallel: parallel:
matrix: matrix:
- NM_TEST_SELECT_RUN: - NM_TEST_SELECT_RUN:
- autotools+gcc+docs+valgrind
- meson+gcc+docs+valgrind - meson+gcc+docs+valgrind
- autotools+clang
- meson+clang - meson+clang
- rpm+autotools
- rpm+meson - rpm+meson
- tarball+meson
- tarball - tarball
- subtree - subtree
{% endif %} {% endif %}
@@ -179,8 +171,6 @@ t_{{distro.name}}:{{version}}:
{% endif %} {% endif %}
needs: needs:
- "tier{{distro.tier}}:{{distro.name}}:{{version}}@prep" - "tier{{distro.tier}}:{{distro.name}}:{{version}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
@@ -198,8 +188,6 @@ check-patch:
FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
needs: needs:
- "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep" - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1 stage: tier1
script: script:
- date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh
@@ -213,12 +201,6 @@ check-tree:
FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
needs: needs:
- "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep" - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1 stage: tier1
script: script:
- date '+%Y%m%d-%H%M%S'; clang-format --version - date '+%Y%m%d-%H%M%S'; clang-format --version
@@ -227,7 +209,7 @@ check-tree:
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code - date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
- date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ] - date '+%Y%m%d-%H%M%S'; ./autogen.sh && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
pages: pages:
stage: deploy stage: deploy
@@ -237,63 +219,25 @@ pages:
expire_in: 20 days expire_in: 20 days
paths: paths:
- public - public
rules: only:
- if: $CI_PIPELINE_SOURCE == 'schedule' - main
when: never
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
dependencies: dependencies:
- "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]" - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [autotools+gcc+docs+valgrind]"
needs: needs:
- "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]" - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [autotools+gcc+docs+valgrind]"
triage:issues: triage:issues:
stage: triage stage: triage
image: ruby:3 image: ruby:2.7
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "daily"
tags:
- placeholder-job # The job mostly waits on network requests, so use only one CPU: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/1358#note_2457416
script: script:
- gem install gitlab-triage - gem install gitlab-triage
- gitlab-triage --debug --token $API_TOKEN --source-id $CI_PROJECT_ID - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
only:
coverity: - schedules
extends:
- .fdo.distribution-image@{{default_distro.name}}
variables:
FDO_DISTRIBUTION_VERSION: '{{default_distro.versions[0]}}'
FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
stage: coverity
needs:
- "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- dnf install -y curl
- CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
- cd build
- ../.gitlab-ci/coverity.sh download
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
- ../.gitlab-ci/coverity.sh upload
# Clean the generated images periodically to get updated snapshots of the distribution images.
# Create an scheduled pipeline to run it, passing an AUTHFILE environment variable of type
# 'File' with an authentication token with API access level.
clean-images:
extends:
- .fdo.ci-fairy
stage: prep
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- ci-fairy -v --authfile $AUTHFILE delete-image --project NetworkManager/NetworkManager --all
# Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html) # Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html)
# https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg # https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
workflow: workflow:
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'schedule' - if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH

View File

@@ -18,57 +18,52 @@ base_types:
# The list of all distributions we want to create job for. # The list of all distributions we want to create job for.
distributions: distributions:
# TIER 1: CI run for all MRs.
# The first tier:1 in the list is used to build the pages and check-{tree,patch}.
- name: fedora - name: fedora
# The first tier:1 in the list is used to build the pages and check-{tree,patch}
tier: 1 tier: 1
versions: versions:
- '42' - '39'
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release.
- name: fedora - name: fedora
tier: 2 tier: 2
versions: versions:
- 'rawhide' - '37'
- '38'
- '40'
- name: fedora
tier: 3
versions:
- '30'
- '31'
- '32'
- '33'
- '34'
- '35'
- '36'
- name: ubuntu
tier: 2
versions:
- '18.04'
- '20.04'
- '22.04'
- 'devel'
- 'rolling'
- name: debian
tier: 2
versions:
- '10'
- '11'
- 'sid'
- name: debian
tier: 3
versions:
- '9'
- 'testing'
- name: centos - name: centos
tier: 2 tier: 2
versions: versions:
- 'stream8'
- 'stream9' - 'stream9'
- name: ubuntu
tier: 2
versions:
- 'devel'
- name: debian
tier: 2
versions:
- 'testing'
- 'sid'
- name: alpine - name: alpine
tier: 2 tier: 2
versions: versions:
- 'edge' - 'latest'
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release.
- name: fedora
tier: 3
versions:
- '41'
- name: ubuntu
tier: 3
versions:
- '25.04'
- '24.10'
- '24.04'
- '22.04'
- name: debian
tier: 3
versions:
- '12'
- name: alpine
tier: 3
versions:
- '3.21'
- '3.20'
- '3.19'

View File

@@ -1,25 +0,0 @@
#!/bin/bash
set -e
[ "$COVERITY_SCAN_PROJECT_NAME" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
[ "$COVERITY_SCAN_TOKEN" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
if [ "$1" = "download" ]; then
curl https://scan.coverity.com/download/linux64 \
-o /tmp/cov-analysis-linux64.tar.gz \
--form "project=$COVERITY_SCAN_PROJECT_NAME" \
--form "token=$COVERITY_SCAN_TOKEN"
tar xvzf /tmp/cov-analysis-linux64.tar.gz
elif [ "$1" = "upload" ]; then
tar cvzf cov-int.tar.gz cov-int
ls -l cov-int.tar.gz
curl "https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME" \
--form "token=$COVERITY_SCAN_TOKEN" --form "email=$GITLAB_USER_EMAIL" \
--form file=@cov-int.tar.gz --form version="`meson introspect --projectinfo | jq -r .version`" \
--form description="ci run: $CI_COMMIT_TITLE / `git rev-parse --short HEAD`"
rm -rf cov-int*
else
echo "invalid command: $1" >&2
exit 1
fi

View File

@@ -1,141 +0,0 @@
# Fedora:
# cadence: every 6 months
# support: 13 months
# Image aliases: latest, rawhide
# Releases and support info: https://docs.fedoraproject.org/en-US/releases/lifecycle/
# NetworkManager versions info: https://src.fedoraproject.org/rpms/NetworkManager
fedora:
- version: rawhide
support: yes
nm: main
- version: 42
support: 2026-05-13
nm: 1.52
tier1-default: yes
- version: 41
support: 2025-11-19
nm: 1.50
# CentOS Stream
centos:
- version: stream9
support: 2027-05-31
nm: main
# RHEL:
# Even minor versions:
# cadence: every year
# support: 2 years EUS + 2 years SAP / Enhaced EUS
# Odd minor versions:
# cadence: every year (every other 6 months than even versions)
# support: 6 months
# Releases and support info: https://access.redhat.com/support/policy/updates/errata
rhel:
- version: 9.6 # not released yet
support: yes
nm: main
- version: 9.5
support: yes
nm: 1.48
- version: 9.4
support: 2026-04-30
extended-support: 2028-04-30
nm: 1.46
- version: 9.2
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.42
- version: 8.10 # last RHEL 8 release, maintenaince support only
support: 2029-05-31
extended-support: no
nm: 1.40
- version: 8.8
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.40
# SAP / Enhaced EUS only:
- version: 9.0
support: 2024-05-31
extended-support: 2026-05-31
nm: 1.36
- version: 8.6
support: 2024-05-31
extended-support: 2026-05-31
nm: 1.36
# Ubuntu:
# LTS:
# cadence: every 2 years
# support: 5 years LTS + 5 years extended security
# non-LTS (rolling):
# cadence: every 6 months
# support: 9 months
# Image aliases: latest (LTS), rolling (LTS or non-LTS), devel
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/ubuntu.csv
# NetworkManager versions info: https://packages.ubuntu.com/search?keywords=network-manager
ubuntu:
- version: devel
support: yes
nm: main
- version: 25.04
name: plucky
support: 2026-01-15
nm: 1.52
- version: 24.10
name: oracular
support: 2025-07-10
nm: 1.48
- version: 24.04
name: noble
support: 2029-05-31
extended-support: 2034-04-25
nm: 1.46
- version: 22.04
name: jammy
support: 2027-06-01
extended-support: 2032-04-21
nm: 1.36
# Debian:
# cadence: every 2 years
# support: 3 years + 2 years LTS
# Images aliases: testing, sid, stable, oldstable, oldoldstable
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/debian.csv
# NetworkManager versions info: https://packages.debian.org/search?keywords=network-manager
debian:
- version: testing
support: yes
nm: main
- version: sid
support: yes
nm: main
- version: 12
name: bookworm
support: 2026-06-11
extended-support: 2028-06-30
nm: 1.42
- version: 11
name: bullseye
support: 2024-08-15
extended-support: 2026-08-31
nm: 1.30
# Alpine:
# cadence: every 6 months
# support: 2 years
# Image aliases: latest, edge (development)
# Releases and support info: https://alpinelinux.org/releases/
# NetworkManager versions info (manually select Alpine version): https://pkgs.alpinelinux.org/packages?name=networkmanager&arch=x86_64
alpine:
- version: edge
support: yes
nm: main
- version: 3.21
support: 2026-11-01
nm: 1.50
- version: 3.20
support: 2026-04-01
nm: 1.46
- version: 3.19
support: 2025-11-01
nm: 1.44

View File

@@ -1,234 +0,0 @@
#!/usr/bin/env python3
import datetime
import os
import sys
try:
import yaml
except ImportError:
print("Error: missing pyyaml. Install with `pip install pyyaml`.", file=sys.stderr)
quit(code=1)
# These are the distros that we currently check, ordered by priority to be chosen as Tier 1
ci_distros = ("fedora", "centos", "debian", "ubuntu", "alpine")
def _parse_date(date_str) -> datetime.date:
return datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
def _is_supported(val_str, today) -> bool:
val_str = val_str.lower()
if val_str in ("yes", "true"):
return True
elif val_str in ("no", "false"):
return False
else:
support_date = _parse_date(val_str)
return today <= support_date
def _nm_version_is_newer(nm_ver, nm_ver_from):
if nm_ver == "main":
return nm_ver_from != "main" # main is newer than anything except main itself
elif nm_ver_from == "main":
return False
nm_ver = nm_ver.split(".")
nm_ver_from = nm_ver_from.split(".")
if int(nm_ver[0]) > int(nm_ver_from[0]):
return True
elif nm_ver[0] == nm_ver_from[0] and int(nm_ver[1]) > int(nm_ver_from[1]):
return True
return False
def _print_usage():
print("Usage: distros_support.py [-a|--all] | <nm_version>")
print(" -a|--all: print NM versions still active in any distro")
print(" nm_version: print all info and config.yml file of the specified NM version")
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help", "help"):
_print_usage()
quit()
elif len(sys.argv) > 2:
print("Error: wrong arguments.", file=sys.stderr)
_print_usage()
quit(code=1)
today = datetime.date.today()
with open(os.path.dirname(__file__) + "/distros-info.yml") as f:
distros_info = yaml.load(f, Loader=yaml.BaseLoader)
# Warn about EOL'd distros to remove them
for distro, versions in distros_info.items():
for info in versions:
if _is_supported(info["support"], today):
continue
if "extended-support" in info and _is_supported(
info["extended-support"], today
):
continue
print(
f"Warn: {distro} {info['version']} reached EOL, consider deleting this entry",
file=sys.stderr,
)
# If --all is selected, print all active NM versions and return
if len(sys.argv) < 2 or sys.argv[1] in ("-a", "--all"):
nm_versions = {}
for distro, versions in distros_info.items():
for info in versions:
if not _is_supported(info["support"], today):
continue
nm_versions.setdefault(info["nm"], []).append(f"{distro} {info['version']}")
for nm_ver, distros in sorted(nm_versions.items(), reverse=True):
print("- NM {}: {}".format(nm_ver, ", ".join(distros)))
quit()
# Otherwise, print all the info related to the specified NM version
nm_version = sys.argv[1]
# Print distros that uses this nm_version
print(f"# List of distros using NM {nm_version}")
print("---")
for distro, versions in distros_info.items():
for info in versions:
if nm_version == info["nm"] and _is_supported(info["support"], today):
try:
support_end_date = _parse_date(info["support"])
print(
f"- {distro} {info['version']}, supported until {info['support']}"
)
except ValueError:
print(f"- {distro} {info['version']}, supported")
# Collect info about what distros should be Tier 2 and 3
tier2 = {}
tier3 = {}
for distro, versions in distros_info.items():
if distro not in ci_distros:
continue
for info in versions:
if not _is_supported(info["support"], today):
continue
if nm_version == info["nm"]:
tier2.setdefault(distro, []).append(info["version"])
elif _nm_version_is_newer(nm_version, info["nm"]):
tier3.setdefault(distro, []).append(info["version"])
# Select a Tier1 distro
tier1_distro, tier1_version = "", ""
for fed_ver_info in distros_info["fedora"]:
# We prefer the Fedora version marked as tier1-default
if fed_ver_info.get("tier1-default", False):
for tier in (tier2, tier3):
if fed_ver_info["version"] in tier.get("fedora", []):
tier1_distro = "fedora"
tier1_version = fed_ver_info["version"]
tier["fedora"].remove(fed_ver_info["version"])
if not tier["fedora"]:
del tier["fedora"]
for distro in ci_distros:
if tier1_distro:
break
for tier in (tier2, tier3):
if distro in tier:
# Exception: we want to use fedora:latest instead of fedora:rawhide because
# we don't want lot of build failures in Tier 1, which is run for every MR.
# We just ignore fedora:rawhide for Tier 1.
if distro == "fedora" and tier[distro][0] == "rawhide":
if len(tier[distro]) == 1:
continue
idx = 1
else:
idx = 0
tier1_distro = distro
tier1_version = tier[distro].pop(idx)
if not tier[distro]:
del tier[distro]
break
if not tier1_distro or not tier1_version:
print("Warn: no suitable distro for Tier 1 found", file=sys.stderr)
# Always add CentOS Stream at least as Tier 3
for centos_ver_info in distros_info["centos"]:
version = centos_ver_info["version"]
found = False
if tier1_distro == "centos" and tier1_version == version:
found = True
for tier in (tier2, tier3):
if "centos" in tier and version in tier["centos"]:
found = True
break
if not found:
tier3.setdefault("centos", []).append(version)
# Print the config.yml needed for the corresponding stable branch
branch = "main" if nm_version == "main" else "nm-" + nm_version.replace(".", "-")
print("\n# .gitlab-ci/config.yml for branch '{}'".format(branch))
print(
"""---
# This file contains the configuration for the gitlab ci.
#
# To recreate the .gitlab-ci.yml file, run
# ci-fairy generate-template
#
# The ci-fairy tool is part of
# https://gitlab.freedesktop.org/freedesktop/ci-templates
#
# Some distros are fairly similar, and we reuse similar scripts.
# The base type maps the distro name to their base.
base_types:
fedora: fedora
centos: fedora
debian: debian
ubuntu: debian
alpine: alpine
# The list of all distributions we want to create job for.
distributions:
# TIER 1: CI run for all MRs.
# The first tier:1 in the list is used to build the pages and check-{tree,patch}."""
)
print(" - name: {}".format(tier1_distro))
print(" tier: 1")
print(" versions:")
print(" - '{}'".format(tier1_version))
print(
"""
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release."""
)
for distro, versions in tier2.items():
print(" - name: {}".format(distro))
print(" tier: 2")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))
print(
"""
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release."""
)
for distro, versions in tier3.items():
print(" - name: {}".format(distro))
print(" tier: 3")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))

View File

@@ -5,7 +5,6 @@ set -ex
IS_FEDORA=0 IS_FEDORA=0
IS_CENTOS=0 IS_CENTOS=0
CENTOS_VERSION=0 CENTOS_VERSION=0
FEDORA_VERSION=0
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1 grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1 grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
if [ $IS_CENTOS = 1 ]; then if [ $IS_CENTOS = 1 ]; then
@@ -39,33 +38,22 @@ fi
fi fi
NM_NO_EXTRA=1 NM_INSTALL="yum install -y --allowerasing" ./contrib/fedora/REQUIRED_PACKAGES NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
yum install -y glibc-langpack-pl ccache clang yum install -y glibc-langpack-pl ccache clang
# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html # containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
# to generate proper documentation. # to generate proper documentation.
yum reinstall -y --setopt='tsflags=' glib2-doc yum reinstall -y --setopt='tsflags=' glib2-doc
if [ $IS_FEDORA = 1 ]; then
FEDORA_VERSION=$(cat /etc/os-release | grep '^VERSION_ID=' | sed s\/"VERSION_ID="\/\/)
fi
if command -v dnf &>/dev/null; then if command -v dnf &>/dev/null; then
dnf install -y python3-dnf-plugins-core dnf install -y python3-dnf-plugins-core
# Fedora 41 migrated to DNF5 and the debuginfo-install plugin is not implemented yet dnf debuginfo-install -y glib2
# therefore we need to enable the repo and install the debuginfo subpackage manually
if [ $FEDORA_VERSION -lt "41" ]; then
dnf debuginfo-install -y glib2
else
dnf install -y dnf5-plugins
dnf config-manager setopt fedora-debuginfo.enabled=1
dnf config-manager setopt rawhide-debuginfo.enabled=1 || true
dnf install -y glib2-debuginfo
fi
else else
debuginfo-install -y glib2 debuginfo-install -y glib2
fi fi
contrib/scripts/nm-ci-patch-gtkdoc.sh || true
if [ -x /usr/bin/ninja ] && ! [ -x /usr/bin/ninja-build ]; then if [ -x /usr/bin/ninja ] && ! [ -x /usr/bin/ninja-build ]; then
ln -s /usr/bin/ninja-build /usr/bin/ninja ln -s /usr/bin/ninja-build /usr/bin/ninja
fi fi

View File

@@ -40,7 +40,7 @@ uname -a
meson --version meson --version
! command -v dpkg &>/dev/null || dpkg -l ! command -v dpkg &>/dev/null || dpkg -l
! command -v dnf &>/dev/null || dnf list --installed ! command -v yum &>/dev/null || yum list installed
! command -v apk &>/dev/null || apk -v info ! command -v apk &>/dev/null || apk -v info
# We have a unit test that check that `ci-fairy generate-template` # We have a unit test that check that `ci-fairy generate-template`
@@ -50,17 +50,19 @@ meson --version
export NMTST_SKIP_CHECK_GITLAB_CI=1 export NMTST_SKIP_CHECK_GITLAB_CI=1
# Assert that "$1" is one of the valid values for NM_TEST_SELECT_RUN. die() otherwise. # Assert that "$1" is one of the valid values for NM_TEST_SELECT_RUN. die() otherwise.
is_run_selected_assert() { check_run_assert() {
{ set +x; } 2>/dev/null { set +x; } 2>/dev/null
local run="$1" local run="$1"
local a local a
# These are the supported $NM_TEST_SELECT_RUN values. # These are the supported $NM_TEST_SELECT_RUN values.
local _CHECK_RUN_LIST=( local _CHECK_RUN_LIST=(
autotools+gcc+docs+valgrind
meson+gcc+docs+valgrind meson+gcc+docs+valgrind
autotools+clang
meson+clang meson+clang
rpm+autotools
rpm+meson rpm+meson
tarball+meson
tarball tarball
subtree subtree
@@ -83,57 +85,48 @@ is_run_selected_assert() {
} }
[ -z "$NM_TEST_SELECT_RUN" ] && NM_TEST_SELECT_RUN=all [ -z "$NM_TEST_SELECT_RUN" ] && NM_TEST_SELECT_RUN=all
is_run_selected_assert "$NM_TEST_SELECT_RUN" check_run_assert "$NM_TEST_SELECT_RUN"
is_run_selected() { check_run() {
local run="$1" local test_no="$1"
is_run_selected_assert "$run" check_run_assert "$test_no"
# Usually, we run the build several times. However, for testing # Usually, we run the build several times. However, for testing
# the build script manually, it can be useful to explicitly select # the build script manually, it can be useful to explicitly select
# one step to run. For example, if step 3 is known to fail, you # one step to run. For example, if step 3 is known to fail, you
# can still manually run step A by setting NM_TEST_SELECT_RUN=A. # can still manually run step A by setting NM_TEST_SELECT_RUN=A.
test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$run" test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$test_no"
} }
die_with_testlog() { check_run_clean() {
mv ./build/meson-logs/testlog.txt ./testlog.txt if ! check_run "$1" ; then
exit 1 return 1
}
if is_run_selected meson+gcc+docs+valgrind ; then
do_clean
CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
fi
if is_run_selected meson+clang; then
do_clean
CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
if is_run_selected rpm+meson; then
do_clean
if [[ $IS_FEDORA = 1 ]]; then
./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson || die_with_testlog
fi fi
do_clean
return 0
}
if check_run_clean autotools+gcc+docs+valgrind ; then
BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
mv build/INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
fi fi
if is_run_selected tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then check_run_clean meson+gcc+docs+valgrind && BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
do_clean check_run_clean autotools+clang && BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r || die_with_testlog check_run_clean meson+clang && BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
mv ./build/meson-dist/NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
check_run_clean rpm+autotools && test $IS_FEDORA = 1 -o $IS_CENTOS = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson
check_run_clean rpm+meson && test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r
mv ./NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/" mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/"
do_clean do_clean
fi fi
if is_run_selected tarball+meson; then
do_clean
CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
############################################################################### ###############################################################################
test_subtree() { test_subtree() {
@@ -159,8 +152,7 @@ test_subtree() {
popd popd
} }
if is_run_selected subtree; then if check_run_clean subtree; then
do_clean
for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
for cc in gcc clang; do for cc in gcc clang; do
test_subtree "$d" "$cc" test_subtree "$d" "$cc"
@@ -172,10 +164,10 @@ fi
if [ "$NM_BUILD_TARBALL" = 1 ]; then if [ "$NM_BUILD_TARBALL" = 1 ]; then
do_clean do_clean
if is_run_selected meson+gcc+docs+valgrind ; then if check_run autotools+gcc+docs+valgrind ; then
mv "$ARTIFACT_DIR/docs-html/" ./ mv "$ARTIFACT_DIR/docs-html/" ./
fi fi
if is_run_selected tarball ; then if check_run tarball ; then
mv \ mv \
"$ARTIFACT_DIR"/NetworkManager-1*.tar.xz \ "$ARTIFACT_DIR"/NetworkManager-1*.tar.xz \
"$ARTIFACT_DIR"/NetworkManager-1*.src.rpm \ "$ARTIFACT_DIR"/NetworkManager-1*.src.rpm \

View File

@@ -1,26 +0,0 @@
/confidential
/label ~"workflow::triage"
## Summary
(Summarize the security vulnerability encountered concisely)
## Version affected
(Which version of NetworkManager is affected (`nmcli --version`), which distro, and the version of any other relevant software involved)
## Vulnerability details
* **Type:** (e.g., Buffer overflow, injection flaws, ...)
* **Severity:** (High/Medium/Low)
* **Any other vulnerability details:**
## Steps to reproduce
## Actual result
## Expected result
## Relevant logs
(Please see the DEBUGGING section of "[man NetworkManager](https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/NetworkManager.html)" and attach any relevant log)

View File

@@ -17,4 +17,3 @@ before opening the merge request. In particular, check that:
- [ ] the source is properly formatted - [ ] the source is properly formatted
- [ ] any relevant documentation is up to date - [ ] any relevant documentation is up to date
- [ ] you have added unit tests if applicable - [ ] you have added unit tests if applicable
- [ ] the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.

View File

@@ -1,171 +1,23 @@
# Gitlab-triage documentation: https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/blob/master/README.md
host_url: https://gitlab.freedesktop.org host_url: https://gitlab.freedesktop.org
resource_rules: resource_rules:
issues: issues:
rules: rules:
- name: Set initial workflow stage
conditions:
state: opened
forbidden_labels:
- workflow::triage
- workflow::investigation
- workflow::devel
actions:
labels:
- workflow::triage
- name: Ensure that only one workflow label is used (1/2)
conditions:
state: opened
labels:
- workflow::triage
- workflow::investigation
forbidden_labels:
- workflow::devel
actions:
remove_labels:
- workflow::triage
- name: Ensure that only one workflow label is used (1/2)
conditions:
state: opened
labels:
- workflow::{triage, investigation}
- workflow::devel
actions:
remove_labels:
- workflow::triage
- workflow::investigation
- name: Remove help-needed::* and unassigned labels on assigned issue
conditions:
state: opened
ruby: resource["assignees"].length > 0
labels:
- help-needed::{triage, investigation, devel}
- unassigned
actions:
remove_labels:
- help-needed::triage
- help-needed::investigation
- help-needed::devel
- unassigned
- name: Add help-needed::triage and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::triage
forbidden_labels:
- help-needed::triage
- unassigned
actions:
labels:
- help-needed::triage
- unassigned
- name: Remove wrong help-needed::* labels for issues on triage stage
conditions:
state: opened
labels:
- workflow::triage
- help-needed::{investigation, devel}
actions:
remove_labels:
- help-needed::investigation
- help-needed::devel
- name: Add help-needed::investigation and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::investigation
forbidden_labels:
- help-needed::investigation
- unassigned
actions:
labels:
- help-needed::investigation
- unassigned
- name: Remove wrong help-needed::* labels for issues on investigation stage
conditions:
state: opened
labels:
- workflow::investigation
- help-needed::{triage, devel}
actions:
remove_labels:
- help-needed::triage
- help-needed::devel
- name: Add help-needed::devel and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::devel
forbidden_labels:
- help-needed::devel
- unassigned
actions:
labels:
- help-needed::devel
- unassigned
- name: Remove wrong help-needed::* labels for issues on devel stage
conditions:
state: opened
labels:
- workflow::devel
- help-needed::{triage, investigation}
actions:
remove_labels:
- help-needed::triage
- help-needed::investigation
- name: Remove triage::* labels if the issue is not triaged
conditions:
state: opened
labels:
- workflow::triage
- triaged::{bug, RFE}
actions:
remove_labels:
- triaged::bug
- triaged::RFE
- name: Ensure that only one triaged::* label is used
conditions:
state: opened
labels:
- triaged::bug
- triaged::RFE
actions:
remove_labels:
- triaged::RFE
- name: Mark issue as stale with no activity for 4 months - name: Mark issue as stale with no activity for 4 months
conditions: conditions:
state: opened
date: date:
attribute: updated_at attribute: updated_at
condition: older_than condition: older_than
interval_type: months interval_type: months
interval: 4 interval: 4
state: opened
forbidden_labels: forbidden_labels:
- stale - stale
actions: actions:
comment: >- comment: |
This issue has been inactive for 4 months and got stale. This issue has been inactive for 4 months and got stale. Contributions welcome to move it forward.
Contributions welcome to move it forward.
labels: labels:
- stale - stale
merge_requests: merge_requests:
rules: rules:
- name: Mark merge-request as stale after no activity for 2 months - name: Mark merge-request as stale after no activity for 2 months
@@ -179,52 +31,7 @@ resource_rules:
forbidden_labels: forbidden_labels:
- stale - stale
actions: actions:
comment: >- comment: |
This merge-request has been inactive for 2 months and got stale. This merge-request has been inactive for 2 months and got stale. Work is necessary to move it forward.
Work is necessary to move it forward.
labels: labels:
- stale - stale
- name: Label for MRs authored by core contributors (member_of project)
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
author_member:
source: project
condition: member_of
source_id: NetworkManager/NetworkManager
actions:
labels:
- core-contributor
- name: Label for MRs authored by core contributors (member_of group)
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
author_member:
source: group
condition: member_of
source_id: NetworkManager
actions:
labels:
- core-contributor
- name: Label for MRs authored by community contributors and ensure CI is run
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
actions:
labels:
- community-contributor
comment_type: thread
comment: >-
Attention maintainers: remember to run the CI!!
This MR is authored by a contributor from the community and the CI does not
run automatically.

View File

@@ -33,35 +33,8 @@ and you still need to review them. You can also personally hand over the logfile
to a NM developer to treat it confidential. to a NM developer to treat it confidential.
Help with issues triage Contribute
----------------------- ----------
The big amount of reported issues is difficult to handle by the small team of
developers actively working on the project. Many bugs remain unfixed because
there is no enough time to investigate them.
Working on issues triage and investigation is a very useful help that many
people can provide very effectively, even if they can't do the fix in the
code afterwards.
This is the kind of help that may facilitate other developers to prepare a fix:
- Investigate if it's a real bug or if it's expected behaviour.
- Provide information and context to explain why it is a bug and what the
expected behaviour would be.
- Create reproducers.
- Investigate where the failure might be in the code, even if you don't know
how to fix it.
- In a general sense, provide any information that might be useful later.
Find issues with the `help-needed::triage` and `help-needed::investigation`
label in our [issue tracker](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues)
and help with them. Issues in "investigation" stage has been triaged, i.e.
identified as a bug, but there is not enough information to start working on it
yet.
Contribute patches
------------------
Send patches to our repository at [gitlab.freedesktop.org](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/). Send patches to our repository at [gitlab.freedesktop.org](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/).
If you are willing to contribute, please read these guidelines first: If you are willing to contribute, please read these guidelines first:
@@ -70,8 +43,11 @@ If you are willing to contribute, please read these guidelines first:
- Work on any issue you want, but please put a comment to indicate that you are - Work on any issue you want, but please put a comment to indicate that you are
willing to work on it so others don't do the same work in parallel, or to willing to work on it so others don't do the same work in parallel, or to
check whether anyone is already doing so. You can find issues waiting for a check whether anyone is already doing so.
developer to work on it searching for the `help-needed::devel` label.
- Issues marked as `help-wanted` are those where the NetworkManager developers
are explicitly asking for contributors' help, probably due to lack of capacity
to work on it.
- Issues marked as `good-first-issue` indicate that they are probably quite - Issues marked as `good-first-issue` indicate that they are probably quite
simple fixes, well suited for first time contributors. simple fixes, well suited for first time contributors.
@@ -221,11 +197,17 @@ you can look at [this](contrib/fedora/REQUIRED_PACKAGES)
script and [here](contrib/debian/REQUIRED_PACKAGES) script and [here](contrib/debian/REQUIRED_PACKAGES)
is a script for Debian/Ubuntu. is a script for Debian/Ubuntu.
meson is the recommended way for building NetworkManager. You can configure Both meson and autotools are supported. You may choose whatever you prefer.
the build environment using the `meson setup` command: For autotools the common steps are
``` ```
meson setup build/ $CONFIGURE_OPTIONS ./autogen.sh $CONFIGURE_OPTIONS
make -j 8
# optional: sudo make install
```
and for meson it's
```
meson build $CONFIGURE_OPTIONS
ninja -C build ninja -C build
# optional: sudo meson install -C build # optional: sudo meson install -C build
``` ```
@@ -234,13 +216,6 @@ Beware to set the correct `$CONFIGURE_OPTIONS`. In particular, you may
not want the default installation prefix and not overwrite files in not want the default installation prefix and not overwrite files in
`/usr`. `/usr`.
To specify options when setting up the meson environment, the `-D` argument
is used, like: `meson setup build -Ddocs=true`.
To get a list of all possible configuration options, you can use `meson configure`.
For additional usage, refer to the meson manual.
### Fedora ### Fedora
For Fedora/RHEL/CentOS, you can build an RPM from upstream sources with For Fedora/RHEL/CentOS, you can build an RPM from upstream sources with
@@ -256,13 +231,14 @@ maintained by the upstream maintainers. There you find builds of latest `main` a
Unit Tests Unit Tests
---------- ----------
We have plenty of unit tests. Run them with `meson test -C build`. We have plenty of unit tests. Run them with `make check` or
`meson test -C build`.
Note that some files in the source tree are both generated and commited Note that some files in the source tree are both generated and commited
to git. That means, certain changes to the code also affect these generated to git. That means, certain changes to the code also affect these generated
files. The unit test fail in that case, to indicate that the generated files. The unit test fail in that case, to indicate that the generated
files no longer match what is commited to git. files no longer match what is commited to git.
You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 meson test`. You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 make check`.
Note that test-client requires working translation. Note that test-client requires working translation.
See the [comment](src/tests/client/test-client.py#L14) See the [comment](src/tests/client/test-client.py#L14)
for how to configure it. for how to configure it.
@@ -415,7 +391,7 @@ have `-I. -I./src/` in their build arguments. So to include a header like
[`src/libnm-glib-aux/nm-random-utils.h`](src/libnm-glib-aux/nm-random-utils.h) [`src/libnm-glib-aux/nm-random-utils.h`](src/libnm-glib-aux/nm-random-utils.h)
you'd do `#include "libnm-glib-aux/nm-random-utils.h"`. you'd do `#include "libnm-glib-aux/nm-random-utils.h"`.
Note that there are exceptions. For example, [`src/libnm-std-aux/nm-linux-compat.h`](src/libnm-std-aux/nm-linux-compat.h) Note that there are exceptions. For example, `src/libnm-std-aux/nm-linux-compat.h`](src/libnm-std-aux/nm-linux-compat.h)
may need to be included before system headers as it is supposed to include headers may need to be included before system headers as it is supposed to include headers
from `src/linux-headers`](src/linux-headers). from `src/linux-headers`](src/linux-headers).

View File

@@ -6,51 +6,38 @@ Issue tracker: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/is
Help other maintainers with the triage following these guidelines. This way, it Help other maintainers with the triage following these guidelines. This way, it
will be easier to find issues that require attention. will be easier to find issues that require attention.
- Workflow: indicate the current stage with the corresponding label: - Assign an issue to yourself if you are going to take care of providing the
required help. Assign it to another person if he/she is more suitable to help,
but do this quite rarely so we take care of not overloading to anyone.
- `workflow::triage`: needs triage to determine whether is a bug, an RFE or we - Add suitable labels to indicate the state of open issues:
should close it.
- `workflow::investigation`: has been triaged but more info is needed to start
working on a fix. This step can be skipped if enough information is provided
during triage.
- `workflow::devel`: on development (or waiting for it).
- Closed: the issue is already solved, either via a code fix or via providing
the required info. Also if the request is clearly incorrect or doesn't fit
at all in the project.
- Assignee: assign the issue to the person that is working on it. This will
remove the `unassigned` and `help-needed::*` labels.
- Manual labels: add suitable labels to indicate the state of open issues:
- `need-info`: waiting for info or feedback from anyone. - `need-info`: waiting for info or feedback from anyone.
- `good-first-issue`: the task is simple and well suited for a first time
contributor.
- `triaged::bug` / `triaged::RFE`: type of issue.
- `need-discussion`: something is not clear about what to do, or about if - `need-discussion`: something is not clear about what to do, or about if
something has to be done at all. The problem should be discussed by the something has to be done at all. The problem should be discussed by the
maintainers and/or with the reporter and/or other interested parts. maintainers and/or with the reporter and/or other interested parts.
- `triaged`: if the problem is properly explained and understood. Add also
one of the labels `bug` or `RFE` as corresponds.
- `help-wanted`: request external contributors to work on this. If it's a
simple fix, add `good-first-issue` too.
- `work-in-progress`: anyone is already working on a Merge Request, so others.
- `blocked`: the issue is waiting for something that blocks its progress - `blocked`: the issue is waiting for something that blocks its progress
- `close-proposed`: there are good reasons to reject the request (explain - `close-proposed`: there are good reasons to reject the request (explain
those reasons when adding the label) but a chance to others to provide those reasons when adding the label). If after a reasonable time there is no
reasons against it is desired. additional info that is good enouch to reconsider it, the issue will be
It is not mandatory to always use this tag. closed.
It is not mandatory to always use this tag before closing an issue, but
- `Spam`: mark as spam, blocking the author. See [damspam](https://gitlab.freedesktop.org/freedesktop/damspam/-/blob/main/README.md?ref_type=heads). usually desirable.
- Automatic labels: some labels are automatically added and removed by a bot and - Close an issue if the problem is already solved, either via a code fix or via
the maintainers don't need to care much about them. The label `stale` is some information that has been provided. Also if the request is clearly
used for issues without activity for a long time. The labels `unassigned` and incorrect or doesn't fit at all in the project.
`help-needed::{triage, investigation, devel}` are used for issues without an
assignee.
Merging Merge Requests Merging Merge Requests
@@ -172,116 +159,14 @@ In practice when we want to backport new API from main we have two options:
19d7e66099ee43f47d6be0e740dc710fc365d200. Then, on main we add duplicate 19d7e66099ee43f47d6be0e740dc710fc365d200. Then, on main we add duplicate
symbols with commit 5eade4da11ee38a0e7faf4a87b2c2b5af07c5eeb. symbols with commit 5eade4da11ee38a0e7faf4a87b2c2b5af07c5eeb.
### Reimporting systemd
NetworkManager release process
------------------------------
It's mostly automated by [release.sh](contrib/fedora/rpm/release.sh).
Before running the script:
- For stable releases, remember to backport all commits with "Fixes:" tag that
are applicable. Use the [find-backports](contrib/scripts/find-backports)
script to find them.
- Start all the jobs in the latest Gitlab pipeline of the right branch. The
script checks that they ran successfully.
Tiers 1 and 2 must pass, failed Tier 3 jobs can be fixed after the release.
The script also takes care of choosing the right version number depending on the
release type that you specify, like devel, rc1, rc, major, major-post, etc.
Run the script with `--help` to see all options.
Notes:
- You need a private token from gitlab.freedesktop.org with 'api' level access
to the project. It can be saved to `~/.config/nm-release-token` or passed to
the `--gitlab-token` argument of `release.sh`.
- The GPG key used to sign the tags must be exported to a keyserver.
Versioning scheme, automatically handled by the script (version numbers are
called MAJOR.MINOR.MICRO):
- Development releases has an odd MINOR version number (i.e. `1.47.2`).
- Stable releases has an even MINOR version number (i.e. `1.48.1`).
- Release candidates (RC) are tagged like `1.48-rc1`, `1.48-rc2`, etc. But in
NM's internal code they looks like `1.47.90`, `1.47.91`, etc. (MINOR is one
number less, and MICRO is >= 90).
The main differences between the different kind of releases are:
- Development releases: for development and testing purposes only.
- Release candidates (RC): stabilization phase before a stable release. Normally
there are one or two RCs with ~2 weeks cadence. More RCs can be releases if
they are needed.
- Stable releases: Releases within the same stable branch should remain very
stable while fixing important bugs, backported from `main`. New features are
added very rarely.
Stable branches are branched out from `main` to prepare the first release
candidate (RC) of the next stable branch. These branches are called `nm-MAJOR-MINOR`
(i.e. `nm-1-48`). As they are used to release stable versions, the last number
is always even.
There are some additional tasks that the script doesn't handle:
- For RC releases:
- The NEWS file should reflect a curated summary of the changes that the new
stable release will include.
- The release should be announced on the mailing list.
- For stable releases:
- The official documentation must be updated on the website when there is a new
stable release. Use the [import-docs.sh](https://gitlab.freedesktop.org/NetworkManager/networkmanager.pages.freedesktop.org/-/blob/main/scripts/import-docs.sh)
script from the website's repo.
- The release should be announced on the mailing list.
VPN plugins and nm-applet release process
-----------------------------------------
The same versioning scheme and release process is used for the VPN plugins,
nm-applet (including nm-connection-editor) and libnma.
Note that each of them is hosted in its own repository, but this is documented
here to avoid duplication, as the process is the same for all (at least for
those that we maintain).
Also note that there are no stable branches or development versions. Everything
is developed on main, and releases are done on main.
Versioning scheme (version numbers are called MAJOR.MINOR.MICRO):
- Small changes increments only the MICRO number.
- Bigger changes or new features increments the MINOR number.
- There is no strict criteria to define what change is small or big, but try to
adhere mostly to [semantic versioning](https://semver.org/).
- Use only even numbers for MINOR, skipping odd ones. That way we use the same
versioning scheme than the main NM project despite there are no development
versions here.
When doing a release, follow this process:
1. Ensure that `NEWS` file is up to date.
2. Increment the version in `meson.build`, commit and tag the commit. Example:
`git tag -s 1.2.8 -m 'Tag 1.2.8'`.
3. Ensure that you are on the right commit and create the tarball:
`git clean -fdx && meson setup build && cd build && meson dist`
4. Upload the tarball: `scp ./*-*.tar.xz "$user@master.gnome.org:"`
5. Login to `master.gnome.org` and run `ftpadmin install`.
Ensure the new tarballs show up at https://download.gnome.org/sources/
(happens after a short delay)
6. Announce the release on the mailing list.
Notes:
- You need access to master.gnome.org, see [here](https://handbook.gnome.org/infrastructure/accounts.html).
- The GPG key used to sign the tags must be exported to a keyserver.
Reimporting systemd
-------------------
See [here](src/libnm-systemd-shared/README.md#reimport-upstream-code). See [here](src/libnm-systemd-shared/README.md#reimport-upstream-code).
### Copr repository
Copr repository
---------------
See [here](contrib/scripts/nm-copr-build.sh). See [here](contrib/scripts/nm-copr-build.sh).
### gitlab-ci Pipelines
Gitlab-ci Pipelines
-------------------
See [here](.gitlab-ci/README.md). See [here](.gitlab-ci/README.md).

5929
Makefile.am Normal file

File diff suppressed because it is too large Load Diff

221
Makefile.examples Normal file
View File

@@ -0,0 +1,221 @@
###############################################################################
# examples/C/glib
###############################################################################
examples_C_glib_cppflags = \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-client-public \
-I$(top_builddir)/src/libnm-client-public \
$(GLIB_CFLAGS)
examples_C_glib_cppflags_gdbus = $(examples_C_glib_cppflags)
examples_C_glib_cppflags_libnm = $(examples_C_glib_cppflags)
check_programs_norun += \
examples/C/glib/add-connection-gdbus \
examples/C/glib/add-connection-libnm \
examples/C/glib/get-active-connections-gdbus \
examples/C/glib/get-ap-info-libnm \
examples/C/glib/list-connections-gdbus \
examples/C/glib/list-connections-libnm \
examples/C/glib/monitor-nm-running-gdbus \
examples/C/glib/monitor-nm-state-gdbus \
examples/C/glib/vpn-import-libnm \
$(NULL)
examples_C_glib_add_connection_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_add_connection_gdbus_LDADD = \
$(GLIB_LIBS) \
$(UUID_LIBS)
$(examples_C_glib_add_connection_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_add_connection_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_add_connection_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_add_connection_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_get_active_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_get_active_connections_gdbus_LDADD = \
$(GLIB_LIBS)
$(examples_C_glib_get_active_connections_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_get_ap_info_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_get_ap_info_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_get_ap_info_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_list_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_list_connections_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_list_connections_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_list_connections_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_list_connections_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_monitor_nm_running_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_monitor_nm_running_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_monitor_nm_state_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_monitor_nm_state_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_vpn_import_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_vpn_import_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_vpn_import_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
EXTRA_DIST += \
examples/C/glib/meson.build
###############################################################################
# examples/C/qt
###############################################################################
if WITH_QT
examples_C_qt_cppflags = \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_builddir)/libnm \
-I$(top_srcdir)/libnm \
-I$(builddir)/examples/C/qt \
$(DBUS_CFLAGS) \
$(QT_CFLAGS)
check_programs_norun += \
examples/C/qt/add-connection-wired \
examples/C/qt/list-connections \
examples/C/qt/change-ipv4-addresses \
examples/C/qt/monitor-nm-running
examples_C_qt_add_connection_wired_SOURCES = examples/C/qt/add-connection-wired.cpp
examples_C_qt_add_connection_wired_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_add_connection_wired_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_list_connections_SOURCES = examples/C/qt/list-connections.cpp
examples_C_qt_list_connections_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_list_connections_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_change_ipv4_addresses_SOURCES = examples/C/qt/change-ipv4-addresses.cpp
examples_C_qt_change_ipv4_addresses_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_change_ipv4_addresses_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_monitor_nm_running_SOURCES = examples/C/qt/monitor-nm-running.cpp
examples_C_qt_monitor_nm_running_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_monitor_nm_running_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples/C/qt/monitor-nm-running.moc: examples/C/qt/monitor-nm-running.cpp
$(AM_V_GEN) $(MOC) -i $< -o $@
$(examples_C_qt_monitor_nm_running_OBJECTS): examples/C/qt/monitor-nm-running.moc
CLEANFILES += \
examples/C/qt/monitor-nm-running.moc
endif
EXTRA_DIST += \
examples/C/qt/add-connection-wired.cpp \
examples/C/qt/list-connections.cpp \
examples/C/qt/change-ipv4-addresses.cpp \
examples/C/qt/monitor-nm-running.cpp \
examples/C/qt/meson.build
###############################################################################
# examples
###############################################################################
EXTRA_DIST += \
examples/dispatcher/10-ifcfg-rh-routes.sh \
examples/dispatcher/70-wifi-wired-exclusive.sh \
\
examples/js/get_ips.js \
\
examples/lua/lgi/add-connection.lua \
examples/lua/lgi/change-vpn-username.lua \
examples/lua/lgi/deactivate-all.lua \
examples/lua/lgi/get-basic-nm-info.lua \
examples/lua/lgi/get-ips.lua \
examples/lua/lgi/list-connections.lua \
examples/lua/lgi/list-devices.lua \
examples/lua/lgi/show-wifi-networks.lua \
\
examples/nm-conf.d/30-anon.conf \
examples/nm-conf.d/31-mac-addr-change.conf \
\
examples/python/dbus/add-connection-compat.py \
examples/python/dbus/add-connection.py \
examples/python/dbus/add-wifi-eap-connection.py \
examples/python/dbus/add-wifi-psk-connection.py \
examples/python/dbus/add-wifi-sae-connection.py \
examples/python/dbus/checkpoint.py \
examples/python/dbus/create-bond.py \
examples/python/dbus/disconnect-device.py \
examples/python/dbus/get-active-connection-uuids.py \
examples/python/dbus/is-wwan-default.py \
examples/python/dbus/list-connections.py \
examples/python/dbus/list-devices.py \
examples/python/dbus/nm-state.py \
examples/python/dbus/show-bssids.py \
examples/python/dbus/update-ip4-method.py \
examples/python/dbus/update-secrets.py \
examples/python/dbus/vpn.py \
examples/python/dbus/wifi-active-ap.py\
examples/python/dbus/wifi-hotspot.py \
\
examples/python/gi/README \
examples/python/gi/add_connection.py \
examples/python/gi/checkpoint.py \
examples/python/gi/deactivate-all.py \
examples/python/gi/device-reapply.py \
examples/python/gi/device-state-ip4config.py \
examples/python/gi/dns.py \
examples/python/gi/firewall-zone.py \
examples/python/gi/get-active-connections.py \
examples/python/gi/get-devices.py \
examples/python/gi/get-interface-flags.py \
examples/python/gi/get-lldp-neighbors.py \
examples/python/gi/get_ips.py \
examples/python/gi/gmaincontext.py \
examples/python/gi/list-connections.py \
examples/python/gi/nm-add-connection2.py \
examples/python/gi/nm-connection-update-stable-id.py \
examples/python/gi/nm-keyfile.py \
examples/python/gi/nm-up-many.py \
examples/python/gi/nm-update2.py \
examples/python/gi/nm-wg-set \
examples/python/gi/ovs-external-ids.py \
examples/python/gi/setting-user-data.py \
examples/python/gi/show-wifi-networks.py \
examples/python/gi/update-ip4-method.py \
examples/python/gi/vpn-import.py \
examples/python/gi/wifi-p2p.py \
\
examples/python/python-networkmanager/README \
\
examples/ruby/add-connection.rb \
examples/ruby/get-basic-nm-info.rb \
examples/ruby/list-devices.rb \
\
examples/shell/active-wifi.sh \
examples/shell/disconnect-device.sh \
examples/shell/get-hostname.sh \
examples/shell/list-devices.sh \
examples/shell/nm-logging.sh \
\
$(NULL)

168
Makefile.glib Normal file
View File

@@ -0,0 +1,168 @@
#
# Work-in-progress...
# See https://bugzilla.gnome.org/show_bug.cgi?id=654395
_GLIB_CLEANFILES =
_GLIB_DISTCLEANFILES =
_GLIB_V_GEN = $(_glib_v_gen_$(V))
_glib_v_gen_ = $(_glib_v_gen_$(AM_DEFAULT_VERBOSITY))
_glib_v_gen_0 = @echo " GEN " $(subst .stamp,,$@);
### glib-genmarshal
_GLIB_MARSHAL_GENERATED = $(subst .h,,$(filter %marshal.h,$(GLIB_GENERATED)))
_glib_marshal_prefix = $(subst marshal,,$(subst _marshal,,$(subst -,_,$(notdir $(1)))))_marshal
_glib_marshal_sources_var = $(subst -,_,$(notdir $(1)))_sources
_glib_marshal_sources = $(filter-out %.h,$(filter-out $(GLIB_GENERATED),$($(_glib_marshal_sources_var))))
define _glib_make_genmarshal_rules
$(if $(_glib_marshal_sources),,$(error Need to define $(_glib_marshal_sources_var) for $(1).[ch]))
$(1).list.stamp: $(_glib_marshal_sources) Makefile
$$(_GLIB_V_GEN) LC_ALL=C sed -ne 's/.*_$(_glib_marshal_prefix)_\([_A-Z]*\).*/\1/p' $$(filter-out Makefile, $$^) | sort -u | sed -e 's/__/:/' -e 's/_/,/g' > $(1).list.tmp && \
(cmp -s $(1).list.tmp $(1).list || cp $(1).list.tmp $(1).list) && \
rm -f $(1).list.tmp && \
echo timestamp > $$@
$(1).list: $(1).list.stamp
@true
$(1).h: $(1).list
$$(_GLIB_V_GEN) $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --header \
$$(GLIB_GENMARSHAL_H_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_H_FLAGS) \
$$< > $$@.tmp && \
mv $$@.tmp $$@
$(1).c: $(1).list
$$(_GLIB_V_GEN) (echo "#include \"$$(subst .c,.h,$$(@F))\""; $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --body \
$$(GLIB_GENMARSHAL_C_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_C_FLAGS) \
$$< ) > $$@.tmp && \
mv $$@.tmp $$@
_GLIB_CLEANFILES += $(1).list.stamp $(1).list
_GLIB_DISTCLEANFILES += $(1).h $(1).c
endef
$(foreach f,$(_GLIB_MARSHAL_GENERATED),$(eval $(call _glib_make_genmarshal_rules,$f)))
### glib-mkenums
_GLIB_ENUM_TYPES_GENERATED = $(subst .h,,$(filter %enum-types.h %enumtypes.h,$(GLIB_GENERATED)))
_glib_enum_types_prefix = $(subst -,_,$(notdir $(1)))
_glib_enum_types_guard = __$(shell LC_ALL=C echo $(_glib_enum_types_prefix) | tr 'a-z' 'A-Z')_H__
_glib_enum_types_sources_var = $(_glib_enum_types_prefix)_sources
_glib_enum_types_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enum_types_sources_var)))
_glib_enum_types_h_sources = $(filter %.h,$(_glib_enum_types_sources))
define _glib_make_mkenums_rules
$(if $(_glib_enum_types_sources),,$(error Need to define $(_glib_enum_types_sources_var) for $(1).[ch]))
$(1).h.stamp: $(_glib_enum_types_h_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#ifndef $(_glib_enum_types_guard)\n#define $(_glib_enum_types_guard)\n\n" \
$$(GLIB_MKENUMS_H_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
--fhead "#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
--ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
$$(filter-out Makefile, $$^) > $(1).h.tmp && \
(cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \
rm -f $(1).h.tmp && \
echo timestamp > $$@
$(1).h: $(1).h.stamp
@true
$(1).c.stamp: $(_glib_enum_types_h_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"config.h\"\n\n#include \"$(notdir $(1)).h\"\n" \
$$(GLIB_MKENUMS_C_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \
--fhead "$$(foreach f,$$(filter-out Makefile,$$(^F)),\n#include \"$$(f)\")\n\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" },\n" \
--vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n" \
$$(filter-out Makefile, $$^) > $(1).c.tmp && \
(cmp -s $(1).c.tmp $(1).c || cp $(1).c.tmp $(1).c) && \
rm -f $(1).c.tmp && \
echo timestamp > $$@
$(1).c: $(1).c.stamp
@true
_GLIB_CLEANFILES += $(1).h.stamp $(1).c.stamp
_GLIB_DISTCLEANFILES += $(1).h $(1).c $(1).h.stamp $(1).c.stamp
endef
$(foreach f,$(_GLIB_ENUM_TYPES_GENERATED),$(eval $(call _glib_make_mkenums_rules,$f)))
### glib-compile-schemas
_GLIB_ENUMS_XML_GENERATED = $(filter %.enums.xml,$(GLIB_GENERATED))
_GLIB_GSETTINGS_SCHEMA_FILES = $(filter %.gschema.xml,$(gsettingsschema_DATA))
_GLIB_GSETTINGS_VALID_FILES = $(subst .xml,.valid,$(_GLIB_GSETTINGS_SCHEMA_FILES))
_glib_enums_xml_prefix = $(subst .,_,$(notdir $(1)))
_glib_enums_xml_sources_var = $(_glib_enums_xml_prefix)_sources
_glib_enums_xml_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enums_xml_sources_var)))
_glib_enums_xml_namespace = $(subst .enums.xml,,$(notdir $(1)))
define _glib_make_enums_xml_rule
$(if $(_glib_enums_xml_sources),,$(error Need to define $(_glib_enums_xml_sources_var) for $(1)))
$(1): $(_glib_enums_xml_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) --comments '<!-- @comment@ -->' --fhead "<schemalist>" --vhead " <@type@ id='$(_glib_enums_xml_namespace).@EnumName@'>" --vprod " <value nick='@valuenick@' value='@valuenum@'/>" --vtail " </@type@>" --ftail "</schemalist>" $$(filter-out Makefile, $$^) > $$@.tmp && mv $$@.tmp $$@
endef
_GLIB_V_CHECK = $(_glib_v_check_$(V))
_glib_v_check_ = $(_glib_v_check_$(AM_DEFAULT_VERBOSITY))
_glib_v_check_0 = @echo " CHECK " $(subst .valid,.xml,$@);
define _glib_make_schema_validate_rule
$(subst .xml,.valid,$(1)): $(_GLIB_ENUMS_XML_GENERATED) $(1)
$$(_GLIB_V_CHECK) $$(GLIB_COMPILE_SCHEMAS) --strict --dry-run $$(addprefix --schema-file=,$$^) && touch $$@
endef
define _glib_make_schema_rules
all-am: $(_GLIB_GSETTINGS_VALID_FILES)
install-data-am: glib-install-schemas-hook
glib-install-schemas-hook: install-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
uninstall-am: glib-uninstall-schemas-hook
glib-uninstall-schemas-hook: uninstall-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
.PHONY: glib-install-schemas-hook glib-uninstall-schemas-hook
endef
_GLIB_CLEANFILES += $(_GLIB_ENUMS_XML_GENERATED) $(_GLIB_GSETTINGS_VALID_FILES)
$(foreach f,$(_GLIB_ENUMS_XML_GENERATED),$(eval $(call _glib_make_enums_xml_rule,$f)))
$(foreach f,$(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(call _glib_make_schema_validate_rule,$f)))
$(if $(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(_glib_make_schema_rules)))
### Cleanup
.PHONY: clean-glib distclean-glib
clean-am: clean-glib
clean-glib:
$(if $(strip $(_GLIB_CLEANFILES)),-rm -f $(_GLIB_CLEANFILES))
distclean-am: distclean-glib
distclean-glib:
$(if $(strip $(_GLIB_DISTCLEANFILES)),-rm -f $(_GLIB_DISTCLEANFILES))

62
Makefile.vapigen Normal file
View File

@@ -0,0 +1,62 @@
# Makefile for Vala API Generator (vapigen)
# Written by Evan Nemerson
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
#
# Variables:
#
# VAPIGEN_FILES
#
# VAPIs to create
#
# *_DEPS / VAPIGEN_DEPS
#
# The dependencies. Generally the pkg-config names.
#
# *_METADATADIRS / VAPIGEN_METADATADIRS
#
# Directory containing the metadata.
#
# *_VAPIDIRS / VAPIGEN_VAPIDIRS
#
# Additional location(s) to search for VAPI dependencies.
#
# *_GIRDIRS / VAPIGEN_GIRDIRS
#
# Additional location(s) to search for GIR dependencies.
#
# *_FILES
#
# The files which should be used to generate the VAPI.
_vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
_vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
_vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
_vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_opts_0 = --quiet
_vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
define vapigen
$(1): $$($(_vapi_name)_GIR)
$(_vapigen_silent_prefix) \
G_DEBUG='' \
$(VAPIGEN) $(_vapigen_silent_opts) \
--library $(1:.vapi=) \
$(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
$(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
$(foreach _vapi_gir_dir,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_vapi_gir_dir)) \
$(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
$$($(_vapi_name)_FILES) && \
touch $(1)
endef
$(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))

152
NEWS
View File

@@ -1,137 +1,3 @@
=============================================
NetworkManager-1.56
Overview of changes since NetworkManager-1.54
=============================================
This is a snapshot of NetworkManager development. The API is
subject to change and not guaranteed to be compatible with
the later release.
USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* nmcli now supports viewing and managing WireGuard peers.
=============================================
NetworkManager-1.54
Overview of changes since NetworkManager-1.52
=============================================
* Add support for configuring per-device IPv4 forwarding via the
"ipv4.forwarding" connection property.
* Add a new "prefix-delegation" setting containing a "subnet-id"
property that specifies the subnet to choose on the downstream
interface when using IPv6 prefix delegation.
* Support OCI baremetal in nm-cloud-setup
* When activating a WireGuard connection to an IPv6 endpoint, now
NetworkManager creates firewall rules to ensure that the incoming
packets are not dropped by kernel reverse path filtering.
* Add support for configuring the loopback interface in nmtui.
* Most of the properties of ovs-bridge and ovs-port connections can
now be reapplied at runtime without bringing the connection down.
* Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device
when the connection is deactivated, or whether it resets them to
their default value.
* Introduce a new "ovs-dpdk.lsc-interrupt" property to configure the
Link State Change (LSC) detection mode for OVS DPDK interfaces.
* The initrd-generator now can parse the NVMe Boot Firmware Table
(NBFT) to configure networking during early boot.
* Add systemd services to provide networking in the initrd.
=============================================
NetworkManager-1.52
Overview of changes since NetworkManager-1.50
=============================================
* Store interactive history in `$XDG_CACHE_HOME/nmcli-history` instead of
`~/.nmcli-history`
* Add new ipv4.link-local=fallback to set an IPv4 link-local address
when no other IPv4 is set.
* Remove support for building with Autotools
* Add IPVLAN interface support
* Allow to manually configure the authentication of LTE's initial EPS Bearer.
* Add support for the "IPv6-only preferred" DHCPv4 option (RFC 8925),
used to indicate that a host supports an IPv6-only mode and is
willing to forgo obtaining an IPv4 address if the network provides
IPv6 connectivity.
* Support automatically adding routes to DNS servers via the
ipv4.routed-dns and ipv6.routed-dns properties; when enabled, each
name server is reached only via the device that specifies it.
* Support OCI in nm-cloud-setup
* Added support for ethtool FEC mode
* Add new ipv4.shared-dhcp-range and ipv4.shared-dhcp-lease-time,
which allows you to customize the DHCP range and lease time offered
by DHCP server in `shared` connection method.
* DNS servers can now be specified with a URI-like syntax which supports
DNS over TLS name servers.
* The initrd-generator understands the "rd.net.dns" option to configure
global name servers.
* Drop support for the "dhcpcanon" DHCP client.
* global-dns configuration section now has 2 additional keys: "resolve-mode"
and "certification-authority".
* Dnsconfd plugin can now be used for configuration of system-wide DNS
caching resolver. If dnsconfd plugin is enabled and ipvX.routed-dns is
set to -1 then adding routes is by default enabled.
* Add "shared" method to the IPv6 configuration options in nmtui.
* Fix a bug that prevented the activation of bond and bridge's ports in some cases
* Fix a bug that prevented the activation of OVS interfaces in some cases
* Fix MTPCP endpoint creation for IPv4 with DAD and IPv6 tentative addresses
* Fix some VPN routes not being added to the table specified in ipv4/6.routing-table.
This fix allow to use policy routing to mitigate Tunnelvision attacks.
=============================================
NetworkManager-1.50
Overview of changes since NetworkManager-1.48
=============================================
* The support for "dhclient" has been deprecated, not built unless
explicitely enabled, and will be removed in a future release.
The internal DHCP client should be used instead and has been
the default since version 1.20 (1.12 when built with meson).
* Support matching a OVS system interface by MAC address.
* Add a timeout option to connectivity checking.
* Support configuring veth interfaces in nmtui.
* When looking up the system hostname from the reverse DNS lookup of
addresses configured on interfaces, NetworkManager now takes into
account the content of /etc/hosts.
* Revert to using sysctl ipv6.conf.default for ip6-privacy
* Allow specifying a system OVS interface by MAC address
* ndisc: Support multiple gateways for a single network
* wifi: Support configuring channel-width in AP mode
* keyfile: Stop writing offensive terms into keyfiles
* Support reapplying the VLANs on bridge ports.
* Fix crash caused by malformed LLDP package if debug log is enabled
* Retry hostname resolution when it fails
=============================================
NetworkManager-1.48
Overview of changes since NetworkManager-1.46
=============================================
* Building with autotools is now deprecated and will be completely removed
in the next development cycle. We recommend using meson to build
NetworkManager -- for basic setup, see the CONTRIBUTING.md file.
To ignore this deprecation and still build with Autotools, you can specify
the '--disable-autotools-deprecation' argument when configuring.
* Support changing the OpenSSL ciphers for 802.1X authentication via
connection property "802-1x.openssl-ciphers".
* The reason why a device is unmanaged is now properly set in the
"StateReason" property of the "Device" D-Bus object. The property is
visible in nmcli via "nmcli -f all device show $DEV".
* Deprecated 802-11-wireless and 802-11-wired property 'mac-address-blacklist'
and introduced the 'mac-address-denylist' property.
* Properly restore in-memory connection profiles during the rollback
of a checkpoint.
* Fix detection of 6 GHz band capability for WiFi devices
* Allow IPv6 SLAAC and static IPv6 DNS server assignment for modem broadband
when IPv6 device address was not explicitly passed on by ModemManager
* Fix a performance issue that was leading to 100% CPU usage by NetworkManager
if external programs were doing a big amount of routes updates.
* Patch-level development releases (i.e. 1.48.1-dev) won't be used anymore.
From now on, all the patch releases whithin a stable branch will be normal
releases, like 1.48.0, 1.48.1, 1.48.2, 1.48.3 and so on.
Odd numbers in the minor version number still indicates if it's a development
branch like 1.49 or a stable one like 1.48.
============================================= =============================================
NetworkManager-1.46 NetworkManager-1.46
Overview of changes since NetworkManager-1.44 Overview of changes since NetworkManager-1.44
@@ -230,7 +96,7 @@ Overview of changes since NetworkManager-1.42
lead to unexpected behaviors in case of multiconnect profiles. lead to unexpected behaviors in case of multiconnect profiles.
* Set VLAN filtering options on bridge via netlink instead of sysfs. * Set VLAN filtering options on bridge via netlink instead of sysfs.
* nm-cloud-setup now supports IMDSv2 on Amazon EC2. * nm-cloud-setup now supports IMDSv2 on Amazon EC2.
* nmtui now supports enabling/disabling Wi-Fi and WWAN radios. * nmtui now allows to enable or disable Wi-Fi and WWAN radios.
* Honor ignore-carrier=no for bond/bridge/team devices. * Honor ignore-carrier=no for bond/bridge/team devices.
* Add version mismatch warning when running nmcli commands. * Add version mismatch warning when running nmcli commands.
@@ -395,7 +261,7 @@ Overview of changes since NetworkManager-1.38
* NetworkManager reads the kernel command line "/proc/cmdline" for several * NetworkManager reads the kernel command line "/proc/cmdline" for several
purposes, including "nm.debug" for enabling debugging and the purposes, including "nm.debug" for enabling debugging and the
"match.kernel-command-line" setting in the profile. NetworkManager now "match.kernel-command-line" setting in the profile. NetworkManager now
first looks now for "/run/NetworkManager/proc-cmdline", which allows one to first looks now for "/run/NetworkManager/proc-cmdline", which allows to
overwrite the command line. overwrite the command line.
* Improve the reapply of non-bridge properties. * Improve the reapply of non-bridge properties.
* Honor adding a Bluetooth NAP connection with all available methods. * Honor adding a Bluetooth NAP connection with all available methods.
@@ -468,7 +334,7 @@ Overview of changes since NetworkManager-1.36
* Workaround libcurl blocking NetworkManager while resolving DNS names. * Workaround libcurl blocking NetworkManager while resolving DNS names.
* nmcli: indicate missing Wi-Fi hardware when showing rfkill setting. * nmcli: indicate missing Wi-Fi hardware when showing rfkill setting.
* nmcli: add connection migrate command to move a profile to a specified * nmcli: add connection migrate command to move a profile to a specified
settings plugin. This allows one to convert profiles in the deprecated ifcfg-rh settings plugin. This allows to convert profiles in the deprecated ifcfg-rh
format to keyfile. format to keyfile.
* Set "src" attribute for routes from DHCPv4 to the leased address. This * Set "src" attribute for routes from DHCPv4 to the leased address. This
helps with source address selection. helps with source address selection.
@@ -600,7 +466,7 @@ and 1.32.12 are also present in NetworkManager-1.34:
* core: fix adding stale local routes when address changes. * core: fix adding stale local routes when address changes.
* initrd: tag generated profiles with origin in user data. * initrd: tag generated profiles with origin in user data.
* core: introduce "allowed-connections" option to disallow * core: introduce "allowed-connections" option to disallow
profiles on a device. This allows one to filter out profiles profiles on a device. This allows to filter out profiles
that originate from initrd. that originate from initrd.
* core: introduce "keep-configuration" device option to forcefully * core: introduce "keep-configuration" device option to forcefully
activate a profile on start. activate a profile on start.
@@ -661,7 +527,7 @@ Overview of changes since NetworkManager-1.30
'nm-daemon-helper' binary is spawned to perform the lookup using 'nm-daemon-helper' binary is spawned to perform the lookup using
the 'dns' NSS module. the 'dns' NSS module.
* dhcp: honor "ID_NET_DHCP_BROADCAST" udev attribute to set the broadcast flag. * dhcp: honor "ID_NET_DHCP_BROADCAST" udev attribute to set the broadcast flag.
This allows one to configure devices in udev for which DHCPOFFER messages are to be This allows to configure devices in udev for which DHCPOFFER messages are to be
broadcast. broadcast.
* firewall: add nftables firewall backend for configuring IPv4 NAT with shared * firewall: add nftables firewall backend for configuring IPv4 NAT with shared
mode. Now two backends are supported, "iptables" and "nftables". The default mode. Now two backends are supported, "iptables" and "nftables". The default
@@ -895,7 +761,7 @@ This is a new stable release of NetworkManager. Notable changes include:
* The libnm-glib library, deprecated in favor of libnm since NetworkManager 1.0, * The libnm-glib library, deprecated in favor of libnm since NetworkManager 1.0,
and disabled by default since NetworkManager 1.12, has now been removed. and disabled by default since NetworkManager 1.12, has now been removed.
* The DHCP client now defaults to "internal". The default can be overridden * The DHCP client now defaults to "internal". The default can be overriden
at build time by using the --with-config-dhcp-default option of the at build time by using the --with-config-dhcp-default option of the
configure script or at run time by setting the main.dhcp option in the configure script or at run time by setting the main.dhcp option in the
configuration file. configuration file.
@@ -921,16 +787,16 @@ This is a new stable release of NetworkManager. Notable changes include:
in allowed-ips. in allowed-ips.
* Rework implementation of settings plugins and how profiles are presisted * Rework implementation of settings plugins and how profiles are presisted
to disk. This is a large internal refactoring of the settings plugins that to disk. This is a large internal refactoring of the settings plugins that
allows one to migrate a connection profile between plugins. allows to migrate a connection profile between plugins.
* In-memory profiles are now only handled by keyfile plugin and will also be * In-memory profiles are now only handled by keyfile plugin and will also be
persisted to /run directory. This allows one to restart NetworkManager without persisted to /run directory. This allows to restart NetworkManager without
loosing these profiles and it provides a file-system based API for creating loosing these profiles and it provides a file-system based API for creating
in-memory profiles. in-memory profiles.
* Keyfile plugin now supports a read-only directory of profiles under directory * Keyfile plugin now supports a read-only directory of profiles under directory
"/usr/lib/NetworkManager/system-connections". Such profiles still can be modified "/usr/lib/NetworkManager/system-connections". Such profiles still can be modified
and deleted via D-Bus, which results in writing profiles to /etc or /run that and deleted via D-Bus, which results in writing profiles to /etc or /run that
shadow the read-only files. shadow the read-only files.
* Add new D-Bus method AddConnection2() that allows one to block autoconnect of * Add new D-Bus method AddConnection2() that allows to block autoconnect of
the profile at the moment when creating the profile. Also add support for the profile at the moment when creating the profile. Also add support for
this API to libnm. this API to libnm.
* Add flag "no-reapply" to Update2() D-Bus method. Normally, when a connection * Add flag "no-reapply" to Update2() D-Bus method. Normally, when a connection

View File

@@ -112,14 +112,6 @@ contrib/fedora/rpm/NetworkManager.conf for how to enable debug logging
in NetworkManager. in NetworkManager.
Requirements
------------
NetworkManager requires:
- Linux kernel >= 5.6 for some ethtool options (pause, eee, ring)
Documentation Documentation
------------- -------------
@@ -141,12 +133,7 @@ Report bugs or feature request in our [issue tracker](https://gitlab.freedesktop
See [Report issues](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md?ref_type=heads#report-issues) See [Report issues](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md?ref_type=heads#report-issues)
for details about how to do it. for details about how to do it.
To get involved, see [CONTRIBUTING.md](CONTRIBUTING.md)
Contribute
----------
To get involved, see [CONTRIBUTING.md](CONTRIBUTING.md) to find different ways
to contribute.
License License

31
autogen.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e
srcdir=`dirname $0`
if test -z "$srcdir"; then
srcdir=.
fi
olddir=`pwd`
REQUIRED_AUTOMAKE_VERSION=1.9
PKG_NAME=NetworkManager
(test -f $srcdir/configure.ac \
&& test -f $srcdir/src/core/main.c) || {
printf "**Error**: Directory "\`$srcdir\'" does not look like the" >&2
echo " top-level $PKG_NAME directory" >&2
exit 1
}
cd $srcdir
gtkdocize
autoreconf --verbose --force --install
cd $olddir
if test -z "$NOCONFIGURE"; then
exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error --enable-gtk-doc --enable-introspection "$@"
fi

27
config-extra.h.mk Normal file
View File

@@ -0,0 +1,27 @@
# With autotools, it is not easily possible to generate these defines
# from configure.ac.
#
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
#
# With meson-only, they could just be set via config.h.meson
config-extra.h: config-extra.h.mk config.h config.status
$(AM_V_GEN) \
echo "/* Generated by Makefile.am */" >$@ && \
echo "#define BINDIR \"$(bindir)\"" >>$@ && \
echo "#define DATADIR \"$(datadir)\"" >>$@ && \
echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@ && \
echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@ && \
echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@ && \
echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@ && \
echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@ && \
echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@ && \
echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@ && \
echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@ && \
echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@ && \
echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@ && \
echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@ && \
echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
echo "#define PREFIX \"$(prefix)\"" >>$@ && \
echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \
echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \
true

View File

@@ -4,6 +4,9 @@
/* Define to path of dhclient binary */ /* Define to path of dhclient binary */
#mesondefine DHCLIENT_PATH #mesondefine DHCLIENT_PATH
/* Define to path of dhcpcanon binary */
#mesondefine DHCPCANON_PATH
/* Define to path of dhcpcd binary */ /* Define to path of dhcpcd binary */
#mesondefine DHCPCD_PATH #mesondefine DHCPCD_PATH
@@ -67,9 +70,6 @@
/* Define to path of iptables binary */ /* Define to path of iptables binary */
#mesondefine IPTABLES_PATH #mesondefine IPTABLES_PATH
/* Define to path of ip6tables binary */
#mesondefine IP6TABLES_PATH
/* Define to path of nft binary */ /* Define to path of nft binary */
#mesondefine NFT_PATH #mesondefine NFT_PATH
@@ -224,6 +224,9 @@
/* Define if you have dhclient */ /* Define if you have dhclient */
#mesondefine WITH_DHCLIENT #mesondefine WITH_DHCLIENT
/* Define if you have dhcpcanon */
#mesondefine WITH_DHCPCANON
/* Define if you have dhcpcd */ /* Define if you have dhcpcd */
#mesondefine WITH_DHCPCD #mesondefine WITH_DHCPCD
@@ -280,8 +283,3 @@
/* Define to 1 if you have history support from -lreadline. */ /* Define to 1 if you have history support from -lreadline. */
#mesondefine HAVE_READLINE_HISTORY #mesondefine HAVE_READLINE_HISTORY
/* Define if NBFT support is enabled */
#mesondefine WITH_NBFT
/* Define to 1 if dlvsym() is available */
#mesondefine HAVE_DLVSYM

1493
configure.ac Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,10 +7,12 @@ apk update
apk add \ apk add \
'alpine-sdk' \ 'alpine-sdk' \
'autoconf' \ 'autoconf' \
'automake' \
'bash' \ 'bash' \
'clang' \ 'clang' \
'curl-dev' \ 'curl-dev' \
'dbus' \ 'dbus' \
'dbus-glib-dev' \
'elogind-dev' \ 'elogind-dev' \
'eudev-dev' \ 'eudev-dev' \
'gcc' \ 'gcc' \
@@ -24,13 +26,13 @@ apk add \
'jansson-dev' \ 'jansson-dev' \
'libgudev-dev' \ 'libgudev-dev' \
'libndp-dev' \ 'libndp-dev' \
'libnvme-dev' \
'libnl3-dev' \ 'libnl3-dev' \
'libpsl-dev' \ 'libpsl-dev' \
'libsoup-dev' \ 'libsoup-dev' \
'libteam-dev' \ 'libteam-dev' \
'libtool' \ 'libtool' \
'linux-headers' \ 'linux-headers' \
'make' \
'meson' \ 'meson' \
'mobile-broadband-provider-info' \ 'mobile-broadband-provider-info' \
'modemmanager-dev' \ 'modemmanager-dev' \

View File

@@ -32,6 +32,9 @@ install_ignore_missing() {
install \ install \
\ \
autoconf \
automake \
autopoint \
clang \ clang \
dbus \ dbus \
dbus-x11 \ dbus-x11 \
@@ -56,7 +59,6 @@ install \
libndp-dev \ libndp-dev \
libnewt-dev \ libnewt-dev \
libnss3-dev \ libnss3-dev \
libnvme-dev \
libpolkit-gobject-1-dev \ libpolkit-gobject-1-dev \
libpsl-dev \ libpsl-dev \
libreadline-dev \ libreadline-dev \
@@ -65,9 +67,11 @@ install \
libtool \ libtool \
libudev-dev \ libudev-dev \
locales \ locales \
make \
meson \ meson \
mobile-broadband-provider-info \ mobile-broadband-provider-info \
pkg-config \ pkg-config \
policykit-1 \
ppp \ ppp \
ppp-dev \ ppp-dev \
python3-dbus \ python3-dbus \
@@ -83,8 +87,6 @@ install \
install_ignore_missing \ install_ignore_missing \
python-setuptools \ python-setuptools \
policykit-1 \
polkitd \
\ \
#end #end

View File

@@ -52,7 +52,7 @@ install \
clang \ clang \
dbus-devel \ dbus-devel \
dbus-x11 \ dbus-x11 \
ethtool \ dhclient \
firewalld-filesystem \ firewalld-filesystem \
gcc-c++ \ gcc-c++ \
gettext-devel \ gettext-devel \
@@ -63,13 +63,12 @@ install \
gtk-doc \ gtk-doc \
iptables \ iptables \
jansson-devel \ jansson-devel \
jq \
libcurl-devel \ libcurl-devel \
libndp-devel \ libndp-devel \
libnvme-devel \
libselinux-devel \ libselinux-devel \
libtool \ libtool \
libuuid-devel \ libuuid-devel \
make \
meson \ meson \
mobile-broadband-provider-info-devel \ mobile-broadband-provider-info-devel \
newt-devel \ newt-devel \
@@ -83,22 +82,26 @@ install \
readline-devel \ readline-devel \
rpm-build \ rpm-build \
systemd-devel \ systemd-devel \
teamd-devel \
util-linux \ util-linux \
vala \ vala \
valgrind \ valgrind \
which \ which \
#end "${EXTRA_PACKAGES[@]}"
# some packages don't exist in certain distributions. Install them one-by-one, and ignore errors. # some packages don't exist in certain distributions. Install them one-by-one, and ignore errors.
install_ignore_missing \ install_ignore_missing \
black \ black \
dhclient \ dbus-python \
iproute-tc \ iproute-tc \
libasan \ libasan \
libpsl-devel \ libpsl-devel \
libubsan \ libubsan \
libvala-devel \ libvala-devel \
pexpect \
pygobject3-base \
python-gobject-base \
python36-pexpect \
qt-devel \ qt-devel \
teamd-devel \
vala-devel \ vala-devel \
"${EXTRA_PACKAGES[@]}" #end

View File

@@ -23,7 +23,7 @@
# #
# See `man 5 nm-settings` for "wifi.cloned-mac-address" and "connection.stable-id". # See `man 5 nm-settings` for "wifi.cloned-mac-address" and "connection.stable-id".
[connection-22-wifi-mac-addr] [connection.22-wifi-mac-addr]
match-device=type:wifi match-device=type:wifi
wifi.cloned-mac-address=stable-ssid wifi.cloned-mac-address=stable-ssid

View File

@@ -1,5 +1,5 @@
# SPEC file to build NetworkManager for testing. It aims for a similar # SPEC file to build NetworkManager for testing. It aims for a similar
# configuration as RHEL and Fedora Rawhide # configuration as rhel-7.0 and Fedora rawhide
# #
# This spec file is not used as is to create official packages for RHEL, Fedora or any # This spec file is not used as is to create official packages for RHEL, Fedora or any
# other distribution. # other distribution.
@@ -14,7 +14,6 @@
%global epoch_version 1 %global epoch_version 1
%global real_version __VERSION__ %global real_version __VERSION__
%global git_tag_version __GIT_TAG_VERSION__
%global rpm_version %{real_version} %global rpm_version %{real_version}
%global release_version __RELEASE_VERSION__ %global release_version __RELEASE_VERSION__
%global snapshot __SNAPSHOT__ %global snapshot __SNAPSHOT__
@@ -49,19 +48,12 @@
%global systemd_units_cloud_setup nm-cloud-setup.service nm-cloud-setup.timer %global systemd_units_cloud_setup nm-cloud-setup.service nm-cloud-setup.timer
############################################################################### ###############################################################################
%if 0%{?fedora} > 40 || 0%{?rhel} >= 10
%bcond_with dhclient %bcond_with meson
%else
%bcond_without dhclient
%endif
%bcond_without adsl %bcond_without adsl
%bcond_without bluetooth %bcond_without bluetooth
%bcond_without wwan %bcond_without wwan
%if 0%{?rhel} >= 10
%bcond_with team
%else
%bcond_without team %bcond_without team
%endif
%bcond_without wifi %bcond_without wifi
%bcond_without ovs %bcond_without ovs
%bcond_without ppp %bcond_without ppp
@@ -79,7 +71,7 @@
%bcond_with test %bcond_with test
%endif %endif
%if "%{?bcond_default_lto}" == "" %if "%{?bcond_default_lto}" == ""
%if 0%{?fedora} || 0%{?rhel} >= 9 %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%bcond_without lto %bcond_without lto
%else %else
%bcond_with lto %bcond_with lto
@@ -97,21 +89,44 @@
%else %else
%bcond_with connectivity_fedora %bcond_with connectivity_fedora
%endif %endif
%if 0%{?rhel} %if 0%{?rhel} && 0%{?rhel} >= 8
%bcond_without connectivity_redhat %bcond_without connectivity_redhat
%else %else
%bcond_with connectivity_redhat %bcond_with connectivity_redhat
%endif %endif
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%bcond_without crypto_gnutls
%else
%bcond_with crypto_gnutls
%endif
%if 0%{?rhel} %if 0%{?rhel}
%bcond_with iwd %bcond_with iwd
%else %else
%bcond_without iwd %bcond_without iwd
%endif %endif
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_without firewalld_zone
%else
%bcond_with firewalld_zone
%endif
############################################################################### ###############################################################################
%if 0%{?fedora} || 0%{?rhel} >= 8
%global dbus_version 1.9.18 %global dbus_version 1.9.18
%global dbus_sys_dir %{_datadir}/dbus-1/system.d %global dbus_sys_dir %{_datadir}/dbus-1/system.d
%else
%global dbus_version 1.1
%global dbus_sys_dir %{_sysconfdir}/dbus-1/system.d
%endif
# Older libndp versions use select() (rh#1933041). On well known distros,
# choose a version that has the necessary fix.
%if 0%{?rhel} && 0%{?rhel} == 8
%global libndp_version 1.7-4
%else
%global libndp_version %{nil}
%endif
%if %{with bluetooth} || %{with wwan} %if %{with bluetooth} || %{with wwan}
%global with_modem_manager_1 1 %global with_modem_manager_1 1
@@ -119,39 +134,46 @@
%global with_modem_manager_1 0 %global with_modem_manager_1 0
%endif %endif
%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
%global dhcp_default internal
%else
%global dhcp_default dhclient
%endif
%if 0%{?fedora} || 0%{?rhel} >= 8
%global logging_backend_default journal
%if 0%{?fedora} || 0%{?rhel} >= 9 %if 0%{?fedora} || 0%{?rhel} >= 9
%global dns_rc_manager_default auto %global dns_rc_manager_default auto
%else %else
%global dns_rc_manager_default symlink %global dns_rc_manager_default symlink
%endif %endif
%else
%global logging_backend_default syslog
%global dns_rc_manager_default file
%endif
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%bcond_with default_ifcfg_rh %global config_plugins_default_ifcfg_rh 0
%else %else
%bcond_without default_ifcfg_rh %global config_plugins_default_ifcfg_rh 1
%endif %endif
%if 0%{?rhel} >= 10 || 0%{?fedora} >= 41 %if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
%bcond_with ifcfg_rh %global split_ifcfg_rh 1
%bcond_with split_ifcfg_rh
%elif 0%{?fedora} >= 36
%bcond_without ifcfg_rh
%bcond_without split_ifcfg_rh
%else %else
%bcond_without ifcfg_rh %global split_ifcfg_rh 0
%bcond_with split_ifcfg_rh
%endif %endif
%if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} == 9 %if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} >= 9
%bcond_without ifcfg_warning %global ifcfg_warning 1
%else %else
%bcond_with ifcfg_warning %global ifcfg_warning 0
%endif %endif
%if %{with ifcfg_rh} && 0%{?fedora} >= 39 %if 0%{?fedora} >= 39
%bcond_without ifcfg_migrate %global ifcfg_migrate 1
%else %else
%bcond_with ifcfg_migrate %global ifcfg_migrate 0
%endif %endif
%if 0%{?fedora} %if 0%{?fedora}
@@ -181,7 +203,7 @@ Group: System Environment/Base
License: GPL-2.0-or-later AND LGPL-2.1-or-later License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: https://networkmanager.dev/ URL: https://networkmanager.dev/
#Source: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/releases/%{git_tag_version}/downloads/%{name}-%{real_version}.tar.xz #Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
Source: __SOURCE1__ Source: __SOURCE1__
Source1: NetworkManager.conf Source1: NetworkManager.conf
Source2: 00-server.conf Source2: 00-server.conf
@@ -195,7 +217,9 @@ Source9: readme-ifcfg-rh-migrated.txt
#Patch1: 0001-some.patch #Patch1: 0001-some.patch
Requires(post): systemd Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires(post): systemd-udev Requires(post): systemd-udev
%endif
Requires(post): /usr/sbin/update-alternatives Requires(post): /usr/sbin/update-alternatives
Requires(preun): systemd Requires(preun): systemd
Requires(preun): /usr/sbin/update-alternatives Requires(preun): /usr/sbin/update-alternatives
@@ -204,40 +228,23 @@ Requires(postun): systemd
Requires: dbus >= %{dbus_version} Requires: dbus >= %{dbus_version}
Requires: glib2 >= %{glib2_version} Requires: glib2 >= %{glib2_version}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
%if "%{libndp_version}" != ""
Recommends: iputils Requires: libndp >= %{libndp_version}
%if 0%{?rhel} == 8
# Older libndp versions use select() (rh#1933041). On well known distros,
# choose a version that has the necessary fix.
Requires: libndp >= 1.7-4
%endif %endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
Obsoletes: NetworkManager < %{obsoletes_ppp_plugin} Obsoletes: NetworkManager < %{obsoletes_ppp_plugin}
Obsoletes: NetworkManager-wimax < 1:1.2 Obsoletes: NetworkManager-wimax < 1:1.2
%if 0%{?rhel} == 8 %if 0%{?rhel} && 0%{?rhel} == 8
Suggests: NetworkManager-initscripts-updown Suggests: NetworkManager-initscripts-updown
%endif %endif
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
%if %{with split_ifcfg_rh} %if 0%{?split_ifcfg_rh}
Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh}
%endif %endif
%if 0%{?rhel} >= 10 %if 0%{?rhel} && 0%{?rhel} <= 7
%if 0%{without team} # Kept for RHEL to ensure that wired 802.1x works out of the box
Obsoletes: NetworkManager-team < 1:1.47.5-3 Requires: wpa_supplicant >= 1:1.1
%endif
Obsoletes: NetworkManager-initscripts-ifcfg-rh < 1:1.47.5-3
Obsoletes: NetworkManager-dispatcher-routing-rules < 1:1.47.5-3
%endif
%if 0%{?fedora} >= 41
%if %{without ifcfg_rh}
Obsoletes: NetworkManager-initscripts-ifcfg-rh < 1:1.49-3.1
Obsoletes: NetworkManager-dispatcher-routing-rules < 1:1.49.3-1
Obsoletes: NetworkManager-initscripts-updown < 1:1.49.3-1
%endif
%endif %endif
Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1 Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1
@@ -245,18 +252,17 @@ Conflicts: NetworkManager-openvpn < 1:0.7.0.99-1
Conflicts: NetworkManager-pptp < 1:0.7.0.99-1 Conflicts: NetworkManager-pptp < 1:0.7.0.99-1
Conflicts: NetworkManager-openconnect < 0:0.7.0.99-1 Conflicts: NetworkManager-openconnect < 0:0.7.0.99-1
Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09
%if 0%{?rhel} >= 10
%if 0%{without team}
Conflicts: NetworkManager-team <= 1:1.47.5-3
%endif
Conflicts: NetworkManager-initscripts-ifcfg-rh <= 1:1.47.5-3
Conflicts: NetworkManager-dispatcher-routing-rules <= 1:1.47.5-3
%endif
BuildRequires: make
BuildRequires: gcc BuildRequires: gcc
BuildRequires: libtool BuildRequires: libtool
BuildRequires: pkgconfig BuildRequires: pkgconfig
%if %{with meson}
BuildRequires: meson BuildRequires: meson
%else
BuildRequires: automake
BuildRequires: autoconf
%endif
BuildRequires: gettext-devel >= 0.19.8 BuildRequires: gettext-devel >= 0.19.8
BuildRequires: dbus-devel >= %{dbus_version} BuildRequires: dbus-devel >= %{dbus_version}
@@ -265,7 +271,11 @@ BuildRequires: gobject-introspection-devel >= 0.10.3
%if %{with ppp} %if %{with ppp}
BuildRequires: ppp-devel >= 2.4.5 BuildRequires: ppp-devel >= 2.4.5
%endif %endif
%if %{with crypto_gnutls}
BuildRequires: gnutls-devel >= 2.12 BuildRequires: gnutls-devel >= 2.12
%else
BuildRequires: nss-devel >= 3.11.7
%endif
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: audit-libs-devel BuildRequires: audit-libs-devel
%if %{with regen_docs} %if %{with regen_docs}
@@ -303,12 +313,17 @@ BuildRequires: polkit-devel
BuildRequires: jansson-devel BuildRequires: jansson-devel
%if %{with sanitizer} %if %{with sanitizer}
BuildRequires: libasan BuildRequires: libasan
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: libubsan BuildRequires: libubsan
%endif %endif
%endif
%if %{with firewalld_zone}
BuildRequires: firewalld-filesystem BuildRequires: firewalld-filesystem
%endif
BuildRequires: iproute BuildRequires: iproute
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: iproute-tc BuildRequires: iproute-tc
BuildRequires: libnvme-devel >= 1.5 %endif
Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release} Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release}
@@ -351,7 +366,12 @@ Summary: Bluetooth device plugin for NetworkManager
Group: System Environment/Base Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release} Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:bluez to prevent it being installed when updating
# to the split NM package
%else
Requires: bluez >= 4.101-5 Requires: bluez >= 4.101-5
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description bluetooth %description bluetooth
@@ -366,10 +386,12 @@ Group: System Environment/Base
BuildRequires: teamd-devel BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%if 0%{?fedora} || 0%{?rhel} >= 8
# Team was split from main NM binary between 0.9.10 and 1.0 # Team was split from main NM binary between 0.9.10 and 1.0
# We need this Obsoletes in addition to the one above # We need this Obsoletes in addition to the one above
# (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d). # (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d).
Obsoletes: NetworkManager < 1:1.0.0 Obsoletes: NetworkManager < 1:1.0.0
%endif
%description team %description team
This package contains NetworkManager support for team devices. This package contains NetworkManager support for team devices.
@@ -388,10 +410,13 @@ Requires: wireless-regdb
Requires: crda Requires: crda
%endif %endif
%if %{with iwd} %if %{with iwd} && (0%{?fedora} >= 25 || 0%{?rhel} >= 8)
Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd) Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd)
Suggests: wpa_supplicant Suggests: wpa_supplicant
%else %else
# Just require wpa_supplicant on platforms that don't support boolean
# dependencies even though the plugin supports both supplicant and
# iwd backend.
Requires: wpa_supplicant >= %{wpa_supplicant_version} Requires: wpa_supplicant >= %{wpa_supplicant_version}
%endif %endif
@@ -407,7 +432,12 @@ This package contains NetworkManager support for Wifi and OLPC devices.
Summary: Mobile broadband device plugin for NetworkManager Summary: Mobile broadband device plugin for NetworkManager
Group: System Environment/Base Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:ModemManager to prevent it being installed when updating
# to the split NM package
%else
Requires: ModemManager Requires: ModemManager
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description wwan %description wwan
@@ -510,14 +540,12 @@ This package is intended to be installed by default for server
deployments. deployments.
%if %{with ifcfg_rh}
%package dispatcher-routing-rules %package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules Summary: NetworkManager dispatcher file for advanced routing rules
Group: System Environment/Base Group: System Environment/Base
%if %{with split_ifcfg_rh} %if 0%{?split_ifcfg_rh}
Requires: %{name}-initscripts-ifcfg-rh Requires: %{name}-initscripts-ifcfg-rh
%endif %endif
Requires: ipcalc
BuildArch: noarch BuildArch: noarch
Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release} Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-config-routing-rules < 1:1.31.0 Obsoletes: %{name}-config-routing-rules < 1:1.31.0
@@ -526,7 +554,6 @@ Obsoletes: %{name}-config-routing-rules < 1:1.31.0
This adds a NetworkManager dispatcher file to support networking This adds a NetworkManager dispatcher file to support networking
configurations using "/etc/sysconfig/network-scripts/rule-NAME" files configurations using "/etc/sysconfig/network-scripts/rule-NAME" files
(eg, to do policy-based routing). (eg, to do policy-based routing).
%endif
%if %{with nmtui} %if %{with nmtui}
@@ -543,7 +570,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%endif %endif
%if %{with split_ifcfg_rh} %if 0%{?split_ifcfg_rh}
%package initscripts-ifcfg-rh %package initscripts-ifcfg-rh
Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format
Group: System Environment/Base Group: System Environment/Base
@@ -570,7 +597,6 @@ like Aliyun, Azure, EC2, GCP are supported.
%endif %endif
%if %{with ifcfg_rh}
%package initscripts-updown %package initscripts-updown
Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts) Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Group: System Environment/Base Group: System Environment/Base
@@ -583,7 +609,6 @@ Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
Installs alternative ifup/ifdown scripts that talk to NetworkManager. Installs alternative ifup/ifdown scripts that talk to NetworkManager.
This is only for backward compatibility with initscripts (network-scripts). This is only for backward compatibility with initscripts (network-scripts).
Preferably use nmcli instead. Preferably use nmcli instead.
%endif
%prep %prep
@@ -591,6 +616,7 @@ Preferably use nmcli instead.
%build %build
%if %{with meson}
%meson \ %meson \
-Db_ndebug=false \ -Db_ndebug=false \
--warnlevel 2 \ --warnlevel 2 \
@@ -599,14 +625,15 @@ Preferably use nmcli instead.
%endif %endif
-Dnft=%{_sbindir}/nft \ -Dnft=%{_sbindir}/nft \
-Diptables=%{_sbindir}/iptables \ -Diptables=%{_sbindir}/iptables \
-Dip6tables=%{_sbindir}/ip6tables \
%if %{with dhclient}
-Ddhclient=%{_sbindir}/dhclient \ -Ddhclient=%{_sbindir}/dhclient \
%else -Ddhcpcanon=no \
-Ddhclient=no \
%endif
-Ddhcpcd=no \ -Ddhcpcd=no \
-Dconfig_dhcp_default=%{dhcp_default} \
%if %{with crypto_gnutls}
-Dcrypto=gnutls \ -Dcrypto=gnutls \
%else
-Dcrypto=nss \
%endif
%if %{with debug} %if %{with debug}
-Dmore_logging=true \ -Dmore_logging=true \
-Dmore_asserts=10000 \ -Dmore_asserts=10000 \
@@ -696,11 +723,7 @@ Preferably use nmcli instead.
-Ddbus_conf_dir=%{dbus_sys_dir} \ -Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \ -Dtests=yes \
-Dvalgrind=no \ -Dvalgrind=no \
%if %{with ifcfg_rh}
-Difcfg_rh=true \ -Difcfg_rh=true \
%else
-Difcfg_rh=false \
%endif
-Difupdown=false \ -Difupdown=false \
%if %{with ppp} %if %{with ppp}
-Dppp=true \ -Dppp=true \
@@ -708,23 +731,182 @@ Preferably use nmcli instead.
-Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \ -Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \
%else %else
-Dppp=false \ -Dppp=false \
%endif
%if %{with firewalld_zone}
-Dfirewalld_zone=true \
%else
-Dfirewalld_zone=false \
%endif %endif
-Ddist_version=%{version}-%{release} \ -Ddist_version=%{version}-%{release} \
%if %{with default_ifcfg_rh} %if %{?config_plugins_default_ifcfg_rh}
-Dconfig_plugins_default=ifcfg-rh \ -Dconfig_plugins_default=ifcfg-rh \
%endif %endif
%if %{with ifcfg_migrate} %if %{?ifcfg_migrate}
-Dconfig_migrate_ifcfg_rh_default=true \ -Dconfig_migrate_ifcfg_rh_default=true \
%endif %endif
-Dresolvconf=no \ -Dresolvconf=no \
-Dnetconfig=no \ -Dnetconfig=no \
-Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \ -Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \
-Dconfig_logging_backend_default=journal -Dconfig_logging_backend_default=%{logging_backend_default}
%meson_build %meson_build
%else
# autotools
%if %{with regen_docs}
gtkdocize
%endif
autoreconf --install --force
%configure \
--with-runstatedir=%{_rundir} \
--enable-silent-rules=no \
--enable-static=no \
--with-nft=%{_sbindir}/nft \
--with-iptables=%{_sbindir}/iptables \
--with-dhclient=%{_sbindir}/dhclient \
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-config-dhcp-default=%{dhcp_default} \
%if %{with crypto_gnutls}
--with-crypto=gnutls \
%else
--with-crypto=nss \
%endif
%if %{with sanitizer}
--with-address-sanitizer=exec \
%if 0%{?fedora} || 0%{?rhel} >= 8
--enable-undefined-sanitizer=yes \
%else
--enable-undefined-sanitizer=no \
%endif
%else
--with-address-sanitizer=no \
--enable-undefined-sanitizer=no \
%endif
%if %{with debug}
--enable-more-logging=yes \
--with-more-asserts=10000 \
%else
--enable-more-logging=no \
--with-more-asserts=0 \
%endif
--enable-ld-gc=yes \
%if %{with lto}
--enable-lto=yes \
%else
--enable-lto=no \
%endif
--with-libaudit=yes-disabled-by-default \
%if 0%{?with_modem_manager_1}
--with-modem-manager-1=yes \
%else
--with-modem-manager-1=no \
%endif
%if %{with wifi}
--enable-wifi=yes \
%if 0%{?fedora}
--with-wext=yes \
%else
--with-wext=no \
%endif
%else
--enable-wifi=no \
%endif
%if %{with iwd}
--with-iwd=yes \
%else
--with-iwd=no \
%endif
%if %{with bluetooth}
--enable-bluez5-dun=yes \
%else
--enable-bluez5-dun=no \
%endif
%if %{with nmtui}
--with-nmtui=yes \
%else
--with-nmtui=no \
%endif
%if %{with nm_cloud_setup}
--with-nm-cloud-setup=yes \
%else
--with-nm-cloud-setup=no \
%endif
--enable-vala=yes \
--enable-introspection=yes \
%if %{with regen_docs}
--enable-gtk-doc=yes \
%else
--enable-gtk-doc=no \
%endif
%if %{with team}
--enable-teamdctl=yes \
%else
--enable-teamdctl=no \
%endif
%if %{with ovs}
--enable-ovs=yes \
%else
--enable-ovs=no \
%endif
--with-selinux=yes \
--enable-polkit=yes \
--enable-modify-system=yes \
--enable-concheck=yes \
%if 0%{?fedora}
--with-libpsl=yes \
%else
--with-libpsl=no \
%endif
--with-ebpf=%{ebpf_enabled} \
--with-session-tracking=systemd \
--with-suspend-resume=systemd \
--with-systemdsystemunitdir=%{_unitdir} \
--with-system-ca-path=/etc/pki/tls/cert.pem \
--with-dbus-sys-dir=%{dbus_sys_dir} \
--with-tests=yes \
%if %{with test}
--enable-more-warnings=error \
%else
--enable-more-warnings=yes \
%endif
--with-valgrind=no \
--enable-ifcfg-rh=yes \
--enable-ifupdown=no \
%if %{with ppp}
--enable-ppp=yes \
--with-pppd="%{_sbindir}/pppd" \
--with-pppd-plugin-dir="%{_libdir}/pppd/%{ppp_version}" \
%else
--enable-ppp=no \
%endif
%if %{with firewalld_zone}
--enable-firewalld-zone=yes \
%else
--enable-firewalld-zone=no \
%endif
--with-dist-version=%{version}-%{release} \
%if %{?config_plugins_default_ifcfg_rh}
--with-config-plugins-default=ifcfg-rh \
%endif
%if %{?ifcfg_migrate}
--with-config-migrate-ifcfg-rh-default=yes \
%endif
--with-resolvconf=no \
--with-netconfig=no \
--with-config-dns-rc-manager-default=%{dns_rc_manager_default} \
--with-config-logging-backend-default=%{logging_backend_default}
%make_build
%endif
%install %install
%if %{with meson}
%meson_install %meson_install
%else
%make_install
%endif
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/ cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
@@ -744,18 +926,16 @@ cp %{SOURCE7} %{buildroot}%{_sysctldir}
cp %{SOURCE6} %{buildroot}%{nmlibdir}/conf.d/ cp %{SOURCE6} %{buildroot}%{nmlibdir}/conf.d/
%endif %endif
%if %{with ifcfg_warning} %if 0%{?ifcfg_warning}
cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
%endif %endif
%if %{with ifcfg_migrate} %if 0%{?ifcfg_migrate}
cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif %endif
%if %{with ifcfg_rh}
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/ cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/ ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/ ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/
%endif
%find_lang %{name} %find_lang %{name}
@@ -763,31 +943,34 @@ rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
rm -f %{buildroot}%{nmplugindir}/*.la rm -f %{buildroot}%{nmplugindir}/*.la
# Don't use the *-initrd.service files yet, wait dracut to support them
rm -f %{buildroot}%{_unitdir}/NetworkManager-config-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-wait-online-initrd.service
# Ensure the documentation timestamps are constant to avoid multilib conflicts # Ensure the documentation timestamps are constant to avoid multilib conflicts
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference meson.build '{}' \+ find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
%if 0%{?__debug_package} && ! 0%{?flatpak} %if 0%{?__debug_package} && ! 0%{?flatpak}
mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif %endif
%if %{with ifcfg_rh}
touch %{buildroot}%{_sbindir}/ifup touch %{buildroot}%{_sbindir}/ifup
touch %{buildroot}%{_sbindir}/ifdown touch %{buildroot}%{_sbindir}/ifdown
%endif
%check %check
%if %{with meson}
%if %{with test} %if %{with test}
%meson_test %meson_test
%else %else
%ninja_test -C %{_vpath_builddir} || : %ninja_test -C %{_vpath_builddir} || :
%endif %endif
%else
# autotools
%if %{with test}
make -k %{?_smp_mflags} check
%else
make -k %{?_smp_mflags} check || :
%endif
%endif
%pre %pre
if [ -f "%{_unitdir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then if [ -f "%{_unitdir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then
@@ -806,12 +989,13 @@ if [ -S /run/udev/control ]; then
/usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || : /usr/bin/udevadm trigger --subsystem-match=net || :
fi fi
%if %{with firewalld_zone}
%firewalld_reload %firewalld_reload
%endif
%systemd_post %{systemd_units} %systemd_post %{systemd_units}
%if %{with ifcfg_rh}
%post initscripts-updown %post initscripts-updown
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
# initscripts package too old, won't let us set an alternative # initscripts package too old, won't let us set an alternative
@@ -820,7 +1004,6 @@ else
/usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \ /usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \
--slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown --slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown
fi fi
%endif
%if %{with nm_cloud_setup} %if %{with nm_cloud_setup}
@@ -840,12 +1023,10 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service %systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
%if %{with ifcfg_rh}
%preun initscripts-updown %preun initscripts-updown
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || : /usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
fi fi
%endif
%if %{with nm_cloud_setup} %if %{with nm_cloud_setup}
@@ -857,11 +1038,19 @@ fi
%postun %postun
/usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || : /usr/bin/udevadm trigger --subsystem-match=net || :
%if %{with firewalld_zone}
%firewalld_reload %firewalld_reload
%endif
%systemd_postun %{systemd_units} %systemd_postun %{systemd_units}
%if (0%{?fedora} && 0%{?fedora} < 28) || 0%{?rhel}
%post libnm -p /sbin/ldconfig
%postun libnm -p /sbin/ldconfig
%endif
%if %{with nm_cloud_setup} %if %{with nm_cloud_setup}
%postun cloud-setup %postun cloud-setup
%systemd_postun %{systemd_units_cloud_setup} %systemd_postun %{systemd_units_cloud_setup}
@@ -872,7 +1061,7 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf %{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf %{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-priv-helper.conf %{dbus_sys_dir}/nm-priv-helper.conf
%if %{with ifcfg_rh} && %{without split_ifcfg_rh} %if 0%{?split_ifcfg_rh} == 0
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif %endif
%{_sbindir}/%{name} %{_sbindir}/%{name}
@@ -900,7 +1089,7 @@ fi
%{_libexecdir}/nm-priv-helper %{_libexecdir}/nm-priv-helper
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%dir %{nmplugindir} %dir %{nmplugindir}
%if %{with ifcfg_rh} && %{without split_ifcfg_rh} %if 0%{?split_ifcfg_rh} == 0
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%endif %endif
%if %{with nmtui} %if %{with nmtui}
@@ -922,14 +1111,14 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8* %{_mandir}/man8/NetworkManager-dispatcher.8*
%{_mandir}/man8/NetworkManager-wait-online.service.8* %{_mandir}/man8/NetworkManager-wait-online.service.8*
%dir %{_localstatedir}/lib/NetworkManager %dir %{_localstatedir}/lib/NetworkManager
%if %{with ifcfg_rh}
%dir %{_sysconfdir}/sysconfig/network-scripts %dir %{_sysconfdir}/sysconfig/network-scripts
%endif
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
%{_datadir}/polkit-1/actions/*.policy %{_datadir}/polkit-1/actions/*.policy
%{_prefix}/lib/udev/rules.d/*.rules %{_prefix}/lib/udev/rules.d/*.rules
%if %{with firewalld_zone}
%{_prefix}/lib/firewalld/zones/nm-shared.xml %{_prefix}/lib/firewalld/zones/nm-shared.xml
%endif
# systemd stuff # systemd stuff
%{_unitdir}/NetworkManager.service %{_unitdir}/NetworkManager.service
%{_unitdir}/NetworkManager-wait-online.service %{_unitdir}/NetworkManager-wait-online.service
@@ -937,7 +1126,7 @@ fi
%{_unitdir}/nm-priv-helper.service %{_unitdir}/nm-priv-helper.service
%dir %{_datadir}/doc/NetworkManager/examples %dir %{_datadir}/doc/NetworkManager/examples
%{_datadir}/doc/NetworkManager/examples/server.conf %{_datadir}/doc/NetworkManager/examples/server.conf
%if %{with ifcfg_warning} || %{with ifcfg_migrate} %if 0%{?ifcfg_warning} || 0%{?ifcfg_migrate}
%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt %{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif %endif
%doc NEWS AUTHORS README.md CONTRIBUTING.md %doc NEWS AUTHORS README.md CONTRIBUTING.md
@@ -1037,12 +1226,10 @@ fi
%{nmlibdir}/conf.d/00-server.conf %{nmlibdir}/conf.d/00-server.conf
%if %{with ifcfg_rh}
%files dispatcher-routing-rules %files dispatcher-routing-rules
%{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%endif
%if %{with nmtui} %if %{with nmtui}
@@ -1055,7 +1242,7 @@ fi
%endif %endif
%if %{with split_ifcfg_rh} %if 0%{?split_ifcfg_rh}
%files initscripts-ifcfg-rh %files initscripts-ifcfg-rh
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
@@ -1074,13 +1261,11 @@ fi
%endif %endif
%if %{with ifcfg_rh}
%files initscripts-updown %files initscripts-updown
%{_libexecdir}/nm-ifup %{_libexecdir}/nm-ifup
%ghost %attr(755, root, root) %{_sbindir}/ifup %ghost %attr(755, root, root) %{_sbindir}/ifup
%{_libexecdir}/nm-ifdown %{_libexecdir}/nm-ifdown
%ghost %attr(755, root, root) %{_sbindir}/ifdown %ghost %attr(755, root, root) %{_sbindir}/ifdown
%endif
%changelog %changelog

View File

@@ -1,8 +1,6 @@
#!/bin/bash #!/bin/bash
#set -vx #set -vx
set -e
set -o pipefail
# Set arguments via environment variables. # Set arguments via environment variables.
# Argument can be omitted and defaults will be detected. # Argument can be omitted and defaults will be detected.
@@ -12,7 +10,6 @@ set -o pipefail
# RELEASE_VERSION= # RELEASE_VERSION=
# SNAPSHOT= # SNAPSHOT=
# VERSION= # VERSION=
# GIT_TAG_VERSION=
# COMMIT_FULL= # COMMIT_FULL=
# COMMIT= # COMMIT=
# USERNAME= # USERNAME=
@@ -79,7 +76,14 @@ abs_path() {
} }
get_version() { get_version() {
grep -E -m1 '^\s+version:' "$GITDIR/meson.build" | cut -d"'" -f2 local major minor micro
local F="${1:-"$GITDIR/configure.ac"}"
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
eval "$vars"
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
echo "$major.$minor.$micro"
} }
write_changelog() { write_changelog() {
@@ -113,13 +117,12 @@ UUID=`uuidgen`
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}" RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}"
SNAPSHOT="${SNAPSHOT:-%{nil\}}" SNAPSHOT="${SNAPSHOT:-%{nil\}}"
VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}" VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}"
GIT_TAG_VERSION="${GIT_TAG_VERSION:-$VERSION}"
COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}" COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}"
COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}" COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"
BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}" BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}"
BCOND_DEFAULT_TEST="${BCOND_DEFAULT_TEST:-0}" BCOND_DEFAULT_TEST="${BCOND_DEFAULT_TEST:-0}"
BCOND_DEFAULT_LTO="${BCOND_DEFAULT_LTO}" BCOND_DEFAULT_LTO="${BCOND_DEFAULT_LTO}"
USERNAME="${USERNAME:-"$(git config user.name || :) <$(git config user.email || :)>"}" USERNAME="${USERNAME:-"$(git config user.name) <$(git config user.email)>"}"
SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")" || die "invalid \$SPECFILE argument" SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")" || die "invalid \$SPECFILE argument"
SOURCE_FROM_GIT="$(coerce_bool "$SOURCE_FROM_GIT" "")" SOURCE_FROM_GIT="$(coerce_bool "$SOURCE_FROM_GIT" "")"
SOURCE="$(abs_path "$SOURCE")" || die "invalid \$SOURCE argument" SOURCE="$(abs_path "$SOURCE")" || die "invalid \$SOURCE argument"
@@ -129,7 +132,7 @@ if [ -n "$SOURCE" ]; then
[[ "$SOURCE_FROM_GIT" == 1 ]] && die "Cannot set both \$SOURCE and \$SOURCE_FROM_GIT=1" [[ "$SOURCE_FROM_GIT" == 1 ]] && die "Cannot set both \$SOURCE and \$SOURCE_FROM_GIT=1"
SOURCE_FROM_GIT=0 SOURCE_FROM_GIT=0
elif [[ "$SOURCE_FROM_GIT" != "1" ]]; then elif [[ "$SOURCE_FROM_GIT" != "1" ]]; then
SOURCE="$(ls -1 "$GITDIR/NetworkManager-${VERSION}.tar."* 2>/dev/null | head -n1 || :)" SOURCE="$(ls -1 "$GITDIR/NetworkManager-${VERSION}.tar."* 2>/dev/null | head -n1)"
if [[ -z "$SOURCE" ]]; then if [[ -z "$SOURCE" ]]; then
[[ "$SOURCE_FROM_GIT" == "0" ]] && die "Either set \$SOURCE or set \$SOURCE_FROM_GIT=1" [[ "$SOURCE_FROM_GIT" == "0" ]] && die "Either set \$SOURCE or set \$SOURCE_FROM_GIT=1"
SOURCE_FROM_GIT=1 SOURCE_FROM_GIT=1
@@ -157,7 +160,6 @@ if [[ "$SOURCE_FROM_GIT" == "1" ]]; then
fi fi
LOG "VERSION=$VERSION" LOG "VERSION=$VERSION"
LOG "GIT_TAG_VERSION=$GIT_TAG_VERSION"
LOG "RELEASE_VERSION=$RELEASE_VERSION" LOG "RELEASE_VERSION=$RELEASE_VERSION"
LOG "SNAPSHOT=$SNAPSHOT" LOG "SNAPSHOT=$SNAPSHOT"
LOG "COMMIT_FULL=$COMMIT_FULL" LOG "COMMIT_FULL=$COMMIT_FULL"
@@ -210,7 +212,6 @@ cp "$SOURCE_README_IFCFG_MIGRATED" "$TEMP/SOURCES/readme-ifcfg-rh-migrated.txt"
write_changelog write_changelog
sed -e "s/__VERSION__/$VERSION/g" \ sed -e "s/__VERSION__/$VERSION/g" \
-e "s/__GIT_TAG_VERSION__/$GIT_TAG_VERSION/g" \
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \ -e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
-e "s/__SNAPSHOT__/$SNAPSHOT/g" \ -e "s/__SNAPSHOT__/$SNAPSHOT/g" \
-e "s/__COMMIT__/$COMMIT/g" \ -e "s/__COMMIT__/$COMMIT/g" \
@@ -241,7 +242,7 @@ rpmbuild --define "_topdir $TEMP" $RPM_BUILD_OPTION "$TEMPSPEC" $NM_RPMBUILD_ARG
LS_EXTRA=() LS_EXTRA=()
if [ "$SIGN_SOURCE" = 1 ]; then if [ "$SIGN_SOURCE" = 1 ]; then
SIGNKEY="$(git config --get user.signingkey || :)" SIGNKEY="$(git config --get user.signingkey)"
if [ "$SIGNKEY" != "" ]; then if [ "$SIGNKEY" != "" ]; then
SIGNKEY="--local-user $(printf '%q' "$SIGNKEY")" SIGNKEY="--local-user $(printf '%q' "$SIGNKEY")"
fi fi
@@ -268,7 +269,7 @@ ls -dla \
"$TEMP_LATEST"/RPMS/*/*.rpm \ "$TEMP_LATEST"/RPMS/*/*.rpm \
"$TEMP_LATEST"/SRPMS/ \ "$TEMP_LATEST"/SRPMS/ \
"$TEMP_LATEST"/SRPMS/*.rpm \ "$TEMP_LATEST"/SRPMS/*.rpm \
2>/dev/null | sed 's/^/ /' || : 2>/dev/null | sed 's/^/ /'
LOG LOG
if [[ "$BUILDTYPE" == "SRPM" ]]; then if [[ "$BUILDTYPE" == "SRPM" ]]; then
LOG sudo $(command -v dnf &>/dev/null && echo dnf builddep || echo yum-builddep) $TEMP_LATEST/SRPMS/*.src.rpm LOG sudo $(command -v dnf &>/dev/null && echo dnf builddep || echo yum-builddep) $TEMP_LATEST/SRPMS/*.src.rpm

View File

@@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
set -o pipefail
die() { die() {
echo "$*" >&2 echo "$*" >&2
@@ -20,9 +18,9 @@ usage() {
echo " -f|--force: force build, even if working directory is not clean and has local modifications" echo " -f|--force: force build, even if working directory is not clean and has local modifications"
echo " -c|--clean: run \`git-clean -fdx :/\` before build" echo " -c|--clean: run \`git-clean -fdx :/\` before build"
echo " -S|--srpm: only build the SRPM" echo " -S|--srpm: only build the SRPM"
echo " -g|--git: create tarball from current git HEAD (skips meson dist)" echo " -g|--git: create tarball from current git HEAD (skips make dist)"
echo " -Q|--quick: only create the distribution tarball, without running checks" echo " -Q|--quick: only run \`make dist\` instead of \`make distcheck\`"
echo " -N|--no-dist: skip creating the source tarball if you already did \`meson dist\`" echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug" echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug" echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)" echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
@@ -143,7 +141,7 @@ while [[ $# -gt 0 ]]; do
;; ;;
--no-auto-with-test) --no-auto-with-test)
# by default, the script adds "-w test" (unless the command line contains # by default, the script adds "-w test" (unless the command line contains
# "-w test" or "-W test"). This flag suppresses that automatism. # "-w test" or "-W test"). This flags allows to suppress that automatism.
# It's really only useful to test the spec file's internal default for the # It's really only useful to test the spec file's internal default for the
# "test" option. Otherwise, you can always just explicitly select "-w test" # "test" option. Otherwise, you can always just explicitly select "-w test"
# or "-W test". # or "-W test".
@@ -190,14 +188,12 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
fi fi
fi fi
get_version_meson() {
meson introspect "$GITDIR/build" --projectinfo |
python -c 'import json, sys; print(json.load(sys.stdin)["version"])'
}
if [[ $NO_DIST != 1 ]]; then if [[ $NO_DIST != 1 ]]; then
meson setup "$GITDIR/build" \ ./autogen.sh \
--with-runstatedir=/run \
--program-prefix= \
--prefix=/usr \ --prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \ --bindir=/usr/bin \
--sbindir=/usr/sbin \ --sbindir=/usr/sbin \
--sysconfdir=/etc \ --sysconfdir=/etc \
@@ -209,30 +205,29 @@ if [[ $NO_DIST != 1 ]]; then
--sharedstatedir=/var/lib \ --sharedstatedir=/var/lib \
--mandir=/usr/share/man \ --mandir=/usr/share/man \
--infodir=/usr/share/info \ --infodir=/usr/share/info \
-Ddocs=true \ \
-Dintrospection=true \ --disable-dependency-tracking \
-Difcfg_rh=true \ --enable-gtk-doc \
-Difupdown=true \ --enable-introspection \
-Dconfig_logging_backend_default=syslog \ --enable-ifcfg-rh \
-Dconfig_wifi_backend_default=wpa_supplicant \ --enable-ifupdown \
-Dlibaudit=yes-disabled-by-default \ --with-config-logging-backend-default=syslog \
-Dpolkit=true \ --with-config-wifi-backend-default=wpa_supplicant \
-Dnm_cloud_setup=true \ --with-libaudit=yes-disabled-by-default \
-Ddhclient=/usr/sbin/dhclient \ --enable-polkit=yes \
-Dconfig_dhcp_default=internal \ --with-nm-cloud-setup=yes \
-Dconfig_dns_rc_manager_default=auto \ --with-config-dhcp-default=internal \
-Diptables=/usr/sbin/iptables \ --with-config-dns-rc-manager-default=auto \
-Dip6tables=/usr/sbin/ip6tables \ \
-Dnft=/usr/bin/nft \ --with-iptables=/usr/sbin/iptables \
|| die "Error meson setup" --with-nft=/usr/sbin/nft \
\
VERSION="${VERSION:-$(get_version_meson || die "Could not read VERSION")}" || die "Error autogen.sh"
TEST_FLAG=""
if [[ $QUICK == 1 ]]; then if [[ $QUICK == 1 ]]; then
TEST_FLAG="--no-tests" make dist -j 7 || die "Error make dist"
else
make distcheck -j 7 || die "Error make distcheck"
fi fi
meson dist --allow-dirty -C "$GITDIR/build/" $TEST_FLAG || die "Error meson dist"
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
fi fi
if [[ "$ADD_WITH_TEST" == 1 ]]; then if [[ "$ADD_WITH_TEST" == 1 ]]; then

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Run configure/meson for NetworkManager in a way similar to how an RPM build does it. # Run configure/meson for NetworkManager in a way similar to how an RPM build does it.
# The effect is, that if you do `meson install`, that it will overwrite the files that # The effect is, that if you do `make install`, that it will overwrite the files that
# you'd usually get by installing the NetworkManager RPM. Also, it means you can afterwards # you'd usually get by installing the NetworkManager RPM. Also, it means you can afterwards
# systemctl restart NetworkManager. # systemctl restart NetworkManager.
@@ -30,10 +30,10 @@ vars_with_vals() {
} }
usage() { usage() {
echo "$ $0 [-m|--meson <builddir>] [-s|--show] [-B|--no-build] [-h|--help]" echo "$ $0 [-m|--meson] [-a|--autotools] [-s|--show] [-B|--no-build] [-h|--help]"
echo "" echo ""
echo "Configure NetworkManager in a way that is similar to when building" echo "Configure NetworkManager in a way that is similar to when building"
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`meson install\`" echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`make install\`"
echo "will overwrite the files in /usr that you installed via the package management" echo "will overwrite the files in /usr that you installed via the package management"
echo "systemd. Also, subsequent \`systemctl restart NetworkManager\` works." echo "systemd. Also, subsequent \`systemctl restart NetworkManager\` works."
echo "You don't want to do this on your real system, because it messes up your" echo "You don't want to do this on your real system, because it messes up your"
@@ -44,7 +44,14 @@ usage() {
} }
get_version() { get_version() {
grep -E -m1 '^\s+version:' meson.build | cut -d"'" -f2 local major minor micro
local F="./configure.ac"
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
eval "$vars"
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
echo "$major.$minor.$micro"
} }
bool() { bool() {
@@ -142,8 +149,7 @@ P_NOBUILD="${NOBUILD-0}"
P_DEBUG="${DEBUG-1}" P_DEBUG="${DEBUG-1}"
P_MESON_BUILDDIR="${MESON_BUILDDIR-./build}" P_BUILD_TYPE="${BUILD_TYPE-}"
[ -n "$MESON_BUILDDIR" ] && P_MESON_BUILDDIR_FORCE=1
P_CFLAGS="${CFLAGS-}" P_CFLAGS="${CFLAGS-}"
P_CC="${CC-$((! command -v gcc && command -v clang) &>/dev/null && echo clang || echo gcc)}" P_CC="${CC-$((! command -v gcc && command -v clang) &>/dev/null && echo clang || echo gcc)}"
@@ -300,14 +306,25 @@ else
P_CFLAGS="-g -O2 -fexceptions${P_CFLAGS:+ }$P_CFLAGS" P_CFLAGS="-g -O2 -fexceptions${P_CFLAGS:+ }$P_CFLAGS"
fi fi
if [ -z "$P_BUILD_TYPE" ] ; then
if [ -d ./build -a ! -f ./configure ] ; then
P_BUILD_TYPE=meson
elif [ ! -d ./build -a -f ./configure ] ; then
P_BUILD_TYPE=autotools
else
P_BUILD_TYPE=autotools
fi
fi
while [[ $# -gt 0 ]] ; do while [[ $# -gt 0 ]] ; do
A="$1" A="$1"
shift shift
case "$A" in case "$A" in
--meson|-m) --meson|-m)
P_MESON_BUILDDIR="$1" P_BUILD_TYPE=meson
P_MESON_BUILDDIR_FORCE=1 ;;
shift --autotools|-a)
P_BUILD_TYPE=autotools
;; ;;
-s|--show) -s|--show)
SHOW_CMD=show_cmd SHOW_CMD=show_cmd
@@ -326,99 +343,184 @@ while [[ $# -gt 0 ]] ; do
esac esac
done done
if [ "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
if [ -d "$P_MESON_BUILDDIR" ]; then
echo "Build directory '$P_MESON_BUILDDIR' chosen by default, but it exists and will be overwritten." \
"If you really want that, pass '--meson \"$P_MESON_BUILDDIR\"'." >&2
exit 1
fi
fi
vars_with_vals vars_with_vals
MESON_RECONFIGURE= if [ "$P_BUILD_TYPE" == meson ] ; then
if test -d "$P_MESON_BUILDDIR" ; then MESON_RECONFIGURE=
MESON_RECONFIGURE="--reconfigure" if test -d "./build/" ; then
fi MESON_RECONFIGURE="--reconfigure"
fi
$SHOW_CMD \ $SHOW_CMD \
env \ env \
CC="$P_CC" \ CC="$P_CC" \
CFLAGS="$P_CFLAGS" \ CFLAGS="$P_CFLAGS" \
meson setup\ meson \
$MESON_RECONFIGURE \ --buildtype=plain \
--buildtype=plain \ --prefix="$D_PREFIX" \
--prefix="$D_PREFIX" \ --libdir="$D_LIBDIR" \
--libdir="$D_LIBDIR" \ --libexecdir="$D_LIBEXECDIR" \
--libexecdir="$D_LIBEXECDIR" \ --bindir="$D_BINDIR" \
--bindir="$D_BINDIR" \ --sbindir="$D_SBINDIR" \
--sbindir="$D_SBINDIR" \ --includedir="$D_INCLUDEDIR" \
--includedir="$D_INCLUDEDIR" \ --datadir="$D_DATADIR" \
--datadir="$D_DATADIR" \ --mandir="$D_MANDIR" \
--mandir="$D_MANDIR" \ --infodir="$D_INFODIR" \
--infodir="$D_INFODIR" \ --localedir="$D_DATADIR"/locale \
--localedir="$D_DATADIR"/locale \ --sysconfdir="$D_SYSCONFDIR" \
--sysconfdir="$D_SYSCONFDIR" \ --localstatedir="$D_LOCALSTATEDIR" \
--localstatedir="$D_LOCALSTATEDIR" \ --sharedstatedir="$D_SHAREDSTATEDIR" \
--sharedstatedir="$D_SHAREDSTATEDIR" \ --wrap-mode=nodownload \
--wrap-mode=nodownload \ --auto-features=enabled \
--auto-features=enabled \ \
-Db_ndebug=false \ build \
--warnlevel 2 \ \
$(args_enable "$P_TEST" --werror) \ $MESON_RECONFIGURE \
-Dnft="${D_SBINDIR}/nft" \ \
-Diptables="${D_SBINDIR}/iptables" \ -Db_ndebug=false \
-Dip6tables="${D_SBINDIR}/ip6tables" \ --warnlevel 2 \
-Ddhclient="${D_SBINDIR}/dhclient" \ $(args_enable "$P_TEST" --werror) \
-Ddhcpcd=no \ -Dnft="${D_SBINDIR}/nft" \
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \ -Diptables="${D_SBINDIR}/iptables" \
"-Dcrypto=$P_CRYPTO" \ -Ddhclient="${D_SBINDIR}/dhclient" \
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \ -Ddhcpcanon=no \
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \ -Ddhcpcd=no \
-Dld_gc=true \ -Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
-Db_lto="$(bool_true "$P_LTO")" \ "-Dcrypto=$P_CRYPTO" \
-Dlibaudit=yes-disabled-by-default \ $(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \ $(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \ -Dld_gc=true \
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \ -Db_lto="$(bool_true "$P_LTO")" \
-Diwd="$(bool_true "$P_IWD")" \ -Dlibaudit=yes-disabled-by-default \
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \ -Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
-Dnmtui="$(bool_true "$P_NMTUI")" \ $(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \ $(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
-Dvapi=true \ -Diwd="$(bool_true "$P_IWD")" \
-Dintrospection=true \ -Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \ -Dnmtui="$(bool_true "$P_NMTUI")" \
-Dteamdctl="$(bool_true "$P_TEAM")" \ -Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
-Dovs="$(bool_true "$P_OVS")" \ -Dvapi=true \
-Dselinux=true \ -Dintrospection=true \
-Dpolkit=true \ -Ddocs="$(bool_true "$P_REGEN_DOCS")" \
-Dconfig_auth_polkit_default=true \ -Dteamdctl="$(bool_true "$P_TEAM")" \
-Dmodify_system=true \ -Dovs="$(bool_true "$P_OVS")" \
-Dconcheck=true \ -Dselinux=true \
-Dlibpsl="$(bool_true "$P_FEDORA")" \ -Dpolkit=true \
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \ -Dconfig_auth_polkit_default=true \
-Dsession_tracking=systemd \ -Dmodify_system=true \
-Dsuspend_resume=systemd \ -Dconcheck=true \
-Dsystemdsystemunitdir=/usr/lib/systemd/system \ -Dlibpsl="$(bool_true "$P_FEDORA")" \
-Dsystem_ca_path=/etc/pki/tls/cert.pem \ -Debpf="$(bool_true "$P_EBPF_ENABLED")" \
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \ -Dsession_tracking=systemd \
-Dtests=yes \ -Dsuspend_resume=systemd \
-Dvalgrind=no \ -Dsystemdsystemunitdir=/usr/lib/systemd/system \
-Difcfg_rh=true \ -Dsystem_ca_path=/etc/pki/tls/cert.pem \
-Difupdown=false \ -Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \ -Dtests=yes \
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \ -Dvalgrind=no \
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \ -Difcfg_rh=true \
-Ddist_version="$P_VERSION-$P_RELEASE" \ -Difupdown=false \
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \ $(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
-Dresolvconf=no \ $(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
-Dnetconfig=no \ -Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \ -Ddist_version="$P_VERSION-$P_RELEASE" \
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \ $(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
\ -Dresolvconf=no \
"$P_MESON_BUILDDIR" \ -Dnetconfig=no \
; -Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
;
else
if ! test -x ./configure ; then
if [ -z "$SHOW_CMD" ]; then
NOCONFIGURE=yes ./autogen.sh
fi
fi
$SHOW_CMD \
./configure \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--program-prefix= \
--prefix="$D_PREFIX" \
--exec-prefix=/usr \
--bindir="$D_BINDIR" \
--sbindir="$D_SBINDIR" \
--sysconfdir="$D_SYSCONFDIR" \
--datadir="$D_DATADIR" \
--includedir="$D_INCLUDEDIR" \
--libdir="$D_LIBDIR" \
--libexecdir="$D_LIBEXECDIR" \
--localstatedir="$D_LOCALSTATEDIR" \
--sharedstatedir="$D_SHAREDSTATEDIR" \
--mandir="$D_MANDIR" \
--infodir="$D_INFODIR" \
\
CC="$P_CC" \
CFLAGS="$P_CFLAGS" \
\
--enable-dependency-tracking=yes \
\
--with-runstatedir="$D_RUNDIR" \
--enable-silent-rules="$(bool_yes "$P_SILENT_RULES")" \
--enable-static=no \
--with-nft="${D_SBINDIR}/nft" \
--with-iptables="${D_SBINDIR}/iptables" \
--with-dhclient="${D_SBINDIR}/dhclient" \
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-config-dhcp-default="$P_DHCP_DEFAULT" \
--with-crypto="$P_CRYPTO" \
$(args_enable "$P_SANITIZER" --with-address-sanitizer=exec --enable-undefined-sanitizer="$( (bool "$P_FEDORA" || test "$P_RHEL" -ge 8) && echo yes || echo no)" ) \
$(args_enable "$(bool_not_true "$P_SANITIZER")" --with-address-sanitizer=no --enable-undefined-sanitizer=no ) \
$(args_enable "$P_DEBUG" --enable-more-logging=yes --with-more-asserts=10000) \
$(args_enable "$(bool_not_true "$P_DEBUG")" --enable-more-logging=no --with-more-asserts=0 ) \
--enable-ld-gc=yes \
--enable-lto="$(bool_yes "$P_LTO")" \
--with-libaudit=yes-disabled-by-default \
--with-modem-manager-1="$(bool_yes "$P_MODEM_MANAGER_1")" \
$(args_enable "$P_WIFI" --enable-wifi=yes --with-wext="$(bool_yes "$P_FEDORA")") \
$(args_enable "$(bool_not_true "$P_WIFI")" --enable-wifi=no ) \
--with-iwd="$(bool_yes "$P_IWD")" \
--enable-bluez5-dun="$(bool_yes "$P_BLUETOOTH")" \
--with-nmtui="$(bool_yes "$P_NMTUI")" \
--with-nm-cloud-setup="$(bool_yes "$P_NM_CLOUD_SETUP")" \
--enable-vala=yes \
--enable-introspection=yes \
--enable-gtk-doc="$(bool_yes "$P_REGEN_DOCS")" \
--enable-teamdctl="$(bool_yes "$P_TEAM")" \
--enable-ovs="$(bool_yes "$P_OVS")" \
--with-selinux=yes \
--enable-polkit=yes \
--enable-modify-system=yes \
--enable-concheck=yes \
--with-libpsl="$(bool_yes "$P_FEDORA")" \
--with-ebpf="$(bool_yes "$P_EBPF_ENABLED")" \
--with-session-tracking=systemd \
--with-suspend-resume=systemd \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
--with-system-ca-path=/etc/pki/tls/cert.pem \
--with-dbus-sys-dir="$P_DBUS_SYS_DIR" \
--with-tests=yes \
--enable-more-warnings="$(bool "$P_TEST" && echo error || echo yes)" \
--with-valgrind=no \
--enable-ifcfg-rh=yes \
--enable-ifupdown=no \
$(args_enable "$P_PPP" --enable-ppp=yes --with-pppd="$D_SBINDIR/pppd" --with-pppd-plugin-dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
$(args_enable "$(bool_not_true "$P_PPP")" --enable-ppp=no ) \
--enable-firewalld-zone="$(bool_yes "$P_FIREWALLD_ZONE")" \
--with-dist-version="$P_VERSION-$P_RELEASE" \
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" --with-config-plugins-default=ifcfg-rh) \
--with-resolvconf=no \
--with-netconfig=no \
--with-config-dns-rc-manager-default="$P_DNS_RC_MANAGER_DEFAULT" \
--with-config-logging-backend-default="$P_LOGGING_BACKEND_DEFAULT" \
;
fi
if ! bool "$P_NOBUILD" ; then if ! bool "$P_NOBUILD" ; then
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR" if [ "$P_BUILD_TYPE" == meson ] ; then
$SHOW_CMD ninja -C build
else
$SHOW_CMD make -j 10
fi
fi fi

View File

@@ -14,11 +14,12 @@
# - "rc" : further release candidates on RC branch (e.g. from "nm-1-26" branch # - "rc" : further release candidates on RC branch (e.g. from "nm-1-26" branch
# tag "1.26-rc2" with version number 1.25.91). # tag "1.26-rc2" with version number 1.25.91).
# - "major" : on stable branch do a major release (e.g. on "nm-1-26" branch # - "major" : on stable branch do a major release (e.g. on "nm-1-26" branch
# release "1.26.0"). # release "1.26.0", followed by "1.26.1-dev").
# You should do a "major-post" release right a "major" release. # You should do a "major-post" release right a "major" release.
# - "major-post": after a "major" release, merge the release branch with main and # - "major-post": after a "major" release, merge the release branch with main and
# do another devel snapshot on main (e.g. do "1.27.1-dev" release). # do another devel snapshot on main (e.g. do "1.27.1-dev" release).
# - "minor" : on a stable branch do a minor release (e.g. "1.26.4" on "nm-1-26"). # - "minor" : on a stable branch do a minor release (e.g. "1.26.4" on "nm-1-26"
# branch and bump to "1.26.5-dev").
# #
# Requisites: # Requisites:
# #
@@ -27,8 +28,7 @@
# * Run in a "clean" environment, i.e. no unusual environment variables set, on a recent # * Run in a "clean" environment, i.e. no unusual environment variables set, on a recent
# Fedora, with suitable dependencies installed. # Fedora, with suitable dependencies installed.
# #
# * First, ensure that you have a valid Gitlab's private token for gitlab.freedestkop.org # * First, ensure that you have ssh keys for "master.gnome.org" installed (and ssh-agent running).
# stored in ~/.config/nm-release-token, or pass one with --gitlab-token argument.
# Also, ensure you have a GPG key that you want to use for signing. Also, have gpg-agent running # Also, ensure you have a GPG key that you want to use for signing. Also, have gpg-agent running
# and possibly configure `git config --get user.signingkey` for the proper key. # and possibly configure `git config --get user.signingkey` for the proper key.
# #
@@ -40,13 +40,9 @@
# #
# Run with --no-test to do the actual release. # Run with --no-test to do the actual release.
fail_msg() { die() {
echo -n "FAIL: " echo -n "FAIL: "
echo_color 31 "$@" echo_color 31 "$@"
}
die() {
fail_msg "$@"
exit 1 exit 1
} }
@@ -68,13 +64,12 @@ print_usage() {
echo " [--no-check-gitlab] \\" echo " [--no-check-gitlab] \\"
echo " [--no-check-news] \\" echo " [--no-check-news] \\"
echo " [--no-warn-publish-docs] \\" echo " [--no-warn-publish-docs] \\"
echo " [--gitlab-token <private_gitlab_token>] \\"
} }
die_help() { die_help() {
print_usage print_usage
echo echo
sed -e '2,/^$/!d' -e 's/^#\($\| \)/ /' "$BASH_SOURCE" sed -e '/^# /,/# Run with --no-test/!d' -e 's/^#\($\| \)/ /' "$BASH_SOURCE"
exit 0 exit 0
} }
@@ -99,17 +94,14 @@ do_command() {
fi fi
} }
SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")"
parse_version() { parse_version() {
local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \ local MAJ="$(sed -n '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
| cut -d"'" -f2 \ local MIN="$(sed -n '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
| sed 's/\./ /g') local MIC="$(sed -n '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$' re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
[[ "$VERSION" =~ $re ]] || return 1 [[ "$MAJ $MIN $MIC" =~ $re ]] || return 1
echo "$VERSION" echo "$MAJ $MIN $MIC"
} }
number_is_even() { number_is_even() {
@@ -133,7 +125,7 @@ check_gitlab_pipeline() {
local SHA="$2" local SHA="$2"
local PIPELINE_ID local PIPELINE_ID
PIPELINE_ID="$(curl --no-progress-meter "https://gitlab.freedesktop.org/api/v4/projects/411/pipelines?ref=$BRANCH&sha=$SHA&source=push&order_by=id" 2>/dev/null | jq '.[0].id')" PIPELINE_ID="$(curl --no-progress-meter "https://gitlab.freedesktop.org/api/v4/projects/411/pipelines?ref=$BRANCH&sha=$SHA&order_by=id" 2>/dev/null | jq '.[0].id')"
if ! [[ $PIPELINE_ID =~ [0-9]+ ]] ; then if ! [[ $PIPELINE_ID =~ [0-9]+ ]] ; then
echo "Cannot find pipeline for branch $BRANCH. Check \"https://gitlab.freedesktop.org/NetworkManager/NetworkManager/pipelines?page=1&scope=branches&ref=$BRANCH\"" echo "Cannot find pipeline for branch $BRANCH. Check \"https://gitlab.freedesktop.org/NetworkManager/NetworkManager/pipelines?page=1&scope=branches&ref=$BRANCH\""
return 1 return 1
@@ -153,12 +145,25 @@ check_gitlab_pipeline() {
return 0 return 0
} }
set_version_number() { set_version_number_autotools() {
sed -i \
-e '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/m4_define([nm_major_version], ['"$1"'])/' \
-e '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/m4_define([nm_minor_version], ['"$2"'])/' \
-e '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/m4_define([nm_micro_version], ['"$3"'])/' \
./configure.ac
}
set_version_number_meson() {
sed -i \ sed -i \
-e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \ -e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \
meson.build meson.build
} }
set_version_number() {
set_version_number_autotools "$@" &&
set_version_number_meson "$@"
}
check_news() { check_news() {
local mode="$1" local mode="$1"
shift shift
@@ -241,11 +246,6 @@ while [ "$#" -ge 1 ]; do
--help|-h) --help|-h)
die_help die_help
;; ;;
--gitlab-token)
[ "$#" -ge 1 ] || die_usage "provide a value for --gitlab-token"
GITLAB_TOKEN="$1"
shift
;;
devel|rc1|rc|major|major-post|minor) devel|rc1|rc|major|major-post|minor)
[ -z "$RELEASE_MODE" ] || die_usage "duplicate release-mode" [ -z "$RELEASE_MODE" ] || die_usage "duplicate release-mode"
RELEASE_MODE="$A" RELEASE_MODE="$A"
@@ -296,7 +296,8 @@ RC_VERSION=
RELEASE_BRANCH= RELEASE_BRANCH=
case "$RELEASE_MODE" in case "$RELEASE_MODE" in
minor) minor)
number_is_even "${VERSION_ARR[1]}" || die "cannot do minor release on top of version $VERSION_STR" number_is_even "${VERSION_ARR[1]}" &&
number_is_odd "${VERSION_ARR[2]}" || die "cannot do minor release on top of version $VERSION_STR"
[ "$CUR_BRANCH" != main ] || die "cannot do a minor release on main" [ "$CUR_BRANCH" != main ] || die "cannot do a minor release on main"
;; ;;
devel) devel)
@@ -412,7 +413,7 @@ fi
if [ $CHECK_GITLAB = 1 ]; then if [ $CHECK_GITLAB = 1 ]; then
if ! check_gitlab_pipeline "$CUR_BRANCH" "$CUR_HEAD" ; then if ! check_gitlab_pipeline "$CUR_BRANCH" "$CUR_HEAD" ; then
echo "Check the pipelines for branch \"$CUR_BRANCH\" at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/pipelines?ref=$CUR_BRANCH&source=push" echo "Check the pipelines for branch \"$CUR_BRANCH\" at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/pipelines?ref=$CUR_BRANCH"
echo "Wait for pipeline with \`ci-fairy wait-for-pipeline --project NetworkManager/NetworkManager --sha \"$CUR_HEAD\"\`" echo "Wait for pipeline with \`ci-fairy wait-for-pipeline --project NetworkManager/NetworkManager --sha \"$CUR_HEAD\"\`"
die "It seems not all gitlab-ci jobs were running/succeeding. Skip this check with --no-check-gitlab" die "It seems not all gitlab-ci jobs were running/succeeding. Skip this check with --no-check-gitlab"
fi fi
@@ -430,13 +431,19 @@ case "$RELEASE_MODE" in
minor) minor)
set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1)) set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))" -a || die "failed to commit release" git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))" -a || die "failed to commit release"
set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 2))
git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 2)) (development)" -a || die "failed to commit devel version bump"
b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))" b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release" git tag -s -a -m "Tag $b" "$b" HEAD~ || die "failed to tag release"
BRANCHES+=("$b") BRANCHES+=("$b")
CLEANUP_REFS+=("refs/tags/$b") CLEANUP_REFS+=("refs/tags/$b")
BUILD_TAG="$b" BUILD_TAG="$b"
TAR_VERSION="$b" b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 2))"
git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag devel version"
BRANCHES+=("$b-dev")
CLEANUP_REFS+=("refs/tags/$b-dev")
TAR_VERSION="$BUILD_TAG"
;; ;;
devel) devel)
set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1)) set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
@@ -475,12 +482,20 @@ case "$RELEASE_MODE" in
;; ;;
major) major)
b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0" b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0"
b2="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).1"
set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 0 set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 0
git commit -m "release: bump version to $b" -a || die "failed to commit major version bump" git commit -m "release: bump version to $b" -a || die "failed to commit major version bump"
git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release" git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release"
BRANCHES+=("$b") BRANCHES+=("$b")
CLEANUP_REFS+=("refs/tags/$b") CLEANUP_REFS+=("refs/tags/$b")
set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 1
git commit -m "release: bump version to $b2 (development)" -a || die "failed to commit another bump after major version bump"
git tag -s -a -m "Tag $b (development)" "$b2-dev" HEAD || die "failed to tag release"
BRANCHES+=("$b2-dev")
CLEANUP_REFS+=("refs/tags/$b2-dev")
BUILD_TAG="$b" BUILD_TAG="$b"
TAR_VERSION="$b" TAR_VERSION="$b"
;; ;;
@@ -512,23 +527,27 @@ case "$RELEASE_MODE" in
esac esac
build_tag() { build_tag() {
local BUILD_TAG="$1"
local TAR_FILE="NetworkManager-$2.tar.xz"
local SUM_FILE="$TAR_FILE.sha256sum"
git checkout "$BUILD_TAG" || die "failed to checkout $BUILD_TAG" git checkout "$BUILD_TAG" || die "failed to checkout $BUILD_TAG"
./contrib/fedora/rpm/build_clean.sh -r || die "build release failed" ./contrib/fedora/rpm/build_clean.sh -r || die "build release failed"
cp "./build/meson-dist/$TAR_FILE" /tmp/ || die "failed to copy $TAR_FILE to /tmp"
cp "./build/meson-dist/$SUM_FILE" /tmp/ || die "failed to copy $SUM_FILE to /tmp" test -f "./$RELEASE_FILE" \
|| die "release file \"./$RELEASE_FILE\" not found"
cp "./$RELEASE_FILE" /tmp/ || die "failed to copy release tarball to /tmp"
if test -f "./$RELEASE_FILE.sig" ; then
cp "./$RELEASE_FILE.sig" /tmp/ || die "failed to copy signature for tarball to /tmp"
fi
git clean -fdx git clean -fdx
} }
RELEASE_TAR_VERSIONS=() RELEASE_FILES=()
RELEASE_TAGS=()
if [ -n "$BUILD_TAG" ]; then if [ -n "$BUILD_TAG" ]; then
build_tag "$BUILD_TAG" "$TAR_VERSION" RELEASE_FILE="NetworkManager-$TAR_VERSION.tar.xz"
RELEASE_TAR_VERSIONS+=("$TAR_VERSION") RELEASE_FILES+=("$RELEASE_FILE")
RELEASE_TAGS+=("$BUILD_TAG") build_tag
fi fi
git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH" git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
@@ -538,6 +557,9 @@ if [ "$RELEASE_MODE" = rc1 ]; then
git branch "$RELEASE_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH" git branch "$RELEASE_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
BRANCHES+=( "$RELEASE_BRANCH" ) BRANCHES+=( "$RELEASE_BRANCH" )
CLEANUP_REFS+=( "refs/heads/$RELEASE_BRANCH" ) CLEANUP_REFS+=( "refs/heads/$RELEASE_BRANCH" )
fi
if [ "$RELEASE_MODE" = rc1 ]; then
git checkout "$TMP_BRANCH" git checkout "$TMP_BRANCH"
b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).0" b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).0"
set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 2))" 0 set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 2))" 0
@@ -547,88 +569,29 @@ if [ "$RELEASE_MODE" = rc1 ]; then
CLEANUP_REFS+=("refs/tags/$b-dev") CLEANUP_REFS+=("refs/tags/$b-dev")
BUILD_TAG="$b-dev" BUILD_TAG="$b-dev"
TAR_VERSION="$b" TAR_VERSION="$b"
build_tag "$BUILD_TAG" "$TAR_VERSION" RELEASE_FILE="NetworkManager-$TAR_VERSION.tar.xz"
RELEASE_TAR_VERSIONS+=("$TAR_VERSION") RELEASE_FILES+=("$RELEASE_FILE")
RELEASE_TAGS+=("$BUILD_TAG") build_tag
git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH" git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
fi fi
if [[ $GITLAB_TOKEN == "" ]]; then if ! [ "$DRY_RUN" = 0 ]; then
[[ -r ~/.config/nm-release-token ]] || die "cannot read ~/.config/nm-release-token" ssh master.gnome.org true || die "failed to \`ssh master.gnome.org\`"
GITLAB_TOKEN=$(< ~/.config/nm-release-token)
fi fi
# This step is not necessary for authentication, we use it only to provide a meaningful error message. for r in "${RELEASE_FILES[@]}"; do
GITLAB_USER_ID=$(curl --request GET --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ do_command rsync -va --append-verify -P "/tmp/$r" master.gnome.org: || die "failed to rsync \"/tmp/$r\""
"https://gitlab.freedesktop.org/api/v4/personal_access_tokens/self" 2>/dev/null | jq ".user_id" || true) done
if [ -z "$GITLAB_USER_ID" ] || [ "$GITLAB_USER_ID" = "null" ]; then
die "failed to authenticate to gitlab.freedesktop.org with the private token"
fi
do_command git push "$ORIGIN" "${BRANCHES[@]}" || die "failed to to push branches ${BRANCHES[@]} to $ORIGIN" do_command git push "$ORIGIN" "${BRANCHES[@]}" || die "failed to to push branches ${BRANCHES[@]} to $ORIGIN"
CREATE_RELEASE_FAIL=0 FAIL=0
for I in "${!RELEASE_TAR_VERSIONS[@]}"; do for r in "${RELEASE_FILES[@]}"; do
TAR_FILE="NetworkManager-${RELEASE_TAR_VERSIONS[$I]}.tar.xz" do_command ssh master.gnome.org ftpadmin install --unattended "$r" || FAIL=1
SUM_FILE="$TAR_FILE.sha256sum"
BUILD_TAG="${RELEASE_TAGS["$I"]}"
FAIL=0
# upload tarball and checksum file as generic packages
for F in "$TAR_FILE" "$SUM_FILE"; do
do_command curl --location --fail-with-body --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--upload-file "/tmp/$F" \
"https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$F" \
|| FAIL=1
if [[ $FAIL = 1 ]]; then
fail_msg "failed to upload $F"
CREATE_RELEASE_FAIL=1
break
fi
done
[[ $FAIL = 1 ]] && continue
# create release
do_command curl --location --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--request POST "https://gitlab.freedesktop.org/api/v4/projects/411/releases" \
--data "$(cat <<END
{
"name": "NetworkManager $BUILD_TAG",
"tag_name": "$BUILD_TAG",
"assets": {
"links": [
{
"name": "NetworkManager $BUILD_TAG tarball with docs",
"url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$TAR_FILE",
"direct_asset_path": "/$TAR_FILE",
"link_type":"package"
},
{
"name": "NetworkManager $BUILD_TAG tarball sha256sum",
"url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$SUM_FILE",
"direct_asset_path": "/$SUM_FILE",
"link_type":"package"
},
{
"name": "NEWS",
"url": "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/$BUILD_TAG/NEWS?ref_type=tags",
"direct_asset_path": "/NEWS",
"link_type":"other"
}
]
}
}
END
)" || FAIL=1
if [[ $? != 0 ]]; then
fail_msg "failed to create NetworkManager $BUILD_TAG release"
CREATE_RELEASE_FAIL=1
continue
fi
done done
if [ "$FAIL" = 1 ]; then
die "ftpadmin install failed. This was the last step. Invoke the command manually"
fi
CLEANUP_CHECKOUT_BRANCH= CLEANUP_CHECKOUT_BRANCH=
if [ "$DRY_RUN" = 0 ]; then if [ "$DRY_RUN" = 0 ]; then
@@ -639,7 +602,3 @@ else
git checkout -B "$CUR_BRANCH" "$CUR_HEAD" || die "cannot reset $CUR_BRANCH to $CUR_HEAD" git checkout -B "$CUR_BRANCH" "$CUR_HEAD" || die "cannot reset $CUR_BRANCH to $CUR_HEAD"
echo "delete reference. Restore with $(echo_color 36 -n git checkout -B "\"$CUR_BRANCH\"" "$H")" echo "delete reference. Restore with $(echo_color 36 -n git checkout -B "\"$CUR_BRANCH\"" "$H")"
fi fi
if [[ $CREATE_RELEASE_FAIL == 1 ]]; then
die "failed creating the release at gitlab.freedesktop.org. This was the last step, create it manually from the web UI"
fi

View File

@@ -262,14 +262,6 @@ detect_dirname() {
# the unpacked tarball (that is, stripping the suffix). # the unpacked tarball (that is, stripping the suffix).
for T in $(ls -1 "$BUILD_TYPE"*"$suffix" 2>/dev/null); do for T in $(ls -1 "$BUILD_TYPE"*"$suffix" 2>/dev/null); do
D="${T%$suffix}" D="${T%$suffix}"
# At some point FEDPKG changed the behavior of "prep" command
# now it generates the directory with "-build" suffix and the
# real directory inside. We just move it out.
if [ -d "$D-build" ]; then
rm -rf "$D"
mv "$D-build/$D" .
rm -rf "$D-build"
fi
[[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D") [[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D")
done done
done done
@@ -416,10 +408,6 @@ pushd "$DIRNAME"
git remote add origin "https://github.com/firewalld/firewalld.git" git remote add origin "https://github.com/firewalld/firewalld.git"
elif [[ "$BUILD_TYPE" == "nftables" ]]; then elif [[ "$BUILD_TYPE" == "nftables" ]]; then
git remote add origin "git://git.netfilter.org/nftables" git remote add origin "git://git.netfilter.org/nftables"
elif [[ "$BUILD_TYPE" == "ulogd" ]]; then
git remote add origin "https://git.netfilter.org/ulogd2"
elif [[ "$BUILD_TYPE" == "libnetfilter_log" ]]; then
git remote add origin "https://git.netfilter.org/$BUILD_TYPE"
fi fi
LOCAL_MIRROR_URL="$(LANG=C git remote -v | sed -n 's/^origin\t*\([^\t].*\) (fetch)/\1/p')" LOCAL_MIRROR_URL="$(LANG=C git remote -v | sed -n 's/^origin\t*\([^\t].*\) (fetch)/\1/p')"
LOCAL_MIRROR="$(get_local_mirror "$LOCAL_MIRROR_URL")" LOCAL_MIRROR="$(get_local_mirror "$LOCAL_MIRROR_URL")"
@@ -538,13 +526,6 @@ cc304f05edab6c408a0f061eb1a104f9f06b8587 86ef789876b65c61751ce854835b91d4 init
# systemd # systemd
903dd65b5eb63257393955cb79777beb8c71afc1 SHA512 (systemd-253-rc1.tar.gz) = aaf0a6bf21bbc50a42015c9cb17f69d1aaf6cab6cabfba5140a94212fb864e38d638dace9a70447f62b4d2a817a0d3bd6f4ae8d9b3c2e741cdeb1cb332f70b65 903dd65b5eb63257393955cb79777beb8c71afc1 SHA512 (systemd-253-rc1.tar.gz) = aaf0a6bf21bbc50a42015c9cb17f69d1aaf6cab6cabfba5140a94212fb864e38d638dace9a70447f62b4d2a817a0d3bd6f4ae8d9b3c2e741cdeb1cb332f70b65
# libnetfilter_log
97866a0a7482ca518bad39536c7c667bfb9604b2 2a4bb0654ae675a52d2e8d1c06090b94 libnetfilter_log-1.0.1.tar.bz2
b0e4be94c0b8f68d4e912402b93a130063c34e17 SHA512 (libnetfilter_log-1.0.2.tar.bz2) = 6b33718b1dd7f4504bceae14001da3a652cec46a6725a5dee83a7b55028cfa8e768cba917f968a5d5b60fd9ff04edf6040ef271a68e5fb65858bf73f4f9ccf23
# ulogd
79aa980f2df9dda0c097e8f883a62f414b9e5138 SHA512 (ulogd-2.0.8.tar.bz2) = 9f99f6f35bad5da4559d788dc3ba3dae17d4ae972737cae3313ecf68f08eaf5f55514fce6f30503437e4158fd30a06438b9249d5d20f6343964cbf690f87309d
EOF EOF
)" )"
OLDIFS="$IFS" OLDIFS="$IFS"
@@ -602,7 +583,7 @@ EOF
if [[ "$REVERT_COUNT" == "" || $REVERT_COUNT -gt 0 ]]; then if [[ "$REVERT_COUNT" == "" || $REVERT_COUNT -gt 0 ]]; then
# parse the list of patches # parse the list of patches
IFS=$'\n' read -rd '' -a PATCH_LIST <<<"$(sed -n 's/^Patch\([0-9]\+\):[ ]\+\(.*\)$/\1 \2/p' ../"$SPEC" | sort -n)" IFS=$'\n' read -rd '' -a PATCH_LIST <<<"$(sed -n 's/^Patch\([0-9]\+\): \+\(.*\)$/\1 \2/p' ../"$SPEC" | sort -n)"
if [[ "$BUILD_TYPE" == "NetworkManager" ]]; then if [[ "$BUILD_TYPE" == "NetworkManager" ]]; then
if containsElement idx "123 rh1085015-applet-translations.patch" "${PATCH_LIST[@]}"; then if containsElement idx "123 rh1085015-applet-translations.patch" "${PATCH_LIST[@]}"; then
@@ -693,7 +674,7 @@ popd
if [[ $LOCAL != 0 ]]; then if [[ $LOCAL != 0 ]]; then
rm -rf ./.makerepo.git/ rm -rf ./.makerepo.git/
mv "$DIRNAME/.git" ./.makerepo.git/ mv "$DIRNAME/.git" ./.makerepo.git/
$FEDPKG $DIST local -- --noclean $FEDPKG $DIST local
mv ./.makerepo.git/ "$DIRNAME/.git" mv ./.makerepo.git/ "$DIRNAME/.git"
pushd "$DIRNAME" pushd "$DIRNAME"
git checkout -- .gitignore git checkout -- .gitignore

View File

@@ -203,7 +203,7 @@ complain ("Don't use g_direct_equal() for hash tables, pass NULL for pointer equ
complain ("Prefer nm_pint_hash()/nm_pint64_hash()/nm_pdouble_hash() over g_int_hash()/g_int64_hash()/g_double_hash(). Those use siphash24") if $line =~ /\b(g_int_hash|g_int64_hash|g_double_hash)\b/; complain ("Prefer nm_pint_hash()/nm_pint64_hash()/nm_pdouble_hash() over g_int_hash()/g_int64_hash()/g_double_hash(). Those use siphash24") if $line =~ /\b(g_int_hash|g_int64_hash|g_double_hash)\b/;
complain ("Prefer nm_pint_equal()/nm_pint64_equal()/nm_pdouble_equal() over g_int_equal()/g_int64_equal()/g_double_equal(). Those names mirror our nm_p*_hash() functions") if $line =~ /\b(g_int_equal|g_int64_equal|g_double_equal)\b/; complain ("Prefer nm_pint_equal()/nm_pint64_equal()/nm_pdouble_equal() over g_int_equal()/g_int64_equal()/g_double_equal(). Those names mirror our nm_p*_hash() functions") if $line =~ /\b(g_int_equal|g_int64_equal|g_double_equal)\b/;
complain ("Avoid g_clear_pointer() and use nm_clear_pointer() (or nm_clear_g_free(), g_clear_object(), etc.)") if $line =~ /\b(g_clear_pointer)\b/; complain ("Avoid g_clear_pointer() and use nm_clear_pointer() (or nm_clear_g_free(), g_clear_object(), etc.)") if $line =~ /\b(g_clear_pointer)\b/;
complain ("Define setting properties with _nm_setting_property_define_direct_*() API") if $line =~ /g_param_spec_/ and $filename =~ /\/libnm-core-impl\/nm-setting/ and (not $filename =~ /\/nm-setting-ip-config.c$/); complain ("Define setting properties with _nm_setting_property_define_direct_*() API") if $line =~ /g_param_spec_/ and $filename =~ /\/libnm-core-impl\/nm-setting/;
complain ("Use nm_g_array_{index,first,last,index_p}() instead of g_array_index(), as it nm_assert()s for valid element size and out-of-bound access") if $line =~ /\bg_array_index\b/; complain ("Use nm_g_array_{index,first,last,index_p}() instead of g_array_index(), as it nm_assert()s for valid element size and out-of-bound access") if $line =~ /\bg_array_index\b/;
complain ("Use spaces instead of tabs") if $line =~ /\t/; complain ("Use spaces instead of tabs") if $line =~ /\t/;
complain ("Prefer implementing private pointers via _NM_GET_PRIVATE() or _NM_GET_PRIVATE_PTR() (the latter, if the private data has an opqaue pointer in the header file)") if $line =~ /\b(g_type_class_add_private|G_TYPE_INSTANCE_GET_PRIVATE)\b/; complain ("Prefer implementing private pointers via _NM_GET_PRIVATE() or _NM_GET_PRIVATE_PTR() (the latter, if the private data has an opqaue pointer in the header file)") if $line =~ /\b(g_type_class_add_private|G_TYPE_INSTANCE_GET_PRIVATE)\b/;

View File

@@ -193,9 +193,7 @@ def git_ref_commit_body(ref):
def git_ref_commit_body_get_fixes(ref): def git_ref_commit_body_get_fixes(ref):
body = git_ref_commit_body(ref) body = git_ref_commit_body(ref)
result = [] result = []
for mo in re.finditer( for mo in re.finditer(re_bin("\\b[fF]ixes: *([0-9a-z]+)\\b"), body):
re_bin("^\\s*[fF]ixes: *([0-9a-z]+)\\b"), body, flags=re.MULTILINE
):
c = mo.group(1).decode("ascii") c = mo.group(1).decode("ascii")
h = git_ref_exists(c) h = git_ref_exists(c)
if h: if h:
@@ -204,9 +202,7 @@ def git_ref_commit_body_get_fixes(ref):
# The commit that contains a "Fixes:" line, can also contain an "Ignore-Fixes:" line # The commit that contains a "Fixes:" line, can also contain an "Ignore-Fixes:" line
# to disable it. This only makes sense with refs/notes/bugs notes, to fix up a wrong # to disable it. This only makes sense with refs/notes/bugs notes, to fix up a wrong
# annotation. # annotation.
for mo in re.finditer( for mo in re.finditer(re_bin("\\bIgnore-[fF]ixes: *([0-9a-z]+)\\b"), body):
re_bin("^\\s*Ignore-[fF]ixes: *([0-9a-z]+)\\b"), body, flags=re.MULTILINE
):
c = mo.group(1).decode("ascii") c = mo.group(1).decode("ascii")
h = git_ref_exists(c) h = git_ref_exists(c)
try: try:

View File

@@ -0,0 +1,40 @@
#!/bin/bash
# patch gtk-doc for https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
cd /
patch -f -p 1 --fuzz 0 --reject-file=- <<EOF
diff --git a/usr/share/gtk-doc/python/gtkdoc/scan.py b/usr/share/gtk-doc/python/gtkdoc/scan.py
index f1f167235ab2e4c62676fbcfb87ebbe55c95b944..b59dd17abfa5f42b7bb06d239f9c78e5efffbf5d 100644
--- a/usr/share/gtk-doc/python/gtkdoc/scan.py
+++ b/usr/share/gtk-doc/python/gtkdoc/scan.py
@@ -427,20 +427,26 @@ def ScanHeader(input_file, section_list, decl_list, get_types, options):
elif m9:
# We've found a 'typedef struct _<name> <name>;'
# This could be an opaque data structure, so we output an
# empty declaration. If the structure is actually found that
# will override this.
structsym = m9.group(1).upper()
logging.info('%s typedef: "%s"', structsym, m9.group(2))
forward_decls[m9.group(2)] = '<%s>\n<NAME>%s</NAME>\n%s</%s>\n' % (
structsym, m9.group(2), deprecated, structsym)
+ bm = re.search(r'^(\S+)(Class|Iface|Interface)\b', m9.group(2))
+ if bm:
+ objectname = bm.group(1)
+ logging.info('Found object: "%s"', objectname)
+ title = '<TITLE>%s</TITLE>' % objectname
+
elif re.search(r'^\s*(?:struct|union)\s+_(\w+)\s*;', line):
# Skip private structs/unions.
logging.info('private struct/union')
elif m10:
# Do a similar thing for normal structs as for typedefs above.
# But we output the declaration as well in this case, so we
# can differentiate it from a typedef.
structsym = m10.group(1).upper()
logging.info('%s:%s', structsym, m10.group(2))
EOF

View File

@@ -3,6 +3,7 @@
# Arguments via environment variables: # Arguments via environment variables:
# - CI # - CI
# - CC # - CC
# - BUILD_TYPE
# - CFLAGS # - CFLAGS
# - WITH_DOCS # - WITH_DOCS
@@ -49,18 +50,23 @@ grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1
############################################################################### ###############################################################################
_WITH_CRYPTO="gnutls" if [ "$BUILD_TYPE" == meson ]; then
_WITH_WERROR=1 _TRUE=true
_WITH_LIBTEAM="true" _FALSE=false
_WITH_DOCS="true" elif [ "$BUILD_TYPE" == autotools ]; then
_WITH_SYSTEMD_LOGIND="true" _TRUE=yes
_WITH_NBFT="true" _FALSE=no
if [ $IS_ALPINE = 1 ]; then else
_WITH_SYSTEMD_LOGIND="false" die "invalid \$BUILD_TYPE \"$BUILD_TYPE\""
fi fi
if ! pkgconf 'libnvme >= 1.5'; then _WITH_CRYPTO="gnutls"
_WITH_NBFT="false" _WITH_WERROR=1
_WITH_LIBTEAM="$_TRUE"
_WITH_DOCS="$_TRUE"
_WITH_SYSTEMD_LOGIND="$_TRUE"
if [ $IS_ALPINE = 1 ]; then
_WITH_SYSTEMD_LOGIND="$_FALSE"
fi fi
if [ -z "${NMTST_SEED_RAND+x}" ]; then if [ -z "${NMTST_SEED_RAND+x}" ]; then
@@ -86,9 +92,9 @@ fi
if [ "$WITH_DOCS" != "" ]; then if [ "$WITH_DOCS" != "" ]; then
if _is_true "$WITH_DOCS"; then if _is_true "$WITH_DOCS"; then
_WITH_DOCS="true" _WITH_DOCS="$_TRUE"
else else
_WITH_DOCS="false" _WITH_DOCS="$_FALSE"
fi fi
fi fi
@@ -143,64 +149,126 @@ _print_test_logs() {
fi fi
} }
run_autotools() {
NOCONFIGURE=1 ./autogen.sh
mkdir ./build
if [ "$_WITH_WERROR" == 1 ]; then
_WITH_WERROR_VAL="error"
else
_WITH_WERROR_VAL="yes"
fi
DISABLE_DEPENDENCY_TRACKING=
if [ $IS_ALPINE = 1 ]; then
DISABLE_DEPENDENCY_TRACKING='--disable-dependency-tracking'
fi
pushd ./build
../configure \
--prefix="$PWD/INST" \
$DISABLE_DEPENDENCY_TRACKING \
\
--enable-introspection=$_WITH_DOCS \
--enable-gtk-doc=$_WITH_DOCS \
--with-systemd-logind=$_WITH_SYSTEMD_LOGIND \
--enable-more-warnings="$_WITH_WERROR_VAL" \
--enable-tests=yes \
--with-crypto=$_WITH_CRYPTO \
\
--with-ebpf=no \
\
--with-iwd=yes \
--with-ofono=yes \
--enable-teamdctl=$_WITH_LIBTEAM \
\
--with-dhcpcanon=yes \
--with-dhcpcd=yes \
--with-dhclient=yes \
\
--with-netconfig=/bin/nowhere/netconfig \
--with-resolvconf=/bin/nowhere/resolvconf \
\
--enable-ifcfg-rh=yes \
--enable-ifupdown=yes \
\
#end
make -j 6
make install
export NM_TEST_CLIENT_CHECK_L10N=1
if ! make check -j 6 -k ; then
_print_test_logs "first-test"
echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || :
echo ">>>> RUN SECOND TEST (done)"
_print_test_logs "second-test"
die "autotools test failed"
fi
if _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then
_print_test_logs "(valgrind test)"
die "autotools+valgrind test failed"
fi
fi
popd
}
############################################################################### ###############################################################################
if [ "$_WITH_WERROR" == 1 ]; then run_meson() {
_WITH_WERROR_VAL="--werror" if [ "$_WITH_WERROR" == 1 ]; then
else _WITH_WERROR_VAL="--werror"
_WITH_WERROR_VAL="" else
fi _WITH_WERROR_VAL=""
fi
meson build \
\
-Dprefix="$PWD/INST" \
\
--warnlevel 2 \
$_WITH_WERROR_VAL \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=$_WITH_DOCS \
-D qt=false \
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
-D ebpf=false \
\
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
\
-D dhclient=/bin/nowhere/dhclient \
-D dhcpcanon=/bin/nowhere/dhcpcanon \
-D dhcpcd=/bin/nowhere/dhcpd \
\
-D netconfig=/bin/nowhere/netconfig \
-D resolvconf=/bin/nowhere/resolvconf \
\
-D ifcfg_rh=false \
-D ifupdown=true \
\
#end
meson setup build \ export NM_TEST_CLIENT_CHECK_L10N=1
\
-Dprefix="$PWD/INST" \
\
--warnlevel 2 \
$_WITH_WERROR_VAL \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=$_WITH_DOCS \
-D man=$_WITH_DOCS \
-D qt=false \
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
-D ebpf=false \
\
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
\
-D dhclient=/bin/nowhere/dhclient \
-D dhcpcd=/bin/nowhere/dhcpd \
\
-D netconfig=/bin/nowhere/netconfig \
-D resolvconf=/bin/nowhere/resolvconf \
\
-D ifcfg_rh=false \
-D ifupdown=true \
\
-D nbft=$_WITH_NBFT \
\
#end
export NM_TEST_CLIENT_CHECK_L10N=1
if [ "$CONFIGURE_ONLY" != 1 ]; then
ninja -C build -v ninja -C build -v
ninja -C build install ninja -C build install
if ! meson test -C build -v --print-errorlogs ; then if ! meson test -C build -v --print-errorlogs ; then
echo ">>>> RUN SECOND TEST (start)" echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" \ NMTST_DEBUG="debug,TRACE,no-expect-message" \
meson test -C build -v --print-errorlogs || : meson test -C build -v --print-errorlogs || :
echo ">>>> RUN SECOND TEST (done)" echo ">>>> RUN SECOND TEST (done)"
die "meson test failed" die "meson test failed"
fi fi
@@ -211,6 +279,14 @@ if [ "$CONFIGURE_ONLY" != 1 ]; then
die "meson+valgrind test failed" die "meson+valgrind test failed"
fi fi
fi fi
}
###############################################################################
if [ "$BUILD_TYPE" == autotools ]; then
run_autotools
elif [ "$BUILD_TYPE" == meson ]; then
run_meson
fi fi
if [ "$USE_CCACHE" = 1 ]; then if [ "$USE_CCACHE" = 1 ]; then

View File

@@ -70,7 +70,7 @@ get_nm_git_bundle() {
if [ -n "${NM_GIT_BUNDLE+x}" ]; then if [ -n "${NM_GIT_BUNDLE+x}" ]; then
return 0 return 0
fi fi
NM_GIT_BUNDLE='https://download.copr.fedorainfracloud.org/results/networkmanager/NetworkManager-main/fedora-41-x86_64/08367599-nm-git-bundle/nm-git-bundle-20241209-150540.noarch.rpm' NM_GIT_BUNDLE='https://download.copr.fedorainfracloud.org/results/networkmanager/NetworkManager-main/fedora-38-x86_64/06008259-nm-git-bundle/nm-git-bundle-20230606-102458.noarch.rpm'
fi fi
mkdir nm-git-bundle mkdir nm-git-bundle
pushd nm-git-bundle pushd nm-git-bundle

View File

@@ -1,27 +0,0 @@
[Unit]
Description=NetworkManager Configuration (initrd)
DefaultDependencies=no
Wants=systemd-journald.socket
After=systemd-journald.socket
Before=systemd-udevd.service systemd-udev-trigger.service
ConditionPathExists=/etc/initrd-release
[Service]
Type=oneshot
ExecStartPre=/bin/sh -c "rm -f /run/NetworkManager/system-connections/*"
ExecStart=/bin/sh -c "@libexecdir@/nm-initrd-generator -- $(cat /proc/cmdline)"
ExecStartPost=/bin/sh -c ' \
for i in /{usr/lib,run,etc}/NetworkManager/system-connections/*; do \
[ -f "$i" ] || continue; \
mkdir -p /run/NetworkManager/initrd; \
: > /run/NetworkManager/initrd/neednet; \
break; \
done; \
if [ -s /run/NetworkManager/initrd/hostname ]; then \
cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname; \
fi \
'
RemainAfterExit=yes
[Install]
WantedBy=initrd.target

View File

@@ -1,32 +0,0 @@
[Unit]
Description=NetworkManager (initrd)
DefaultDependencies=no
Wants=systemd-udev-trigger.service network.target
After=systemd-udev-trigger.service network-pre.target dbus.service NetworkManager-config-initrd.service
Before=network.target
BindsTo=dbus.service
ConditionPathExists=/etc/initrd-release
ConditionPathExists=/run/NetworkManager/initrd/neednet
ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/run/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/*
[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
ExecStart=@sbindir@/NetworkManager
# NM doesn't want systemd to kill its children for it
KillMode=process
Environment=NM_CONFIG_ENABLE_TAG=initrd
Restart=on-failure
ProtectSystem=true
ProtectHome=read-only
[Install]
WantedBy=initrd.target
# We want to enable NetworkManager-wait-online-initrd.service whenever this
# service is enabled. NetworkManager-wait-online-initrd.service has
# WantedBy=network-online.target, so enabling it only has an effect if
# network-online.target itself is enabled or pulled in by some other unit.
Also=NetworkManager-config-initrd.service NetworkManager-wait-online-initrd.service

View File

@@ -1,26 +0,0 @@
[Unit]
Description=NetworkManager Wait Online (initrd)
DefaultDependencies=no
Requires=NetworkManager-initrd.service
After=NetworkManager-initrd.service
Before=network-online.target
ConditionPathExists=/etc/initrd-release
ConditionPathExists=/run/NetworkManager/initrd/neednet
[Service]
# `nm-online -s` waits until the point when NetworkManager logs
# "startup complete". That is when startup actions are settled and
# devices and profiles reached a conclusive activated or deactivated
# state. It depends on which profiles are configured to autoconnect and
# also depends on profile settings like ipv4.may-fail/ipv6.may-fail,
# which affect when a profile is considered fully activated.
# Check NetworkManager logs to find out why wait-online takes a certain
# time.
Type=oneshot
ExecStart=@bindir@/nm-online -s -q
RemainAfterExit=yes
Environment=NM_ONLINE_TIMEOUT=3600
[Install]
WantedBy=initrd.target network-online.target

View File

@@ -19,6 +19,7 @@ KillMode=process
# With a huge number of interfaces, starting can take a long time. # With a huge number of interfaces, starting can take a long time.
TimeoutStartSec=600 TimeoutStartSec=600
# CAP_DAC_OVERRIDE: required to open /run/openvswitch/db.sock socket.
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
ProtectSystem=true ProtectSystem=true

View File

@@ -9,28 +9,19 @@ configure_file(
if install_systemdunitdir if install_systemdunitdir
services = [ services = [
'NetworkManager-dispatcher.service', 'NetworkManager-dispatcher.service.in',
'NetworkManager.service', 'NetworkManager.service.in',
'nm-priv-helper.service', 'nm-priv-helper.service.in',
'NetworkManager-wait-online.service', 'NetworkManager-wait-online.service.in',
'NetworkManager-config-initrd.service',
'NetworkManager-initrd.service',
'NetworkManager-wait-online-initrd.service',
] ]
foreach service: services foreach service: services
configure_file( configure_file(
input: service + '.in', input: service,
output: service, output: '@BASENAME@',
install_dir: systemd_systemdsystemunitdir, install_dir: systemd_systemdsystemunitdir,
configuration: data_conf, configuration: data_conf,
) )
test(
'check-' + service,
find_program(join_paths(source_root, 'src/tests/check-systemd-unit.sh')),
args: [ join_paths(meson.current_build_dir(), service) ],
)
endforeach endforeach
if enable_ovs if enable_ovs

View File

@@ -2,8 +2,8 @@
Description=NetworkManager Privileged Helper Description=NetworkManager Privileged Helper
# #
# nm-priv-helper exists for privilege separation. It allows NetworkManager # nm-priv-helper exists for privilege separation. It allows to run
# to run without certain capabilities, and ask nm-priv-helper # NetworkManager without certain capabilities, and ask nm-priv-helper
# for special operations where more privileges are required. # for special operations where more privileges are required.
# #

View File

@@ -16,6 +16,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.reload"> <action id="org.freedesktop.NetworkManager.reload">
@@ -26,6 +27,7 @@
<allow_inactive>auth_admin_keep</allow_inactive> <allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active> <allow_active>auth_admin_keep</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.sleep-wake"> <action id="org.freedesktop.NetworkManager.sleep-wake">
@@ -35,6 +37,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>no</allow_active> <allow_active>no</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.enable-disable-wifi"> <action id="org.freedesktop.NetworkManager.enable-disable-wifi">
@@ -44,6 +47,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.enable-disable-wwan"> <action id="org.freedesktop.NetworkManager.enable-disable-wwan">
@@ -53,6 +57,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.enable-disable-wimax"> <action id="org.freedesktop.NetworkManager.enable-disable-wimax">
@@ -62,6 +67,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.network-control"> <action id="org.freedesktop.NetworkManager.network-control">
@@ -72,6 +78,7 @@
<allow_inactive>yes</allow_inactive> <allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.wifi.scan"> <action id="org.freedesktop.NetworkManager.wifi.scan">
@@ -82,6 +89,7 @@
<allow_inactive>yes</allow_inactive> <allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.wifi.share.protected"> <action id="org.freedesktop.NetworkManager.wifi.share.protected">
@@ -91,6 +99,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.wifi.share.open"> <action id="org.freedesktop.NetworkManager.wifi.share.open">
@@ -100,6 +109,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.settings.modify.own"> <action id="org.freedesktop.NetworkManager.settings.modify.own">
@@ -110,6 +120,7 @@
<allow_inactive>yes</allow_inactive> <allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.settings.modify.system"> <action id="org.freedesktop.NetworkManager.settings.modify.system">
@@ -120,6 +131,7 @@
<allow_inactive>@NM_MODIFY_SYSTEM_POLICY@</allow_inactive> <allow_inactive>@NM_MODIFY_SYSTEM_POLICY@</allow_inactive>
<allow_active>@NM_MODIFY_SYSTEM_POLICY@</allow_active> <allow_active>@NM_MODIFY_SYSTEM_POLICY@</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.settings.modify.hostname"> <action id="org.freedesktop.NetworkManager.settings.modify.hostname">
@@ -130,6 +142,7 @@
<allow_inactive>auth_admin_keep</allow_inactive> <allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active> <allow_active>auth_admin_keep</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.settings.modify.global-dns"> <action id="org.freedesktop.NetworkManager.settings.modify.global-dns">
@@ -140,6 +153,7 @@
<allow_inactive>auth_admin_keep</allow_inactive> <allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active> <allow_active>auth_admin_keep</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.checkpoint-rollback"> <action id="org.freedesktop.NetworkManager.checkpoint-rollback">
@@ -150,6 +164,7 @@
<allow_inactive>auth_admin_keep</allow_inactive> <allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active> <allow_active>auth_admin_keep</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.enable-disable-statistics"> <action id="org.freedesktop.NetworkManager.enable-disable-statistics">
@@ -159,6 +174,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
<action id="org.freedesktop.NetworkManager.enable-disable-connectivity-check"> <action id="org.freedesktop.NetworkManager.enable-disable-connectivity-check">
@@ -168,6 +184,7 @@
<allow_inactive>no</allow_inactive> <allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.owner">unix-user:networkmanager</annotate>
</action> </action>
</policyconfig> </policyconfig>

140
docs/api/Makefile.am Normal file
View File

@@ -0,0 +1,140 @@
AUTOMAKE_OPTIONS = 1.7
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
GENERATED_FILES =
if BUILD_DOCS
GENERATED_FILES += settings-spec.xml
endif
# The name of the module.
DOC_MODULE=NetworkManager
# The top-level SGML file.
DOC_MAIN_SGML_FILE=network-manager-docs.xml
DOC_SOURCE_DIR=$(srcdir)
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=--path="$(abs_srcdir)"
# Files to be included in $(DOC_MAIN_SGML_FILE)
content_files = \
$(GENERATED_FILES) \
dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
dbus-org.freedesktop.NetworkManager.AgentManager.xml \
dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
dbus-org.freedesktop.NetworkManager.Device.Hsr.xml \
dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
dbus-org.freedesktop.NetworkManager.Device.Loopback.xml \
dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
dbus-org.freedesktop.NetworkManager.Device.Team.xml \
dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml \
dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
dbus-org.freedesktop.NetworkManager.Device.xml \
dbus-org.freedesktop.NetworkManager.DnsManager.xml \
dbus-org.freedesktop.NetworkManager.IP4Config.xml \
dbus-org.freedesktop.NetworkManager.IP6Config.xml \
dbus-org.freedesktop.NetworkManager.PPP.xml \
dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
dbus-org.freedesktop.NetworkManager.Settings.xml \
dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
dbus-org.freedesktop.NetworkManager.xml \
$(top_builddir)/src/libnm-core-public/nm-dbus-types.xml \
$(top_builddir)/src/libnm-core-public/nm-vpn-dbus-types.xml \
$(top_builddir)/man/nmcli.xml \
$(top_builddir)/man/nmtui.xml \
$(top_builddir)/man/nm-online.xml \
$(top_builddir)/man/nm-initrd-generator.xml \
$(top_builddir)/man/NetworkManager.xml \
$(top_builddir)/man/NetworkManager-dispatcher.xml \
$(top_builddir)/man/NetworkManager.conf.xml \
$(top_builddir)/man/NetworkManager-wait-online.service.xml \
$(top_builddir)/man/nmcli-examples.xml \
$(top_builddir)/man/nm-settings-dbus.xml \
$(top_builddir)/man/nm-settings-keyfile.xml \
$(top_builddir)/man/nm-settings-nmcli.xml \
version.xml \
$(NULL)
if WITH_OPENVSWITCH
content_files += $(top_builddir)/man/nm-openvswitch.xml
endif
if BUILD_NM_CLOUD_SETUP
content_files += $(top_builddir)/man/nm-cloud-setup.xml
endif
if CONFIG_PLUGIN_IFCFG_RH
content_files += $(top_builddir)/man/nm-settings-ifcfg-rh.xml
endif
include $(top_srcdir)/gtk-doc.make
# workaround setup-build.stamp from gtk-doc.make, which copies
# the file as read-only. That breaks later build steps, as the
# file can no longer be written. Instead, copy the file with `cp -f`
# only.
setup-build.stamp:
-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
if test "x$$files" != "x" ; then \
for file in $$files ; do \
destdir=`dirname $(abs_builddir)/$$file`; \
test -d "$$destdir" || mkdir -p "$$destdir"; \
test -f $(abs_srcdir)/$$file && \
( cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file ; \
chmod u+w $(abs_builddir)/$$file ) || true; \
done; \
fi; \
fi
$(AM_V_at)touch setup-build.stamp
settings-spec.xml: settings-spec.xsl $(top_builddir)/man/nm-settings-docs-dbus.xml
$(AM_V_GEN) (! test -f $@ || chmod u+w $@) && xsltproc --output $@ $^
EXTRA_DIST += \
version.xml.in \
settings-spec.xsl \
meson.build \
$(GENERATED_FILES) \
$(NULL)
CLEANFILES += \
html/* \
tmpl/* \
xml/* \
NetworkManager-overrides.txt \
NetworkManager-sections.txt \
NetworkManager.actions \
settings-spec.xml \
$(NULL)

View File

@@ -1,8 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
if enable_introspection if enable_introspection
xsltproc = find_program('xsltproc')
settings = 'settings-spec' settings = 'settings-spec'
output = settings + '.xml' output = settings + '.xml'

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml"> <!ENTITY version SYSTEM "version.xml">
]> ]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> <book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
@@ -186,7 +186,6 @@
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Hsr.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.Hsr.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Ipvlan.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Loopback.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.Loopback.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Macsec.xml"/> <xi:include href="dbus-org.freedesktop.NetworkManager.Device.Macsec.xml"/>

View File

@@ -4,8 +4,8 @@
<xsl:output <xsl:output
method="xml" method="xml"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
/> />
<xsl:template match="nm-setting-docs"> <xsl:template match="nm-setting-docs">

View File

@@ -160,7 +160,7 @@ The diagram shows other objects on the right side:
- *SleepMonitor*: gets notifications for sleep and wake events by - *SleepMonitor*: gets notifications for sleep and wake events by
registering to the available subsystem provided by the distro such registering to the available subsystem provided by the distro such
as systemd-logind or ConsoleKit. as systemd-logind, upower or ConsoleKit.
- *SessionMonitor*: tracks which users have an active session by - *SessionMonitor*: tracks which users have an active session by
using systemd-logind, elogind or ConsoleKit. using systemd-logind, elogind or ConsoleKit.

View File

@@ -304,8 +304,8 @@ Note that the unmanaged flags are tracked via two variables
practice a tri-state variable with possible values TRUE (unmanaged), practice a tri-state variable with possible values TRUE (unmanaged),
FALSE (managed) and UNSET. FALSE (managed) and UNSET.
External devices and managed-type External devices and sys-iface-state
--------------------------------- ------------------------------------
Even if a device is managed, that doesn't mean that NetworkManager is Even if a device is managed, that doesn't mean that NetworkManager is
actively configuring it. When a device is created externally (for actively configuring it. When a device is created externally (for
@@ -314,9 +314,9 @@ creates a in-memory connection representing the configuration
parameters on the interface such as IP addresses, routes, DNS, etc.; parameters on the interface such as IP addresses, routes, DNS, etc.;
the connection appears as active but NetworkManager doesn't actually the connection appears as active but NetworkManager doesn't actually
touch the interface. The external status is tracked in the touch the interface. The external status is tracked in the
`managed-type` member, which can have the following values: `sys-iface-state` member, which can have the following values:
- EXTERNAL: the interface is not touched by NM. - EXTERNAL: the interface is not touched by NM.
- ASSUME: this value is deprecated; it used to mean that NM should manage the device without fully reconfiguring it. Now, the interface is either managed on external. - ASSUME: this value is deprecated; it used to mean that NM should manage the device without fully reconfiguring it. Now, the interface is either managed on external.
- FULL: the interface is fully managed. - MANAGED: the interface is fully managed.
- REMOVED: the link was removed externally. - REMOVED: the link was removed externally.

View File

@@ -1,252 +0,0 @@
<mxfile host="app.diagrams.net" modified="2024-06-28T11:22:13.361Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" etag="l2Af_3rD5dQLdPzdT-Eh" version="24.4.13" type="device">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1060" dy="533" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="120" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-4" value="Yes" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry y="20" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="220" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-5" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-7" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="270" y="210" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-8" value="No" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" edge="1">
<mxGeometry x="0.3333" y="20" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="220" y="430" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-9" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-12" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="270" y="330" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-0" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<mxPoint x="440" y="120" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-0" value="&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;font-size: 12px;&quot;&gt;Static hostname&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;font-size: 12px;&quot;&gt;set?&lt;/font&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="110" y="187" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-4" target="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-4" value="Build a sorted list of devices eligible for hostname evaluation" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="78.75" y="252" width="182.5" height="38" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-5" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-0" target="SsSxIaJ2XBONRL21woKM-4">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="390" y="360" as="sourcePoint" />
<mxPoint x="440" y="310" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-36" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-8" target="SsSxIaJ2XBONRL21woKM-34">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-8" value="For each device in the list" style="swimlane;whiteSpace=wrap;html=1;strokeWidth=2;strokeColor=#7EA6E0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="77.5" y="308" width="185" height="250" as="geometry">
<mxRectangle x="85" y="320" width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-12" target="SsSxIaJ2XBONRL21woKM-23">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-12" value="&lt;div&gt;Got a hostname&lt;/div&gt;&lt;div&gt;from DHCP?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-15" value="&lt;div&gt;Got a hostname&lt;/div&gt;&lt;div&gt;from DNS?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="180" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-19" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="91.57999999999998" y="30" as="sourcePoint" />
<mxPoint x="91.57999999999998" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-21" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="92.58" y="220" as="sourcePoint" />
<mxPoint x="62.5" y="227" as="targetPoint" />
<Array as="points">
<mxPoint x="92.5" y="240" />
<mxPoint x="62.5" y="240" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-23" target="SsSxIaJ2XBONRL21woKM-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-23" value="Resolve via DNS" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="115" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-29" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="141.5" y="48" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-28" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="140.5" y="179" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-32" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="85.5" y="214" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-31" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="86.5" y="84" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-89" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-15">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="152.5" y="202" as="sourcePoint" />
<mxPoint x="197.5" y="200" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-13" target="SsSxIaJ2XBONRL21woKM-42">
<mxGeometry relative="1" as="geometry">
<mxPoint x="355" y="500" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-13" value="Use it" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="320" y="437" width="70" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-12" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="275" y="378" />
<mxPoint x="275" y="455" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-26" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="60" y="200" as="sourcePoint" />
<mxPoint x="109.99999999999999" y="206.58" as="targetPoint" />
<Array as="points">
<mxPoint x="60" y="207" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-27" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="219" y="184" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-30" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="164" y="222" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-34" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="275" y="594" />
<mxPoint x="275" y="455" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-34" value="Hostname set externally?" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="110" y="574" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-40" value="Start" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="33" y="175" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-42" value="End" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="335" y="621" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-43" value="Resolve via DNS" style="swimlane;whiteSpace=wrap;html=1;strokeWidth=2;strokeColor=#7EA6E0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="414" y="230" width="360" height="355" as="geometry">
<mxRectangle x="85" y="320" width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-60" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-45" target="SsSxIaJ2XBONRL21woKM-57">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-65" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-45" target="SsSxIaJ2XBONRL21woKM-59">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-45" value="&lt;div&gt;systemd-resolved&lt;/div&gt;&lt;div&gt;available?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="20" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-47" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="79.57999999999998" y="30" as="sourcePoint" />
<mxPoint x="79.57999999999998" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-61" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-57" target="SsSxIaJ2XBONRL21woKM-58">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-57" value="Resolve via systemd-resolved" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="234" y="52.5" width="100" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-63" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-58" target="SsSxIaJ2XBONRL21woKM-62">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-66" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-58" target="SsSxIaJ2XBONRL21woKM-59">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-58" value="&lt;div&gt;systemd-resolved&lt;/div&gt;&lt;div&gt;replied?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="224" y="129.5" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-59" value="&lt;div&gt;spawn helper (dns, files)&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="30" y="129" width="100" height="41" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-75" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-62" target="SsSxIaJ2XBONRL21woKM-70">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-62" value="returned a result?" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="224" y="210" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-67" value="return the result" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="20" y="310" width="330" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-68" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.801;entryY=0.01;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-62" target="SsSxIaJ2XBONRL21woKM-67">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-70" value="&lt;div&gt;spawn helper (files)&lt;br&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="90" y="210" width="100" height="41" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-72" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.104;entryY=0.01;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-59" target="SsSxIaJ2XBONRL21woKM-67">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-74" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-70">
<mxGeometry relative="1" as="geometry">
<mxPoint x="140" y="310" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-76" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="488" y="316" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-77" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="544" y="277" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-78" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="615" y="357" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-81" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="691" y="395" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-82" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="692" y="476" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-83" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="617" y="438" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-85" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="219" y="571" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-87" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="164" y="608" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-88" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.007;entryY=0.452;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-34" target="SsSxIaJ2XBONRL21woKM-42">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@@ -1,40 +0,0 @@
Hostname management
===================
NetworkManager can update the system hostname via different
mechanisms. The following diagram describes the workflow:
![Hostname management workflow](hostname.png "Hostname management")
A few notes on the diagram:
- if there is a static hostname set in `/etc/hostname`, no action is
taken. NetworkManager only manages the transient hostname. See the
systemd-hostnamed
[documentation](https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.hostname1.html#Semantics)
about the distinction between static and transient hostname.
- When there is no static hostname set, NetworkManager builds a
sorted list of active devices that are eligible for the hostname
evaluation. When doing so, the `hostname` setting of the connection
active on each device is taken into account. Properties `from-dhcp`
and `from-dns-lookup` determine if the two methods must be used for
the device; property `only-from-default` determines whether devices
without a default route should be considered, and `priority` is
used to sort the entries. In case of a tie of the priority, a
device with the default route comes first.
- When evaluating a given device, first NM checks if the device
received an hostname via DHCP and then if the first IPv4 and IPv6
addresses configured on the interface can be resolved to a name via
DNS. The mechanism used to perform the reverse DNS lookup of a
specific address is described in the diagram on the right.
- In the "spawn helper" step, NM starts a separate process that
performs the reverse DNS lookup using the NSS services specified
(see `man nsswitch.conf`). Service `dns` does the lookup via a DNS
query, while `files` returns results from `/etc/hosts`.
- In case there is no valid result from DHCP or DNS, from any device,
if there a valid transient hostname set outside of NetworkManager,
that hostname is honored.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

117
docs/libnm/Makefile.am Normal file
View File

@@ -0,0 +1,117 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6
check_local =
# The name of the module
DOC_MODULE=libnm
# The top-level SGML file.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting functions and macros.
DOC_SOURCE_DIR= \
$(top_builddir)/src/libnm-core-public \
$(top_srcdir)/src/libnm-core-public \
$(top_builddir)/src/libnm-core-impl \
$(top_srcdir)/src/libnm-core-impl \
$(top_srcdir)/src/libnm-client-public \
$(top_builddir)/src/libnm-client-public \
$(top_srcdir)/src/libnm-client-impl \
$(top_builddir)/src/libnm-client-impl \
$(NULL)
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections --ignore-decorators='NM_AVAILABLE_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+_FOR\(\)'
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-fixref.
FIXXREF_OPTIONS=
# Used for dependencies.
HFILE_GLOB=$(top_srcdir)/src/libnm-core-public/*.h $(top_srcdir)/src/libnm-client-public/*.h
CFILE_GLOB=$(top_srcdir)/src/libnm-core-impl/*.c $(top_srcdir)/src/libnm-client-impl/*.c
# Header files to ignore when scanning.
IGNORE_HFILES= \
nm-dbus-helpers.h \
nm-default-libnm.h \
nm-device-private.h \
nm-dhcp4-config.h \
nm-dhcp6-config.h \
nm-dns-manager.h \
nm-ip4-config.h \
nm-ip6-config.h \
nm-libnm-utils.h \
nm-object-private.h \
nm-remote-connection-private.h \
\
nm-connection-private.h \
nm-default-libnm-core.h \
nm-setting-private.h \
nm-team-utils.h \
nm-utils-private.h \
\
nm-core-tests-enum-types.h \
test-general-enums.h \
\
$(NULL)
# Images to copy into HTML directory.
HTML_IMAGES = libnm.png
# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
content_files = version.xml
# Other files to distribute.
extra_files = libnm.png
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
GTKDOC_CFLAGS = \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-client-public \
-I$(top_builddir)/src/libnm-client-public \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(SANITIZER_EXEC_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/src/libnm-client-impl/libnm.la \
$(GLIB_LIBS) \
$(SANITIZER_EXEC_LDFLAGS)
# include common portion ...
include $(top_srcdir)/gtk-doc.make
EXTRA_DIST += \
version.xml.in \
meson.build \
$(NULL)
CLEANFILES += \
html/* \
tmpl/* \
xml/* \
libnm-overrides.txt \
libnm-sections.txt \
libnm.actions \
$(NULL)
if GTK_DOC_BUILD_HTML
check-local-gtk-doc-patch:
@if grep -q -F '<a href="libnm-nm-setting-user.html">nm-setting-user</a>' "$(top_builddir)/docs/libnm/html/index.html"; then \
echo "WARNING: The generated documentation has issues. Patch your gtk-doc (see https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2). Let this check fail with NMTST_CHECK_GTK_DOC=1"; \
test "$$NMTST_CHECK_GTK_DOC" != 1; \
fi
check_local += check-local-gtk-doc-patch
endif
check-local: $(check_local)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml"> <!ENTITY version SYSTEM "version.xml">
]> ]>
@@ -325,7 +325,6 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-setting-ip-tunnel.xml"/> <xi:include href="xml/nm-setting-ip-tunnel.xml"/>
<xi:include href="xml/nm-setting-ip4-config.xml"/> <xi:include href="xml/nm-setting-ip4-config.xml"/>
<xi:include href="xml/nm-setting-ip6-config.xml"/> <xi:include href="xml/nm-setting-ip6-config.xml"/>
<xi:include href="xml/nm-setting-ipvlan.xml"/>
<xi:include href="xml/nm-setting-link.xml"/> <xi:include href="xml/nm-setting-link.xml"/>
<xi:include href="xml/nm-setting-loopback.xml"/> <xi:include href="xml/nm-setting-loopback.xml"/>
<xi:include href="xml/nm-setting-macsec.xml"/> <xi:include href="xml/nm-setting-macsec.xml"/>
@@ -341,7 +340,6 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-setting-ovs-port.xml"/> <xi:include href="xml/nm-setting-ovs-port.xml"/>
<xi:include href="xml/nm-setting-ppp.xml"/> <xi:include href="xml/nm-setting-ppp.xml"/>
<xi:include href="xml/nm-setting-pppoe.xml"/> <xi:include href="xml/nm-setting-pppoe.xml"/>
<xi:include href="xml/nm-setting-prefix-delegation.xml"/>
<xi:include href="xml/nm-setting-proxy.xml"/> <xi:include href="xml/nm-setting-proxy.xml"/>
<xi:include href="xml/nm-setting-serial.xml"/> <xi:include href="xml/nm-setting-serial.xml"/>
<xi:include href="xml/nm-setting-sriov.xml"/> <xi:include href="xml/nm-setting-sriov.xml"/>
@@ -380,7 +378,6 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-device-hsr.xml"/> <xi:include href="xml/nm-device-hsr.xml"/>
<xi:include href="xml/nm-device-infiniband.xml"/> <xi:include href="xml/nm-device-infiniband.xml"/>
<xi:include href="xml/nm-device-ip-tunnel.xml"/> <xi:include href="xml/nm-device-ip-tunnel.xml"/>
<xi:include href="xml/nm-device-ipvlan.xml"/>
<xi:include href="xml/nm-device-loopback.xml"/> <xi:include href="xml/nm-device-loopback.xml"/>
<xi:include href="xml/nm-device-macsec.xml"/> <xi:include href="xml/nm-device-macsec.xml"/>
<xi:include href="xml/nm-device-macvlan.xml"/> <xi:include href="xml/nm-device-macvlan.xml"/>

View File

@@ -107,7 +107,7 @@ connection_add(NMConnection *conn)
nm_connection_get_id(conn), nm_connection_get_id(conn),
nm_connection_get_uuid(conn)); nm_connection_get_uuid(conn));
rdata = (RequestData) { rdata = (RequestData){
.loop = g_main_loop_new(NULL, FALSE), .loop = g_main_loop_new(NULL, FALSE),
.rconn = NULL, .rconn = NULL,
.error = NULL, .error = NULL,

View File

@@ -8,7 +8,7 @@ examples = [
moc = find_program('moc-qt4', required: false) moc = find_program('moc-qt4', required: false)
if not moc.found() if not moc.found()
moc = qt_core_dep.get_variable(pkgconfig: 'moc_location') moc = qt_core_dep.get_pkgconfig_variable('moc_location')
endif endif
example = 'monitor-nm-running' example = 'monitor-nm-running'

View File

@@ -45,11 +45,9 @@ def show(c, ts=None):
" timeout: %u seconds%s" " timeout: %u seconds%s"
% ( % (
rt, rt,
( ""
"" if ts is None
if ts is None else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0)),
else (" (circa %s sec left)" % ((cr + (rt * 1000) - ts) / 1000.0))
),
) )
) )
print( print(

View File

@@ -35,7 +35,7 @@ def show_addresses(dev, family):
addr = nm_address.get_address() addr = nm_address.get_address()
prefix = nm_address.get_prefix() prefix = nm_address.get_prefix()
print("%s/%d" % (addr, prefix)) print("%s/%d") % (addr, prefix)
def show_gateway(dev, family): def show_gateway(dev, family):
@@ -75,7 +75,7 @@ def show_routes(dev, family):
next_hop = nm_route.get_next_hop() next_hop = nm_route.get_next_hop()
metric = nm_route.get_metric() metric = nm_route.get_metric()
print("%s/%d %s %d" % (dest, prefix, next_hop, metric)) print("%s/%d %s %d") % (dest, prefix, next_hop, metric)
def show_dns(dev, family): def show_dns(dev, family):
@@ -88,11 +88,11 @@ def show_dns(dev, family):
print("None") print("None")
return return
print("Nameservers: %s" % ip_cfg.get_nameservers()) print("Nameservers: %s") % (ip_cfg.get_nameservers())
print("Domains: %s" % ip_cfg.get_domains()) print("Domains: %s") % (ip_cfg.get_domains())
print("Searches: %s" % ip_cfg.get_searches()) print("Searches: %s") % (ip_cfg.get_searches())
if family == socket.AF_INET: if family == socket.AF_INET:
print("WINS: %s" % ip_cfg.get_wins_servers()) print("WINS: %s") % (ip_cfg.get_wins_servers())
if __name__ == "__main__": if __name__ == "__main__":
@@ -110,39 +110,39 @@ if __name__ == "__main__":
print("IPv4 addresses:") print("IPv4 addresses:")
print("---------------") print("---------------")
show_addresses(dev, socket.AF_INET) show_addresses(dev, socket.AF_INET)
print() print
print("IPv4 gateway:") print("IPv4 gateway:")
print("-------------") print("-------------")
show_gateway(dev, socket.AF_INET) show_gateway(dev, socket.AF_INET)
print() print
print("IPv4 routes:") print("IPv4 routes:")
print("------------") print("------------")
show_routes(dev, socket.AF_INET) show_routes(dev, socket.AF_INET)
print() print
print("IPv6 addresses:") print("IPv6 addresses:")
print("---------------") print("---------------")
show_addresses(dev, socket.AF_INET6) show_addresses(dev, socket.AF_INET6)
print() print
print("IPv6 gateway:") print("IPv6 gateway:")
print("-------------") print("-------------")
show_gateway(dev, socket.AF_INET6) show_gateway(dev, socket.AF_INET6)
print() print
print("IPv6 routes:") print("IPv6 routes:")
print("------------") print("------------")
show_routes(dev, socket.AF_INET6) show_routes(dev, socket.AF_INET6)
print() print
print("IPv4 DNS:") print("IPv4 DNS:")
print("------------") print("------------")
show_dns(dev, socket.AF_INET) show_dns(dev, socket.AF_INET)
print() print
print("IPv6 DNS:") print("IPv6 DNS:")
print("------------") print("------------")
show_dns(dev, socket.AF_INET6) show_dns(dev, socket.AF_INET6)
print() print

View File

@@ -14,7 +14,7 @@
# API (like NM.Client.new()) is for simple programs but usually not best # API (like NM.Client.new()) is for simple programs but usually not best
# for using NMClient for real applications. # for using NMClient for real applications.
# #
# To learn more about GMainContext, read https://developer.gnome.org/documentation/tutorials/main-contexts.html # To learn more about GMainContext, read https://developer.gnome.org/SearchProvider/documentation/tutorials/main-contexts.html
# When I say "mainloop" or "event loop", I mean GMainContext. GMainLoop is # When I say "mainloop" or "event loop", I mean GMainContext. GMainLoop is
# a small wrapper around GMainContext to run the context with a boolean # a small wrapper around GMainContext to run the context with a boolean
# flag. # flag.
@@ -188,7 +188,7 @@ def create_nmc(dbus_connection):
# which has an overhead. # which has an overhead.
# #
# Also, split the GObject creation and the init_async() call in two. # Also, split the GObject creation and the init_async() call in two.
# That allows one to pass construct-only parameters, in particular like # That allows to pass construct-only parameters, in particular like
# the instance_flags. # the instance_flags.
# Create a separate context for the NMClient. The NMClient is strongly # Create a separate context for the NMClient. The NMClient is strongly

View File

@@ -1,92 +0,0 @@
#!/usr/bin/env python
# SPDX-License-Identifier: LGPL-2.1-or-later
import gi
gi.require_version("NM", "1.0")
from gi.repository import GLib, NM, Gio
# This example shows how to implement a very simple secret agent for
# NetworkManager. The secret agent registers to the NM daemon and can
# provide missing secrets like Wi-Fi or VPN passwords. Set environment
# variable "LIBNM_CLIENT_DEBUG=trace" to enable libnm verbose logging.
class SecretAgent(NM.SecretAgentOld):
def __init__(self):
super().__init__(identifier="MySecretAgent")
super().init()
def do_get_secrets(
self,
connection,
connection_path,
setting_name,
hints,
flags,
callback,
callback_data,
):
print(
"get_secrets for '{}', interface '{}', setting '{}'".format(
connection.get_id(), connection.get_interface_name(), setting_name
)
)
# Implement here the logic to retrieve the secrets.
# As an example, we return a hardcoded Wi-Fi PSK.
if (
connection.get_connection_type() == "802-11-wireless"
and setting_name == "802-11-wireless-security"
):
s_wifi = connection.get_setting_wireless()
ssid = NM.utils_ssid_to_utf8(s_wifi.get_ssid().get_data())
if ssid == "home":
secrets = GLib.Variant(
"a{sa{sv}}",
{
"802-11-wireless-security": {
"psk": GLib.Variant("s", "abcd1234")
}
},
)
print("Sending secrets {}".format(secrets))
callback(self, connection, secrets, None)
return
# We don't have the secret, NM will ask to another agent or fail
callback(
self,
connection,
None,
GLib.GError.new_literal(
NM.SecretAgentError.quark(),
"No secrets found",
NM.SecretAgentError.NOSECRETS,
),
)
def do_cancel_get_secrets(self, connection_path, connection_name):
pass
def do_save_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def do_delete_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def main():
agent = SecretAgent()
loop = GLib.MainLoop()
try:
loop.run()
except KeyboardInterrupt:
print("Exiting Secret Agent...")
if __name__ == "__main__":
main()

View File

@@ -42,32 +42,33 @@ if __name__ == "__main__":
# create Client object # create Client object
client = NM.Client.new(None) client = NM.Client.new(None)
try: all_connections = client.get_connections()
conn = next(c for c in client.get_connections() if c.get_uuid() == uuid) for c in all_connections:
except StopIteration: if c.get_uuid() != uuid:
sys.exit("not found connection with uuid=%s" % uuid) continue
# add IPv4 setting if it doesn't yet exist # add IPv4 setting if it doesn't yet exist
s_ip4 = conn.get_setting_ip4_config() s_ip4 = c.get_setting_ip4_config()
if not s_ip4: if not s_ip4:
s_ip4 = NM.SettingIP4Config.new() s_ip4 = NM.SettingIP4Config.new()
conn.add_setting(s_ip4) c.add_setting(s_ip4)
# set the method and change properties # set the method and change properties
s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, method) s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, method)
if method == "auto": if method == "auto":
# remove addresses and gateway # remove addresses and gateway
s_ip4.clear_addresses() s_ip4.clear_addresses()
s_ip4.props.gateway = None s_ip4.props.gateway = None
elif method == "manual": elif method == "manual":
# Add the static IP address, prefix, and (optional) gateway # Add the static IP address, prefix, and (optional) gateway
addr = NM.IPAddress.new(socket.AF_INET, sys.argv[3], int(sys.argv[4])) addr = NM.IPAddress.new(socket.AF_INET, sys.argv[3], int(sys.argv[4]))
s_ip4.add_address(addr) s_ip4.add_address(addr)
if len(sys.argv) == 6: if len(sys.argv) == 6:
s_ip4.props.gateway = sys.argv[5] s_ip4.props.gateway = sys.argv[5]
try: try:
conn.commit_changes(True, None) c.commit_changes(True, None)
print("The connection profile has been updated.") print("The connection profile has been updated.")
except Exception as e: except Exception as e:
sys.stderr.write("Error: %s\n" % e) sys.stderr.write("Error: %s\n" % e)
break

View File

@@ -18,7 +18,6 @@ ifaces = [
'org.freedesktop.NetworkManager.Device.Hsr', 'org.freedesktop.NetworkManager.Device.Hsr',
'org.freedesktop.NetworkManager.Device.IPTunnel', 'org.freedesktop.NetworkManager.Device.IPTunnel',
'org.freedesktop.NetworkManager.Device.Infiniband', 'org.freedesktop.NetworkManager.Device.Infiniband',
'org.freedesktop.NetworkManager.Device.Ipvlan',
'org.freedesktop.NetworkManager.Device.Loopback', 'org.freedesktop.NetworkManager.Device.Loopback',
'org.freedesktop.NetworkManager.Device.Lowpan', 'org.freedesktop.NetworkManager.Device.Lowpan',
'org.freedesktop.NetworkManager.Device.Macsec', 'org.freedesktop.NetworkManager.Device.Macsec',
@@ -81,8 +80,14 @@ foreach iface: ifaces
endif endif
content_files += dbus_iface_xml_path content_files += dbus_iface_xml_path
introspection_files += [ [res[2], dbus_iface_xml_path] ]
headers += res[1] # res is an array only since 0.46. Documentation won't work with
# older versions
if meson.version().version_compare('>= 0.46.0')
introspection_files += [ [res[2], dbus_iface_xml_path] ]
headers += res[1]
endif
endforeach endforeach
install_data( install_data(

View File

@@ -9,7 +9,7 @@
<!-- <!--
Port1: Port1:
@since: 1.46 @since: 1.46
The device's port1 device. The device's port1 device.
--> -->
@@ -17,7 +17,7 @@
<!-- <!--
Port2: Port2:
@since: 1.46 @since: 1.46
The device's port2 device. The device's port2 device.
--> -->
@@ -25,7 +25,7 @@
<!-- <!--
SupervisionAddress: SupervisionAddress:
@since: 1.46 @since: 1.46
The supervision MAC address. The supervision MAC address.
--> -->
@@ -33,7 +33,7 @@
<!-- <!--
MulticastSpec: MulticastSpec:
@since: 1.46 @since: 1.46
The last byte of the supervision address. The last byte of the supervision address.
--> -->
@@ -41,7 +41,7 @@
<!-- <!--
Prp: Prp:
@since: 1.46 @since: 1.46
Whether the PRP protocol is used or not. Whether the PRP protocol is used or not.
--> -->

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<node name="/">
<!--
org.freedesktop.NetworkManager.Device.Ipvlan:
@short_description: IPVLAN Device.
-->
<interface name="org.freedesktop.NetworkManager.Device.Ipvlan">
<!--
Parent:
@since: 1.52
The object path of the parent device.
-->
<property name="Parent" type="o" access="read"/>
<!--
Vepa:
@since: 1.52
The IPVLAN VEPA flag.
-->
<property name="Vepa" type="b" access="read"/>
<!--
Mode:
@since: 1.52
The IPVLAN mode, one of "l2", "l3", "l3s".
-->
<property name="Mode" type="s" access="read"/>
<!--
Private:
@since: 1.52
The IPVLAN private flag.
-->
<property name="Private" type="b" access="read"/>
</interface>
</node>

View File

@@ -321,7 +321,7 @@
<!-- <!--
Reapply: Reapply:
@connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarily differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses. @connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarily differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows one to catch concurrent modifications between the GetAppliedConnection call and Reapply. @version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
@flags: Flags which would modify the behavior of the Reapply call. Invalid flags are rejected. @flags: Flags which would modify the behavior of the Reapply call. Invalid flags are rejected.
Attempts to update the configuration of a device without deactivating it. Attempts to update the configuration of a device without deactivating it.
@@ -337,7 +337,7 @@
settings-connection, or call Reapply. The Reapply call allows you to settings-connection, or call Reapply. The Reapply call allows you to
directly update the applied-connection and reconfigure the device. Reapply directly update the applied-connection and reconfigure the device. Reapply
can also be useful if the currently applied-connection is equal to the can also be useful if the currently applied-connection is equal to the
connection that is about to be reapplied. This allows one to reconfigure the connection that is about to be reapplied. This allows to reconfigure the
device and revert external changes like removing or adding an IP address device and revert external changes like removing or adding an IP address
(which NetworkManager doesn't revert automatically because it is assumed (which NetworkManager doesn't revert automatically because it is assumed
that the user made these changes intentionally outside of NetworkManager). that the user made these changes intentionally outside of NetworkManager).

290
m4/attributes.m4 Normal file
View File

@@ -0,0 +1,290 @@
dnl Macros to check the presence of generic (non-typed) symbols.
dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
dnl Copyright (c) 2006-2008 xine project
dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program.
dnl
dnl As a special exception, the copyright owners of the
dnl macro gives unlimited permission to copy, distribute and modify the
dnl configure scripts that are the output of Autoconf when processing the
dnl Macro. You need not follow the terms of the GNU General Public
dnl License when using or distributing such scripts, even though portions
dnl of the text of the Macro appear in them. The GNU General Public
dnl License (GPL) does govern all other use of the material that
dnl constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the
dnl Autoconf Macro released by this project. When you make and
dnl distribute a modified version of the Autoconf Macro, you may extend
dnl this special exception to the GPL to apply to your modified version as
dnl well.
dnl Check if FLAG in ENV-VAR is supported by compiler and append it
dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to
dnl -W* as gcc cannot test for negated warnings. If a C snippet is passed,
dnl use it, otherwise use a simple main() definition that just returns 0.
dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG], [C-SNIPPET])
AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
[int main(void) { return 0; } ],
[$4]))],
[eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
[eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
eval "AS_TR_SH([$2])='$cc_save_$2'"])
AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
[eval "$1='${$1} $3'"])
])
dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2], [C-SNIPPET])
AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
for flag in [$3]; do
CC_CHECK_FLAG_APPEND([$1], [$2], $flag, [$4])
done
])
dnl Check if the flag is supported by linker (cacheable)
dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
AC_DEFUN([CC_CHECK_LDFLAGS], [
AC_CACHE_CHECK([if $CC supports $1 flag],
AS_TR_SH([cc_cv_ldflags_$1]),
[ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $1"
AC_LINK_IFELSE([int main() { return 1; }],
[eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_ldflags_$1])="])
LDFLAGS="$ac_save_LDFLAGS"
])
AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
[$2], [$3])
])
dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
dnl the current linker to avoid undefined references in a shared object.
AC_DEFUN([CC_NOUNDEFINED], [
dnl We check $host for which systems to enable this for.
AC_REQUIRE([AC_CANONICAL_HOST])
case $host in
dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
dnl are requested, as different implementations are present; to avoid problems
dnl use -Wl,-z,defs only for those platform not behaving this way.
*-freebsd* | *-openbsd*) ;;
*)
dnl First of all check for the --no-undefined variant of GNU ld. This allows
dnl for a much more readable command line, so that people can understand what
dnl it does without going to look for what the heck -z defs does.
for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
break
done
;;
esac
AC_SUBST([LDFLAGS_NOUNDEFINED])
])
dnl Check for a -Werror flag or equivalent. -Werror is the GCC
dnl and ICC flag that tells the compiler to treat all the warnings
dnl as fatal. We usually need this option to make sure that some
dnl constructs (like attributes) are not simply ignored.
dnl
dnl Other compilers don't support -Werror per se, but they support
dnl an equivalent flag:
dnl - Sun Studio compiler supports -errwarn=%all
AC_DEFUN([CC_CHECK_WERROR], [
AC_CACHE_CHECK(
[for $CC way to treat warnings as errors],
[cc_cv_werror],
[CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
[CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
])
])
AC_DEFUN([CC_CHECK_ATTRIBUTE], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
AS_TR_SH([cc_cv_attribute_$1]),
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
[eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
CFLAGS="$ac_save_CFLAGS"
])
AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes],
[AC_DEFINE(
AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1,
[Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]
)
$4],
[$5])
])
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
CC_CHECK_ATTRIBUTE(
[constructor],,
[void __attribute__((constructor)) ctor() { int a; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
CC_CHECK_ATTRIBUTE(
[format], [format(printf, n, n)],
[void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [
CC_CHECK_ATTRIBUTE(
[format_arg], [format_arg(printf)],
[char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
CC_CHECK_ATTRIBUTE(
[visibility_$1], [visibility("$1")],
[void __attribute__((visibility("$1"))) $1_function() { }],
[$2], [$3])
])
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
CC_CHECK_ATTRIBUTE(
[nonnull], [nonnull()],
[void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
CC_CHECK_ATTRIBUTE(
[unused], ,
[void some_function(void *foo, __attribute__((unused)) void *bar);],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
CC_CHECK_ATTRIBUTE(
[sentinel], ,
[void some_function(void *foo, ...) __attribute__((sentinel));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
CC_CHECK_ATTRIBUTE(
[deprecated], ,
[void some_function(void *foo, ...) __attribute__((deprecated));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIAS], [
CC_CHECK_ATTRIBUTE(
[alias], [weak, alias],
[void other_function(void *foo) { }
void some_function(void *foo) __attribute__((weak, alias("other_function")));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_MALLOC], [
CC_CHECK_ATTRIBUTE(
[malloc], ,
[void * __attribute__((malloc)) my_alloc(int n);],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_PACKED], [
CC_CHECK_ATTRIBUTE(
[packed], ,
[struct astructure { char a; int b; long c; void *d; } __attribute__((packed));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_CONST], [
CC_CHECK_ATTRIBUTE(
[const], ,
[int __attribute__((const)) twopow(int n) { return 1 << n; } ],
[$1], [$2])
])
AC_DEFUN([CC_FLAG_VISIBILITY], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
[cc_cv_flag_visibility],
[cc_flag_visibility_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
cc_cv_flag_visibility='yes',
cc_cv_flag_visibility='no')
CFLAGS="$cc_flag_visibility_save_CFLAGS"])
AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
[AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
[Define this if the compiler supports the -fvisibility flag])
$1],
[$2])
])
AC_DEFUN([CC_FUNC_EXPECT], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if compiler has __builtin_expect function],
[cc_cv_func_expect],
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[int some_function() {
int a = 3;
return (int)__builtin_expect(a, 3);
}])],
[cc_cv_func_expect=yes],
[cc_cv_func_expect=no])
CFLAGS="$ac_save_CFLAGS"
])
AS_IF([test "x$cc_cv_func_expect" = "xyes"],
[AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1,
[Define this if the compiler supports __builtin_expect() function])
$1],
[$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported],
[cc_cv_attribute_aligned],
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
for cc_attribute_align_try in 64 32 16 8 4 2; do
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
int main() {
static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0;
return c;
}])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
done
CFLAGS="$ac_save_CFLAGS"
])
if test "x$cc_cv_attribute_aligned" != "x"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned],
[Define the highest alignment supported])
fi
])

158
m4/ax_lib_readline.m4 Normal file
View File

@@ -0,0 +1,158 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_LIB_READLINE
#
# DESCRIPTION
#
# Searches for a readline compatible library. If found, defines
# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
# necessary include files and sets `HAVE_READLINE_H' or
# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
# 'HAVE_HISTORY_H' if the corresponding include files exists.
#
# The libraries that may be readline compatible are `libedit',
# `libeditline' and `libreadline'. Sometimes we need to link a termcap
# library for readline to work, this macro tests these cases too by trying
# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
#
# Here is an example of how to use the information provided by this macro
# to perform the necessary includes or declarations in a C file:
#
# #ifdef HAVE_LIBREADLINE
# # if defined(HAVE_READLINE_READLINE_H)
# # include <readline/readline.h>
# # elif defined(HAVE_READLINE_H)
# # include <readline.h>
# # else /* !defined(HAVE_READLINE_H) */
# extern char *readline ();
# # endif /* !defined(HAVE_READLINE_H) */
# char *cmdline = NULL;
# #else /* !defined(HAVE_READLINE_READLINE_H) */
# /* no readline */
# #endif /* HAVE_LIBREADLINE */
#
# #ifdef HAVE_READLINE_HISTORY
# # if defined(HAVE_READLINE_HISTORY_H)
# # include <readline/history.h>
# # elif defined(HAVE_HISTORY_H)
# # include <history.h>
# # else /* !defined(HAVE_HISTORY_H) */
# extern void add_history ();
# extern int write_history ();
# extern int read_history ();
# # endif /* defined(HAVE_READLINE_HISTORY_H) */
# /* no history */
# #endif /* HAVE_READLINE_HISTORY */
#
# LICENSE
#
# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
AC_DEFUN([AX_LIB_READLINE], [
AC_ARG_WITH(readline,
AS_HELP_STRING([--with-readline=auto|libreadline|libedit|none], [Using libreadline (auto) or libedit]),
[],
[with_readline=auto])
if test "$with_readline" != "none"; then
AC_CACHE_CHECK([for a readline compatible library],
ax_cv_lib_readline, [
ORIG_LIBS="$LIBS"
if test "$with_readline" = "libreadline"; then
search_readlines="readline"
elif test "$with_readline" = "libedit"; then
search_readlines="edit"
elif test "$with_readline" = "auto"; then
search_readlines="readline edit"
else
AC_MSG_ERROR([invalid --with-readline option. Valid options are --with-readline=auto|libreadline|libedit|none])
fi
for readline_lib in $search_readlines; do
# prefer ncurses since we use it for nmtui too
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib"
else
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
AC_LINK_IFELSE([AC_LANG_CALL([], [readline])], [ax_cv_lib_readline="$TRY_LIB"])
if test -n "$ax_cv_lib_readline"; then
break
fi
done
if test -n "$ax_cv_lib_readline"; then
if test "$with_readline" = auto; then
if test "$readline_lib" = readline; then
with_readline=libreadline
else
with_readline=libedit
fi
fi
break
fi
done
if test -z "$ax_cv_lib_readline"; then
if test "$with_readline" != auto; then
AC_MSG_ERROR([libreadline not found for --with-readline=$with_readline"])
fi
with_readline=none
ax_cv_lib_readline="no"
fi
LIBS="$ORIG_LIBS"
])
if test "$ax_cv_lib_readline" != "no"; then
READLINE_LIBS="$ax_cv_lib_readline"
AC_SUBST(READLINE_LIBS)
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
if test "$with_readline" = "libedit"; then
AC_DEFINE(HAVE_EDITLINE_READLINE, 1,
[Explicitly set to 1 when libedit shall be used])
else
AC_DEFINE(HAVE_EDITLINE_READLINE, 0,
[By default the libreadline is used as readline library])
fi
ORIG_LIBS="$LIBS"
LIBS="$ORIG_LIBS $ax_cv_lib_readline"
AC_CACHE_CHECK([whether readline supports history],
ax_cv_lib_readline_history, [
ax_cv_lib_readline_history="no"
AC_LINK_IFELSE([AC_LANG_CALL([], [history_set_history_state])],
[ax_cv_lib_readline_history="yes"])
])
LIBS=$ORIG_LIBS
if test "$ax_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`history_set_history_state'])
AC_CHECK_HEADERS(readline/history.h histedit.h)
else
AC_DEFINE(HAVE_READLINE_HISTORY, 0,
[Explicitly set to 0 when libreadline shall not be used])
fi
fi
fi
])dnl

522
m4/ax_pthread.m4 Normal file
View File

@@ -0,0 +1,522 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
# needed for multi-threaded programs (defaults to the value of CC
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
# special cc_r/CC_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
# CXX="$PTHREAD_CXX"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 30
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_TARGET])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items with a "," contain both
# C compiler flags (before ",") and linker flags (after ","). Other items
# starting with a "-" are C compiler flags, and remaining items are
# library names, except for "none" which indicates that we try without
# any flags at all, and "pthread-config" which is a program returning
# the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case $target_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
;;
esac
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
# Note that for GCC and Clang -pthread generally implies -lpthread,
# except when -nostdlib is passed.
# This is problematic using libtool to build C++ shared libraries with pthread:
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
# To solve this, first try -pthread together with -lpthread for GCC
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
AS_IF([test "x$ax_pthread_clang" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $target_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
*,*)
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void *some_global = NULL;
static void routine(void *a)
{
/* To avoid any unused-parameter or
unused-but-set-parameter warning. */
some_global = a;
}
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $target_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;
return i;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then
case $target_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
],
[
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
]
)
])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CXX])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

227
m4/compiler_options.m4 Normal file
View File

@@ -0,0 +1,227 @@
AC_DEFUN([_NM_COMPILER_FLAG], [
CFLAGS_SAVED="$CFLAGS"
CFLAGS="$CFLAGS $GLIB_CFLAGS -Werror $1"
AC_MSG_CHECKING([whether $1 works as expected])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]])], [
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS_SAVED"
$3
],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS_SAVED"
$4
])
],[
AC_MSG_RESULT(not supported)
CFLAGS="$CFLAGS_SAVED"
])
])
dnl Check whether a particular compiler flag is supported,
dnl append it to the specified variable if the check succeeds.
dnl NM_COMPILER_FLAG([ENV-VAR], [FLAG], [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
AC_DEFUN([NM_COMPILER_FLAG], [
_NM_COMPILER_FLAG([$2], [], [
eval "AS_TR_SH([$1])='$$1 $2'"
$3
], [$4])
])
dnl Check whether a particular warning is supported. If yes, the flag
dnl is appended to [ENV-VAR].
dnl NM_COMPILER_WARNING_FLAG([ENV-VAR], [WARNING])
AC_DEFUN([NM_COMPILER_WARNING_FLAG], [
dnl "-Wno-*" requires special handling, see https://gcc.gnu.org/wiki/FAQ#wnowarning.
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$2" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [], [eval "AS_TR_SH([$1])='$$1 $2'"], [])
])
dnl Check whether a particular warning is not emitted with code provided,
dnl append an option to disable the warning to a specified variable if the check fails.
dnl Note that this always either adds -W$2 or -Wno-$2, depending on whether it's supported.
dnl NM_COMPILER_WARNING([ENV-VAR], [WARNING], [C-SNIPPET])
AC_DEFUN([NM_COMPILER_WARNING], [
_NM_COMPILER_FLAG([-W$2], [$3], [eval "AS_TR_SH([$1])='$$1 -W$2'"], [eval "AS_TR_SH([$1])='$$1 -Wno-$2'"])
])
dnl NM_COMPILER_WARNINGS([ENV-VAR], [MORE-WARNINGS])
AC_DEFUN([NM_COMPILER_WARNINGS],
[AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
set_more_warnings="$enableval",set_more_warnings=$2)
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
dnl This is enabled in clang by default, makes little sense,
dnl and causes the build to abort with -Werror.
CFLAGS_SAVED="$CFLAGS"
CFLAGS="$CFLAGS -Qunused-arguments"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], eval "AS_TR_SH([$1])='$$1 -Qunused-arguments'", [])
CFLAGS="$CFLAGS_SAVED"
dnl clang only warns about unknown warnings, unless
dnl called with "-Werror=unknown-warning-option"
dnl Test if the compiler supports that, and if it does
dnl attach it to the CFLAGS.
NM_COMPILER_WARNING([$1], [unknown-warning-option], [])
CFLAGS_MORE_WARNINGS="-Wall"
if test "x$enable_lto" = xyes; then
dnl With LTO and optimizations enabled, gcc 10.2.1-1.fc32 is really
dnl adamant to warn about correct uses of strncpy. Disable "-Wstringop-overflow".
_CFLAGS_MORE_WARNINGS_DISABLE_LTO="-Wno-stringop-overflow"
dnl We want to build with "-Wmaybe-uninitialized" enabled. With LTO that
dnl can easily lead to false positives. For manual testing, disable the
dnl warning here by uncommenting the following line.
dnl _CFLAGS_MORE_WARNINGS_DISABLE_LTO="$_CFLAGS_MORE_WARNINGS_DISABLE_LTO -Wno-error=maybe-uninitialized"
else
_CFLAGS_MORE_WARNINGS_DISABLE_LTO=
fi
if test "x$set_more_warnings" = xerror; then
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
fi
for option in \
$_CFLAGS_MORE_WARNINGS_DISABLE_LTO \
-Wall \
-Wextra \
-Wcast-align=strict \
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wformat-nonliteral \
-Wformat-security \
-Wimplicit-function-declaration \
-Wimplicit-int \
-Winit-self \
-Wint-conversion \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-include-dirs \
-Wmissing-prototypes \
-Wold-style-definition \
-Wparentheses-equality \
-Wpointer-arith \
-Wshadow \
-Wshift-negative-value \
-Wstrict-prototypes \
-Wtypedef-redefinition \
-Wundef \
-Wunknown-attributes \
-Wvla \
-Wno-duplicate-decl-specifier \
-Wno-format-truncation \
-Wno-format-y2k \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-missing-field-initializers \
-Wno-pragmas \
-Wno-sign-compare \
-Wno-tautological-constant-out-of-range-compare \
-Wno-unknown-pragmas \
-Wno-unused-parameter \
; do
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$option" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [],
[CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], [])
done
unset option
dnl Disable warnings triggered by known compiler problems
dnl https://bugzilla.gnome.org/show_bug.cgi?id=745821
NM_COMPILER_WARNING([$1], [unknown-attributes], [#include <glib.h>])
dnl https://bugzilla.gnome.org/show_bug.cgi?id=744473
NM_COMPILER_WARNING([$1], [typedef-redefinition], [#include <gio/gio.h>])
dnl https://llvm.org/bugs/show_bug.cgi?id=21614
NM_COMPILER_WARNING([$1], [array-bounds],
[#include <string.h>]
[void f () { strcmp ("something", "0"); }]
)
dnl https://llvm.org/bugs/show_bug.cgi?id=22949
NM_COMPILER_WARNING([$1], [parentheses-equality],
[#include <sys/wait.h>]
[void f () { if (WIFCONTINUED(0)) return; }]
)
dnl systemd-dhcp's log_internal macro and our handle_warn are sometimes
dnl used in void context,u sometimes in int. Makes clang unhappy.
NM_COMPILER_WARNING([$1], [unused-value],
[#define yolo ({ (666 + 666); })]
[int f () { int i = yolo; yolo; return i; }]
)
dnl a new warning in gcc 8, glib 2.55 doesn't play nice yet
dnl https://bugzilla.gnome.org/show_bug.cgi?id=793272
NM_COMPILER_WARNING([$1], [cast-function-type],
[#include <glib-object.h>]
[typedef struct { GObject parent; } NMObject;]
[typedef struct { GObjectClass parent; } NMObjectClass;]
[static void nm_object_init (NMObject *object) { } ]
[static void nm_object_class_init (NMObjectClass *object) { }]
[G_DEFINE_TYPE (NMObject, nm_object, G_TYPE_OBJECT)]
)
dnl clang started supporting -Wimplicit-fallthrough, but it does not
dnl honor the code comments to suppress the warning. Disable the
dnl warning with clang.
dnl
NM_COMPILER_WARNING([$1], [implicit-fallthrough],
[int foo(int a);
int foo(int a) {
int r = 0;
switch (a) {
case 1:
r++;
/* fall-through */
case 2:
r++;
break;
}
return r;
}]
)
eval "AS_TR_SH([$1])='$CFLAGS_MORE_WARNINGS $$1'"
else
AC_MSG_RESULT(no)
fi
])
AC_DEFUN([NM_LTO],
[AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size [default=no]]))
if (test "${enable_lto}" = "yes"); then
CC_CHECK_FLAG_APPEND([lto_flags], [CFLAGS], [-flto -flto-partition=none])
if (test -n "${lto_flags}"); then
CFLAGS="-flto -flto-partition=none $CFLAGS"
else
AC_MSG_ERROR([Link Time Optimization -flto is not supported.])
fi
else
enable_lto='no'
fi
])
AC_DEFUN([NM_LD_GC],
[AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking [default=auto]]))
if (test "${enable_ld_gc}" != "no"); then
CC_CHECK_FLAG_APPEND([ld_gc_flags], [CFLAGS], [-fdata-sections -ffunction-sections -Wl,--gc-sections])
if (test -n "${ld_gc_flags}"); then
enable_ld_gc="yes"
CFLAGS="$ld_gc_flags $CFLAGS"
else
if (test "${enable_ld_gc}" = "yes"); then
AC_MSG_ERROR([Unused symbol eviction requested but not supported.])
else
enable_ld_gc="no"
fi
fi
fi
])

15
m4/git-sha-record.m4 Normal file
View File

@@ -0,0 +1,15 @@
dnl GIT_SHA_RECORD($1, $2)
dnl
dnl $1: the name of the assigned variable. For example NM_GIT_SHA,
dnl NMA_GIT_SHA, LIBNL_GIT_SHA.
dnl $2: by default, a define to config.h is added. This can be
dnl suppressed by passing "no-config-h".
dnl
AC_DEFUN([GIT_SHA_RECORD], [
m4_define([git_sha_record_v],
[m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
$1=git_sha_record_v
if test ""$2"" != "no-config-h" ; then
AC_DEFINE_UNQUOTED($1,"$$1",[git commit id of the original source code version])
fi
])

142
m4/gnome-code-coverage.m4 Normal file
View File

@@ -0,0 +1,142 @@
dnl GNOME_CODE_COVERAGE
dnl
dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
dnl (program or library) which should be built with code coverage support.
dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
dnl Makefile; and $enable_code_coverage which can be used in subsequent
dnl configure output.
dnl
dnl Note that all optimisation flags in CFLAGS must be disabled when code
dnl coverage is enabled.
dnl
dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
dnl This file is licenced under LGPLv2.1+.
dnl
dnl Usage example:
dnl configure.ac:
dnl GNOME_CODE_COVERAGE
dnl
dnl Makefile.am:
dnl @GNOME_CODE_COVERAGE_RULES@
dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
dnl
dnl This results in a “check-code-coverage” rule being added to any Makefile.am
dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
dnl configured with --enable-code-coverage). Running `make check-code-coverage`
dnl in that directory will run the modules test suite (`make check`) and build
dnl a code coverage report detailing the code which was touched, then print the
dnl URI for the report.
AC_DEFUN([GNOME_CODE_COVERAGE],[
dnl Check for --enable-code-coverage
AC_MSG_CHECKING([whether to build with code coverage support])
AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
AC_MSG_RESULT($enable_code_coverage)
AS_IF([ test "$enable_code_coverage" = "yes" ], [
dnl Check if gcc is being used
AS_IF([ test "$GCC" = "no" ], [
AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
])
AC_CHECK_PROG([LCOV], [lcov], [lcov])
AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
AS_IF([ test -z "$LCOV" ], [
AC_MSG_ERROR([lcov is needed to enable code coverage reporting])
])
AS_IF([ test -z "$GENHTML" ], [
AC_MSG_ERROR([Could not find genhtml from the lcov package])
])
dnl Build the code coverage flags
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
CODE_COVERAGE_LDFLAGS="-lgcov"
AC_SUBST([CODE_COVERAGE_CFLAGS])
AC_SUBST([CODE_COVERAGE_LDFLAGS])
])
GNOME_CODE_COVERAGE_RULES='
# Code coverage
#
# Optional:
# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
# (Default: $(top_builddir))
# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
# by lcov for code coverage. (Default:
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
# reports to be created. (Default:
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
# (Default: empty)
# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
# instance. (Default: empty)
# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
#
# The generated report will be titled using the $(PACKAGE_NAME) and
# $(PACKAGE_VERSION). In order to add the current git hash to the title,
# use the git-version-gen script, available online.
# Optional variables
CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
CODE_COVERAGE_LCOV_OPTIONS ?=
CODE_COVERAGE_GENHTML_OPTIONS ?=
CODE_COVERAGE_IGNORE_PATTERN ?=
code_coverage_quiet = $(code_coverage_quiet_$(V))
code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
code_coverage_quiet_0 = --quiet
# Use recursive makes in order to ignore errors during check
check-code-coverage:
ifeq ($(CODE_COVERAGE_ENABLED),yes)
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
else
@echo "Need to reconfigure with --enable-code-coverage"
endif
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
ifeq ($(CODE_COVERAGE_ENABLED),yes)
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
else
@echo "Need to reconfigure with --enable-code-coverage"
endif
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:
ifeq ($(CODE_COVERAGE_ENABLED),yes)
clean: code-coverage-clean
code-coverage-clean:
-$(LCOV) --directory $(top_builddir) -z
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-find . -name "*.gcda" -o -name "*.gcov" -delete
endif
GITIGNOREFILES ?=
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
DISTCHECK_CONFIGURE_FLAGS ?=
DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
'
AC_SUBST([GNOME_CODE_COVERAGE_RULES])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
])

92
m4/introspection.m4 Normal file
View File

@@ -0,0 +1,92 @@
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$enable_introspection" = "xno"; then
found_introspection="no"
else
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], [
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
AC_MSG_CHECKING([if $INTROSPECTION_SCANNER works])
if CFLAGS="${CFLAGS} -Wno-error" "$INTROSPECTION_SCANNER" --namespace=test --library=c /dev/null --output /dev/null >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
found_introspection=yes
else
found_introspection="no (compiler failure -- check config.log)"
fi
AC_MSG_RESULT([$found_introspection])
], [found_introspection="no (not installed)"])
if test "x$enable_introspection" = "xyes"; then
if test "x$found_introspection" != "xyes"; then
AC_MSG_ERROR([introspection enabled but can't be used])
fi
elif test "x$enable_introspection" != "xauto"; then
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
fi
fi
AC_SUBST(INTROSPECTION_SCANNER, 'CFLAGS="${CFLAGS} -Wno-error" '"$INTROSPECTION_SCANNER")
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])

87
m4/vapigen.m4 Normal file
View File

@@ -0,0 +1,87 @@
dnl vala.m4
dnl
dnl Copyright 2012 Evan Nemerson
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library.
# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND-INTROSPECTION])
# --------------------------------------
# Check that vapigen existence and version
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
AC_DEFUN([VAPIGEN_CHECK],
[
AC_BEFORE([GOBJECT_INTROSPECTION_CHECK],[$0])
AC_BEFORE([GOBJECT_INTROSPECTION_REQUIRE],[$0])
AC_ARG_ENABLE([vala],
AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],
[build Vala bindings [default=auto]]),,
[enable_vala=auto])
AS_CASE([$enable_vala], [no], [],
[yes], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
AC_MSG_ERROR([Vala bindings require GObject Introspection])
])
], [auto], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
enable_vala=no
])
], [
AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
])
AS_IF([test "x$2" = "x"], [
vapigen_pkg_name=vapigen
], [
vapigen_pkg_name=vapigen-$2
])
AS_IF([test "x$1" = "x"], [
vapigen_pkg="$vapigen_pkg_name"
], [
vapigen_pkg="$vapigen_pkg_name >= $1"
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_EXISTS([$vapigen_pkg], [
AS_IF([test "$enable_vala" = "auto"], [
enable_vala=yes
])
], [
AS_CASE([$enable_vala], [yes], [
AC_MSG_ERROR([$vapigen_pkg not found])
], [auto], [
enable_vala=no
])
])
AS_CASE([$enable_vala],
[yes], [
VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen`
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen
AS_IF([test "x$2" = "x"], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen`
])
])
AC_SUBST([VAPIGEN])
AC_SUBST([VAPIGEN_VAPIDIR])
AC_SUBST([VAPIGEN_MAKEFILE])
AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
])

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -50,10 +50,9 @@
NetworkManager-dispatcher will execute scripts in the NetworkManager-dispatcher will execute scripts in the
<filename>/{etc,usr/lib}/NetworkManager/dispatcher.d</filename> <filename>/{etc,usr/lib}/NetworkManager/dispatcher.d</filename>
directory or subdirectories in directory or subdirectories in
alphabetical order in response to network events. Files in <filename>/etc</filename> alphabetical order in response to network events. Each script should
take precedence over identically-named files in <filename>/usr/lib</filename>. be a regular executable file owned by root. Furthermore, it must not be
Each script should be a regular executable file owned by root. Furthermore, it must writable by group or other, and not setuid.
not be writable by group or other, and not setuid.
</para> </para>
<para> <para>
Each script receives two arguments, the first being the interface name of the Each script receives two arguments, the first being the interface name of the

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <!--*-nxml-*--> <?xml version='1.0'?> <!--*-nxml-*-->
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -167,14 +167,18 @@ plugins-=remove-me
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>dhcp</varname></term> <term><varname>dhcp</varname></term>
<listitem><para>This key sets up what DHCP client NetworkManager will <listitem><para>This key sets up what DHCP client
use. Allowed values depend on build configuration; this version of NetworkManager will use. Allowed values are
NetworkManager was built with support for the following clients: <literal>dhclient</literal>, <literal>dhcpcd</literal>, and
&NM_DHCP_CLIENTS_ENABLED_TEXT;.</para> <literal>internal</literal>. The <literal>dhclient</literal>
<para>The <literal>internal</literal> client is built-in, while other options and <literal>dhcpcd</literal> options require the indicated
may require an external DHCP client to be installed.</para> clients to be installed. The <literal>internal</literal>
<para>If this key is missing, <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal> option uses a built-in DHCP client which is not currently as
is used with a fallback to other supported clients.</para></listitem> featureful as the external clients.</para>
<para>If this key is missing, it defaults to <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal>.
If the chosen plugin is not available, clients are looked for
in this order: <literal>dhclient</literal>, <literal>dhcpcd</literal>,
<literal>internal</literal>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>no-auto-default</varname></term> <term><varname>no-auto-default</varname></term>
@@ -215,7 +219,7 @@ no-auto-default=*
if specified (See <xref linkend="ignore-carrier"/>). if specified (See <xref linkend="ignore-carrier"/>).
Otherwise, it is a list of matches to specify for which device Otherwise, it is a list of matches to specify for which device
carrier should be ignored. See <xref linkend="device-spec"/> for the carrier should be ignored. See <xref linkend="device-spec"/> for the
syntax how to specify a device. Note that controller types like syntax how to specify a device. Note that master types like
bond, bridge, and team ignore carrier by default. You can however bond, bridge, and team ignore carrier by default. You can however
revert that default using the "except:" specifier (or better, revert that default using the "except:" specifier (or better,
use the per-device setting instead of the deprecated setting). use the per-device setting instead of the deprecated setting).
@@ -271,7 +275,8 @@ no-auto-default=*
Set the management mode of the hostname. This parameter will Set the management mode of the hostname. This parameter will
affect only the transient hostname. If a valid static hostname is set, affect only the transient hostname. If a valid static hostname is set,
NetworkManager will skip the update of the hostname despite the value of NetworkManager will skip the update of the hostname despite the value of
this option. A hostname empty or equal to '(none)' is considered invalid. this option. An hostname empty or equal to 'localhost', 'localhost6',
'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
</para> </para>
<para><literal>default</literal>: NetworkManager will update the <para><literal>default</literal>: NetworkManager will update the
hostname with the one provided via DHCP or reverse DNS lookup of the hostname with the one provided via DHCP or reverse DNS lookup of the
@@ -331,24 +336,20 @@ no-auto-default=*
<para><literal>systemd-resolved</literal>: NetworkManager will <para><literal>systemd-resolved</literal>: NetworkManager will
push the DNS configuration to systemd-resolved</para> push the DNS configuration to systemd-resolved</para>
<para><literal>dnsconfd</literal>: NetworkManager will
push the DNS configuration to dnsconfd</para> and by default set ipvX.routed-dns to
yes, so servers are contacted through right interfaces.
<para><literal>none</literal>: NetworkManager will not <para><literal>none</literal>: NetworkManager will not
modify resolv.conf. This implies modify resolv.conf. This implies
<literal>rc-manager</literal>&nbsp;<literal>unmanaged</literal></para> <literal>rc-manager</literal>&nbsp;<literal>unmanaged</literal></para>
<para>Note that the plugins <literal>dnsmasq</literal>,<literal>systemd-resolved</literal> <para>Note that the plugins <literal>dnsmasq</literal> and <literal>systemd-resolved</literal>
and <literal>dnsconfd</literal> are caching local nameservers. are caching local nameservers.
Hence, when NetworkManager writes <filename>&nmrundir;/resolv.conf</filename> Hence, when NetworkManager writes <filename>&nmrundir;/resolv.conf</filename>
and <filename>/etc/resolv.conf</filename> (according to <literal>rc-manager</literal> and <filename>/etc/resolv.conf</filename> (according to <literal>rc-manager</literal>
setting below), the name server there will be localhost only. setting below), the name server there will be localhost only.
NetworkManager also writes a file <filename>&nmrundir;/no-stub-resolv.conf</filename> NetworkManager also writes a file <filename>&nmrundir;/no-stub-resolv.conf</filename>
that contains the original name servers pushed to the DNS plugin.</para> that contains the original name servers pushed to the DNS plugin.</para>
<para>When using <literal>dnsmasq</literal>,<literal>systemd-resolved</literal> and <para>When using <literal>dnsmasq</literal> and <literal>systemd-resolved</literal>,
<literal>dnsconfd</literal> per-connection added dns servers will always be queried using per-connection added dns servers will always be queried using
the device the connection has been activated on.</para> the device the connection has been activated on.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -360,7 +361,7 @@ no-auto-default=*
management mode. This option is about how NetworkManager writes to management mode. This option is about how NetworkManager writes to
<filename>/etc/resolv.conf</filename>, if at all. <filename>/etc/resolv.conf</filename>, if at all.
The default value depends on NetworkManager build The default value depends on NetworkManager build
options, and this version of NetworkManager was built with a default of options, and this version of NetworkManager was build with a default of
"<literal>&NM_CONFIG_DEFAULT_MAIN_RC_MANAGER;</literal>". "<literal>&NM_CONFIG_DEFAULT_MAIN_RC_MANAGER;</literal>".
Regardless of this setting, NetworkManager will Regardless of this setting, NetworkManager will
always write its version of resolv.conf to its runtime state directory always write its version of resolv.conf to its runtime state directory
@@ -491,7 +492,7 @@ no-auto-default=*
files without preserving their contents. files without preserving their contents.
</para> </para>
<para> <para>
The path can also be overridden by pointing to a specific The path can also be overriden by pointing to a specific
existing and writable directory. On the other hand setting existing and writable directory. On the other hand setting
this to an empty string or any other value disables the this to an empty string or any other value disables the
profile conversion mechanism. profile conversion mechanism.
@@ -822,11 +823,6 @@ domains=ALL
and these default values only matter if the per-profile values explicitly indicates and these default values only matter if the per-profile values explicitly indicates
to use the default from <literal>NetworkManager.conf</literal>. to use the default from <literal>NetworkManager.conf</literal>.
</para> </para>
<para>
Note that while nmcli supports various aliases and convenience features for configuring
properties, the settings in this section do not. For example, enum values usually only
can be configured via their numeric magic number.
</para>
<para> <para>
Example: Example:
<programlisting> <programlisting>
@@ -856,21 +852,8 @@ ipv6.ip6-privacy=0
<listitem><para>If left unspecified, the default value is 3 tries before failing the connection. <listitem><para>If left unspecified, the default value is 3 tries before failing the connection.
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>connection.autoconnect-ports</varname></term>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>connection.autoconnect-slaves</varname></term> <term><varname>connection.autoconnect-slaves</varname></term>
<listitem><para>This is deprecated, please use "connection.autoconnect-ports" instead.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.down-on-poweroff</varname></term>
<listitem><para>Whether the connection will be brought down before the system is powered off.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.ip-ping-addresses-require-all</varname></term>
<listitem><para>Whether it is sufficient for any ping check to succeed among the list of target addresses, or if all ping checks must succeed for the entire list of target addresses.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>connection.mud-url</varname></term> <term><varname>connection.mud-url</varname></term>
@@ -885,13 +868,7 @@ ipv6.ip6-privacy=0
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>connection.mdns</varname></term> <term><varname>connection.mdns</varname></term>
<listitem><para> <listitem><para>If unspecified, the ultimate default values depends on the DNS plugin. With systemd-resolved the default currently is "no" (0) and for all other plugins also "no" (0).</para></listitem>
Currently only the systemd-resolve DNS plugin supports this setting.
If the setting is unspecified both in the profile and in the global
default here, then the default is determined by systemd-resolved.
See <literal>MulticastDNS=</literal> in
<citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>connection.mptcp-flags</varname></term> <term><varname>connection.mptcp-flags</varname></term>
@@ -941,13 +918,6 @@ ipv6.ip6-privacy=0
<term><varname>ip-tunnel.mtu</varname></term> <term><varname>ip-tunnel.mtu</varname></term>
<listitem><para>If configured explicitly to 0, the MTU is not reconfigured during device activation unless it is required due to IPv6 constraints. If left unspecified, a DHCP/IPv6 SLAAC provided value is used or a default of 1500.</para></listitem> <listitem><para>If configured explicitly to 0, the MTU is not reconfigured during device activation unless it is required due to IPv6 constraints. If left unspecified, a DHCP/IPv6 SLAAC provided value is used or a default of 1500.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv4.forwarding</varname></term>
<listitem><para>Whether to configure IPv4 sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the IPv4 packet from one interface to another. If left unspecified, "auto" is used, so NetworkManager sets the IPv4 forwarding if any shared connection is active, or it will use the kernel default value otherwise. The "ipv4.forwarding" property is ignored when "ipv4.method" is set to "shared", because forwarding is always enabled in this case. The accepted values are: 0: disabled, 1: enabled, 2: auto, 3: ignored (leave the forwarding unchanged).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.routed-dns</varname></term>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv4.dad-timeout</varname></term> <term><varname>ipv4.dad-timeout</varname></term>
</varlistentry> </varlistentry>
@@ -961,22 +931,10 @@ ipv6.ip6-privacy=0
<term><varname>ipv4.dhcp-iaid</varname></term> <term><varname>ipv4.dhcp-iaid</varname></term>
<listitem><para>If left unspecified, it defaults to "ifname".</para></listitem> <listitem><para>If left unspecified, it defaults to "ifname".</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-ipv6-only-preferred</varname></term>
<listitem><para>If left unspecified, the "IPv6-only preferred" DHCPv4 option is disabled.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv4.dhcp-hostname-flags</varname></term> <term><varname>ipv4.dhcp-hostname-flags</varname></term>
<listitem><para>If left unspecified, the value 3 (fqdn-encoded,fqdn-serv-update) is used.</para></listitem> <listitem><para>If left unspecified, the value 3 (fqdn-encoded,fqdn-serv-update) is used.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-send-hostname</varname></term>
<listitem><para>Whether a hostname is sent to the DHCP server when acquiring a lease. When the property is not specified in the connection, the global value from NetworkManager configuration is looked up. If the global value is not set, the value from ipv4.dhcp-send-hostname-deprecated, which defaults to true, is used for backwards compatibility. In the future this will change and, in absence of a global default, it will always fallback to true.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-send-release</varname></term>
<listitem><para>Whether the DHCP client will send RELEASE message when bringing the connection down.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv4.dhcp-timeout</varname></term> <term><varname>ipv4.dhcp-timeout</varname></term>
<listitem><para>If left unspecified, the default value for <listitem><para>If left unspecified, the default value for
@@ -1008,9 +966,6 @@ ipv6.ip6-privacy=0
removes extraneous routes from the tables. removes extraneous routes from the tables.
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv6.routed-dns</varname></term>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv6.addr-gen-mode</varname></term> <term><varname>ipv6.addr-gen-mode</varname></term>
<listitem><para>If the per-profile setting is either "default" or "default-or-eui64", the <listitem><para>If the per-profile setting is either "default" or "default-or-eui64", the
@@ -1033,14 +988,6 @@ ipv6.ip6-privacy=0
<term><varname>ipv6.dhcp-hostname-flags</varname></term> <term><varname>ipv6.dhcp-hostname-flags</varname></term>
<listitem><para>If left unspecified, the value 1 (fqdn-serv-update) is used.</para></listitem> <listitem><para>If left unspecified, the value 1 (fqdn-serv-update) is used.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv6.dhcp-send-hostname</varname></term>
<listitem><para>Whether a hostname is sent to the DHCP server when acquiring a lease. When the property is not specified in the connection, the global value from NetworkManager configuration is looked up. If the global value is not set, the value from ipv6.dhcp-send-hostname-deprecated, which defaults to true, is used for backwards compatibility. In the future this will change and, in absence of a global default, it will always fallback to true.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv6.dhcp-send-release</varname></term>
<listitem><para>Whether the DHCP client will send RELEASE message when bringing the connection down.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv6.dhcp-timeout</varname></term> <term><varname>ipv6.dhcp-timeout</varname></term>
<listitem><para>If left unspecified, the default value for <listitem><para>If left unspecified, the default value for
@@ -1057,18 +1004,6 @@ ipv6.ip6-privacy=0
"/proc/sys/net/ipv6/conf/default/use_tempaddr" as last fallback. "/proc/sys/net/ipv6/conf/default/use_tempaddr" as last fallback.
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ipv6.temp-valid-lifetime</varname></term>
<listitem><para>If <literal>ipv6.temp-valid-lifetime</literal> is unset, use the
content of "/proc/sys/net/ipv6/conf/default/temp_valid_lft" as last fallback.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv6.temp-preferred-lifetime</varname></term>
<listitem><para>If <literal>ipv6.temp-preferred-lifetime</literal> is unset, use
the content of "/proc/sys/net/ipv6/conf/default/temp_prefered_lft" as last fallback.
</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>ipv6.required-timeout</varname></term> <term><varname>ipv6.required-timeout</varname></term>
</varlistentry> </varlistentry>
@@ -1093,12 +1028,6 @@ ipv6.ip6-privacy=0
<term><varname>sriov.autoprobe-drivers</varname></term> <term><varname>sriov.autoprobe-drivers</varname></term>
<listitem><para>If left unspecified, drivers are autoprobed when the SR-IOV VF gets created.</para></listitem> <listitem><para>If left unspecified, drivers are autoprobed when the SR-IOV VF gets created.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>sriov.preserve-on-down</varname></term>
<listitem><para>Set to 0 or 1 to select whether the SR-IOV parameters are
preserved when the connection is deactivated. If left unspecified, default
to 0 (parameters are not preserved). </para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>vpn.timeout</varname></term> <term><varname>vpn.timeout</varname></term>
<listitem><para>If left unspecified, default value of 60 seconds is used.</para></listitem> <listitem><para>If left unspecified, default value of 60 seconds is used.</para></listitem>
@@ -1161,7 +1090,7 @@ ipv6.ip6-privacy=0
<programlisting> <programlisting>
[connection] [connection]
ipv6.ip6-privacy=0 ipv6.ip6-privacy=0
connection.autoconnect-ports=1 connection.autoconnect-slaves=1
vpn.timeout=120 vpn.timeout=120
[connection-wifi-wlan0] [connection-wifi-wlan0]
@@ -1384,7 +1313,7 @@ managed=1
scanning. This defaults to <literal>yes</literal> in which case scanning. This defaults to <literal>yes</literal> in which case
a random, locally-administered MAC address will be used. a random, locally-administered MAC address will be used.
The setting <literal>wifi.scan-generate-mac-address-mask</literal> The setting <literal>wifi.scan-generate-mac-address-mask</literal>
can be used to influence the generated MAC address to use certain vendor allows to influence the generated MAC address to use certain vendor
OUIs. OUIs.
If disabled, the MAC address during scanning is left unchanged to If disabled, the MAC address during scanning is left unchanged to
whatever is configured. whatever is configured.
@@ -1408,7 +1337,7 @@ managed=1
<listitem> <listitem>
<para> <para>
Like the per-connection settings <literal>ethernet.generate-mac-address-mask</literal> Like the per-connection settings <literal>ethernet.generate-mac-address-mask</literal>
and <literal>wifi.generate-mac-address-mask</literal>, this can be used to configure the and <literal>wifi.generate-mac-address-mask</literal>, this allows to configure the
generated MAC addresses during scanning. See <citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry> generated MAC addresses during scanning. See <citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details. for details.
</para> </para>
@@ -1516,18 +1445,12 @@ managed=1
set to 0 connectivity checking is disabled. If missing, the set to 0 connectivity checking is disabled. If missing, the
default is 300 seconds.</para></listitem> default is 300 seconds.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>timeout</varname></term>
<listitem><para>Specified in seconds; controls how long
to wait for a response before connectivity is marked as
limited. If missing, the default is 20 seconds.</para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>response</varname></term> <term><varname>response</varname></term>
<listitem><para>If set, controls what body content <listitem><para>If set, controls what body content
NetworkManager checks for when requesting the URI for NetworkManager checks for when requesting the URI for
connectivity checking. Note that this only compares connectivity checking. Note that this only compares
that the HTTP response starts with the specified text, that the HTTP response starts with the specifid text,
it does not compare the exact string. This behavior it does not compare the exact string. This behavior
might change in the future, so avoid relying on it. might change in the future, so avoid relying on it.
If missing, the response defaults to "NetworkManager is online". If missing, the response defaults to "NetworkManager is online".
@@ -1560,29 +1483,6 @@ managed=1
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>resolve-mode</varname></term>
<listitem>
<para>
String indicating how DNS servers retrieved from global configuration and connections
should be used. <literal>backup</literal> - Indicates that they can be freely merged
and used for the same purposes. <literal>prefer</literal> - Forbids DNS servers
retrieved from connections to be used for general queries that are not subdomains of
domains set by connection. <literal>exclusive</literal> - Forbids use of connection
DNS servers for any query. Currently relevant only for Dnsconfd plugin.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>certification-authority</varname></term>
<listitem>
<para>
String specifying absolute path to bundle of CA certificates that must be used for
validation of certificates presented by DNS servers when encrypted DNS is used.
Currently relevant only for Dnsconfd plugin.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
</refsect1> </refsect1>
@@ -1590,7 +1490,7 @@ managed=1
<refsect1> <refsect1>
<title><literal>global-dns-domain</literal> sections</title> <title><literal>global-dns-domain</literal> sections</title>
<para>Sections with a name starting with the "global-dns-domain-" <para>Sections with a name starting with the "global-dns-domain-"
prefix allow one to define global DNS configuration for specific prefix allow to define global DNS configuration for specific
domains. The part of section name after "global-dns-domain-" domains. The part of section name after "global-dns-domain-"
specifies the domain name a section applies to (for example, a specifies the domain name a section applies to (for example, a
section could be named "global-dns-domain-foobar.com"). More section could be named "global-dns-domain-foobar.com"). More
@@ -1608,24 +1508,8 @@ managed=1
<term><varname>servers</varname></term> <term><varname>servers</varname></term>
<listitem> <listitem>
<para> <para>
A list of addresses of DNS servers to be used for the A list of addresses of DNS servers to be used for the given domain.
given domain. Each server can be specified either as a </para>
plain IP address or with a URI syntax. When it is
specified as an URI, the following forms are supported:
</para>
<para>
<simplelist type="horiz" columns="1">
<member>dns+udp://<varname>ADDRESS</varname>[:<varname>PORT</varname>] : DNS</member>
<member>dns+tls://<varname>ADDRESS</varname>[:<varname>PORT</varname>][#<varname>SERVERNAME]</varname> : DNS over TLS</member>
</simplelist>
</para>
<para>
<varname>ADDRESS</varname> is an IPv4 or IPv6
address. When it is IPv6, it must be enclosed in square
brackets ('[' and ']'). When it is a IPv6 link-local
address, the address should be followed by a percent
sign ('%') and an interface name.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@@ -1942,7 +1826,7 @@ interface-name:vboxnet*,except:interface-name:vboxnet2
<literal>"uuid:83037490-1d17-4986-a397-01f1db3a7fc2"</literal></para></listitem> <literal>"uuid:83037490-1d17-4986-a397-01f1db3a7fc2"</literal></para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>id:ID</term> <term>id=ID</term>
<listitem><para>Match the connection by name.</para></listitem> <listitem><para>Match the connection by name.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>

View File

@@ -10,4 +10,3 @@
<!ENTITY NM_CONFIG_DEFAULT_MAIN_DHCP "@NM_CONFIG_DEFAULT_MAIN_DHCP@"> <!ENTITY NM_CONFIG_DEFAULT_MAIN_DHCP "@NM_CONFIG_DEFAULT_MAIN_DHCP@">
<!ENTITY NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT "@NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT@"> <!ENTITY NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT "@NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT@">
<!ENTITY NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT "@NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT@"> <!ENTITY NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT "@NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT@">
<!ENTITY NM_DHCP_CLIENTS_ENABLED_TEXT "@NM_DHCP_CLIENTS_ENABLED@">

View File

@@ -1,5 +1,29 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
common_ent_file = configure_file(
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
xsltproc_options = [
xsltproc,
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
mans = [ mans = [
['NetworkManager', '8'], ['NetworkManager', '8'],
['NetworkManager-dispatcher', '8'], ['NetworkManager-dispatcher', '8'],
@@ -20,75 +44,25 @@ if enable_nm_cloud_setup
mans += [['nm-cloud-setup', '8']] mans += [['nm-cloud-setup', '8']]
endif endif
introspection_mans = [ foreach man: mans
['nm-settings-keyfile', '5'], input = man[0] + '.xml'
['nm-settings-dbus', '5'], content_files += join_paths(meson.current_source_dir(), input)
['nm-settings-nmcli', '5'],
]
if enable_ifcfg_rh output = '@0@.@1@'.format(man[0], man[1])
introspection_mans += [['nm-settings-ifcfg-rh', '5']]
endif
built_mans = [] custom_target(
foreach man: mans + introspection_mans output,
name = man[0] + '.' + man[1] input: input,
if not fs.exists(name) output: output,
built_mans = [] command: xsltproc_options + [docbook_xls, '@INPUT@'],
break depend_files: common_ent_file,
endif install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
built_mans += name )
endforeach endforeach
if enable_introspection or enable_docs if enable_introspection
common_ent_file = configure_file( merge_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-merge.py')
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
endif
if enable_introspection and (enable_man or enable_docs)
xsltproc_options = [
find_program('xsltproc'),
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
output = '@0@.@1@'.format(man[0], man[1])
# not needed if only html requested
if enable_man
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
depend_files: common_ent_file,
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach
merge_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-merge.py')
name = 'dbus' name = 'dbus'
nm_settings_docs_xml_dbus = custom_target( nm_settings_docs_xml_dbus = custom_target(
@@ -96,7 +70,7 @@ if enable_introspection and (enable_man or enable_docs)
input: [merge_cmd, nm_property_infos_xml[name], nm_settings_docs_xml_gir[name]], input: [merge_cmd, nm_property_infos_xml[name], nm_settings_docs_xml_gir[name]],
output: 'nm-settings-docs-' + name + '.xml', output: 'nm-settings-docs-' + name + '.xml',
command: [ command: [
python_path, python.path(),
merge_cmd, merge_cmd,
'@OUTPUT@', '@OUTPUT@',
nm_property_infos_xml[name], nm_property_infos_xml[name],
@@ -110,7 +84,7 @@ if enable_introspection and (enable_man or enable_docs)
input: [merge_cmd, nm_property_infos_xml[name], gen_metadata_nm_settings_nmcli_xml, nm_settings_docs_xml_gir[name]], input: [merge_cmd, nm_property_infos_xml[name], gen_metadata_nm_settings_nmcli_xml, nm_settings_docs_xml_gir[name]],
output: 'nm-settings-docs-' + name + '.xml', output: 'nm-settings-docs-' + name + '.xml',
command: [ command: [
python_path, python.path(),
merge_cmd, merge_cmd,
'@OUTPUT@', '@OUTPUT@',
'--only-properties-from', '--only-properties-from',
@@ -150,23 +124,13 @@ if enable_introspection and (enable_man or enable_docs)
output = '@0@.@1@'.format(man[0], man[1]) output = '@0@.@1@'.format(man[0], man[1])
# not needed if only html requested custom_target(
if enable_man output,
custom_target( input: input,
output, output: output,
input: input, command: xsltproc_options + [docbook_xls, '@INPUT@'],
output: output, install: true,
command: xsltproc_options + [docbook_xls, '@INPUT@'], install_dir: join_paths(nm_mandir, 'man' + man[1]),
install: true, )
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach endforeach
# not needed if only html requested
elif enable_man
if built_mans.length() > 0
install_man(built_mans)
else
error('Building manpages requires xsltproc and -Dintrospection=true, and no prebuilt manpages were found. Try building from a release tarball or using -Dman=false.')
endif
endif endif

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -115,9 +115,9 @@
<title>nm-cloud-setup.service systemd unit</title> <title>nm-cloud-setup.service systemd unit</title>
<para>Usually <command>/usr/libexec/nm-cloud-setup</command> is not run directly, <para>Usually <command>/usr/libexec/nm-cloud-setup</command> is not run directly,
but only by <command>systemctl restart nm-cloud-setup.service</command>. This but only by <command>systemctl restart nm-cloud-setup.service</command>. This
ensures that the tool only runs once at any time. ensures that the tool only runs once at any time. It also allows to integrate
The unit is also used by the nm-cloud-setup systemd timer and allows with the nm-cloud-setup systemd timer,
enabling/disabling the service via systemd.</para> and to enable/disable the service via systemd.</para>
<para>As you need to set environment variable to configure nm-cloud-setup binary, <para>As you need to set environment variable to configure nm-cloud-setup binary,
you can do so via systemd override files. Try <command>systemctl edit nm-cloud-setup.service</command>.</para> you can do so via systemd override files. Try <command>systemctl edit nm-cloud-setup.service</command>.</para>
@@ -184,10 +184,6 @@
<para><literal>NM_CLOUD_SETUP_ALIYUN</literal>: boolean, whether Alibaba Cloud (Aliyun) support is enabled. Defaults <para><literal>NM_CLOUD_SETUP_ALIYUN</literal>: boolean, whether Alibaba Cloud (Aliyun) support is enabled. Defaults
to <literal>no</literal>.</para> to <literal>no</literal>.</para>
</listitem> </listitem>
<listitem>
<para><literal>NM_CLOUD_SETUP_OCI</literal>: boolean, whether Oracle Cloud (OCI) support is enabled. Defaults
to <literal>no</literal>.</para>
</listitem>
</itemizedlist> </itemizedlist>
</refsect1> </refsect1>
@@ -421,34 +417,6 @@ ln -s /etc/systemd/system/timers.target.wants/nm-cloud-setup.timer /usr/lib/syst
</itemizedlist> </itemizedlist>
</refsect2> </refsect2>
<refsect2>
<title>Oracle Cloud (OCI)</title>
<para>For OCI, the tools tries to fetch configuration from <literal>http://169.254.169.254/</literal>. Currently, it only
configures IPv4 and does nothing about IPv6. It will do the following.</para>
<itemizedlist>
<listitem>
<para>First fetch <literal>http://169.254.169.254/opc/v2/instance</literal> to determine whether the
expected API is present. This determines whether OCI environment is detected and whether to proceed
to configure the host using OCI meta data.</para>
</listitem>
<listitem>
<para>Fetch <literal>http://169.254.169.254/opc/v2/vnics</literal> to get the configuration
for all the VNICs, getting their MAC address, private IP address, gateway and subnet block.</para>
</listitem>
<listitem>
<para>Then nm-cloud-setup iterates over all interfaces for which it could fetch a configuration.
If no ethernet device for the respective MAC address is found, it is skipped.
Also, if the device is currently not activated in NetworkManager or if the currently
activated profile has a user-data <literal>org.freedesktop.nm-cloud-setup.skip=yes</literal>,
it is skipped. Also, there is only one interface and one IP address, the tool does nothing.</para>
<para>Then the tool configures the system like doing for AWS environment. That is, using source based policy routing
with the tables/rules 30200/30400.</para>
</listitem>
</itemizedlist>
</refsect2>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -154,13 +154,9 @@
<member><option>net.ifnames</option></member> <member><option>net.ifnames</option></member>
<member><option>rd.peerdns</option></member> <member><option>rd.peerdns</option></member>
<member><option>rd.iscsi.ibft</option></member> <member><option>rd.iscsi.ibft</option></member>
<member><option>rd.nvmf.nonbft</option></member>
<member><option>rd.bootif</option></member> <member><option>rd.bootif</option></member>
<member><option>rd.neednet</option></member> <member><option>rd.neednet</option></member>
<member><option>rd.ethtool</option></member> <member><option>rd.ethtool</option></member>
<member><option>rd.net.dns</option></member>
<member><option>rd.net.dns-backend</option></member>
<member><option>rd.net.dns-resolve-mode</option></member>
<member><option>rd.net.timeout.dhcp</option></member> <member><option>rd.net.timeout.dhcp</option></member>
<member><option>rd.net.dhcp.retry</option></member> <member><option>rd.net.dhcp.retry</option></member>
<member><option>rd.net.dhcp.vendor-class</option></member> <member><option>rd.net.dhcp.vendor-class</option></member>
@@ -229,37 +225,6 @@
</para> </para>
</listitem> </listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dns-backend</option>=<replaceable>VALUE</replaceable>
kernel command line option to configure the DNS processing
mode. See the description of the <literal>"dns"</literal> key in
the <literal>"main section"</literal> paragraph of <link
linkend='NetworkManager.conf'><citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>. For
example: <literal>rd.net.dns-backend=systemd-resolved</literal>,
<literal>rd.net.dns-backend=dnsconfd</literal>
</para>
</listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dns</option>=<replaceable>SERVER</replaceable>
kernel command line option to configure a global (non
interface-specific) DNS server. The option can be specified
multiple time to add more than one server. Each server can be
specified as a plain IP or as an URI according to the
description in the "global-dns-domains sections" paragraph of
<link
linkend='NetworkManager.conf'><citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>. For
example: <literal>rd.net.dns=2001:db8::1</literal>,
<literal>rd.net.dns=dns+tls://192.0.2.0</literal>,
<literal>rd.net.dns=dns+tls://[2001:db8::2]:5353#example.org</literal>.
In addition, it supports configuring the <literal>"resolve-mode"</literal>
key in the global DNS configuration via the
<option>rd.net.dns-resolve-mode</option> command line option.
</para>
</listitem>
<listitem> <listitem>
<para>NetworkManager supports the <para>NetworkManager supports the
<option>rd.net.dhcp.dscp</option>={<replaceable>CS0</replaceable>|<replaceable>CS4</replaceable>|<replaceable>CS6</replaceable>} <option>rd.net.dhcp.dscp</option>={<replaceable>CS0</replaceable>|<replaceable>CS4</replaceable>|<replaceable>CS6</replaceable>}

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -57,8 +57,8 @@
</listitem> </listitem>
<listitem> <listitem>
<para>The configuration is made up of Bridges, Ports and <para>The configuration is made up of Bridges, Ports and
Interfaces. Interfaces are always attached to Ports, and Ports are always Interfaces. Interfaces are always enslaved to Ports, and Ports are always
attached to Bridges.</para> enslaved to Bridges.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>NetworkManager only creates Bridges, Ports and Interfaces <para>NetworkManager only creates Bridges, Ports and Interfaces
@@ -66,7 +66,7 @@
local interface nor its port automatically.</para> local interface nor its port automatically.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>You can't attach Interface directly to a Bridge. You <para>You can't enslave Interface directly to a Bridge. You
always need a Port, even if it has just one interface.</para> always need a Port, even if it has just one interface.</para>
</listitem> </listitem>
<listitem> <listitem>
@@ -89,7 +89,7 @@
<link linkend="nm-settings.property.connection.type">type</link>. <link linkend="nm-settings.property.connection.type">type</link>.
Due to the limitations of OVSDB, "empty" Bridges (with no Ports) can't exist. Due to the limitations of OVSDB, "empty" Bridges (with no Ports) can't exist.
NetworkManager inserts the records for Bridges into OVSDB when a Port is NetworkManager inserts the records for Bridges into OVSDB when a Port is
attached. enslaved.
</para> </para>
</refsect2> </refsect2>
@@ -101,18 +101,18 @@
Due to the limitations of OVSDB, "empty" Ports (with no Interfaces) can't Due to the limitations of OVSDB, "empty" Ports (with no Interfaces) can't
exist. Ports can also be configured to do VLAN tagging or Bonding. exist. Ports can also be configured to do VLAN tagging or Bonding.
NetworkManager inserts the records for Ports into OVSDB when an Interface is NetworkManager inserts the records for Ports into OVSDB when an Interface is
attached. Ports must be attached to a Bridge.</para> enslaved. Ports must be enslaved to a Bridge.</para>
</refsect2> </refsect2>
<refsect2> <refsect2>
<title>Interfaces</title> <title>Interfaces</title>
<para>Interfaces are represented by a connections attached to a Port. The <para>Interfaces are represented by a connections enslaved to a Port. The
system interfaces (that have a corresponding Linux link) have a respective system interfaces (that have a corresponding Linux link) have a respective
<link linkend="nm-settings.property.connection.type">connection.type</link> <link linkend="nm-settings.property.connection.type">connection.type</link>
of the link (e.g. "wired", "bond", "dummy", etc.). Other interfaces ("internal" of the link (e.g. "wired", "bond", "dummy", etc.). Other interfaces ("internal"
or "patch" interfaces) are of ovs-interface type. The OVSDB entries are or "patch" interfaces) are of ovs-interface type. The OVSDB entries are
inserted upon attachment to a Port.</para> inserted upon enslavement to a Port.</para>
</refsect2> </refsect2>
</refsect1> </refsect1>
@@ -123,10 +123,10 @@
<example><title>Creating a Bridge with a single internal Interface</title> <example><title>Creating a Bridge with a single internal Interface</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-bridge conn.interface bridge0</userinput> <screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-bridge conn.interface bridge0</userinput>
Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added. Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 controller bridge0</userinput> <prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 master bridge0</userinput>
Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added. Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ovs-interface port-type ovs-port conn.interface iface0 \ <prompt>$ </prompt><userinput>nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \
controller port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput> master port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput>
Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added. Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added.
</screen> </screen>
<para>As said above, you need to create a Port even for a single interface. <para>As said above, you need to create a Port even for a single interface.
@@ -136,29 +136,29 @@ Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) success
</example> </example>
<example><title>Adding a Linux interface to a Bridge</title> <example><title>Adding a Linux interface to a Bridge</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 controller bridge0</userinput> <screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 master bridge0</userinput>
Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added. Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 controller port1</userinput> <prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 master port1</userinput>
Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added. Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added.
</screen> </screen>
<para>Again, you need a port.</para> <para>Again, you need a port.</para>
</example> </example>
<example><title>Creating a VLAN</title> <example><title>Creating a VLAN</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 controller bridge0 ovs-port.tag 120</userinput> <screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 master bridge0 ovs-port.tag 120</userinput>
Connection 'ovs-port-port2' (3994c093-4ef7-4549-a4fd-627b831c3cb8) successfully added. Connection 'ovs-port-port2' (3994c093-4ef7-4549-a4fd-627b831c3cb8) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 controller port2</userinput> <prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 master port2</userinput>
Connection 'ovs-slave-eth1' (099be06e-71ad-484d-8d5a-fcadc5f207f5) successfully added. Connection 'ovs-slave-eth1' (099be06e-71ad-484d-8d5a-fcadc5f207f5) successfully added.
</screen> </screen>
<para>It's just a port with a tag.</para> <para>It's just a port with a tag.</para>
</example> </example>
<example><title>Creating a Bond</title> <example><title>Creating a Bond</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 controller bridge0</userinput> <screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 master bridge0</userinput>
Connection 'ovs-port-bond0' (d154ebf9-e999-4e1b-a084-a3de53d25d8a) successfully added. Connection 'ovs-port-bond0' (d154ebf9-e999-4e1b-a084-a3de53d25d8a) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 controller bond0</userinput> <prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 master bond0</userinput>
Connection 'ovs-slave-eth2' (475ac1bf-30b2-4534-a877-27f33f58b082) successfully added. Connection 'ovs-slave-eth2' (475ac1bf-30b2-4534-a877-27f33f58b082) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 controller bond0</userinput> <prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 master bond0</userinput>
Connection 'ovs-slave-eth3' (8dedeecb-ed12-482b-b77a-24a4fb835136) successfully added. Connection 'ovs-slave-eth3' (8dedeecb-ed12-482b-b77a-24a4fb835136) successfully added.
</screen> </screen>
<para>It's just a Port with multiple interfaces. See nm-settings-nmcli manual for <para>It's just a Port with multiple interfaces. See nm-settings-nmcli manual for

View File

@@ -8,8 +8,8 @@
<xsl:output <xsl:output
method="xml" method="xml"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
/> />
<xsl:template match="nm-setting-docs"> <xsl:template match="nm-setting-docs">

View File

@@ -12,8 +12,8 @@
<xsl:output <xsl:output
method="xml" method="xml"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
/> />
<xsl:template match="nm-setting-docs"> <xsl:template match="nm-setting-docs">
@@ -153,8 +153,8 @@ BOOTPROTO=dhcp
<para> <para>
<programlisting> <programlisting>
<emphasis role="bold">Bonding configuration:</emphasis> <emphasis role="bold">Bonding configuration:</emphasis>
ifcfg-BOND: ifcfg-BOND-port: ifcfg-BOND: ifcfg-BOND-slave:
NAME=BOND NAME=BOND-port NAME=BOND NAME=BOND-slave
UUID=b41888aa-924c-450c-b0f8-85a4f0a51b4a UUID=9bb048e4-286a-4cc3-b104-007dbd20decb UUID=b41888aa-924c-450c-b0f8-85a4f0a51b4a UUID=9bb048e4-286a-4cc3-b104-007dbd20decb
DEVICE=bond100 DEVICE=eth0 DEVICE=bond100 DEVICE=eth0
BONDING_OPTS="mode=balance-rr miimon=100" ONBOOT=yes BONDING_OPTS="mode=balance-rr miimon=100" ONBOOT=yes
@@ -177,16 +177,16 @@ NAME=team0-profile
UUID=1d3460a0-7b37-457f-a300-fe8d92da4807 UUID=1d3460a0-7b37-457f-a300-fe8d92da4807
ONBOOT=yes ONBOOT=yes
ifcfg-my_team0_port1: ifcfg-my_team0_slave1:
NAME=team0-port1 NAME=team0-slave1
UUID=d5aed298-c567-4cc1-b808-6d38ecef9e64 UUID=d5aed298-c567-4cc1-b808-6d38ecef9e64
DEVICE=eth1 DEVICE=eth1
ONBOOT=yes ONBOOT=yes
TEAM_MASTER=team0 TEAM_MASTER=team0
DEVICETYPE=TeamPort DEVICETYPE=TeamPort
ifcfg-my_team0_port2: ifcfg-my_team0_slave2:
NAME=team0-port2 NAME=team0-slave2
UUID=94e75f4e-e5ad-401c-8962-31e0ae5d2215 UUID=94e75f4e-e5ad-401c-8962-31e0ae5d2215
DEVICE=eth2 DEVICE=eth2
ONBOOT=yes ONBOOT=yes

View File

@@ -8,8 +8,8 @@
<xsl:output <xsl:output
method="xml" method="xml"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
/> />
<xsl:template match="nm-setting-docs"> <xsl:template match="nm-setting-docs">
@@ -173,8 +173,8 @@ id=MainBridge id=br-port-1
uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e26048fe794 uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e26048fe794
interface-name=MainBridge interface-name=em1 interface-name=MainBridge interface-name=em1
type=bridge type=ethernet type=bridge type=ethernet
controller=MainBridge master=MainBridge
[bridge] port-type=bridge [bridge] slave-type=bridge
interface-name=MainBridge interface-name=MainBridge
</programlisting> </programlisting>
</para> </para>

View File

@@ -8,8 +8,8 @@
<xsl:output <xsl:output
method="xml" method="xml"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
/> />
<xsl:template match="nm-setting-docs"> <xsl:template match="nm-setting-docs">
@@ -141,14 +141,7 @@
<term> <term>
<option> <option>
<xsl:attribute name="id">nm-settings-nmcli.property.<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/></xsl:attribute> <xsl:attribute name="id">nm-settings-nmcli.property.<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/></xsl:attribute>
<xsl:choose> <xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/>
<xsl:when test="@rename">
<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@rename"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</option> </option>
</term> </term>
<listitem> <listitem>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -187,56 +187,56 @@ B,DISPATCH</screen>
</para> </para>
</example> </example>
<example><title>Adding a bonding controller and two port connection profiles</title> <example><title>Adding a bonding master and two slave connection profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type bond ifname mybond0 mode active-backup</userinput> <screen><prompt>$ </prompt><userinput>nmcli con add type bond ifname mybond0 mode active-backup</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 controller mybond0</userinput> <prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 master mybond0</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 controller mybond0</userinput></screen> <prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 master mybond0</userinput></screen>
<para> <para>
This example demonstrates adding a bond controller connection and two ports. The This example demonstrates adding a bond master connection and two slaves. The
first command adds a controller bond connection, naming the bonding interface first command adds a master bond connection, naming the bonding interface
<emphasis>mybond0</emphasis> and using <emphasis>active-backup</emphasis> mode. <emphasis>mybond0</emphasis> and using <emphasis>active-backup</emphasis> mode.
The next two commands add port connections, both attached as port to <emphasis>mybond0</emphasis>. The next two commands add slaves connections, both enslaved to <emphasis>mybond0</emphasis>.
The first port will be bound to <emphasis>eth1</emphasis> interface, the second to The first slave will be bound to <emphasis>eth1</emphasis> interface, the second to
<emphasis>eth2</emphasis>. <emphasis>eth2</emphasis>.
</para> </para>
</example> </example>
<example><title>Adding a team controller and two port connection profiles</title> <example><title>Adding a team master and two slave connection profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-controller-json.conf</userinput> <screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-port1 ifname em1 controller Team1</userinput> <prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-port2 ifname em2 controller Team1</userinput></screen> <prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1</userinput></screen>
<para> <para>
This example demonstrates adding a team controller connection profile and two ports. It is This example demonstrates adding a team master connection profile and two slaves. It is
very similar to the bonding example. The first command adds a controller team profile, naming very similar to the bonding example. The first command adds a master team profile, naming
the team interface and the profile <emphasis>Team1</emphasis>. The team configuration the team interface and the profile <emphasis>Team1</emphasis>. The team configuration
for the controller is read from <emphasis>team1-controller-json.conf</emphasis> file. Later, you can for the master is read from <emphasis>team1-master-json.conf</emphasis> file. Later, you can
change the configuration with <emphasis>modify</emphasis> command change the configuration with <emphasis>modify</emphasis> command
(<emphasis role="bold">nmcli con modify Team1 team.config team1-controller-another-json.conf</emphasis>). (<emphasis role="bold">nmcli con modify Team1 team.config team1-master-another-json.conf</emphasis>).
The last two commands add port profiles, both attached as port to <emphasis>Team1</emphasis>. The last two commands add slaves profiles, both enslaved to <emphasis>Team1</emphasis>.
The first port will be bound to the <emphasis>em1</emphasis> interface, the second to The first slave will be bound to the <emphasis>em1</emphasis> interface, the second to
<emphasis>em2</emphasis>. The ports don't specify <emphasis>config</emphasis> and thus <emphasis>em2</emphasis>. The slaves don't specify <emphasis>config</emphasis> and thus
<emphasis>teamd</emphasis> will use its default configuration. You will activate the whole setup <emphasis>teamd</emphasis> will use its default configuration. You will activate the whole setup
by activating both ports: by activating both slaves:
<screen> <prompt>$ </prompt><userinput>nmcli con up Team1-port1</userinput> <screen> <prompt>$ </prompt><userinput>nmcli con up Team1-slave1</userinput>
<prompt>$ </prompt><userinput>nmcli con up Team1-port2</userinput></screen> <prompt>$ </prompt><userinput>nmcli con up Team1-slave2</userinput></screen>
By default, the created profiles are marked for auto-activation. But if another By default, the created profiles are marked for auto-activation. But if another
connection has been activated on the device, the new profile won't activate connection has been activated on the device, the new profile won't activate
automatically and you need to activate it manually. automatically and you need to activate it manually.
</para> </para>
</example> </example>
<example><title>Adding a bridge and two port profiles</title> <example><title>Adding a bridge and two slave profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type bridge con-name TowerBridge ifname TowerBridge</userinput> <screen><prompt>$ </prompt><userinput>nmcli con add type bridge con-name TowerBridge ifname TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-port-1 ifname ens3 controller TowerBridge</userinput> <prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-port-2 ifname ens4 controller TowerBridge</userinput> <prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con modify TowerBridge bridge.stp no</userinput></screen> <prompt>$ </prompt><userinput>nmcli con modify TowerBridge bridge.stp no</userinput></screen>
<para> <para>
This example demonstrates adding a bridge controller connection and two ports. The This example demonstrates adding a bridge master connection and two slaves. The
first command adds a controller bridge connection, naming the bridge interface and first command adds a master bridge connection, naming the bridge interface and
the profile as <emphasis>TowerBridge</emphasis>. the profile as <emphasis>TowerBridge</emphasis>.
The next two commands add ports profiles, both will be attached as port to The next two commands add slaves profiles, both will be enslaved to
<emphasis>TowerBridge</emphasis>. <emphasis>TowerBridge</emphasis>.
The first port will be tied to <emphasis>ens3</emphasis> interface, the second to The first slave will be tied to <emphasis>ens3</emphasis> interface, the second to
<emphasis>ens4</emphasis>. <emphasis>ens4</emphasis>.
The last command will disable 802.1D STP for the TowerBridge profile. The last command will disable 802.1D STP for the TowerBridge profile.
</para> </para>
@@ -375,8 +375,8 @@ connection.timestamp: 0
connection.read-only: no connection.read-only: no
connection.permissions: connection.permissions:
connection.zone: -- connection.zone: --
connection.controller: -- connection.master: --
connection.port-type: -- connection.slave-type: --
connection.secondaries: connection.secondaries:
connection.gateway-ping-timeout: 0 connection.gateway-ping-timeout: 0
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@@ -465,8 +465,8 @@ connection.timestamp: 0
connection.read-only: no connection.read-only: no
connection.permissions: connection.permissions:
connection.zone: -- connection.zone: --
connection.controller: -- connection.master: --
connection.port-type: -- connection.slave-type: --
connection.secondaries: connection.secondaries:
connection.gateway-ping-timeout: 0 connection.gateway-ping-timeout: 0
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@@ -525,8 +525,8 @@ connection.timestamp: 0
connection.read-only: no connection.read-only: no
connection.permissions: connection.permissions:
connection.zone: -- connection.zone: --
connection.controller: -- connection.master: --
connection.port-type: -- connection.slave-type: --
connection.secondaries: connection.secondaries:
connection.gateway-ping-timeout: 0 connection.gateway-ping-timeout: 0
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>
@@ -1031,7 +1031,7 @@
sort | sort |
awk ' awk '
/^(bond|bridge|team)-slave$/ { /^(bond|bridge|team)-slave$/ {
printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with controller)</para></listitem>\n", $0; printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with master)</para></listitem>\n", $0;
next; next;
} }
/^(wifi|ethernet|olpc-mash)$/ { /^(wifi|ethernet|olpc-mash)$/ {
@@ -1059,27 +1059,26 @@
<listitem><para><literal>adsl</literal></para></listitem> <listitem><para><literal>adsl</literal></para></listitem>
<listitem><para><literal>bluetooth</literal></para></listitem> <listitem><para><literal>bluetooth</literal></para></listitem>
<listitem><para><literal>bond</literal></para></listitem> <listitem><para><literal>bond</literal></para></listitem>
<listitem><para><literal>bond-slave</literal> (deprecated for ethernet with controller)</para></listitem> <listitem><para><literal>bond-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>bridge</literal></para></listitem> <listitem><para><literal>bridge</literal></para></listitem>
<listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with controller)</para></listitem> <listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>cdma</literal></para></listitem> <listitem><para><literal>cdma</literal></para></listitem>
<listitem><para><literal>dummy</literal></para></listitem> <listitem><para><literal>dummy</literal></para></listitem>
<listitem><para><literal>generic</literal></para></listitem> <listitem><para><literal>generic</literal></para></listitem>
<listitem><para><literal>gsm</literal></para></listitem> <listitem><para><literal>gsm</literal></para></listitem>
<listitem><para><literal>hsr</literal></para></listitem>
<listitem><para><literal>infiniband</literal></para></listitem> <listitem><para><literal>infiniband</literal></para></listitem>
<listitem><para><literal>ip-tunnel</literal></para></listitem> <listitem><para><literal>ip-tunnel</literal></para></listitem>
<listitem><para><literal>ipvlan</literal></para></listitem>
<listitem><para><literal>loopback</literal></para></listitem>
<listitem><para><literal>macsec</literal></para></listitem> <listitem><para><literal>macsec</literal></para></listitem>
<listitem><para><literal>macvlan</literal></para></listitem> <listitem><para><literal>macvlan</literal></para></listitem>
<listitem><para><literal>olpc-mesh</literal></para></listitem> <listitem><para><literal>olpc-mesh</literal></para></listitem>
<listitem><para><literal>ovs-bridge</literal></para></listitem> <listitem><para><literal>ovs-bridge</literal></para></listitem>
<listitem><para><literal>ovs-dpdk</literal></para></listitem>
<listitem><para><literal>ovs-interface</literal></para></listitem> <listitem><para><literal>ovs-interface</literal></para></listitem>
<listitem><para><literal>ovs-patch</literal></para></listitem>
<listitem><para><literal>ovs-port</literal></para></listitem> <listitem><para><literal>ovs-port</literal></para></listitem>
<listitem><para><literal>pppoe</literal></para></listitem> <listitem><para><literal>pppoe</literal></para></listitem>
<listitem><para><literal>team</literal></para></listitem> <listitem><para><literal>team</literal></para></listitem>
<listitem><para><literal>team-slave</literal> (deprecated for ethernet with controller)</para></listitem> <listitem><para><literal>team-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>tun</literal></para></listitem> <listitem><para><literal>tun</literal></para></listitem>
<listitem><para><literal>veth</literal></para></listitem> <listitem><para><literal>veth</literal></para></listitem>
<listitem><para><literal>vlan</literal></para></listitem> <listitem><para><literal>vlan</literal></para></listitem>

View File

@@ -1,7 +1,7 @@
<?xml version='1.0'?> <?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" > <!ENTITY % entities SYSTEM "common.ent" >
%entities; %entities;
]> ]>

View File

@@ -2,17 +2,17 @@
project( project(
'NetworkManager', 'c', 'NetworkManager', 'c',
# NOTE: When incrementing version also add corresponding # NOTE: When incrementing version also:
# NM_VERSION_x_y_z macros in # - add corresponding NM_VERSION_x_y_z macros in
# "src/libnm-core-public/nm-version-macros.h.in" # "src/libnm-core-public/nm-version-macros.h.in"
version: '1.55.2', # - update number in configure.ac
version: '1.46.0',
license: 'GPL2+', license: 'GPL2+',
default_options: [ default_options: [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
'c_std=gnu11', 'c_std=gnu11',
'warning_level=2' # value "2" will add "-Wall" and "-Wextra" to the compiler flags
], ],
meson_version: '>= 0.53.0', meson_version: '>= 0.47.2',
) )
nm_name = meson.project_name() nm_name = meson.project_name()
@@ -42,18 +42,10 @@ nm_libexecdir = join_paths(nm_prefix, get_option('libexecdir'))
nm_localedir = join_paths(nm_prefix, get_option('localedir')) nm_localedir = join_paths(nm_prefix, get_option('localedir'))
nm_localstatedir = join_paths(nm_prefix, get_option('localstatedir')) nm_localstatedir = join_paths(nm_prefix, get_option('localstatedir'))
nm_mandir = join_paths(nm_prefix, get_option('mandir')) nm_mandir = join_paths(nm_prefix, get_option('mandir'))
nm_runstatedir = join_paths(nm_localstatedir, 'run')
nm_sbindir = join_paths(nm_prefix, get_option('sbindir')) nm_sbindir = join_paths(nm_prefix, get_option('sbindir'))
nm_sysconfdir = join_paths(nm_prefix, get_option('sysconfdir')) nm_sysconfdir = join_paths(nm_prefix, get_option('sysconfdir'))
nm_runstatedir = get_option('runtime_dir')
if nm_runstatedir == ''
if get_option('prefix') == '/usr'
nm_runstatedir = '/run'
else
nm_runstatedir = join_paths(nm_localstatedir, 'run')
endif
endif
nm_pkgsbindir = join_paths(nm_sbindir, nm_name) nm_pkgsbindir = join_paths(nm_sbindir, nm_name)
nm_pkgconfdir = join_paths(nm_sysconfdir, nm_name) nm_pkgconfdir = join_paths(nm_sysconfdir, nm_name)
nm_pkgdatadir = join_paths(nm_datadir, nm_name) nm_pkgdatadir = join_paths(nm_datadir, nm_name)
@@ -77,7 +69,6 @@ libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision)
libnm_pkgincludedir = join_paths(nm_includedir, libnm_name) libnm_pkgincludedir = join_paths(nm_includedir, libnm_name)
fs = import('fs')
gnome = import('gnome') gnome = import('gnome')
i18n = import('i18n') i18n = import('i18n')
pkg = import('pkgconfig') pkg = import('pkgconfig')
@@ -85,11 +76,12 @@ pkg = import('pkgconfig')
source_root = meson.current_source_dir() source_root = meson.current_source_dir()
build_root = meson.current_build_dir() build_root = meson.current_build_dir()
po_dir = source_root / 'po' po_dir = join_paths(meson.source_root(), 'po')
top_inc = include_directories('.') top_inc = include_directories('.')
perl = find_program('perl') perl = find_program('perl')
xsltproc = find_program('xsltproc')
check_exports = find_program(join_paths(source_root, 'tools', 'check-exports.sh')) check_exports = find_program(join_paths(source_root, 'tools', 'check-exports.sh'))
@@ -137,9 +129,6 @@ config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix:
config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>')) config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>')) config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
config_h.set10('HAVE_DLVSYM', cc.has_function('dlvsym', prefix: '''#define _GNU_SOURCE
#include <dlfcn.h>'''))
# types # types
config_h.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>')) config_h.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
config_h.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>')) config_h.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
@@ -176,21 +165,16 @@ endif
enable_lto = get_option('b_lto') enable_lto = get_option('b_lto')
if enable_lto if enable_lto
cc_version = cc.version() # meson already adds '-flto'
if cc.get_id() == 'clang' lto_flag = '-flto-partition=none'
if cc_version <= '18.0.0' assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
error('Clang version should be greater than 18.0.0, got : ' + cc_version) common_flags += lto_flag
endif common_ldflags += lto_flag
elif cc_version < '12.0'
# GCC < 12 breaks libnm symbol versioning with LTO, use workarounds
lto_flag = '-flto-partition=none'
assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
common_flags += lto_flag
common_ldflags += lto_flag
endif
endif endif
common_flags += cc.get_supported_arguments([ common_flags += cc.get_supported_arguments([
'-Wall',
'-Wextra',
'-Wcast-align=strict', '-Wcast-align=strict',
'-Wdeclaration-after-statement', '-Wdeclaration-after-statement',
'-Wfloat-equal', '-Wfloat-equal',
@@ -270,8 +254,8 @@ config_h.set10('WITH_JANSSON', jansson_dep.found())
jansson_msg = 'no' jansson_msg = 'no'
if jansson_dep.found() if jansson_dep.found()
jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir') jansson_libdir = jansson_dep.get_pkgconfig_variable('libdir')
res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'), check: false) res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'))
jansson_soname = '' jansson_soname = ''
foreach line: res.stdout().split('\n') foreach line: res.stdout().split('\n')
if line.strip().contains('SONAME') if line.strip().contains('SONAME')
@@ -313,7 +297,7 @@ config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH', config_migrate_if
enable_ifupdown = get_option('ifupdown') enable_ifupdown = get_option('ifupdown')
if enable_ifupdown == 'auto' if enable_ifupdown == 'auto'
enable_ifupdown = (run_command('test', '-e', '/etc/debian_version', check: false).returncode() == 0) enable_ifupdown = (run_command('test', '-e', '/etc/debian_version').returncode() == 0)
else else
enable_ifupdown = (enable_ifupdown != 'false') enable_ifupdown = (enable_ifupdown != 'false')
endif endif
@@ -379,7 +363,7 @@ install_systemdunitdir = (systemd_systemdsystemunitdir != 'no')
if install_systemdunitdir and systemd_systemdsystemunitdir == '' if install_systemdunitdir and systemd_systemdsystemunitdir == ''
assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it') assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
systemd_systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', nm_prefix]) systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir', define_variable: ['rootprefix', nm_prefix])
endif endif
enable_systemd_journal = get_option('systemd_journal') enable_systemd_journal = get_option('systemd_journal')
@@ -444,8 +428,10 @@ if suspend_resume == 'auto'
suspend_resume = 'systemd' suspend_resume = 'systemd'
elif libelogind_dep.found() elif libelogind_dep.found()
suspend_resume = 'elogind' suspend_resume = 'elogind'
else elif session_tracking_consolekit
suspend_resume = 'consolekit' suspend_resume = 'consolekit'
else
suspend_resume = 'upower'
endif endif
endif endif
@@ -464,6 +450,8 @@ elif suspend_resume == 'elogind'
config_h.set('SUSPEND_RESUME_ELOGIND', true) config_h.set('SUSPEND_RESUME_ELOGIND', true)
elif suspend_resume == 'consolekit' elif suspend_resume == 'consolekit'
config_h.set('SUSPEND_RESUME_CONSOLEKIT', true) config_h.set('SUSPEND_RESUME_CONSOLEKIT', true)
elif suspend_resume == 'upower'
config_h.set('SUSPEND_RESUME_UPOWER', true)
else else
error('bug') error('bug')
endif endif
@@ -512,7 +500,7 @@ endif
enable_polkit = get_option('polkit') enable_polkit = get_option('polkit')
if enable_polkit if enable_polkit
# FIXME: policydir should be relative to `datadir`, not `prefix`. Fixed in https://gitlab.freedesktop.org/polkit/polkit/merge_requests/2 # FIXME: policydir should be relative to `datadir`, not `prefix`. Fixed in https://gitlab.freedesktop.org/polkit/polkit/merge_requests/2
polkit_gobject_policydir = dependency('polkit-gobject-1').get_variable(pkgconfig: 'policydir', pkgconfig_define: ['prefix', nm_prefix]) polkit_gobject_policydir = dependency('polkit-gobject-1').get_pkgconfig_variable('policydir', define_variable: ['prefix', nm_prefix])
endif endif
config_auth_polkit_default = get_option('config_auth_polkit_default') config_auth_polkit_default = get_option('config_auth_polkit_default')
@@ -527,7 +515,7 @@ polkit_agent_helper_1_path = get_option('polkit_agent_helper_1')
foreach p : [ '/usr/libexec/polkit-agent-helper-1', foreach p : [ '/usr/libexec/polkit-agent-helper-1',
'/usr/lib/polkit-1/polkit-agent-helper-1', '/usr/lib/polkit-1/polkit-agent-helper-1',
'/usr/lib/policykit-1/polkit-agent-helper-1' ] '/usr/lib/policykit-1/polkit-agent-helper-1' ]
if polkit_agent_helper_1_path == '' and run_command('test', '-f', p, check: false).returncode() == 0 if polkit_agent_helper_1_path == '' and run_command('test', '-f', p).returncode() == 0
polkit_agent_helper_1_path = p polkit_agent_helper_1_path = p
endif endif
endforeach endforeach
@@ -562,23 +550,23 @@ endif
dbus_conf_dir = get_option('dbus_conf_dir') dbus_conf_dir = get_option('dbus_conf_dir')
if dbus_conf_dir == '' if dbus_conf_dir == ''
assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid system bus config dir') assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid system bus config dir')
dbus_conf_dir = join_paths(dbus_dep.get_variable(pkgconfig: 'datarootdir', pkgconfig_define: ['prefix', nm_prefix]), 'dbus-1', 'system.d') dbus_conf_dir = join_paths(dbus_dep.get_pkgconfig_variable('datarootdir', define_variable: ['prefix', nm_prefix]), 'dbus-1', 'system.d')
endif endif
dbus_interfaces_dir = dbus_dep.get_variable(pkgconfig: 'interfaces_dir', pkgconfig_define: ['datadir', nm_datadir]) dbus_interfaces_dir = dbus_dep.get_pkgconfig_variable('interfaces_dir', define_variable: ['datadir', nm_datadir])
dbus_system_bus_services_dir = dbus_dep.get_variable(pkgconfig: 'system_bus_services_dir', pkgconfig_define: ['datadir', nm_datadir]) dbus_system_bus_services_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir', define_variable: ['datadir', nm_datadir])
enable_firewalld_zone = get_option('firewalld_zone') enable_firewalld_zone = get_option('firewalld_zone')
config_h.set10('WITH_FIREWALLD_ZONE', enable_firewalld_zone) config_h.set10('WITH_FIREWALLD_ZONE', enable_firewalld_zone)
# pppd # pppd
enable_ppp = get_option('ppp') enable_ppp = get_option('ppp')
NM_PPP_VERSION_2_5_OR_NEWER = false NM_PPP_VERSION_2_5_OR_NEWER = 0
if enable_ppp if enable_ppp
pppd_dep = dependency('pppd', required: false) pppd_dep = dependency('pppd', required: false)
if (pppd_dep.found()) if (pppd_dep.found())
pppd_version = pppd_dep.version() pppd_version = pppd_dep.version()
NM_PPP_VERSION_2_5_OR_NEWER = true NM_PPP_VERSION_2_5_OR_NEWER = 1
else else
assert(cc.has_header('pppd/pppd.h'), 'couldn\'t find pppd.h. pppd development headers are required') assert(cc.has_header('pppd/pppd.h'), 'couldn\'t find pppd.h. pppd development headers are required')
pppd_version = '2.4.9' pppd_version = '2.4.9'
@@ -588,11 +576,7 @@ if enable_ppp
if pppd_path == '' if pppd_path == ''
pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false) pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false)
assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it') assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it')
if meson.version().version_compare('>= 0.55') pppd_path = pppd.path()
pppd_path = pppd.full_path()
else
pppd_path = pppd.path()
endif
endif endif
config_h.set_quoted('PPPD_PATH', pppd_path) config_h.set_quoted('PPPD_PATH', pppd_path)
@@ -612,7 +596,7 @@ if enable_modem_manager
mobile_broadband_provider_info_database = get_option('mobile_broadband_provider_info_database') mobile_broadband_provider_info_database = get_option('mobile_broadband_provider_info_database')
if mobile_broadband_provider_info_database == '' if mobile_broadband_provider_info_database == ''
mobile_broadband_provider_info_database = dependency('mobile-broadband-provider-info').get_variable(pkgconfig: 'database') mobile_broadband_provider_info_database = dependency('mobile-broadband-provider-info').get_pkgconfig_variable('database')
endif endif
config_h.set_quoted('MOBILE_BROADBAND_PROVIDER_INFO_DATABASE', mobile_broadband_provider_info_database) config_h.set_quoted('MOBILE_BROADBAND_PROVIDER_INFO_DATABASE', mobile_broadband_provider_info_database)
endif endif
@@ -634,9 +618,8 @@ config_h.set10('WITH_OFONO', enable_ofono)
# DHCP client support # DHCP client support
config_dhcp_default = get_option('config_dhcp_default') config_dhcp_default = get_option('config_dhcp_default')
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
config_dhcp_clients_enabled = [ 'internal' ]
dhcp_summary = '' dhcp_summary = ''
foreach client : [ 'dhcpcd', 'dhclient' ] foreach client : [ 'dhclient', 'dhcpcd', 'dhcpcanon' ]
client_path = get_option(client) client_path = get_option(client)
client_enable = (client_path != 'no') client_enable = (client_path != 'no')
if client_enable if client_enable
@@ -647,11 +630,7 @@ foreach client : [ 'dhcpcd', 'dhclient' ]
'/usr/local/sbin/' + client, '/usr/local/sbin/' + client,
required : false) required : false)
if client_prog.found() if client_prog.found()
if meson.version().version_compare('>= 0.55') client_path = client_prog.path()
client_path = client_prog.full_path()
else
client_path = client_prog.path()
endif
else else
client_path = '/usr/sbin/' + client client_path = '/usr/sbin/' + client
message('@0@ not found, assume path @1@'.format(client, client_path)) message('@0@ not found, assume path @1@'.format(client, client_path))
@@ -666,10 +645,6 @@ foreach client : [ 'dhcpcd', 'dhclient' ]
dhcp_summary += (' ' + client + ': ' + client_enable.to_string()) dhcp_summary += (' ' + client + ': ' + client_enable.to_string())
if (client_enable) if (client_enable)
dhcp_summary += (' ' + client_path) dhcp_summary += (' ' + client_path)
config_dhcp_clients_enabled += client
endif
if (client == 'dhclient')
dhcp_summary += ' (deprecated)'
endif endif
dhcp_summary += '\n' dhcp_summary += '\n'
endforeach endforeach
@@ -697,11 +672,7 @@ foreach prog_name : ['resolvconf', 'netconfig']
'/usr/local/sbin/' + prog_name, '/usr/local/sbin/' + prog_name,
required : false) required : false)
if prog.found() if prog.found()
if meson.version().version_compare('>= 0.55') prog_path = prog.path()
prog_path = prog.full_path()
else
prog_path = prog.path()
endif
else else
prog_enable = false prog_enable = false
endif endif
@@ -726,7 +697,6 @@ default_paths = ['/sbin', '/usr/sbin']
# 0: cmdline option, 1: paths, 2: fallback # 0: cmdline option, 1: paths, 2: fallback
progs = [['iptables', default_paths, '/usr/sbin/iptables'], progs = [['iptables', default_paths, '/usr/sbin/iptables'],
['ip6tables', default_paths, '/usr/sbin/ip6tables'],
['nft', default_paths, '/usr/sbin/nft'], ['nft', default_paths, '/usr/sbin/nft'],
['dnsmasq', default_paths, ''], ['dnsmasq', default_paths, ''],
['modprobe', default_paths, '/sbin/modprobe'] ['modprobe', default_paths, '/sbin/modprobe']
@@ -740,11 +710,7 @@ foreach prog : progs
search_paths += (path + '/' + prog[0]) search_paths += (path + '/' + prog[0])
endforeach endforeach
exe = find_program(search_paths, required : false) exe = find_program(search_paths, required : false)
if meson.version().version_compare('>= 0.55') path = exe.found() ? exe.path() : prog[2]
path = exe.found() ? exe.full_path() : prog[2]
else
path = exe.found() ? exe.path() : prog[2]
endif
endif endif
name = prog[0].to_upper() + '_PATH' name = prog[0].to_upper() + '_PATH'
config_h.set_quoted(name, path) config_h.set_quoted(name, path)
@@ -813,10 +779,8 @@ endif
enable_nm_cloud_setup = get_option('nm_cloud_setup') enable_nm_cloud_setup = get_option('nm_cloud_setup')
if enable_nm_cloud_setup if enable_nm_cloud_setup
assert(libcurl_dep.found(), 'nm-cloud-setup requires libcurl library. Use -Dnm_cloud_setup=false to disable it') assert(libcurl_dep.found(), 'nm-cloud-setup requires libcurl library. Use -Dnm_cloud_setup=false to disable it')
assert(jansson_dep.found(), 'nm-cloud-setup requires jansson library. Use -Dnm_cloud_setup=false to disable it')
endif endif
enable_man = get_option('man')
enable_docs = get_option('docs') enable_docs = get_option('docs')
more_asserts = get_option('more_asserts') more_asserts = get_option('more_asserts')
@@ -905,42 +869,24 @@ if enable_valgrind
if valgrind_suppressions_path == '' if valgrind_suppressions_path == ''
valgrind_suppressions_path = join_paths(source_root, 'valgrind.suppressions') valgrind_suppressions_path = join_paths(source_root, 'valgrind.suppressions')
endif endif
if meson.version().version_compare('>= 0.55')
valgrind_path = valgrind.full_path()
else
valgrind_path = valgrind.path()
endif
endif endif
test_args = [ test_args = [
'--called-from-make', '--called-from-make',
build_root, build_root,
'', '',
enable_valgrind ? valgrind_path : '', enable_valgrind ? valgrind.path() : '',
enable_valgrind ? valgrind_suppressions_path : '', enable_valgrind ? valgrind_suppressions_path : '',
'--launch-dbus=auto', '--launch-dbus=auto',
] ]
python_mod = import('python') py3 = import('python3')
python = python_mod.find_installation('python3', required: false) python = py3.find_python()
if python.found() if python.found()
if meson.version().version_compare('>= 0.55') config_h.set_quoted('TEST_NM_PYTHON', python.path())
python_path = python.full_path()
else
python_path = python.path()
endif
config_h.set_quoted('TEST_NM_PYTHON', python_path)
endif endif
# libnvme (NBFT support)
enable_nbft = get_option('nbft')
if enable_nbft
libnvme_dep = dependency('libnvme', version: '>= 1.5', required: false)
assert(libnvme_dep.found(), 'NBFT support was requested, but the libnvme library is not available. Use -Dnbft=false to build without it.')
endif
config_h.set10('WITH_NBFT', enable_nbft)
data_conf = configuration_data() data_conf = configuration_data()
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : '')) data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit) data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit)
@@ -950,7 +896,6 @@ data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT', config_migrate_ifcfg_rh_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT', config_migrate_ifcfg_rh_default)
data_conf.set('NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT', config_wifi_backend_default) data_conf.set('NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT', config_wifi_backend_default)
data_conf.set('NM_DHCP_CLIENTS_ENABLED', ', '.join(config_dhcp_clients_enabled))
data_conf.set('NM_MAJOR_VERSION', nm_major_version) data_conf.set('NM_MAJOR_VERSION', nm_major_version)
data_conf.set('NM_MICRO_VERSION', nm_micro_version) data_conf.set('NM_MICRO_VERSION', nm_micro_version)
data_conf.set('NM_MINOR_VERSION', nm_minor_version) data_conf.set('NM_MINOR_VERSION', nm_minor_version)
@@ -965,6 +910,38 @@ data_conf.set('nmstatedir', nm_pkgstatedir)
data_conf.set('sbindir', nm_sbindir) data_conf.set('sbindir', nm_sbindir)
data_conf.set('sysconfdir', nm_sysconfdir) data_conf.set('sysconfdir', nm_sysconfdir)
# check if we can build setting property documentation
'''
build_docs=no
if test -n "$INTROSPECTION_MAKEFILE"; then
# If g-i is installed we know we have python, but we might not have pygobject
if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
fi
AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_ERROR([--enable-introspection requires perl])
fi
AC_PATH_PROG(XSLTPROC, xsltproc)
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([--enable-introspection requires xsltproc])
fi
have_introspection=yes
if test "$enable_gtk_doc" = "yes"; then
build_docs=yes
fi
else
if test "$enable_gtk_doc" = "yes"; then
# large parts of the documentation require introspection/pygobject to extract
# the documentation out of the source files. You cannot enable gtk-doc without alone.
AC_MSG_ERROR(["--with-gtk-doc requires --enable-introspection"])
fi
have_introspection=no
fi
'''
content_files = [] content_files = []
subdir('introspection') subdir('introspection')
@@ -989,27 +966,20 @@ test(
subdir('examples/C/glib') subdir('examples/C/glib')
enable_qt = get_option('qt') enable_qt = get_option('qt')
if enable_qt != 'false' if enable_qt
qt_core_dep = dependency('QtCore', version: '>= 4', required: enable_qt == 'yes') add_languages('cpp')
qt_dbus_dep = dependency('QtDBus', required: enable_qt == 'yes')
qt_network_dep = dependency('QtNetwork', required: enable_qt == 'yes')
# If enable_qt=='yes' we have all the dependencies. If it's 'auto', skip qt_core_dep = dependency('QtCore', version: '>= 4')
# building the Qt examples if any dependency is missing. qt_dbus_dep = dependency('QtDBus')
if qt_core_dep.found() and qt_dbus_dep.found() and qt_network_dep.found() qt_network_dep = dependency('QtNetwork')
add_languages('cpp')
subdir('examples/C/qt') subdir('examples/C/qt')
endif
endif endif
# The man/ directory builds a couple targets needed by the docs build too.
# If we build with docs but no man, then enter the subdir and only build
# some targets.
if enable_docs or enable_man
subdir('man')
endif
if enable_docs if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true') assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
assert(meson.version().version_compare('>= 0.49.0'), '-Ddocs requires meson >= 0.49')
subdir('man')
subdir('docs') subdir('docs')
meson.add_dist_script( meson.add_dist_script(
'tools/meson-dist-data.sh', 'tools/meson-dist-data.sh',
@@ -1060,7 +1030,7 @@ meson.add_install_script(
nm_pkgstatedir, nm_pkgstatedir,
nm_mandir, nm_mandir,
nm_sysconfdir, nm_sysconfdir,
enable_man ? '1' : '0', enable_docs ? '1' : '0',
enable_ifcfg_rh ? '1' : '0', enable_ifcfg_rh ? '1' : '0',
enable_nm_cloud_setup ? '1' : '0', enable_nm_cloud_setup ? '1' : '0',
install_systemdunitdir ? '1' : '0', install_systemdunitdir ? '1' : '0',
@@ -1111,7 +1081,6 @@ endif
output += '\n' output += '\n'
output += ' jansson: ' + jansson_msg + '\n' output += ' jansson: ' + jansson_msg + '\n'
output += ' iptables: ' + config_h.get('IPTABLES_PATH') + '\n' output += ' iptables: ' + config_h.get('IPTABLES_PATH') + '\n'
output += ' ip6tables: ' + config_h.get('IP6TABLES_PATH') + '\n'
output += ' nft: ' + config_h.get('NFT_PATH') + '\n' output += ' nft: ' + config_h.get('NFT_PATH') + '\n'
output += ' modprobe: ' + config_h.get('MODPROBE_PATH') + '\n' output += ' modprobe: ' + config_h.get('MODPROBE_PATH') + '\n'
output += ' modemmanager-1: ' + enable_modem_manager.to_string() + '\n' output += ' modemmanager-1: ' + enable_modem_manager.to_string() + '\n'
@@ -1126,7 +1095,7 @@ output += ' nmcli: ' + enable_nmcli.to_string() + '\n'
output += ' nmtui: ' + enable_nmtui.to_string() + '\n' output += ' nmtui: ' + enable_nmtui.to_string() + '\n'
output += ' nm-cloud-setup: ' + enable_nm_cloud_setup.to_string() + '\n' output += ' nm-cloud-setup: ' + enable_nm_cloud_setup.to_string() + '\n'
output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n' output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n'
output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + ' (deprecated)\n' output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + '\n'
output += ' default value of main.migrate-ifcfg-rh: ' + config_migrate_ifcfg_rh_default + '\n' output += ' default value of main.migrate-ifcfg-rh: ' + config_migrate_ifcfg_rh_default + '\n'
output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n' output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n'
output += '\nHandlers for /etc/resolv.conf:\n' + resolv_conf_summary output += '\nHandlers for /etc/resolv.conf:\n' + resolv_conf_summary
@@ -1146,7 +1115,7 @@ output += ' more-logging: ' + more_logging.to_string() + '\n'
output += ' warning-level: ' + get_option('warning_level') + '\n' output += ' warning-level: ' + get_option('warning_level') + '\n'
output += ' valgrind: ' + enable_valgrind.to_string() output += ' valgrind: ' + enable_valgrind.to_string()
if enable_valgrind if enable_valgrind
output += ' ' + valgrind_path output += ' ' + valgrind.path()
endif endif
output += '\n' output += '\n'
output += ' code coverage: ' + get_option('b_coverage').to_string() + '\n' output += ' code coverage: ' + get_option('b_coverage').to_string() + '\n'

View File

@@ -4,9 +4,7 @@ option('system_ca_path', type: 'string', value: '/etc/ssl/certs', description: '
option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory. Set to \'no\' not to install the udev rule') option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory. Set to \'no\' not to install the udev rule')
option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus system.d directory is') option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus system.d directory is')
option('kernel_firmware_dir', type: 'string', value: '/lib/firmware', description: 'where kernel firmware directory is (default is /lib/firmware)') option('kernel_firmware_dir', type: 'string', value: '/lib/firmware', description: 'where kernel firmware directory is (default is /lib/firmware)')
option('runtime_dir', type: 'string', value: '', description: 'Directory for transient runtime state [default: LOCALSTATEDIR/run or /run]')
option('iptables', type: 'string', value: '', description: 'path to iptables') option('iptables', type: 'string', value: '', description: 'path to iptables')
option('ip6tables', type: 'string', value: '', description: 'path to ip6tables')
option('nft', type: 'string', value: '', description: 'path to nft') option('nft', type: 'string', value: '', description: 'path to nft')
option('dnsmasq', type: 'string', value: '', description: 'path to dnsmasq') option('dnsmasq', type: 'string', value: '', description: 'path to dnsmasq')
option('modprobe', type: 'string', value: '', description: 'path to modprobe') option('modprobe', type: 'string', value: '', description: 'path to modprobe')
@@ -15,7 +13,7 @@ option('modprobe', type: 'string', value: '', description: 'path to modprobe')
option('dist_version', type: 'string', value: '', description: 'Define the NM\'s distribution version string') option('dist_version', type: 'string', value: '', description: 'Define the NM\'s distribution version string')
option('session_tracking_consolekit', type: 'boolean', value: true, description: 'Support consolekit session tracking') option('session_tracking_consolekit', type: 'boolean', value: true, description: 'Support consolekit session tracking')
option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'], value: 'systemd', description: 'Compatibility option to choose one session tracking module') option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'], value: 'systemd', description: 'Compatibility option to choose one session tracking module')
option('suspend_resume', type: 'combo', choices: ['systemd', 'elogind', 'consolekit', 'auto'], value: 'auto', description: 'Build NetworkManager with specific suspend/resume support') option('suspend_resume', type: 'combo', choices: ['upower', 'systemd', 'elogind', 'consolekit', 'auto'], value: 'auto', description: 'Build NetworkManager with specific suspend/resume support')
option('polkit', type: 'boolean', value: true, description: 'User auth-polkit configuration option.') option('polkit', type: 'boolean', value: true, description: 'User auth-polkit configuration option.')
option('config_auth_polkit_default', type: 'combo', choices: ['default', 'true', 'false', 'root-only'], value: 'default', description: 'Default value for configuration main.auth-polkit.') option('config_auth_polkit_default', type: 'combo', choices: ['default', 'true', 'false', 'root-only'], value: 'default', description: 'Default value for configuration main.auth-polkit.')
option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections') option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections')
@@ -45,7 +43,6 @@ option('nmtui', type: 'boolean', value: true, description: 'Build nmtui')
option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud')
option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support') option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support')
option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support') option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support')
option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator')
# configuration plugins # configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset') option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
@@ -59,15 +56,15 @@ option('netconfig', type: 'string', value: '', description: 'Enable SUSE netconf
option('config_dns_rc_manager_default', type: 'combo', choices: ['auto', 'symlink', 'file', 'netconfig', 'resolvconf'], value: 'auto', description: 'Configure default value for main.rc-manager setting') option('config_dns_rc_manager_default', type: 'combo', choices: ['auto', 'symlink', 'file', 'netconfig', 'resolvconf'], value: 'auto', description: 'Configure default value for main.rc-manager setting')
# dhcp clients # dhcp clients
option('dhclient', type: 'string', value: 'no', description: 'Enable dhclient support (deprecated)') option('dhclient', type: 'string', value: '', description: 'Enable dhclient support')
option('dhcpcanon', type: 'string', value: '', description: 'Enable dhcpcanon support (experimental)')
option('dhcpcd', type: 'string', value: '', description: 'Enable dhcpcd support') option('dhcpcd', type: 'string', value: '', description: 'Enable dhcpcd support')
option('config_dhcp_default', type: 'combo', choices: ['dhclient', 'dhcpcd', 'internal', 'nettools'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset') option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal', 'nettools'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')
# miscellaneous # miscellaneous
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build') option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build Vala bindings') option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build Vala bindings')
option('docs', type: 'boolean', value: false, description: 'use to build documentation') option('docs', type: 'boolean', value: false, description: 'use to build documentation')
option('man', type: 'boolean', value: true, description: 'Install manpages')
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests') option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
option('firewalld_zone', type: 'boolean', value: true, description: 'Install and use firewalld zone for shared mode') option('firewalld_zone', type: 'boolean', value: true, description: 'Install and use firewalld zone for shared mode')
option('more_asserts', type: 'string', value: 'auto', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: auto)') option('more_asserts', type: 'string', value: 'auto', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: auto)')
@@ -77,5 +74,5 @@ option('valgrind_suppressions', type: 'string', value: '', description: 'Use spe
option('ld_gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused symbols on linking') option('ld_gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused symbols on linking')
option('libpsl', type: 'boolean', value: true, description: 'Link against libpsl') option('libpsl', type: 'boolean', value: true, description: 'Link against libpsl')
option('crypto', type: 'combo', choices: ['nss', 'gnutls', 'null'], value: 'nss', description: 'Cryptography library to use for certificate and key operations') option('crypto', type: 'combo', choices: ['nss', 'gnutls', 'null'], value: 'nss', description: 'Cryptography library to use for certificate and key operations')
option('qt', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'enable Qt examples') option('qt', type: 'boolean', value: true, description: 'enable Qt examples')
option('readline', type: 'combo', choices: ['auto', 'libreadline', 'libedit', 'none'], description: 'Using readline (auto) or libedit)') option('readline', type: 'combo', choices: ['auto', 'libreadline', 'libedit', 'none'], description: 'Using readline (auto) or libedit)')

View File

@@ -89,13 +89,11 @@ src/libnm-core-impl/nm-setting-cdma.c
src/libnm-core-impl/nm-setting-connection.c src/libnm-core-impl/nm-setting-connection.c
src/libnm-core-impl/nm-setting-dcb.c src/libnm-core-impl/nm-setting-dcb.c
src/libnm-core-impl/nm-setting-ethtool.c src/libnm-core-impl/nm-setting-ethtool.c
src/libnm-core-impl/nm-setting-generic.c
src/libnm-core-impl/nm-setting-gsm.c src/libnm-core-impl/nm-setting-gsm.c
src/libnm-core-impl/nm-setting-hsr.c src/libnm-core-impl/nm-setting-hsr.c
src/libnm-core-impl/nm-setting-infiniband.c src/libnm-core-impl/nm-setting-infiniband.c
src/libnm-core-impl/nm-setting-ip-config.c src/libnm-core-impl/nm-setting-ip-config.c
src/libnm-core-impl/nm-setting-ip-tunnel.c src/libnm-core-impl/nm-setting-ip-tunnel.c
src/libnm-core-impl/nm-setting-ipvlan.c
src/libnm-core-impl/nm-setting-ip4-config.c src/libnm-core-impl/nm-setting-ip4-config.c
src/libnm-core-impl/nm-setting-ip6-config.c src/libnm-core-impl/nm-setting-ip6-config.c
src/libnm-core-impl/nm-setting-loopback.c src/libnm-core-impl/nm-setting-loopback.c
@@ -149,7 +147,6 @@ src/libnmc-base/nm-secret-agent-simple.c
src/libnmc-base/nm-vpn-helpers.c src/libnmc-base/nm-vpn-helpers.c
src/libnmc-setting/nm-meta-setting-access.c src/libnmc-setting/nm-meta-setting-access.c
src/libnmc-setting/nm-meta-setting-desc.c src/libnmc-setting/nm-meta-setting-desc.c
src/libnmc-setting/nm-meta-setting-desc.h
src/libnmc-setting/settings-docs.h.in src/libnmc-setting/settings-docs.h.in
src/libnmt-newt/nmt-newt-utils.c src/libnmt-newt/nmt-newt-utils.c
src/nm-online/nm-online.c src/nm-online/nm-online.c
@@ -181,12 +178,10 @@ src/nmtui/nmt-page-infiniband.c
src/nmtui/nmt-page-ip-tunnel.c src/nmtui/nmt-page-ip-tunnel.c
src/nmtui/nmt-page-ip4.c src/nmtui/nmt-page-ip4.c
src/nmtui/nmt-page-ip6.c src/nmtui/nmt-page-ip6.c
src/nmtui/nmt-page-loopback.c
src/nmtui/nmt-page-macsec.c src/nmtui/nmt-page-macsec.c
src/nmtui/nmt-page-ppp.c src/nmtui/nmt-page-ppp.c
src/nmtui/nmt-page-team-port.c src/nmtui/nmt-page-team-port.c
src/nmtui/nmt-page-team.c src/nmtui/nmt-page-team.c
src/nmtui/nmt-page-veth.c
src/nmtui/nmt-page-vlan.c src/nmtui/nmt-page-vlan.c
src/nmtui/nmt-page-wifi.c src/nmtui/nmt-page-wifi.c
src/nmtui/nmt-page-wireguard.c src/nmtui/nmt-page-wireguard.c

View File

@@ -1,11 +1,20 @@
contrib/fedora/rpm/ contrib/fedora/rpm/
data/NetworkManager-dispatcher.service.in data/NetworkManager-dispatcher.service.in
data/NetworkManager-wait-online.service.in data/NetworkManager-wait-online.service.in
data/NetworkManager-wait-online-initrd.service.in
data/NetworkManager-initrd.service.in
data/NetworkManager.service.in data/NetworkManager.service.in
data/nm-priv-helper.service.in data/nm-priv-helper.service.in
data/org.freedesktop.NetworkManager.policy.in
examples/python/NetworkManager.py
examples/python/systray/eggtrayicon.c
src/contrib/nm-vpn-editor-plugin-call.h src/contrib/nm-vpn-editor-plugin-call.h
src/contrib/nm-vpn-plugin-utils.c src/contrib/nm-vpn-plugin-utils.c
src/libnm-systemd-shared/src/basic/parse-util.c
src/nm-cloud-setup/nm-cloud-setup.service.in src/nm-cloud-setup/nm-cloud-setup.service.in
vpn-daemons/openvpn
vpn-daemons/pptp
vpn-daemons/vpnc
# https://bugs.launchpad.net/intltool/+bug/1117944
sub/data/org.freedesktop.NetworkManager.policy.in
# from meson build directory:
build/data/org.freedesktop.NetworkManager.policy.in

View File

@@ -7801,7 +7801,7 @@ msgstr ""
#: src/libnmc-setting/settings-docs.h.in:190 #: src/libnmc-setting/settings-docs.h.in:190
msgid "" msgid ""
"Configure method for creating the IPv6 interface identifier of addresses with " "Configure method for creating the IPv6 interface identifer of addresses with "
"RFC4862 IPv6 Stateless Address Autoconfiguration and Link Local addresses. " "RFC4862 IPv6 Stateless Address Autoconfiguration and Link Local addresses. "
"The permitted values are: \"eui64\" (0), \"stable-privacy\" (1), " "The permitted values are: \"eui64\" (0), \"stable-privacy\" (1), "
"\"default\" (3) or \"default-or-eui64\" (2). If the property is set to " "\"default\" (3) or \"default-or-eui64\" (2). If the property is set to "

10934
po/de.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More