Commit Graph

809 Commits

Author SHA1 Message Date
Thomas Haller
439ddc5101 contrib/rpm: rename section in "22-wifi-mac-addr.conf"
For [connection*] and [device*] sections, any suffix is allowed in
the group.

However (at least for configuration snippets we ship upstream), we
want to give a suffix that matches the name of the configuration
snippet.

It seems more common to use [connection-*] instead of [connection.].
See also "examples/nm-conf.d/*.conf" and "15-carrier-timeout.conf" file
which contains a [device-15-carrier-timeout] section.

Note that this file (in Fedora) is not configuration (installed in
/usr/lib). It is thus not problematic to modify.

Fixes: ea8dbd7a6d ('contrib/rpm: add "22-wifi-mac-addr.conf" to F40+')
2024-06-19 11:02:55 +00:00
Stanislas FAYE
10d4557720 Make team obsoletes in rhel-10 only if NM-team is not enabled in the rpm 2024-05-31 11:33:58 +00:00
Stanislas FAYE
3f3472c971 Use the versions number from which packages are obsoleted directly instead of using global variables 2024-05-31 11:33:58 +00:00
Stanislas FAYE
613f16de51 rpm: Disable team and ifcfg-rh only in rhel distros and rhel-10+
Resolves: https://issues.redhat.com/browse/RHEL-32948
2024-05-31 11:33:58 +00:00
Íñigo Huguet
714d02697f contrib: configure-for-system: use meson by default
With the deprecation of autotools, use meson by default. For the moment,
it's still possible to build with autotools passing -a/--autotools.

Additionally, as we allow to specify different build directories other
than './build', let's not asume that the user wants to overwrite it
by default. Instead, the script will asume ./build if the user doesn't
specify the build directory, but only if it doesn't exist. If it does,
the user will have to force overwritting it with `--meson ./build`.
2024-05-31 07:08:22 +00:00
Íñigo Huguet
a07627fdcc contrib: configure-for-system: specify meson build dir
Instead of forcing to use ./build directory, let's make the the user
specify what directory he wants to use. This will allow to have multiple
build directories with different configurations as meson is designed to
allow, without having to overwrite the existing build one.
2024-05-31 07:08:22 +00:00
Íñigo Huguet
8eb00c0991 release.sh: stop doing "-dev" releases on stable branches
Note: here I refer to the numbers in a version as MAJOR.MINOR.MICRO.

Having stable and development releases do make sense for the MINOR
version, because we maintain separate branches for them and they
evolve separately. We have 1.47.z where we put all the changes so
anyone can pick the latest development release and test it. At the
same time, we have 1.46.z with the latest stable released version.

However, it does not make sense to have 1.46.2 and 1.46.3-dev because
the latter is not a development version. It is identical to 1.46.2,
only the version number has been bumped, there are no changes to test.
When we add commits, we will be actually testing 1.46.3-dev + some
commits, which is exactly the same as testing 1.46.2 + some commits.

So, basically, someone can use the releases of a development BRANCH,
like 1.47.4, to test the development version of NM. But using a
development MICRO version is exactly the same as using a
non-development one.

From now on, we will just increment the MICRO version each time we do a
release on a stable branch and won't create the '-dev' tag. Update
release.sh to do it this way.
2024-05-29 08:44:02 +02:00
Jan Vaclav
5f72b251b1 gitlab-ci: ignore autotools deprecation
We still need the tests to run on autotools builds too, so we must pass the argument.
2024-05-06 17:22:20 +02:00
Jan Vaclav
7b4acf938c contrib/fedora: update scripts to expect autotools deprecation 2024-05-06 16:39:08 +02:00
Jan Vaclav
d115dcec50 build: break autotools configuration to warn about deprecation
We are planning on completely dropping Autotools in the future.
This breaks the build process with an argument to ignore the deprecation,
so that anyone building NM is warned of this change.
2024-05-06 15:25:50 +02:00
Jan Vaclav
5fae0403b8 contrib/rpm: use meson by default for builds on RHEL10
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on RHEL 10.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1929
2024-05-06 08:13:44 +00:00
Fernando Fernandez Mancera
e1a0323fdd release.sh: adjust build path to meson-dist 2024-05-03 18:05:54 +02:00
Jan Vaclav
069d854f8c merge: branch 'jv/meson-build-default'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1912
2024-04-24 15:12:44 +02:00
Beniamino Galvani
e79e1d637e rpm: disable ifcfg-rh in future versions of RHEL 2024-04-24 09:52:55 +02:00
Beniamino Galvani
bc73478a49 rpm: disable team support in future versions of RHEL 2024-04-24 09:52:55 +02:00
Jan Vaclav
38c799d883 contrib/rpm: use meson by default for builds on rawhide
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on Rawhide.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1905
2024-04-18 13:31:50 +00:00
Jan Vaclav
095e2ab573 contrib/fedora: use meson to build by default from build_clean.sh 2024-04-03 16:02:06 +02:00
Jan Vaclav
61f0531509 gitlab-ci: test re-buildability of distribution tarballs
Adds tests for making a distribution tarball, and then attempting to build NM from its contents.
Files have been left out from the distribution in the past by accident (e.g. 75027879, b2931c96)
and hopefully this test will catch this type of errors.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1862
2024-03-01 07:51:21 +00:00
Thomas Haller
06e039b18a
contrib: pass "--noclean" to rpmbuild in "makerepo.sh"
Recent rpmbuild will delete the source directory on successful build.
With `makerepo.sh` that is bad, because we want that directory with the
git history. Pass "--noclean" to avoid that.
2024-02-20 08:41:47 +01:00
Thomas Haller
cc7295698e
contrib: add "ulogd" to makerepo.sh script 2024-02-19 17:38:30 +01:00
Thomas Haller
70ced147b1
contrib: add "libnetfilter_log" to makerepo.sh script 2024-02-19 11:47:09 +01:00
Jan Vaclav
43c3409081 contrib: add jq to REQUIRED_PACKAGES
jq is used in contrib/fedora/rpm/release.sh and now
also build_clean.sh, so it should probably be added
to REQUIRED_PACKAGES.
2024-01-29 13:21:16 +00:00
Jan Vaclav
95f7c8e128 contrib/fedora: add --meson option to build_clean
This allows the script user to complete the entire build only using meson instead of autotools.
2024-01-29 13:21:16 +00:00
Íñigo Huguet
69ceee1a0b contrib: new script to anonymize logs
Script to do some anonymization to NetworkManager logs. It does
very basic stuff so it shouldn't be trusted without manually
reviewing the logs, but it can still be useful to replace lot
of potentially sensitive data.

What it masks by default:
- MAC addresses
- Public IP addresses
- Hostnames detected from `hostname` command and some known
  log messages from NM.
- Hostnames ending in some common domains such as .com or .org
- Hostnames specified via --hostname argument

What it can mask but it doesn't by default:
- Private IPs

Options like --show-macs and --hide-private-ips can override the default
behaviour.

Note that masking IP addresses can make difficult to analyze routing
problems, and trying to be smart analyzing the defined routes from the
logs or from `ip route` can lead to even worse results. Because of this,
if routing problems need to be analyzed, --show-public-ips need to be
passed.
2023-11-24 07:40:08 +00:00
Thomas Haller
a6e085b3e8
clang-format: rework "nm-code-format-container.sh" script
Instead of doing the broken `podman run` and `podman start` approach,
build an image ("nm-code-format:f38"), cache it, and use it to run
"nm-code-format.sh" via `podman run`. We should build and keep a
container image, not a container.

The benefit is that this allows to hand over the command line arguments
to "nm-code-format.sh". In particular the "-u" and "-F" options, which
are life savers.

This means,

  $ contrib/scripts/nm-code-format-container.sh -u

works.

Try also

  $ contrib/scripts/nm-code-format-container.sh -h

which tells you that you are running inside the container, and how to
delete/renew the container image.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1798
2023-11-22 13:25:04 +01:00
Fernando Fernandez Mancera
084beb0818 contrib/rpm: fix reference to "22-wifi-mac-addr.conf" 2023-11-21 13:03:24 +01:00
Thomas Haller
1d241f5295
contrib: fix invalid escape sequence in "find-backports"
Fixes: 57cfa5daf9 ('contrib: add "find-backports" script')
2023-11-20 17:14:47 +01:00
Thomas Haller
ea8dbd7a6d
contrib/rpm: add "22-wifi-mac-addr.conf" to F40+
Install a configuration snippet on Fedora 40+, that sets the default for
"wifi.cloned-mac-address" to "stable-ssid" (otherwise, the built-in default
is "preserve").

This will mean, that on Wi-Fi profiles that don't explicitly override
the property "wifi.cloned-mac-address", a stable address is generated.
The benefit is, that Fedora will randomize the MAC address by default.

Note that this also affects all pre-existing Wi-Fi profiles, that don't
explicitly configure the property in the profile. Depending on how you
see it, this is desirable. Randomization should be done, unless the user
opts-out (not the other way around).

Note that setting "wifi.cloned-mac-address=stable-ssid" is similar to
setting a stable ID "${NETWORK_SSID}" and "wifi.cloned-mac-address=stable".
The difference is that the latter also affects other properties, like

  - "ipv6.addr-gen-mode=stable-privacy"
  - "{ethernet,wifi}.cloned-mac-address=stable"
  - "ipv4.dhcp-client-id=stable"
  - "ipv6.dhcp-duid=stable-{llt,ll,uuid}"
  - "{ipv4,ipv6}.iaid=stable"

Especially with "ipv6.addr-gen-mode=stable", changing the stable ID
would mean that also all IPv6 addresses change. We want to avoid that by
only changing the cloned-mac-address to "stable-ssid".

This means, after upgrade to F40, different MAC addresses will be used
on most users' Wi-Fi. This means, DHCP might hand out different IP
addresses, sessions might expire, and configuration that depended on the
previous MAC address will be affected.

https://pagure.io/fedora-workstation/issue/350
2023-11-17 12:48:37 +01:00
Thomas Haller
eb5b78c4bf
all: drop support for building with Python2
Now that we no longer test on CentOS7, we also have no more tests that
build using Python2.

Note that build with Python2 is currently broken already (which would be
fixable).

Drop Python2 too.

Existing Python scripts still use a common subset of Python2 and
Python3. They can be improved to use Python3 features in the future.
2023-11-14 10:29:48 +01:00
Íñigo Huguet
1560052dcc contrib/rpm: libnm: migrate to SPDX license
The license identifier was updated for the main package, but not for
libnm which overrides it to LGPL 2.1 or later. Update it too.

Fixes: 8c5aec7a1b ('contrib/rpm: migrate to SPDX license')
2023-11-07 07:20:04 +00:00
Íñigo Huguet
72b2485042 spec: Add missing epoch to some obsoleted versions
An rpm linter has complained with:
Missing epoch prefix on the version-release in 'Obsoletes: NetworkManager < 1.0.0' for NetworkManager-team
2023-10-25 10:20:03 +00:00
Beniamino Galvani
cb4c8c2147 contrib/rpm: add note about interface renaming with ifcfg vs keyfile 2023-10-03 14:09:21 +02:00
Beniamino Galvani
c3ca0b90cd contrib/rpm: ship a different readme when ifcfg migration is enabled
Ship a different file in /etc/sysconfig/network-scripts to warn that
migration is enabled.
2023-10-03 14:09:21 +02:00
Íñigo Huguet
510952b036 contrib: add libpsl-dev to debian requirements
It's installed for Fedora and Alpine, and building with meson requires
it by default.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1723
2023-09-13 16:29:01 +02:00
Beniamino Galvani
995539cd30 contrib/rpm: enable ifcfg migration on Fedora 39+
https://fedoraproject.org/wiki/Changes/MigrateIfcfgToKeyfile
2023-08-10 13:21:49 +02:00
Thomas Haller
514e944da3
contrib: add "cloud-init", "firewalld", "nftables" to makerepo.sh script 2023-07-14 09:40:26 +02:00
Thomas Haller
f08102bf41
contrib: autodetect the Fedora version for "nm-code-format-container.sh" script
From time to time we bump the used clang-format (and Fedora) version.
Previously, we had to change more than one places.

Instead, let the "nm-code-format-container.sh" parse it from ".gitlab-ci/config.yml".
2023-06-27 15:19:01 +02:00
Miroslav Suchy
8c5aec7a1b
contrib/rpm: migrate to SPDX license
Fedora is moving to SPDX standard in naming a licenses.
See https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 .

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1668
2023-06-23 10:14:56 +02:00
Thomas Haller
dd561875dc
contrib/rpm: update RPM description for NetworkManager-cloud-setup package
https://bugzilla.redhat.com/show_bug.cgi?id=2214491
2023-06-13 09:34:36 +02:00
Wen Liang
f04a9eb098 cloud-setup: add pre-up event to prevent reaching network-online.target
network-online.target should not be reached before nm-cloud-setup
completes configuring the network, which may make user service get
started before the network is fully configured.

Setting nm-cloud-setup.service as "Before=network-online.target" would
maybe have already achieved that. However, also use a pre-up dispatcher
script, so that the device activation in NetworkManager is also waiting
for nm-cloud-setup to complete.

https://bugzilla.redhat.com/show_bug.cgi?id=2151040
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1653
2023-06-09 09:18:20 -04:00
Thomas Haller
9ede7e04b1
contrib: extend usage for "contrib/scripts/nm-setup-git.sh" script 2023-06-06 15:00:23 +02:00
Thomas Haller
e75deb8c94
contrib/copr: update URL in "nm-copr-build.sh" to new nm-git-bundle 2023-06-06 14:53:37 +02:00
Thomas Haller
a8b2997fa5
contrib/copr: improve readme in copr scripts (2) 2023-06-06 12:21:30 +02:00
Thomas Haller
fd6fcf335c
contrib/copr: improve readme in copr scripts 2023-06-06 12:20:29 +02:00
Thomas Haller
fe95e07fef
contrib: fix fedora/REQUIRED_PACKAGES for {lib,}vala-devel
Originally, the package was called vala-devel (it still is on CentOS7).
Then it was renamed to libvala-devel, but keeping a Provides.

On Fedora 39, the Provides was dropped. Workaround.
2023-05-19 12:49:23 +02:00
Thomas Haller
c275d24637
clang-format: reformat code with clang-format 16.0.2-1.fc38
This is the version shipped in Fedora 38. As Fedora 38 is now out, the
core developers switch to it. Our gitlab-ci will also use that as base
image for the check-{patch.tree} tests and to generate the pages. There
is a need that everybody agrees on which clang-format version to use,
and that version should be the one of the currently used Fedora release.

Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh"
script.

The gitlab-ci still needs update in the following commit. This change
in isolation will break the "check-tree" test.
2023-05-19 10:53:13 +02:00
Thomas Haller
e37a15acad
all: avoid "==" bashism in scripts 2023-05-18 09:16:41 +02:00
Beniamino Galvani
c67d65f733 rpm: fix detection of ppp version for ppp >= 2.5.0
In ppp 2.5.0 the "patchlevel.h" header file was removed and pkg-config
must be used. Update the detection command to support both ways.
2023-04-20 11:55:49 +02:00
Thomas Haller
cae2011b08
contrib: show clang-format version in failure message
The actual formatting depends on the version of clang-format. Print the
used version, which is in particular interesting when we get an error in
our gitlab-ci check (which uses the correct version).
2023-04-18 19:05:02 +02:00
Thomas Haller
229163202d
release.sh: adjust check for gitlab-ci for changes in pipeline
- We need to fetch more entries per page. 100 is the maximum without
  pagination, but that is enough for us.

- Previously, we checked all stages. Now, let's skip the "prep" and "tier3" stages.
  This change should work both with old and new pipelines.
2023-04-13 13:18:27 +02:00