Commit Graph

269 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 5e3cec87be meson: use a convenience lib for journal user sources
Instead of compiling those files twice, once for libsystemd and once for
libshared, compile once as a static archive and then link into both.
This reduce the meson target for man=no compile to 1291.
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek 34e221a58b Move gcrypt-util to basic/
We were including gcrypt-util.[ch] by hand in the few places where it
was used. Create a convenience library to avoid compiling the same
files multiple times.

v2:
- use a separate static library instead of mergin into libbasic
2018-01-03 12:09:45 +01:00
Zbigniew Jędrzejewski-Szmek 2d4ceca8a5 meson: link libbasic and libshared_static into libshared
gcrypt_util_sources had to be moved because otherwise they appeared twice
in libshared.so halfproducts, causing an error.

-fvisibility=default is added to libbasic, libshared_static so that the symbols
appear properly in the exported symbol list in libshared.

The advantage is that files are not compiled twice. When configured with -Dman=false,
the ninja target list is reduced from 1588 to 1347 targets. The difference in compilation
time is small (<10%). I think this is because of -O0 and ccache and multiple cores, and
in different settings the compilation time could be reduced. The main advantage is that
errors and warnings are not reported twice.
2018-01-03 12:09:14 +01:00
Lennart Poettering 2acfd0ff43 meson: hopefully renameat2() will show up where renameat() is defined
Should glibc add this eventually, let's try to be smart where to look
for it.
2017-12-25 12:35:43 +01:00
Lennart Poettering 7b961e40ee meson: look for gettid() definition where getpid() is defined
Hopefully, should gettid() show up one day in glibc it'll show up where
getpid() is defined too.
2017-12-25 12:35:28 +01:00
Lennart Poettering 3c042add1d meson: when pivot_root() is added one day, look for it in <unistd.h>
We of course don't know in which header glibc will export pivot_root()
and if it ever will. But there's a good chance they'll place it where
chroot() is located, given the similarity in the operations, hence let's
try our luck and look for it at the same place.

If we are lucky this means we don't have to patch our code if glibc
decides to expose the call one day.
2017-12-25 12:10:22 +01:00
Lennart Poettering 85db59b794 meson: use "args" for setting _GNU_SOURCE when checking for functions
This reworks how we set _GNU_SOURCE when checking for the availability
of functions:

1. We set it for most of the functions we look for. After all we set it
for our entire built anyway, and it's usually how Linux-specific
definitions in glibc are protected these days. Given that we usually
have checks for such modern stuff only anyway, let's just blanket enable
it.

2. Use "args" instead of "prefix" to set the macro. This is what is
suggested in the meson docs, hence let's do it.
2017-12-25 12:10:14 +01:00
Yu Watanabe 0e50bfaefd meson: define _GNU_SOURCE to detect copy_file_range() (#7734)
Follow-up for bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f of git
repository for glibc.

Recently glibc added `copy_file_range()`, but to use it,
`_GNU_SOURCE` needs to be defined. This adds the flag in
meson.build to detect the function by meson correctly.
2017-12-25 11:42:42 +01:00
Susant Sahani d384826f69 networkd: Add support for ipvlan L3s and flags (#7726)
This works supports to configure L3S mode and flags
such as bridge, private and vepa
2017-12-23 18:55:03 +01:00
Zbigniew Jędrzejewski-Szmek 4f561ecda9 meson: reuse libsystemd_static for libsystemd
This gets rid of recompilation, making things faster and avoids duplicated warnings.
The result seems to be the same:
$ ls -l build/libsystemd.so.0.20.0 build2/libsystemd.so.0.20.0
-rwxrwxr-x. 1 zbyszek zbyszek 3071312 Dec 19 11:45 build2/libsystemd.so.0.20.0
-rwxrwxr-x. 1 zbyszek zbyszek 3071760 Dec 19 11:11 build/libsystemd.so.0.20.0
$ diff -U1 <(objdump -T build/libsystemd.so.0.20.0|sed -r 's/[0-9a-f]{16}/________________/g') <(objdump -T build2/libsystemd.so.0.20.0|sed -r 's/[0-9a-f]{16}/________________/g')
-build/libsystemd.so.0.20.0:     file format elf64-x86-64
+build2/libsystemd.so.0.20.0:     file format elf64-x86-64
2017-12-21 17:01:23 +01:00
Zbigniew Jędrzejewski-Szmek 37e4d7a855 meson: rename libsystemd_internal to libsystem_static
We already use the "_static" suffix for libshared_static ("shared" is the name
of the library, "static" is the format) and other libs, so let's rename for
consistency.

Also change libsystemd_static_sources to libsystemd_sources, since the same
list is used for both and shorter is better.
2017-12-21 17:01:02 +01:00
Felipe Sateler f9f54413db build-sys: install TRANSIENT-SETTINGS.md and UIDS-GIDS.md (#7690) 2017-12-18 14:58:13 +01:00
Franck Bui 6671e818e9 meson: libudev_core and udevadm should have LOG_REALM=LOG_REALM_UDEV (#7666)
Otherwise, setting udev_log=debug in /etc/udev/udev.conf has no effects since
systemd-udevd is built with LOG_REALM=LOG_REALM_UDEV.

However using LOG_REALM_UDEV (for libudev_core) reveals another similar bug for
udevadm which should also define LOG_REALM_UDEV.
2017-12-16 09:36:36 +01:00
Max Harmathy 5424824adf Fix logical error in meson.build (#7658)
sysvinit_path and sysvrcnd_path have to be set both to activate Sysv compatibility.
2017-12-15 16:05:25 +01:00
Lennart Poettering cbd73c69ba meson: increase version numbers 2017-12-14 17:29:30 +01:00
Lennart Poettering b4b36f4405 meson: link NSS modules with -z nodelete (#7607)
We might end up allocating mempools, and when we are unloaded we might
orphan them, thus leaking them. Hence, let's just stick around for good,
so the mempools remain referenced continously and for good, and thus no
memory is leaked (though the memory isn't cleaned up either).

Fixes: #7596
2017-12-12 20:13:16 +01:00
Lennart Poettering 9e32914aa5
Merge pull request #7570 from keszybz/sulogin-shell-reload-manager
Reload manager before exit from sulogin shell
2017-12-08 13:09:45 +01:00
Zbigniew Jędrzejewski-Szmek e821f6a916 meson: place systemd-sulogin-shell in build/
We do that will all executables so that it's easy to call them.
2017-12-07 12:34:12 +01:00
Yu Watanabe 8374cc6235 meson: warn if nobody-user and nobody-group are set to different name
It may work, but is very strange. So, let's warn about that.

v2:
Debian uses nobody and nogroup. Do not warn such case.
2017-12-07 17:19:11 +09:00
Yu Watanabe 6071202165 sysusers: use NOBODY_USER_NAME 2017-12-07 17:12:13 +09:00
Lennart Poettering c7a54cd67b
Merge pull request #7419 from keszybz/tmpfiles-fixes
Tmpfiles --user mode and various fixes
2017-12-06 19:50:26 +01:00
Lennart Poettering afde45740f meson: print warnings if the "nobody" user/group name is not compatible with the local system
At least on Fedora and Debian systems this not obvious to get right,
hence warn.
2017-12-06 13:40:50 +01:00
Lennart Poettering 87d5e4f286 build-sys: make the dynamic UID range, and the container UID range configurable
Also, export these ranges in our pkg-config files.
2017-12-06 12:55:37 +01:00
Zbigniew Jędrzejewski-Szmek e783f95718 Rename "system-preset" source dir to "presets"
I want to add presets/user/ later. This mirrors the layout for units:
we have units/ and units/user. The advantage is that we avoid having yet
another directory at the top level.
2017-12-06 10:18:35 +01:00
Yu Watanabe d6806870a2 meson: fix indentation 2017-12-05 14:01:39 +09:00
Ikey Doherty 84786b8e32 sysusers: Provide meson argument to set gid for 'users' group (#7533)
To allow better integration with distributions requiring an explicitly
set gid for the `users` group, provide the new `-Dusers-gid` option to
set to a new numeric value.

In the absence of a specified gid, we'll fallback to the default existing
behaviour of `-` as the gid value, to automatically assign the next available
gid on the system.
2017-12-03 13:28:23 +01:00
Zbigniew Jędrzejewski-Szmek d9daae55d5 tmpfiles: add a special return code for syntax failures
In this way, individual errors in files can be treated differently than a
failure of the whole service.

A test is added to check that the expected value is returned.
Some parts are commented out, because it is not. This will be fixed in
a subsequent commit.
2017-12-01 18:58:54 +01:00
Zbigniew Jędrzejewski-Szmek 7f2806d509 Add x-systemd.growfs option for fstab 2017-11-30 20:46:30 +01:00
Zbigniew Jędrzejewski-Szmek da495a0385 Add x-systemd.makefs option for fstab
I opted to completely generate a unit for both mount points and swaps. For
swaps, it would be possible to use fixed template unit like systemd-mkswap@.service,
because there's no information passed except the device name. For mount points,
that's not possible because both the device name and file system type need to
be passed. Nevertheless, I expect that options will need to passed to both mkfs
and mkswap, in which case it'll be necessary to create units of both types
anyway.
2017-11-30 20:46:30 +01:00
Zbigniew Jędrzejewski-Szmek b7f28ac51f Add mkfs wrapper which first checks if the partition is empty 2017-11-30 20:46:30 +01:00
Zbigniew Jędrzejewski-Szmek c34b75a124 growfs: add support for resizing encrypted partitions 2017-11-30 20:43:25 +01:00
Zbigniew Jędrzejewski-Szmek 80750adb22 Add systemd-growfs tool 2017-11-30 20:43:25 +01:00
Zbigniew Jędrzejewski-Szmek 9a8e64b0e9 meson: emit a warning if rootprefix is set
It's printed at the end because it's the easiest to spot there.

When meson is upgraded to 0.43.1, we'll be able to use warning() instead.
2017-11-29 13:29:59 +01:00
Zbigniew Jędrzejewski-Szmek 74344a1702 Revert "meson: drop rootprefix option"
This reverts commit ee4bfa21f6.

Also add comment so that this doesn't get deleted again by mistake.

Replaces #7461.
2017-11-28 20:02:53 +01:00
Yu Watanabe dd5082a9de
Merge pull request #7468 from yuwata/fix-7362
test and meson cleanups
2017-11-26 12:35:07 +09:00
Yu Watanabe e481645174 meson: update header file to detect memfd_create() 2017-11-26 02:17:06 +09:00
Yu Watanabe 359b496f66 meson: remove abbreviations in status 2017-11-25 20:35:24 +09:00
Yu Watanabe 8a38aac3a7 meson: do not install RPM macros if rpmmacrosdir is set to no (#7430)
Fixes #7427.
2017-11-23 14:20:22 +01:00
Zbigniew Jędrzejewski-Szmek 6b97bf2287 meson: re-attach rule-syntax-check.py test
39/248 rule-syntax-check                       OK     0.07 s

--- command ---
/home/zbyszek/src/systemd-work/test/rule-syntax-check.py \
    /home/zbyszek/src/systemd-work/build/../rules/60-block.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-cdrom_id.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-drm.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-evdev.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-input-id.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-persistent-alsa.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-persistent-input.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-persistent-storage.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-persistent-storage-tape.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-persistent-v4l.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-sensor.rules \
    /home/zbyszek/src/systemd-work/build/../rules/60-serial.rules \
    /home/zbyszek/src/systemd-work/build/../rules/70-joystick.rules \
    /home/zbyszek/src/systemd-work/build/../rules/70-mouse.rules \
    /home/zbyszek/src/systemd-work/build/../rules/70-touchpad.rules \
    /home/zbyszek/src/systemd-work/build/../rules/75-net-description.rules \
    /home/zbyszek/src/systemd-work/build/../rules/75-probe_mtd.rules \
    /home/zbyszek/src/systemd-work/build/../rules/78-sound-card.rules \
    /home/zbyszek/src/systemd-work/build/../rules/80-drivers.rules \
    /home/zbyszek/src/systemd-work/build/../rules/80-net-setup-link.rules \
    /home/zbyszek/src/systemd-work/build/rules/50-udev-default.rules \
    /home/zbyszek/src/systemd-work/build/rules/64-btrfs.rules \
    /home/zbyszek/src/systemd-work/build/rules/99-systemd.rules
--- stdout ---
...
-------

It got dropped by mistake in 72cdb3e783.
2017-11-22 12:46:08 +01:00
Susant Sahani d6df583c87 networkd: introduce vxcan netdev. (#7150)
Similar to the virtual ethernet driver veth, vxcan implements a
local CAN traffic tunnel between two virtual CAN network devices.
When creating a vxcan, two vxcan devices are created as pair
When one end receives the packet it appears on its pair and vice
versa. The vxcan can be used for cross namespace communication.
2017-11-22 08:23:22 +01:00
Zbigniew Jędrzejewski-Szmek 97279d8380 meson: "upgrade" -Wimplicit-fallthrough to 5
5 means that only the explicit attribute introduced in previous commit
is accepted. We don't want the comments anymore.
2017-11-21 12:47:51 +01:00
Zbigniew Jędrzejewski-Szmek 18c8db140f meson: add -Wimplicit-fallthrough=3 to compilation options (#7393)
At some point before gcc-7 was released, -Wimplicit-fallthrough=3 was included
in -Wextra. The documentation for gcc-7.2.1-2.fc27.x86_64 still says that, but
empirical testing shows that it's not. The documentation also misstates that
-Wimplicit-fallthrough is equivalent to -Wimplicit-fallthrough=3.

Let's add -Wimplicit-fallthrough=3 explicitly to get the warnings if we regress.

Prompted by #7389.
2017-11-20 12:14:47 +01:00
Zbigniew Jędrzejewski-Szmek 86ea8d70fc
meson: bump required meson version to 0.41 (#7385)
We need data_dirs argument for i18n.merge_file, added in 0.40.1-11-g82492f5d76.
2017-11-20 08:08:43 +01:00
Lennart Poettering 0e74bad141
Merge pull request #7376 from keszybz/simplify-root-options
Simplify root configuration options
2017-11-19 19:50:03 +01:00
Zbigniew Jędrzejewski-Szmek 3a726fcd08 Add license headers and SPDX identifiers to meson.build files
So far I avoided adding license headers to meson files, but they are pretty
big and important and should carry license headers like everything else.
I added my own copyright, even though other people modified those files too.
But this is mostly symbolic, so I hope that's OK.
2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek 0c6e2702b6 meson: use absolute path for rpmmacrosdir
This only matter for the status display at the end of configure step.
Now it looks like:
         RPM macros dir:                    /usr/lib/rpm/macros.d
2017-11-17 13:22:13 +01:00
Zbigniew Jędrzejewski-Szmek ee4bfa21f6 meson: drop rootprefix option
rootprefixdir is now always set to /usr or /, based on the split-usr setting.
Anything else does not work anyway.

C.f. #7375.
2017-11-17 13:08:00 +01:00
Tom Stellard 4e15a7343c udev-rules: Permission changes for /dev/dri/renderD*
- Remove the uaccess tag from /dev/dri/renderD*.
- Change the owning group from video to render.
- Change default mode to 0666.
- Add an option to allow users to set the access mode for these devices at
compile time.
2017-11-08 08:21:31 -08:00
Lennart Poettering 35682fd4a1 Merge pull request #7127 from keszybz/sundry-tweaks
Various unrelated small patches
2017-10-26 10:57:00 +02:00
Michael Biebl 02fa054dc4 modprobe.d: fix directory of modprobe configuration file (#7149)
kmod upstream uses /lib/modprobe.d which means we need to use rootprefix
instead of prefix for installing the modprobe configuration file as
otherwise split-usr systems are broken.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879191
2017-10-21 08:32:50 +02:00
Zbigniew Jędrzejewski-Szmek 9476ddba60 meson: drop unneeded check for grep 2017-10-18 17:14:05 +02:00
Yu Watanabe a7456af52c meson: fix feature list (#7011) 2017-10-06 09:33:21 +02:00
Lennart Poettering d128f369bc build-sys: bump so revisions for prepation of 235 2017-10-05 17:14:04 +02:00
Zbigniew Jędrzejewski-Szmek a9149d876b meson: generate ENABLE_* names automatically
After previous changes, the naming of configuration options and internal
defines is consistent.
2017-10-04 12:09:51 +02:00
Zbigniew Jędrzejewski-Szmek 1ec57f3394 build-sys: s/ENABLE_RESOLVED/ENABLE_RESOLVE/
The configuration option was called -Dresolve, but the internal define
was …RESOLVED. This options governs more than just resolved itself, so
let's settle on the version without "d".
2017-10-04 12:09:51 +02:00
Zbigniew Jędrzejewski-Szmek 08cf5b8dc3 build-sys: s/HAVE_MYHOSTNAME/ENABLE_MYHOSTNAME/
Same justification as for HAVE_UTMP. HAVE_MYHOSTNAME was used before mysthostname
was merged into systemd.
2017-10-04 12:09:51 +02:00
Zbigniew Jędrzejewski-Szmek f9fa32f09c build-sys: s/HAVE_SMACK/ENABLE_SMACK/
Same justification as for HAVE_UTMP.
2017-10-04 12:09:50 +02:00
Zbigniew Jędrzejewski-Szmek 392fd235fd build-sys: s/HAVE_IMA/ENABLE_IMA/
Same justification as for HAVE_UTMP.
2017-10-04 12:09:50 +02:00
Zbigniew Jędrzejewski-Szmek 3211da4bcb build-sys: s/HAVE_UTMP/ENABLE_UTMP/
"Have" should be about the external environment and dependencies. Anything
which is a pure yes/no choice should be "enable".
2017-10-04 12:09:50 +02:00
Zbigniew Jędrzejewski-Szmek 70160ce891 build-sys: require all defines under #if to be present
This should help to catch any errors with typos and HAVE/ENABLE mismatches.
2017-10-04 12:09:50 +02:00
Zbigniew Jędrzejewski-Szmek 349cc4a507 build-sys: use #if Y instead of #ifdef Y everywhere
The advantage is that is the name is mispellt, cpp will warn us.

$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build

squash! build-sys: use #if Y instead of #ifdef Y everywhere

v2:
- fix incorrect setting of HAVE_LIBIDN2
2017-10-04 12:09:29 +02:00
Zbigniew Jędrzejewski-Szmek af8786b16a meson: check for sys/auxv.h
This check was present in configure.ac, but was never added under meson.
The code under HAVE_SYS_AUX_H has been dead ever since :(.
2017-10-03 13:19:51 +02:00
Zbigniew Jędrzejewski-Szmek 4b9545f19e build-sys: change all HAVE_DECL_ macros to HAVE_
This is a legacy of autotools, where one detection routine used a different
prefix then the others.

$ git grep -e HAVE_DECL_ -l|xargs sed -i s/HAVE_DECL_/HAVE_/g
2017-10-03 10:32:34 +02:00
Zbigniew Jędrzejewski-Szmek 56d50ab1d3 meson: move library version defines to the top (#6939) 2017-09-28 19:24:16 +02:00
Lennart Poettering 63950427ab meson: bump release to 235 2017-09-28 11:29:52 +02:00
Daniel Mack 71e5200f94 Add abstraction model for BPF programs
This object takes a number of bpf_insn members and wraps them together with
the in-kernel reference id. Will be needed by the firewall code.
2017-09-22 15:24:54 +02:00
Zbigniew Jędrzejewski-Szmek d6e8096669 build-sys: require libmount >= 2.30 (#6795)
Fixes #4871.

The new libmount has two changes relevant for us:

- x-* options are propagated to /run/mount/utab and are visible through
  libmount (fixes #4817).

- umount -c now really works (partially solves #6115).
2017-09-15 14:47:57 +02:00
Susant Sahani bce67bbee3 networkd: add support to configure IP Rule (#5725)
Routing Policy rule manipulates rules in the routing policy database control the
route selection algorithm.

This work supports to configure Rule
```
[RoutingPolicyRule]
TypeOfService=0x08
Table=7
From= 192.168.100.18

```

```
ip rule show
0:	from all lookup local
0:	from 192.168.100.18 tos 0x08 lookup 7
```

V2 changes:

1. Added logic to handle duplicate rules.
2. If rules are changed or deleted and networkd restarted
   then those are deleted when networkd restarts next time

V3:

1. Add parse_fwmark_fwmask
2017-09-14 21:51:39 +02:00
Zbigniew Jędrzejewski-Szmek fb1b58820f build-sys: make nonnull warning non-fatal (#6742)
Seems to be some kind of confusion in gcc. Insteading of playing whack-a-mole and
adding work-arounds in code, let's adjust the compilation options instead.

Fixes #6119, replaces #6657.
2017-09-04 18:49:12 +02:00
Davide Cavalca 5e1771ace0 meson: add . to include_directories (#6634) 2017-08-30 17:34:44 +02:00
Davide Cavalca 450b60baa5 meson: use current_source_dir() to scope git invocations (#6635) 2017-08-30 17:04:53 +02:00
Felipe Sateler dcfe072ad6 build-sys: don't build networkctl if networkd is disabled 2017-08-23 16:10:42 -03:00
userwithuid e85a690b96 build-sys: fix invalid args detected by meson 0.42 (#6561)
some run_target() calls were using params from custom_target()

example message:
WARNING: Passed invalid keyword argument "input". This will become a hard error in the future.

New way to call targets:
ninja man/man
ninja man/html
ninja man/update-man-rules
2017-08-09 09:41:44 -04:00
Yu Watanabe ad6fc5bbae meson: fix modprobedir (#6523)
Follow-up for 582faeb461.
2017-08-03 08:01:38 -04:00
Dimitri John Ledkov 582faeb461 modprobe.d: ship drop-in to set bonding max_bonds to 0 (#6448)
This allows networkd to correctly manage bond0 using networkd, when requested
by the user.

Fixes #5971 #6184
2017-08-02 08:41:18 -04:00
Lennart Poettering f19ca6105e Merge pull request #6420 from keszybz/gateway-name
Rename "gateway" to "_gateway" and other resolved changes
2017-08-01 09:43:41 +02:00
Zbigniew Jędrzejewski-Szmek 5248e7e1f1 resolved,nss-myhostname: use _gateway for the gateway
This changes the symbolic name for the default gateway from "gateway" to
"_gateway". A new configuration option -Dcompat-gateway-hostname=true|false
is added. If it is set, the old name is also supported, but the new name
is used as the canonical name in either case. This is intended as a temporary
measure to make the transition easier, and the option should be removed
after a few releases, at which point only the new name will be used.

The old "gateway" name mostly works OK, but hasn't gained widespread acceptance
because of the following (potential) conflicts:
- it is completely legal to have a host called "gateway"
- there is no guarantee that "gateway" will not be registered as a TLD, even
  though this currently seems unlikely. (Even then, there would be no
  conflict except for the case when the top-level domain itself was being resolved.
  The "gateway" or "_gateway" labels have only special meaning when the
  whole name consists of a single label, so resolution of any subdomain
  of the hypothetical gateway. TLD would still work OK. )
Moving to "_gateway" avoids those issues because underscores are not allowed
in host names (RFC 1123, §2.1) and avoids potential conflicts with local or
global names.

v2:
- simplify the logic to hardcode "_gateway" and allow
  -Dcompat-gateway-hostname=true as a temporary measure.
2017-07-31 14:41:56 -04:00
Martin Pitt 896bbe7611 Merge pull request #6365 from keszybz/fast-tests
Make tests faster by default
2017-07-28 11:09:50 +02:00
Zbigniew Jędrzejewski-Szmek 9d39c1bf29 meson: add empty lines before enabled/disabled status
Those line are long enough to wrap around a few times, and they are
much more legible with some whitespace.
2017-07-26 14:17:50 -04:00
Zbigniew Jędrzejewski-Szmek a44fb6019f meson.build: reorder tests to match order in meson_options.txt
This makes it easier to edit both files.
2017-07-26 14:08:46 -04:00
Zbigniew Jędrzejewski-Szmek 003c887967 meson: install the git hook (#6425)
This was done autogen.sh previously and was dropped in
72cdb3e783. Let's add it back.
The meson configuration step is the only reasonable place.

Note that this only works for the most standard git dirs, e.g.
the hook will not be installed if git worktree is used or if
$GIT_DIR is specified, etc. I think that's OK because most of
the time meson will be run at least once in the original cloned
dir.
2017-07-24 10:41:45 +02:00
Zbigniew Jędrzejewski-Szmek 18b9ad1f61 build-sys: rename SD_BOOT_LOG_TPM to ENABLE_TPM
This makes it more like other configure defines.

Also, it fixes meson status output which was looking for HAVE_ and ENABLE_
prefixes only (the define under meson was OK, just the summary message was
wrong.)
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek 00d82c81db meson: add option to configure "slow" tests on/off
This is just the meson part, no functional change.
Use meson -D slow-tests=yes to set the default,
or SYSTEMD_SLOW_TESTS=yes build/test-foobar for just one test.
Setting the default is more useful for installed tests.
2017-07-13 17:52:49 -04:00
Zbigniew Jędrzejewski-Szmek 7f7ab22892 NEWS: say that libidn2 is experimental (#6335)
Handling of "_" and some other details requires more thought:
https://gitlab.com/libidn/libidn2/issues/30

Let's switch the default back to libidn and add a note in NEWS.
2017-07-12 09:25:59 +02:00
Zbigniew Jędrzejewski-Szmek 75cf1d66b0 meson: use -Wextra if available
-Wextra was not added to CFLAGS under meson by default, as it is
done by the autotools build.

C.f. 218f467111.
2017-07-04 18:26:01 -04:00
Zbigniew Jędrzejewski-Szmek 0700e8ba71 meson: add support for ctags
This is a squash of casync commits
02fbbdb2b9
(by Silvio Fricke)
and b687a94b1e.

Instead of checking during every meson config whether etags are
available, just try to call them and error out if not. This has
the advantage that the target is always available (if git is installed),
and the error message gives a hint what needs to be installed.

The naming is confusing, but etags(1) is pretty clear:
- emacs expects TAGS file in etags format
- vi expects tags file in ctags format
and automake docs are pretty clear too:
- tags target generates TAGS file
- ctags target generates tags file
2017-07-03 12:42:29 -04:00
Lennart Poettering 4309172946 build-sys: bump versions in prepare for v234 2017-06-27 23:11:26 +02:00
Zbigniew Jędrzejewski-Szmek f52b982cc9 meson: stop setting the linker (#6182)
If wanted, the linker can be set with LDFLAGS (LDFLAGS=-Wl,-fuse-ld=gold meson ...),
and setting it internally was interfering with that. It seems that both gold and
bfd work very well and quick, and the reasons we had to prefer gold are not relevant
anymore.

Fixes #6169.
2017-06-26 15:00:45 +02:00
Waldemar Brodkorb e7e11bbf34 make nss-systemd support conditional (#6155)
This allows the nss-systemd module to be disabled on minimal installations.
2017-06-24 13:30:26 -04:00
Michael Biebl 7cdd978346 meson: install manual and unsafe tests (#6178)
Always install all tests if install-tests is set to true, as they might
be useful for CI. This includes manual and unsafe tests. Install those
in subdirectories of /usr/lib/systemd/tests.

Fixes #6163.
2017-06-22 21:23:30 -04:00
Zbigniew Jędrzejewski-Szmek 4b57a27200 meson: add -pthreads and more libs when -Dlink-udev-shared=false (#6159)
Three binaries would fail to link when ld.bfd was used and link-udev-shared was
false. Add -pthreads (again) to the failing binaries and synchronize the
dependency list between libsystemd-shared .a and .so versions.
Apart from allowing the build to succeed, this shouldn't have much effect becuase
systemd-networkd was already using pthreads.

Fixes #5828.
2017-06-21 12:05:15 +02:00
Yu Watanabe 42303dcb1a resolved: ignore DNSSEC= option when resolved is built without gcrypt (#6084)
Fixes #5583.
2017-06-17 16:22:32 -04:00
Zbigniew Jędrzejewski-Szmek d1bf56759b meson: add -Didn=yes|no option 2017-06-16 09:21:15 -04:00
Zbigniew Jędrzejewski-Szmek 341b892ba2 meson: output TAGS file in source not build directory
The TAGS file was generated in build/ following what autotools did.
Nevertheless, it's more convenient to put in the source dir.
(It doesn't get deleted by mistake, and it's easier to find for the
editor.)
2017-05-30 21:36:27 -04:00
Zbigniew Jędrzejewski-Szmek 94e2523b70 tests,meson: add test-bus-vtable, compiled as C and C++
This test is mostly a compilation test that checks that various defines in
sd-bus-vtable.h are valid C++. The code is executed, but the results are not
checked (apart from sd-bus functions not returning an error). test-bus-objects
contains pretty extensive tests for this functionality.

The C++ version is only added to meson, since it's simpler there.
Because of the .cc extension, meson will compile the executable with c++.

This test is necessary to properly check the macros in sd-bus-vtable.h. Just
running the headers through g++ is not enough, because the macros are not
exercised.

Follow-up for #5941.
2017-05-13 15:50:44 -04:00
Lennart Poettering 6e4177315f Merge pull request #5432 from keszybz/udev-logging
udev logging separation
2017-05-12 15:22:46 +02:00
Zbigniew Jędrzejewski-Szmek 5486a31d28 nss-resolve: drop the internal fallback to libnss_dns (#5945)
If we could not communicate with systemd-resolved, we would call into
libnss_dns. libnss_dns would return NOTFOUND for stuff like "localhost" and
other names resolved by nss-myhostname, which we would fall under the !UNAVAIL=
condition and cause resolution to fail. So the following recommended
configuration in nsswitch.conf would not work:

   hosts: resolve [!UNAVAIL=return] dns myhostname

Remove the internal fallback code completely so that the fallback logic
can be configured in nsswitch.conf.

Tested with
   hosts: resolve [!UNAVAIL=return] myhostname
and
   hosts: resolve [!UNAVAIL=return] dns myhostname

Fixes #5742.
2017-05-12 14:31:46 +02:00
Lennart Poettering 3823da25cf Merge pull request #5928 from keszybz/libidn2
Use idn2 instead of idn
2017-05-12 12:01:40 +02:00
Zbigniew Jędrzejewski-Szmek 87057e244b resolved: support libidn2 in addition to libidn
libidn2 2.0.0 supports IDNA2008, in contrast to libidn which supports IDNA2003.

https://bugzilla.redhat.com/show_bug.cgi?id=1449145
From that bug report:

Internationalized domain names exist for quite some time (IDNA2003), although
the protocols describing them have evolved in an incompatible way (IDNA2008).
These incompatibilities will prevent applications written for IDNA2003 to
access certain problematic domain names defined with IDNA2008, e.g., faß.de is
translated to domain xn--fa-hia.de with IDNA2008, while in IDNA2003 it is
translated to fass.de domain. That not only causes incompatibility problems,
but may be used as an attack vector to redirect users to different web sites.

v2:
- keep libidn support
- require libidn2 >= 2.0.0
v3:
- keep dns_name_apply_idna caller dumb, and keep the #ifdefs inside of the
  function.
- use both ±IDN and ±IDN2 in the version string
2017-05-11 14:25:01 -04:00
Franck Bui b14e1b4394 sysusers: make group shadow support configurable
Some distros (openSUSE) don't have group shadow support enabled. This can lead
to the following error:

  # systemd-sysusers
  Creating group foofoo with gid 478.
  # systemd-sysusers
  # groupdel foofoo
  # systemd-sysusers
  Creating group foofoo with gid 478.
  Failed to write files: File exists

This patch adds --disable-gshadow option to configure. If used,
systemd-sysvusers won't consider /etc/gshadow.
2017-05-10 10:19:37 +02:00
Zbigniew Jędrzejewski-Szmek 5c72049f91 udev: use LOG_REALM_UDEV in all udev code
Any call to set/query/use the log level in the code with LOG_REALM=LOG_REALM_UDEV
refers to log_max_level[1]. In particular this means that systemd code using
the libudev library uses does not set the log level for log calls done in libudev.

Fixes #4525.

v2:
- also update meson's meson.build
2017-05-07 22:49:12 -04:00
Zbigniew Jędrzejewski-Szmek 2c201c2140 meson: use booleans for conf.set and drop unecessary conditionals
Using conf.set() with a boolean argument does the right thing:
either #ifdef or #undef. This means that conf.set can be used unconditionally.

Previously I used '1' as the placeholder value, and that needs to be changed to
'true' for consistency (under meson 1 cannot be used in boolean context). All
checks need to be adjusted.
2017-05-02 16:29:11 -04:00
Zbigniew Jędrzejewski-Szmek 829257d135 meson: add status report
This is similar to what ./configure prints. Instead of a long list of yes/no lines,
I added two lines at the end with "enabled features" and "disabled features".
This is what the mplayer/mencoder ./configure script did back in the day.
The advantage is that it's easy to look at the list of disabled features
and check for any unexpected entries.
2017-05-02 16:29:11 -04:00
Zbigniew Jędrzejewski-Szmek 671677dad1 meson: add forgotten debug options
v2:
-rename -Dextra-debug to -Ddebug to match ./configure --debug
2017-05-02 16:28:40 -04:00
Martin Pitt b13586206b Merge pull request #5827 from keszybz/meson-libcap
meson: fixes to allow meson builds on Ubuntu Trusty
2017-04-27 22:12:28 +02:00
Zbigniew Jędrzejewski-Szmek 0bc9115251 Merge branch 'master' into meson-no-libudev 2017-04-27 13:39:54 -04:00
Zbigniew Jędrzejewski-Szmek 2c5434ad3c meson: fix detection of "-Wno-" options 2017-04-27 10:05:41 -04:00
Zbigniew Jędrzejewski-Szmek 9f0e9c0119 meson: add version check for libseccomp
Compilation fails because of the missing arm64 bits with old seccomp versions.
2017-04-27 10:05:18 -04:00
Zbigniew Jędrzejewski-Szmek 1800cc8546 meson: also search for libcap directly 2017-04-27 01:30:30 -04:00
Michael Biebl c3045943c4 meson: get rid of libfirewall 2017-04-26 22:14:23 +02:00
Michael Biebl 34ce0a52c7 meson: drop implicit libudev link dependencies
Executables which link against libshared do not need an explicit
dependency on libudev, as libshared will make sure that those symbols
are available.
2017-04-26 17:28:48 +02:00
Susant Sahani 9dfed8dd92 meson: add geneve to build system
```
[107/1793] Compiling c object 'src/basic/basic@sta/log.c.o'
In file included from ../src/basic/log.c:44:0:
../src/basic/missing.h:762:6: warning: "HAVE_DECL_IFLA_GENEVE_LABEL" is not defined, evaluates to 0 [-Wundef]
^~~~~~~~~~~~~~~~~~~~~~~~~~~
[108/1793] Compiling c object 'src/basic/basic@sta/path-util.c.o'
In file included from ../src/basic/path-util.c:40:0:
../src/basic/missing.h:762:6: warning: "HAVE_DECL_IFLA_GENEVE_LABEL" is not defined, evaluates to 0 [-Wundef]
^~~~~~~~~~~~~~~~~~~~~~~~~~~

```
2017-04-25 20:30:34 +05:30
Zbigniew Jędrzejewski-Szmek d730e2d164 meson: require newest meson and revert m4 patch
This reverts 78b68dcb55.
2017-04-25 08:49:58 -04:00
Zbigniew Jędrzejewski-Szmek 7572aa805c meson: use name arg so check result is reported 2017-04-25 08:49:16 -04:00
Zbigniew Jędrzejewski-Szmek 6e2afb1cab meson: fix checking of linker args
Previous checks did nothing, because cc.has_argument only does compilation,
without any linking. Unfortunately cc.links() cannot be used, because it does
not accept any options. Providing the test file as a static source is easiest,
even if not every elegant.

https://github.com/mesonbuild/meson/issues/1676
2017-04-25 08:49:16 -04:00
Zbigniew Jędrzejewski-Szmek dd6ab3df74 meson: add git-snapshot target
The output is systemd-<sha1abbrev>.tar.gz in source root.
2017-04-24 19:28:05 -04:00
Zbigniew Jędrzejewski-Szmek 5464ec8a8e meson: there is no smack library
Detection would always fail, so this was broken.
Treat this as a binary enable/disable option.
2017-04-24 19:28:04 -04:00
Zbigniew Jędrzejewski-Szmek 80c6fce81c meson: add forgotten tpm support 2017-04-24 19:28:04 -04:00
Zbigniew Jędrzejewski-Szmek 41afb5eb72 meson: use -f{function,data}-sections for optimized builds 2017-04-24 19:28:04 -04:00
Michael Biebl 0da6f39619 meson: allow static linking of systemd-hwdb
Various distros split udev and its helpers into a separate binary
package. In case of Debian this also includes systemd-hwdb.
In Debian, the udev package is not supposed to depend on systemd, so a
dependency on libsystemd-shared.so is not desired. Allow the
systemd-hwdb binary to be linked statically if link-udev-shared is set
to false.

Follow-up for 3a30f21ff8.
2017-04-24 19:25:33 -04:00
Michael Biebl 76c8741060 meson: fix gcrypt config option
Also detect libgpg-error. Require both to be present for HAVE_CRYPT,
even though libgpg-error is only used in src/resolve. If one is available,
the other should be too, so it doesn't seem worth the trouble to make two
separate conditions.
2017-04-24 19:25:33 -04:00
Zbigniew Jędrzejewski-Szmek 36f0387efc meson: add option to disable libacl support 2017-04-24 19:25:33 -04:00
Zbigniew Jędrzejewski-Szmek 6800fe7f06 meson: define gnu_efi_arch for the arch efi name, fix ldsdir detection
This fixes ldsdir detection under Debian.

v2:
- define gnu_efi_arch for the arch efi include directory name

  In the autotools naming convention, efi_arch and this directory always had
  the same name. But meson.cpu_family() uses a slightly different convention,
  so those two don't always match.
2017-04-24 19:24:36 -04:00
Zbigniew Jędrzejewski-Szmek 4984c8be73 meson: detect getrandom in sys/random.h, fall back to linux/random.h
This is analogous to commit e84397d95c3da2b9722ff265843ad4a8874643d8.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 38f1ae0f99 meson: check string.h not strings.h for explicit_bzero
I used strings.h because that's what explicit_bzero(3) says. But glibc defines
it in string.h. There are no other available implementations atm (musl does not
define it, bionic aliases it to memset in openbsd-compat.h, yikes). We also
include just string.h from the code. So just look for the function in string.h,
and if it ever appears in other places, we can change the detection and includes.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 1276a9f63a meson: add ln --relative check 2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek a923e085af meson: use run_target instead of custom_target where appropriate
This way a fake output does not need to be specified.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 1aec3ed90d meson: add libblkid as libudev-core dep to fix include dir
Follow-up for 6b5cf3ea62.

v2:
- also link udevadm and systemd-udev statically if requested

v3:
- fix install_rpath for udevadm (Michael Biebl)
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 37efbbd821 meson: reindent all files with 8 spaces
The indentation for emacs'es meson-mode is added .dir-locals.

All files are reindented automatically, using the lasest meson-mode from git.
Indentation should now be fairly consistent.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 3a30f21ff8 meson: allow optional static linking of shared code in udev helpers
This makes the helper binaries significantly bigger (in some cases, the final
size depends on link options and optimization level), and is only useful for
distributions which want to provide the option to install udev without systemd.
As the linking is improved, the difference between the columns might shrink,
but it's unlikely that linking libshared statically could ever be more
efficient.

E.g. with -O0, no -flto:
                   (static) (shared)
src/udev/ata_id     999176    85696
src/udev/cdrom_id  1024344   111656
src/udev/collect    990344    81280
src/udev/scsi_id   1023592   115656
src/udev/v4l_id     811736    17744

When linked dynamically, install_rpath must be specified, so add that.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek d83f4f506d test-efi-create-disk.sh: allow running from separate build dir, hook up to meson
This allow test-efi-disk.img to be created under meson.
The invocation of qemu is not converted yet, in particular because the
command-line used in Makefile.am is outdated.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek fdd147a88e meson: add dist-check-includes replacement
This is more-or-less the same as dist-check-includes. meson doesn't exactly
make it easy to call a compiler with a custom set of options. The tests
are included in the test listing.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek abba22c51c meson: add hwdb/update target 2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 177929c236 meson: add git-contrib target 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 83b6af36d1 meson: add test-dlopen
test-dlopen is a very simple binary that is only linked with libc and
libdl. From it we do dlopen() on the nss and pam modules to check that they are
linked to all necessary libs.

(meson-compiled nss modules are linked to less libraries, for whatever reason.
I suspected that some deps are missing, but it turns out that my suspicions
weren't justified, and the modules load just fine. Let's keep the test though,
it is very quick, and might detect missing linkage in the future.)
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek aac2605820 meson: eliminate libsystemd_journal_internal and use libsystemd_internal less
This simplifies things and leads to a smaller installation footprint.
libsystemd_internal and libsystemd_journal_internal are linked into
libystemd-shared and available to all programs linked to libsystemd-shared.
libsystemd_journal_internal is not needed anymore, and libsystemd-shared
is used everwhere. The few exceptions are: libsystemd.so, test-engine,
test-bus-error, and various loadable modules.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek ab916f2e81 meson: add rootprefix option (for Gentoo) 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 4ff3f251b9 meson: install test data
v2:
- do not install test-data if instal-tests=no
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 4390be305b meson: replace yes/no/auto with true/false/auto
This doesn't feel as natural, but is more consistent with the boolean options
which require true/false, and allows setting of options without knowing of
which type the option is.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek b184e8feb9 meson: skip index generation when lxml is not available 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 2895c8ee9f meson: ima support 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 1eeb43f5af meson: libxkbcommon support 2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 005a29f234 meson: recreate dist-check-help 2017-04-23 21:47:28 -04:00
Michael Biebl e17e5ba9bf meson: use join_paths consistently
With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or
//lib/udev for various dir variables. Using join_paths() avoids this.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 2a4c156d64 meson: fix a bunch of substitutions
This makes the diff -r output on autotools and meson installations
empty, except for binary files and ## comments.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 3ca0cb7363 meson: properly conditionalize polkit installation
... including pkla installation on Debian.

v2:
- fix polkit-gobject-1 pkgconfig name
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek b710072da4 meson: add support for building efi modules
This is a very straightforward conversion of the rules in Makefile.am.
Generated objects (on arm64) are identical.
The only difference in executed commands is that automake uses ld -m
elf_x86_64, without us specifying the -m option anywhere. I suspect that
using the default for the given linker should be OK, so it's fine to just
skip it.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 81efcc1c89 meson: specify a timeout of 90 s for tests which take a bit longer
Both test-hashmap and test-benchmark need 10-11 s here, but might time out
under load with the default meson timeout of 30 s.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 8191c5948b meson: disable bootctl without libblkid
bootctl uses blkid probe functions to find the ESP, hence it's useless without
it. Don't even try to build it if libblkid is unavailable.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek f0bd7cc701 meson: fix compilation with -Dnetworkd=false, -Dkmod=no, -Dlibgcrypt=no
The tests are included under the conditional too, instead of specifying
'ENABLE_NETWORKD' in the test definition array, because libnetworkd_core
dependency is undefined if networkd is disabled.
2017-04-23 21:47:27 -04:00