Commit graph

301 commits

Author SHA1 Message Date
Timothy Redaelli 9be0c3330d contrib/rpm: Use Open vSwitch instead of OpenVSwitch
The correct naming is Open vSwitch so use it instead of OpenVSwitch

[lkundrak@v3.sk: added some more cases of the same]

https://github.com/NetworkManager/NetworkManager/pull/150

Fixes: 830a5a14cb
2018-06-28 20:31:32 +02:00
Lubomir Rintel e1db543b5b contrib: add a serial modem emulator
Useful for quickly testing the ModemManager integration.
2018-06-18 16:05:29 +02:00
Thomas Haller ea23010baa contrib/rpm: fix dependency for /sbin/update-alternatives
Fixes: 28d2c07661
2018-06-11 22:07:35 +02:00
Lubomir Rintel 28d2c07661 rpm: install alternative implementations of ifup/ifdown
Unless the initscripts package too old to allow alternatives is present,
install nmcli as an alternative implementation of ifup and ifdown.

The triggerin scriptlet allow us to do the right thing regardless of
which initscripts version is installed or even when it's upgraded.

The initscripts patch was included in Fedora 29:
https://github.com/fedora-sysv/initscripts/pull/197
2018-06-11 15:09:42 +02:00
Lubomir Rintel c28b334fdd rpm/build.sh: suggest dnf builddep after BUILDTYPE=SRPM
Convenient for copy & paste.
2018-05-28 11:44:02 +02:00
Lubomir Rintel de326a4e8a rpm: prefer python3
From Fedora 28 on we can build without Python 2. That is good,
because it's eventually going to be removed.

Based on a change in Fedora dist-git by Iryna Shcherbina.
2018-05-28 11:44:02 +02:00
Thomas Haller ebd61e1bc1 contrib/rpm: use gnutls crypto library instead of NSS on rhel-8 and fedora-29
https://bugzilla.redhat.com/show_bug.cgi?id=1581693
2018-05-24 11:36:00 +02:00
Lubomir Rintel 320422e4cf build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.

The VPN plugins are kept where they always have been -- the path is not
qualified with a version number.
2018-05-14 16:05:12 +02:00
Lubomir Rintel bade13129b contrib/rpm: optionally depend on iwd
When built with iwd support, add an option to use iwd in place of
wpa_supplicant.

The "boolean dependencies" are only supported since RPM 4.13, with older
versions just keep things the way they were before.
2018-05-14 15:36:56 +02:00
Lubomir Rintel 62363ebc8f Revert "build: qualify plugin dir name with a version string"
This is broken -- looks for VPN plugins in a version-qualified path,
which is wrong and break installed VPN plugins.

This reverts commit 6384ad4ee1.
2018-05-11 10:41:50 +02:00
Lubomir Rintel 6384ad4ee1 build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.
2018-05-09 12:59:39 +02:00
Thomas Haller 45fe57aea4 contrib/rpm: build config-connectivity-fedora package conditionally
On RHEL, we don't have NetworkManager-config-connectivity-fedora package.
Hence, the spec files for RHEL differ from upstream in this regard.

The aim is that contrib/rpm's spec file can be used almost as-is for
RHEL, Fedora and possibly other distros. Hence, build the subpackage
conditionally to minimize the difference.
2018-04-23 18:40:47 +02:00
Thomas Haller a187585222 contrib/nm-live-vm: remove nm-live-vm scripts
They were not (notably) touched in more than 3 years.
I doubt anybody is using them.

Also, nowadays we have contrib/rpm to build NetworkManager
packages for Fedora/RPM. We have copr, we have automated CI
in CentOS CI and beaker.

Also, nowadays it should be easy to spawn a a fedora image
in a container or tools like vagrant.

I think there are better alternatives. Drop the scripts.
2018-03-27 11:13:41 +02:00
Thomas Haller 3fab322a20 netlink: drop libnl3 dependency
From libnl3, we only used the helper function to parse/generate netlink
messages and the socket functions to send/receive messages. We don't
need an external dependency to do that, it is simple enough.

Drop the libnl3 dependency, and replace all missing code by directly
copying it from libnl3 sources. At this point, I mostly tried to
import the required bits to make it working with few modifications.

Note that this increases the binary size of NetworkManager by 4736 bytes
for contrib/rpm build on x86_64. In the future, we can simplify the code
further.

A few modifications from libnl3 are:

- netlink errors NLE_* are now in the domain or regular errno.
  The distinction of having to bother with two kinds of error
  number domains was annoying.

- parts of the callback handling is copied partially and unused parts
  are dropped. Especially, the verbose/debug handlers are not used.
  In following commits, the callback handling will be significantly
  simplified.

- the complex handling of seleting ports was simplified. We now always
  let kernel choose the right port automatically.
2018-02-21 12:08:46 +01:00
Thomas Haller 997cce7c90 build: fix glib dependency to require at least 2.40
Fixes: 8a46b25cfa
2018-02-16 13:26:07 +01:00
Beniamino Galvani f548806213 rpm: update sanitizer build flags
Disable undefined sanitizer on RHEL since it's not supported. Also,
enable address sanitizer only for executables, as having it enabled in
libraries causes problems when applications built without asan load
them.
2018-02-15 15:34:03 +01:00
Beniamino Galvani 0fb7989092 rpm: add requirements for sanitizer builds 2018-02-15 15:34:03 +01:00
Thomas Haller 3d41812945 contrib: add -h option to NM-log
Pass "-h" to highlight individual words.
"-h" stands for "highlight".

  $ NM-log -h wlan0 j
2018-02-12 13:06:49 +01:00
Thomas Haller 86a18b2df2 contrib/rpm: make "snapshot" for package version configurable via script
Will be used by CI trigger to name packages that are build during testing
of a github pull request with the corresponding pull request ID.

"build_clean.sh" now supports a command line option -s|--snapshot. But the
same paramter can also be set via $NM_BUILD_SNAPSHOT environment
variable. Using the environment variable is useful to support older versions
and new versions of "build_clean.sh", so that the script can just ignore the
snapshot setting if it doesn't understand it yet.
2018-02-09 17:35:19 +01:00
Lubomir Rintel f7b5e48cdb contrib/rpm: don't force fatal warnings with tests
It just doesn't make sense and just breaks stuff when nobody asked for
it.
2018-02-08 17:11:46 +01:00
Lubomir Rintel c4c8ffd113 contrib/rpm: build verbosely
The RPM build should be not use silent output -- it better be possible
to check whether the correct compiler flags were present at the build
time.
2018-02-08 17:11:46 +01:00
Thomas Haller 28da0154fc all: drop trailing spaces 2018-02-07 13:32:04 +01:00
Lubomir Rintel 8ba46ff4c6 rpm: disable libnm-glib for Fedora 29 and RHEL 8
While at it, move the API documentation to libnm-devel.
There doesn't seem to be a better place for it.
2018-01-16 12:15:51 +01:00
Thomas Haller 02a26de6f8 contrib/rpm: conditionally enable iwd Wi-Fi plugin 2017-12-27 09:18:54 +01:00
Thomas Haller 0474441e22 settings: drop unmaintained ifnet settings plugin of Gentoo
Even Gentoo disables this plugin since before 0.9.8 release
of NetworkManager. Time to say goodbye.

If somebody happens to show up to maintain it, we may resurrect it
later.

If "$distro_plugins=ifnet" was set, configure.ac would use that
to autodetect --with-hostname-persist=gentoo. Replace that autodetect
part by checking for /etc/gentoo-release file.
2017-12-21 10:50:33 +01:00
Thomas Haller 7573594a21 platform: merge nm_platform_*_delete() delete functions
It only makes sense to call delete() with NMPObjects that
we obtained from the platform cache. Otherwise, if we didn't
get it from the cache in the first place, we wouldn't know
what to delete.

Hence, the input argument is (almost) always an NMPObject
in the first place. That is different from add(), where
we might create a new specific NMPlatform* instance on the
stack. For add() it makes slightly more sense to have different
functions depending on the type. For delete(), it doesn't.
2017-12-11 10:30:26 +01:00
Thomas Haller b1c65d32fe Revert "Makefile: rework team compilation flags"
I don't think we should do this.

- renamining/dropping configure options is still an annoyance,
  because it requires to different ./configure options depending
  on the version. The rename from --enable-teamctl to --enable-team
  might be theoretically nice, but more annoying then helpful.

- There is no strict dependency between --enable-team and
  --enable-json-validation. At most, one could argue that
  when enabling the team plugin (--enable-teamctl), then
  libnm must also be build with --enable-json-validation.
  But in fact, the team plugin will happily work with a
  libnm that doesn't link against libjansson.
  That is --enable-teamctl --disable-json-validation will work
  in practice just fine.
  On the other hand, libnm is a client library to create connection
  profiles, fully supporting team profiles also makes sense if the
  actual plugin is not installed (or build). Thus, --disable-teamctl
  --enable-json-validation certainly makes sense.

At this point, one might ask whether libnm is even still complete without
libjansson. Maybe libnm should *require* --enable-json-validation.
But that is not what the patch was doing, and it would also need
some careful consideration before doing so.

This reverts commit 9d5cd7eae8.
2017-12-08 09:07:30 +01:00
Francesco Giudici 9d5cd7eae8 Makefile: rework team compilation flags
Rename the team functionality enablement from 'teamdctl' to 'team'.
Force jansson lib requirement for team functionality: NetworkManager
requires the teamd daemon to manage team. As teamd depends upon jansson
lib, adding jansson requirement for teaming support in NetworkManager
seems reasonable.
Remove the jansson_validation flag, as the only generic json function in
nmcli (not related to team) was the one to check if a string was in json
format. Anyway, that function is used for team checks only. So, move
also json validation functions under the WITH_TEAM flag.
2017-12-08 00:46:27 +01:00
Thomas Haller 8649fcf02a contrib: use less in NM-log to pre-process input
GNU less supports filters. That makes it nice to use instead of cat.
Also, less is well suited for output to a pipe.

With this, `NM-log nm-log.txt.gz` works as you would expect
2017-11-21 15:14:32 +01:00
Beniamino Galvani efe815737b contrib/rpm: fix builds without ovs support
Don't compile ovs support when the RPM is built --without=ovs, to fix
the following error:

error: Installed (but unpackaged) file(s) found:
   /usr/lib/systemd/system/NetworkManager.service.d/NetworkManager-ovs.conf
   /usr/lib64/NetworkManager/libnm-device-plugin-ovs.so
   /usr/share/man/man7/nm-openvswitch.7.gz

Fixes: 830a5a14cb
2017-11-02 11:54:18 +01:00
Lubomir Rintel 6b532fed50 man: add OpenVSwitch overview 2017-10-30 21:46:55 +01:00
Lubomir Rintel 830a5a14cb device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
Murilo Opsfelder Araujo fa61e78d80 contrib/fedora: Add mockbuild.sh
This script comes handy to build from git tree without having to
install build dependencies on the system, the actual build happens
inside mock environment.

https://github.com/NetworkManager/NetworkManager/pull/34
2017-10-30 11:04:20 +01:00
juga0 3aba3e38c3 dhcp: add support for dhcpcanon client
https://github.com/NetworkManager/NetworkManager/pull/31
2017-10-30 10:43:10 +01:00
Murilo Opsfelder Araujo 301cf7151b contrib/fedora: Update required packages
Add dhclient and iptables packages to build dependencies to satisfy
rpmbuild complaints:

```
error: Failed build dependencies:
	dhclient is needed by NetworkManager-1:1.9.2-18653.43dba57439.fc28.x86_64
	iptables is needed by NetworkManager-1:1.9.2-18653.43dba57439.fc28.x86_64
ERROR: rpmbuild FAILED
```

https://github.com/NetworkManager/NetworkManager/pull/33
2017-10-25 18:08:34 +02:00
Thomas Haller 5a00811b5a contrib/rpm: explicitly set default dhcp configuration
It will also be autodetected, but be explicit about it.
2017-10-12 11:06:30 +02:00
Thomas Haller 102a58bb62 contrib/scripts: fix coloring for platform messages in NM-log for old logs
Older logfiles contain

  platform: route: adding or updating IPv4 route: 10.1.0

Hightlight that too.
2017-10-03 15:35:56 +02:00
Thomas Haller 513d0c2286 contrib/rpm: enable "NetworkManager-wait-online.service" on package upgrade
Since commit d61eaf2545 ("service: don't
install dependency for "NetworkManager-wait-online.service" to
"network-online.target.wants") we no longer install NM-w-o.service
in "network-online.target.wants" directory.

Obviously, for previous RPM versions NM-w-o.service was always enabled.
For current versions, it depends now on the preset. Most importantly,
this allows the user to disable the service, without masking it.
Previously NM-w-o.service was always implicitly enabled.

But presets are not applied during package upgrade, so it means that
after upgrade the service will be disabled. Hack around that via an RPM
scriptlet.

https://bugzilla.redhat.com/show_bug.cgi?id=1455704
2017-09-27 18:02:51 +02:00
Thomas Haller 18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller 9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller 85e3f956ad contrib/rpm: update spec file with upstream source URL
This isn't useful for contrib/fedora/rpm itself because here
the __SOURCE__ gets set by the build scripts.

But this spec file is copied to Fedora downstream where the
SOURCE URL is used.
2017-09-20 14:29:53 +02:00
Thomas Haller 7d00a96d23 contrib/rpm: allow building RPM without fatal warnings
A newer compiler version might emit some warnings and break the build
of the RPM. Of course, such warnings must be fixed. But it is still very
inconvenient to break the build of an old RPM version without easy workaround.

When building without "test" (which is on by default), don't use fatal warnings
for compilation.
2017-09-11 14:22:10 +02:00
Thomas Haller 66a09b2192 contrib/NM-log: don't use exec in bash functions
When sourcing the file, using exec inside NM-show-journal is a bad idea,
because it replaces the calling shell.
2017-09-08 17:18:32 +02:00
Thomas Haller d4a5e2b1c8 contrib/NM-log: don't run less with --quit-on-intr argument
I find it annoying when ^C exits less and it prompts me to often
do `NM-log | less -R` instead.
2017-09-07 14:45:26 +02:00
Thomas Haller 83e2764050 contrib/NM-log: colorize warnings and errors in red (fix)
Must not colorize the trailing space, otherwise the following
" device" will no longer match.
2017-09-07 14:29:11 +02:00
Thomas Haller b20fc58b3c contrib/NM-log: colorize warnings and errors in red
- remove "\r\n" line endings
- colorize <warn> and <error> in red
- extend matching the info levels to include the timestamp. This
  (intentionally) will no longer highlight messages from ModemManager,
  which don't include a timestamp.
2017-09-07 14:24:56 +02:00
Thomas Haller cffde0101e contrib/NM-log: improve script and make it sourceable
- use "grep -a" so that grep doesn't refuse to work in binary input.
- make the script source-able to only define the NM-colorize and
  NM-show-journal
- In case the script is sourced, it also defines a NM-log function,
  which does the same as the script itself.
- rename internal functions so that they have names starting with "NM"
  in case of sourcing.
2017-09-07 14:04:13 +02:00
Thomas Haller 1fbd8c079c contrib/scripts: add NM-log helper
To pretty print and colorize NetworkManager logfiles.
2017-08-24 18:40:49 +02:00
Thomas Haller c528a89519 contrib/rpm: skip tests for -Q build option
Previously, the --quick option only mattered when creating
the source tarball, to run `make dist` instead of the slower
`make distcheck`.

Extend its meaning to also skip unit tests while building the RPM.
You still can enable them with

  $ ./contrib/fedora/rpm/build_clean.sh -Q -w test
2017-07-25 06:18:36 +02:00
Lubomir Rintel 1ac92ac355 contrib/rpm: provide NetworkManager-devel
The package no longer exists.

Fixes: 03586743f0
2017-07-21 17:30:49 +02:00