Commit Graph

322 Commits

Author SHA1 Message Date
Thomas Haller
c25d54d0fd contrib/rpm: fix invalid %if condition for building on RHEL
Fixes: 5ef81dc0fb
2018-09-04 09:54:42 +02:00
Thomas Haller
5ef81dc0fb contrib/rpm: change default DHCP plugin to internal
... but keep "dhclient" on Fedora and RHEL <= 7.

https://bugzilla.redhat.com/show_bug.cgi?id=1571655
2018-09-03 21:23:47 +02:00
Lubomir Rintel
d70185ddf1 all: point git references to the GitLab instance
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/2
2018-08-27 11:36:56 +02:00
Thomas Haller
cf02b9c5df checkpatch.pl: complain about space in elvis operator ?: 2018-08-09 17:07:23 +02:00
Thomas Haller
c8f2384210 contrib/rpm: enable connectivity_redhat only from rhel-8 onwards
There is no consensus, that this should be enabled on rhel-7 (yet).
2018-08-03 11:30:32 +02:00
Thomas Haller
e028a53612 contrib/rpm: use %autosetup to simplify patch application
This allows us to omit the %patch1 macros.

See-also: http://rpm.org/user_doc/autosetup.html
2018-08-03 11:08:47 +02:00
Lubomir Rintel
0413704470 rpm: own /etc/sysconfig/network-scripts
We don't rely on initscripts. If they're gone, we still use the
directory.
2018-07-24 19:10:15 +02:00
Lubomir Rintel
c40dbeb49a contrib/rpm: add RHEL connectivity checking package
https://github.com/NetworkManager/NetworkManager/pull/166
2018-07-23 12:30:25 +02:00
Lubomir Rintel
3f449654f7 contrib/rpm: use whitespace consistently
Double newline is used to visually separate sections.
2018-07-23 12:30:20 +02:00
Thomas Haller
3992856964 contrib/rpm: reorder BuildRequires in spec file
Move the BuildRequires related to basic C build environment to the
beginning. Also, avoid specifying multiple packages in one line.
2018-07-17 17:42:24 +02:00
Thomas Haller
e2f106354e contrib/rpm: add BuildRequires to gcc compiler for NetworkManager.spec
Fedora is removing gcc from the default build-root [1], hence
require it.

Actually, we already have a "BuildRequires: libtool", which has a
dependancy on gcc and we already got it implicitly. Just make it
explicit.

[1] https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-17 17:42:24 +02:00
Javier Arteaga
6c3174f6e0 checkpatch: fix perldoc heading
The script does not actually emulate a serial modem (yet).

https://github.com/NetworkManager/NetworkManager/pull/165
2018-07-12 07:40:02 +02:00
Lubomir Rintel
7e98b4cad2 checkpatch: skip foreign code 2018-07-11 12:02:06 +02:00
Lubomir Rintel
2b152a69c4 checkpatch: add a licensing hint 2018-07-11 12:02:06 +02:00
Lubomir Rintel
26910ebdd7 checkpatch: reset line counter on next file 2018-07-11 12:02:06 +02:00
Thomas Haller
24082ad09e checkpatch: check against using "unsigned int" and "$INT_TYPE unsigned|signed"
Don't use the integer type before signed/unsigned, but the
other way around. That is,

    unsigned long var;

instead of

    long unsigned var;

Also, just use "unsigned" instead of "unsigned int".
2018-07-11 12:02:06 +02:00
Thomas Haller
a9d81031f4 checkpatch: skip over generated files from glib-mkenums 2018-07-11 12:02:06 +02:00
Thomas Haller
2d28d5d5d4 checkpatch: warn about non-leading tabs
Tabs are not only wrong after a space, they are always
wrong if they don't appear at the beginning of a line.
That would happen usually, when trying to align multiple
lines like

  enum {
      VALUE1		= 1;
      OTHER_VALUE	= 2;
  };

When doing that, the alignment will only be correct, if the
reader later uses the same tab-width. Note that in NetworkManager
we recommend the tab-width to be 4 characters, but with our "smart
tab" indentation style, it wouldn't actually matter and the reader
is free to choose any other tab-width -- as long as we don't use
non-leading tabs.

Don't allow non-leading tabs.
2018-07-11 12:02:06 +02:00
Thomas Haller
e82e2ca730 checkpatch: warn about using glib typedefs like gchar or gint
We should not use glib typedefs for basic C types char, short, int,
long, float or double. We commonly do not use them, so enforce
consistency.

That is not true for typedefs like guint, which we commonly use
because it's shorter typing than "unsigned int" (or "int unsigned"
or "unsigned"). Whether or not to use guint is left undecided at this
point.
2018-07-11 12:02:06 +02:00
Lubomir Rintel
c866df7997 contrib/checkpatch: print the actual source name instead of patch name
This gives more relevant output in a commit check.

Include a couple of small fixes trivial enough not to deserve a separate
commit.
2018-07-10 13:32:04 +02:00
Lubomir Rintel
0f3f56695a contrib: add checkpatch.pl
A naive code compliance checker. Invoke directly:

  contrib/scripts/checkpatch.pl 0001-switch-comments-to-klingon.patch
  contrib/scripts/checkpatch.pl hello.[ch] world.c

Use from a commit hook:

  echo 'git format-patch --stdout -1 |contrib/scripts/checkpatch.pl || :>' \
      >.git/hooks/post-commit

Or view the documentation with "perldoc contrib/scripts/checkpatch.pl"
2018-07-10 12:41:37 +02:00
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