Commit graph

490 commits

Author SHA1 Message Date
Thomas Haller 2c12786e3d
contrib/rpm: enable LTO by default on RHEL-9 and newer 2020-08-18 23:00:20 +02:00
Thomas Haller 839ba57c7f
contrib/rpm: enable LTO by default on Fedora 33
With Fedora 33, LTO will be enabled by default via CFLAGS in
redhat-rpm-config ([1]).

That basically sets "CFLAGS=-flto -ffat-lto-objects".

Note that we have our own configure/meson option to enable LTO.
With "--with-lto" we set CFLAGS="-flto -flto-partition=none". This
is necessary due ([2], [3]).

So, disable Fedora's automatism, but turn on the suitable configure
option to get working LTO.

[1] 5baaf4a99c?branch=master
[2] e6cf4213a7 ('build: fix building with LTO')
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28
2020-08-17 15:20:08 +02:00
Thomas Haller 67cc4544f7
scripts: use "/bin/cat" in NM-log
Ubuntu 16.04 doesn't have merged /usr directories and cat is in
/bin/cat.
2020-08-17 10:58:19 +02:00
Thomas Haller 6c6a00eae5
contrib: use new "find-backports" script in "release.sh" 2020-08-05 00:24:40 +02:00
Thomas Haller 3e475e5cd1
contrib/rpm: prefer keyfile settings plugin from Fedora 33 and newer
This change is for Fedora 33 and newer. For now, also enable it for RHEL
9 and newer, but it must still be decided whether that will be done
there as well.

https://mail.gnome.org/archives/networkmanager-list/2020-May/msg00002.html
https://fedoraproject.org/wiki/Changes/NetworkManager_keyfile_instead_of_ifcfg_rh
https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/OLOU27DAON2TYGTAVZ35GZE2BEIN42U3/
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/OLOU27DAON2TYGTAVZ35GZE2BEIN42U3/
https://pagure.io/fesco/issue/2432

https://bugzilla.redhat.com/show_bug.cgi?id=1857391
2020-07-16 12:28:03 +02:00
Thomas Haller aa4cb0e5eb
contrib: improve code comments to release.sh scripts 2020-07-13 23:54:34 +02:00
Thomas Haller 5542275672
contrib: add "major-post" step for release.sh script 2020-07-13 23:28:05 +02:00
Thomas Haller c3b04c4fd9
contrib: support "major" release in release.sh script 2020-07-13 18:05:32 +02:00
Thomas Haller ae626ade0f
contrib: consistency check meson.build in release script 2020-06-30 13:57:15 +02:00
Thomas Haller 66651d5660
contrib: improve release script with howto comments and help option 2020-06-30 13:36:42 +02:00
Thomas Haller 53bb23b403
build: for signing use key from git's user.signingkey 2020-06-29 09:08:04 +02:00
Thomas Haller 0748bd989d
release: cleanup temporary release-branch and avoid prompt for ftpadmin install 2020-06-28 19:16:20 +02:00
Thomas Haller 99f834842a
release: fix "rc" release build and add option to suppress check for local branches 2020-06-28 19:02:07 +02:00
Thomas Haller 7f93fd8e7b
release: fix RC_VERSION for release script
The release candidate -rc1 has version "1.y.90", -rc2 has "1.y.91", and so
on. Fix the script.
2020-06-28 18:35:03 +02:00
Thomas Haller 8e9e6fd024
release: fix release script for "rc" 2020-06-28 18:06:17 +02:00
Thomas Haller ccac506a8a
build: print deleted references in release.sh script 2020-06-04 13:17:57 +02:00
Thomas Haller 61b9201898
build: print commands in color for release.sh script 2020-06-04 12:31:39 +02:00
Thomas Haller 207fd8dfb1
build: implement release mode "rc" in release.sh script
Still not implemented are the first release candidate (rc1)
and the major release.
2020-06-04 11:54:31 +02:00
Thomas Haller bbb95c979e
build: optionally sign source tarball in build.sh script
This defaults to $DO_RELEASE. In that case, the script will also GPG sign
the source tarball.

The purpose is that when we do a release we want to ensure that the
published tarball is really the one that we generated. In that case,
the SHA sum would suffice, however that requires you to manually note
it down and compare the result. With the gpg signature, that
verification can be better automated.
2020-06-04 11:33:00 +02:00
Thomas Haller 0ac05a3faa
build: add "release.sh" script
Currently only "minor" and "devel" releases are implement. It's also not yet
tested with --no-dry-run, because that would actually create a release.

Test it when using it the next time.
2020-06-04 10:51:12 +02:00
Thomas Haller b4fb2a4f94
contrib/rpm: remove trailing whitespaces from spec file 2020-05-29 17:06:59 +02:00
Beniamino Galvani 53aa5bd207 platform: add tc tests 2020-05-28 17:25:31 +02:00
Beniamino Galvani 016a82e6dd contrib/rpm: enable the firewalld zone in F32 and RHEL8 2020-05-15 19:06:24 +02:00
Thomas Haller 8d2f6dfe38
contrib/rpm: no longer mention that libnm is "new API"
libnm was introduced in version 1.0, December 2014. It's
no longer new, and libnm-glib is forgotten.
2020-05-14 17:21:12 +02:00
Thomas Haller 350681e7f1
contrib/rpm: enable undefined-sanitizer libubsan on RHEL-8 2020-05-14 12:19:34 +02:00
Thomas Haller b846f9aba3
gitlab-ci: optionally install libasan,libubsan via REQUIRED_PACKAGES script 2020-05-14 12:03:24 +02:00
Thomas Haller 1473f00d74
gitlab-ci: accept failure in REQUIRED_PACKAGES script for non-existing qt-devel
On CentOS 8, many devel packages are not available. Even after

  # dnf config-manager --set-enabled PowerTools

certain devel packages are missing. Some of these (libndp-devel,
mobile-broadband-provider-info-devel, teamd-devel) we build in copr
([1]), but libpsl-devel and qt-devel are still missing.

Only install them optionally and allow failure for them not being
present.

[1] https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-8/nmstate-nm-build-deps-epel-8.repo
2020-05-14 12:03:24 +02:00
Thomas Haller 3f6f7b06c6
contrib/rpm: log MD5/SHA sums of release tarball during build_clean.sh
When doing a release, we should care about the checksum of the tarball.
Log all of them... also, because fedpkg uses sha512, ftpadmin@gnome uses
sha256, etc.
2020-05-08 14:54:37 +02:00
Thomas Haller ed94ab6e23 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != "yes"
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-170120.dp5cp5/SPECS/NetworkManager.spec:596: bad %if condition:  no != "yes"
2020-04-18 19:10:46 +02:00
Thomas Haller be78a12012 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != yes
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-163008.VM582H/SPECS/NetworkManager.spec:596: bad %if condition:  no != yes
2020-04-18 18:33:55 +02:00
Thomas Haller 68b38a09d1 contrib/rpm: avoid bare words in spec file
error: bare words are no longer supported, please use "...":  "x" != x
   error:                                                               ^
   error: /root/nm-build/NetworkManager/contrib/fedora/rpm/NetworkManager.20200402-030113.Hk7EGs/SPECS/NetworkManager.spec:32: bad %if condition:  "x" != x
   ERROR: rpmbuild FAILED
2020-04-02 09:36:37 +02:00
Thomas Haller 1bc5a7c778 contrib/scripts: add "checkpatch-git-post-commit-hook" script to contrib/
This can be used as git post-commit hook.
2020-02-21 07:40:10 +01:00
Thomas Haller 5cc8ca4038 contrib/REQUIRED_PACKAGES: fix script to work without GNU which installed
`which` is convenient, but not installed in Fedora container images.
Fix detection of whether to use `dnf` or `yum`.
2020-02-10 11:26:59 +01:00
Thomas Haller bdd45e6afa contrib/REQUIRED_PACKAGES: ignore for non-existing packages "dbus-python", "pygobject3-base" on Fedora 32
These packages no longer exist on Fedora 32 and dnf fails due to
that. Ignore such errors.
2020-02-10 11:18:51 +01:00
Antonio Cardace df1d214b2e clients: polkit-agent: implement polkit agent without using libpolkit 2019-12-24 10:13:51 +01:00
Thomas Haller 2fa4827eb9 checkpatch: catch "gs_free GError *" declations
(cherry picked from commit ec0adbfaf0)
2019-12-16 17:45:16 +01:00
Thomas Haller d27fcd0754 build/meson: allow configuring default for main.auth-polkit setting
We always build PolicyKit support, because it merely depends on some
D-Bus calls. However, there are two things to configure:

 - the default value for main.auth-polkit in NetworkManager.conf. This
   is now called "-Dconfig_auth_polkit_default=$VAL".

 - whether to install the policy file. This is called "-Dpolkit=$VAL".

These settings are mostly independent, so add "config_auth_polkit_default" to
make the default explicitly configurable.

(cherry picked from commit c21c6bc0be)
2019-12-11 13:13:05 +01:00
Thomas Haller 7302be3b32 cloud-setup: add comment that the tool is still experimental
(cherry picked from commit 16223cff91)
2019-12-02 15:24:17 +01:00
Thomas Haller 7ff866e679 contrib/rpm: explicitly enable/disable bluetooth support
The bluetooth plugin (with BlueZ5/NAP support) always gets
build, but DUN support requires a library.

When enabling build of the bluetooth subpackage, then always
enable DUN support. And enable it explicitly, especially meson
would not autodetect support and disable it by default.

(cherry picked from commit 30f6a5dd21)
2019-12-02 15:16:52 +01:00
Thomas Haller 69f048bf0c cloud-setup: add tool for automatic IP configuration in cloud
This is a tool for automatically configuring networking in a cloud
environment.

Currently it only supports IPv4 on EC2, but it's intended for extending
to other cloud providers (Azure). See [1] and [2] for how to configure
secondary IP addresses on EC2. This is what the tool currently aims to
do (but in the future it might do more).

[1] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/

It is inspired by SuSE's cloud-netconfig ([1], [2]) and ec2-net-utils
package on Amazon Linux ([3], [4]).

[1] https://www.suse.com/c/multi-nic-cloud-netconfig-ec2-azure/
[2] https://github.com/SUSE-Enceladus/cloud-netconfig
[3] https://github.com/aws/ec2-net-utils
[4] https://github.com/lorengordon/ec2-net-utils.git

It is also intended to work without configuration. The main point is
that you boot an image with NetworkManager and nm-cloud-setup enabled,
and it just works.
2019-11-28 19:52:18 +01:00
Thomas Haller 5996b4f166 contrib/rpm: fix comment in "NetworkManager.conf" about default [main].plugins
The "ibft" plugin is no more. The default on RHEL/Fedora is now "ifcfg-rh[,keyfile]".
Adjust the configuration, because a wrong comment is confusing here.

Modifying configuration snippets is potentially annoying, because the user might
have edited the file, so on upgrade a "NetworkManager.conf.rpmnew" file
will be created. Still do it.
2019-11-28 18:33:35 +01:00
Thomas Haller 0521e06ff1 contrib/rpm: avoid warning in specfile about tokens after %endif
warning: extra tokens at the end of %endif directive in line 717:  %endif # end autotools
warning: extra tokens at the end of %endif directive in line 775:  %endif # end autotools
2019-11-23 17:01:41 +01:00
Thomas Haller 0f4819ab36 contrib/rpm: use proper check for nmtui conditional build 2019-11-22 15:32:52 +01:00
Thomas Haller 0bff8d7710 contrib: fix detection of whether being sourced in NM-log script 2019-10-26 14:22:44 +02:00
Lubomir Rintel f222dad838 contrib: move scripts from test/ to scripts/
There's no reason to have them separate. Also add the missing executable
bit to btmodem.pl.

https://github.com/NetworkManager/NetworkManager/pull/355
2019-10-09 11:38:22 +02:00
Thomas Haller 3019648b4b checkpatch,gitlab-ci: let checkpatch script compare against latest upstream master
When opening a merge request from a fork of NetworkManager, then the
pipeline runs with the a checkout of the fork. That means, checkpatch
would compare the branch against "master" (or "nm-x-y" stable branches)
of the fork, instead of upstream.

That doesn't seem too useful. Instead, also add upstream NetworkManager
as git remote, fetch the branches, and use the branches from there as
base for checkpatch.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/255
2019-10-02 18:46:36 +02:00
Thomas Haller 3b69f02164 all: unify format of our Copyright source code comments
```bash

readarray -d '' FILES < <(
  git ls-files -z \
    ':(exclude)po' \
    ':(exclude)shared/c-rbtree' \
    ':(exclude)shared/c-list' \
    ':(exclude)shared/c-siphash' \
    ':(exclude)shared/c-stdaux' \
    ':(exclude)shared/n-acd' \
    ':(exclude)shared/n-dhcp4' \
    ':(exclude)src/systemd/src' \
    ':(exclude)shared/systemd/src' \
    ':(exclude)m4' \
    ':(exclude)COPYING*'
  )

sed \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) *[-–] *\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C1pyright#\5 - \7#\9/' \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) *[,] *\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C2pyright#\5, \7#\9/' \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C3pyright#\5#\7/' \
  -e 's/^Copyright \(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/C4pyright#\1#\3/' \
  -i \
  "${FILES[@]}"

echo ">>> untouched Copyright lines"
git grep Copyright "${FILES[@]}"

echo ">>> Copyright lines with unusual extra"
git grep '\<C[0-9]pyright#' "${FILES[@]}" | grep -i reserved

sed \
  -e 's/\<C[0-9]pyright#\([^#]*\)#\(.*\)$/Copyright (C) \1 \2/' \
  -i \
  "${FILES[@]}"

```

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/298
2019-10-02 17:03:52 +02:00
Lubomir Rintel 8d352b5a47 contrib: add a Bluetooth DUN modem emulator
Useful for quickly testing Bluetooth DUN support. Duplicates some
modemu.pl logic, but hey...

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/297
2019-10-02 11:29:53 +02:00
Thomas Haller abff46cacf all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
Francesco Giudici e150307ab5 artwork: introduce NetworkManager stickers 2019-09-30 17:36:59 +02:00