platform/upstream/systemd.git
7 years agomeson: rework processing of unit files
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 00:58:55 +0000 (20:58 -0400)]
meson: rework processing of unit files

Ideally, we would chain the m4 processing, .in substitutions, and file
installation so that the commands don't have to be repeated. Unfortunately
this does not seem currently possible, because custom_target() output cannot
be fed into install_data(), so it's necessary to use the 'install',
'install_dir' arguments to control installation. Nevertheless, rework the
rules to repeat less stuff and unify handling of conditions between the
different file types.

7 years agomeson: support (the removal of) lines with ##
Zbigniew Jędrzejewski-Szmek [Thu, 13 Apr 2017 00:05:33 +0000 (20:05 -0400)]
meson: support (the removal of) lines with ##

7 years agomeson: fix a bunch of substitutions
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:54:33 +0000 (19:54 -0400)]
meson: fix a bunch of substitutions

This makes the diff -r output on autotools and meson installations
empty, except for binary files and ## comments.

7 years agomeson: properly conditionalize polkit installation
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:09:26 +0000 (19:09 -0400)]
meson: properly conditionalize polkit installation

... including pkla installation on Debian.

v2:
- fix polkit-gobject-1 pkgconfig name

7 years agomeson: add support for building efi modules
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 19:05:55 +0000 (15:05 -0400)]
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.

7 years agomeson: specify a timeout of 90 s for tests which take a bit longer
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 17:08:47 +0000 (13:08 -0400)]
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.

7 years agomeson: disable bootctl without libblkid
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:36:20 +0000 (12:36 -0400)]
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.

7 years agomeson: fix compilation with -Dnetworkd=false, -Dkmod=no, -Dlibgcrypt=no
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:14:30 +0000 (12:14 -0400)]
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.

7 years agomeson: replace $ORIGIN with rootlibdir everywhere
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 16:02:30 +0000 (12:02 -0400)]
meson: replace $ORIGIN with rootlibdir everywhere

$ORIGIN does not work when /proc is not mounted. So the systemd binary cannot use
$ORIGIN. Use the full path everywhere for consistency.

7 years agomeson: make cpp invocations cross-compilation friendly
Zbigniew Jędrzejewski-Szmek [Tue, 11 Apr 2017 14:25:34 +0000 (10:25 -0400)]
meson: make cpp invocations cross-compilation friendly

This implementation assumes that the arguments in compiler.cmd_array()
don't contain any spaces. Since we are only interested in compilation
on Linux, I think this is a safe assumption.

Solution suggested by Nirbheek Chauhan.

7 years agomeson: add a few forgotten substitutions
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 23:06:45 +0000 (19:06 -0400)]
meson: add a few forgotten substitutions

v2:
- a few more

7 years agomeson: specify rpath on all executables linking to libshared
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 22:13:00 +0000 (18:13 -0400)]
meson: specify rpath on all executables linking to libshared

(i.e. pretty much all of them). libtools does this automatically for us.  It
would be great if meson did too. Otherwise, it would be nice to simply attach
the information about necessary rpath to the library object, and have it used
automatically for all users. Dunno, maybe there's already a way to do this.

I used '$ORIGIN' for stuff installed into libexecdir, since that's where
libshared ends up, and a full path for everything else. The advantage of
using $ORIGIN is that those binaries can be started from $DESTDIR, which can
sometimes be useful.

7 years agomeson: link test-lib{systemd,udev}-sym in the usual way
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:35:55 +0000 (17:35 -0400)]
meson: link test-lib{systemd,udev}-sym in the usual way

I tried to link to the right library by hand, because without
mesonbuid/meson#1545, libbasic.a is added to the link arguments. We want to
link the test with nothing but the library being tested. Doing the linking by
hand did achieve that, but it caused a bigger issue: meson didn't know about
the dependency on the library. And the dependency cannot be added using
link_depends, because "link_depends arguments must be strings...", and this
does not work with a compilation target. So just link in the usual way and
accept the overlinking (for now).

7 years agomeson: fix compilation of libsystemd
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:35:21 +0000 (17:35 -0400)]
meson: fix compilation of libsystemd

It uses libsystemd_journal_internal_sources, so we need to
make sure that audit_type-to-name.h is generated early enough.

7 years agomeson: update linking for fixed meson linking
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 21:11:10 +0000 (17:11 -0400)]
meson: update linking for fixed meson linking

With mesonbuid/meson#1545, meson does not propagate deps of a library
when linking with that library. That's of course the right thing to do,
but it exposes a bunch of missing deps.

This compiles with both meson-0.39.1 and meson-git + pr/1545.

7 years agomeson: add test-libudev-sym
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 19:20:42 +0000 (15:20 -0400)]
meson: add test-libudev-sym

This is slightly complicated by the fact that files('libudev.h') cannot be used
as an argument in custom_target command (string is required). This restriction
should be lifted in future versions of mesons, so this could be simplified.

7 years agomeson: add test-libsystemd-sym, fix linking of libsystemd
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 18:13:40 +0000 (14:13 -0400)]
meson: add test-libsystemd-sym, fix linking of libsystemd

This is quite messy. I think libtool might have been using something
like -Wl,--whole-archive, but I don't think meson has support for that.
For now, just recompile all the sources for linking into libsystemd
directly. This should not matter much for efficiency, since it's a
few small files.

7 years agomeson: install systemd-sulogin-shell too
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:37:52 +0000 (12:37 -0400)]
meson: install systemd-sulogin-shell too

7 years agomeson: remove libnss_*.so symlinks after install
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:26:39 +0000 (12:26 -0400)]
meson: remove libnss_*.so symlinks after install

7 years agomeson: create /var/log/journal/remote
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 16:20:03 +0000 (12:20 -0400)]
meson: create /var/log/journal/remote

C.f. https://github.com/mesonbuild/meson/issues/1604.

7 years agomeson: create various symlinks
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:55:50 +0000 (23:55 -0400)]
meson: create various symlinks

v2:
- remove bashisms

7 years agomeson: create dirs and touch /usr
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:55:05 +0000 (23:55 -0400)]
meson: create dirs and touch /usr

This is the equivalent of $(INSTALL_DIRS) and install-touch-usr-hook.
I did not bother to create the directories into which we install files,
since they will be created anyway.

v2:
- remove bashism

7 years agomeson: add unit installation symlinks
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 03:43:53 +0000 (23:43 -0400)]
meson: add unit installation symlinks

This is the equivalent of $(SYSTEM_UNIT_ALIASES) and $(GENERAL_ALIASES)
in Makefile.am.

ninja-build uninstall does not remove the symlinks, see
https://github.com/mesonbuild/meson/issues/1602.
I don't consider this a blocker: after all either one installs into $DESTDIR,
where uninstallation doesn't make much sense, or into a real system, where a
successfull uninstallation would likely destroy the system.

v2:
- remove bashisms
- add various forgotten symlinks and fix service/timer/target confusions

7 years agomeson: create a static version of libshared and link libcore and some tests to it
Zbigniew Jędrzejewski-Szmek [Sun, 9 Apr 2017 18:08:53 +0000 (14:08 -0400)]
meson: create a static version of libshared and link libcore and some tests to it

This is what autoconf-based build does, and it makes test-bus-error and
test-engine able to access the bus error mapping table. OTOH, this is a heavy
price to pay: it would be excellent to link libcore.a to libsystemd-shared-NNN.so.
Otherwise we duplicate the same code in 'systemd' and 'libsystemd-shared-NNN.so'.

-rwxrwxr-x. 1 4075544 Apr  6 20:30 systemd* <-- libcore linked against libsystemd-shared.so
-rwxrwxr-x. 1 5596504 Apr  9 14:07 systemd* <-- libcore linked against libsystemd-shared.a

v2:
- update for 6b5cf3ea621a5bfd218cd2249e066a52c0e73657

7 years agomeson: include the library symbol version list in link_depends
Zbigniew Jędrzejewski-Szmek [Sun, 9 Apr 2017 17:11:49 +0000 (13:11 -0400)]
meson: include the library symbol version list in link_depends

This is pretty ugly, because I don't know how to use a single
definition for two purposes:
- --version-script needs a path relative to the build root
- link_depends needs a path relative to source root
Also, link_depends does not accept files() output
[https://github.com/mesonbuild/meson/issues/1172], and I don't see a way to go
from files() output to a string path that can be used to craft the -Wl arg.

Ideally, a single files() result could be used in both places.
I'm leaving this as a separate commit for now.

7 years agomeson: add option to install tests
Zbigniew Jędrzejewski-Szmek [Sat, 8 Apr 2017 05:55:38 +0000 (01:55 -0400)]
meson: add option to install tests

Instead of a separate target as with make, it is decided at configure time
whether to install tests as part of the install target. The effect should be
the same.

7 years agomeson: define tests
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 04:19:09 +0000 (00:19 -0400)]
meson: define tests

Tests can be run with 'ninja-build test' or using 'mesontest'.
'-Dtests=unsafe' can be used to include the "unsafe" tests in the
test suite, same as with autotools.

v2:
- use more conf.get guards are optional components
- declare deps on generated headers for test-{af,arphrd,cap}-list

v3:
- define environment for tests

  Most test don't need this, but to be consistent with autotools-based build, and
  to avoid questions which tests need it and which don't, set the same environment
  for all tests.

v4:
- rework test generation

  Use a list of lists to define each test. This way we can reduce the
  boilerplate somewhat, although the test listings are still pretty verbose. We
  can also move the definitions of the tests to the subdirs. Unfortunately some
  subdirs are included earlier than some of the libraries that test binaries
  are linked to.  So just dump all definitions of all tests that cannot be
  defined earlier into src/test. The `executable` definitions are still at the
  top level, so the binaries are compiled into the build root.

v5:
- tag test-dnssec-complex as manual

v6:
- fix HAVE_LIBZ typo
- add missing libgobject/libgio defs
- mark test-qcow2 as manual

7 years agomeson: add TAGS target
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 18:33:27 +0000 (14:33 -0400)]
meson: add TAGS target

Quite necessary for all the emacs users out there ;)

v2:
- fix error with etags or git are not found

v3:
- move the definition of git and etags up so it's available for man/

7 years agomeson: add custom targets man/man and man/html
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 02:46:03 +0000 (22:46 -0400)]
meson: add custom targets man/man and man/html

This provides functionality similar to the ./configure --disable-manpages
switch. Man pages are built by default (if xsltproc is found), html pages
are not. Those default can be changed with -Dman=no, -Dhtml=yes/auto.
It is still possible to build one or the either, even if not configured, with
ninja-build man/man and ninja-build man/html.

v2:
- obey conditionals in index/directives list

7 years agomeson: add rule to generate custom-entities.ent
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 23:44:41 +0000 (19:44 -0400)]
meson: add rule to generate custom-entities.ent

This is a bit bare-bones, but should work for now. Maybe in the future we'll
have a way to make meson generate it for us, without specifying all the names
by hand.

7 years agomeson: avoid detecting m4 dir as a program
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 04:40:21 +0000 (00:40 -0400)]
meson: avoid detecting m4 dir as a program

This is a bug in meson, already fixed upstream.
For now, just specify the full path.

7 years agomake-man-rules: add support for generating the list in meson.build format
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 03:21:04 +0000 (23:21 -0400)]
make-man-rules: add support for generating the list in meson.build format

v2:
- sort the alias array too, otherwise the output is not stable

7 years agomeson: build systemd using meson
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 03:03:47 +0000 (23:03 -0400)]
meson: build systemd using meson

It's crucial that we can build systemd using VS2010!

... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.

This is not complete, I'm throwing it out here for your amusement and critique.

- rules for sd-boot are missing. Those might be quite complicated.

- rules for tests are missing too. Those are probably quite simple and
  repetitive, but there's lots of them.

- it's likely that I didn't get all the conditions right, I only tested "full"
  compilation where most deps are provided and nothing is disabled.

- busname.target and all .busname units are skipped on purpose.

  Otherwise, installation into $DESTDIR has the same list of files and the
  autoconf install, except for .la files.

It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.

meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.

The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.

v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments

v3:
- drop required:true and fix progs/prog typo

v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute

v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components

v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
  hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.

v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
  ("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
  split-usr==true.

v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it

v9:
- indentation

v10:
- fix check for qrencode and libaudit

v11:
- unify handling of executable paths, provide options for all progs

  This makes the meson build behave slightly differently than the
  autoconf-based one, because we always first try to find the executable in the
  filesystem, and fall back to the default. I think different handling of
  loadkeys, setfont, and telinit was just a historical accident.

  In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
  In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
  but in Debian, those directories are not included in the path.

  C.f. https://github.com/mesonbuild/meson/issues/1576.

- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable

7 years agojournal/fsprg: set -Wno-pointer-arithm only for that file
Zbigniew Jędrzejewski-Szmek [Sat, 22 Apr 2017 22:49:49 +0000 (18:49 -0400)]
journal/fsprg: set -Wno-pointer-arithm only for that file

Both gcc and clang issue a host of warnings about void pointers used in
arithmetic. The warning must be ignored in that file to avoid multiple
warnings.

Makefile.am used to set this for all libsystemd-journal-internal.a sources,
because there's no finer granularity for warnings. Let's just set it for
this one file.

7 years agogitignore: ignore all build* subdirs in main directory
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 15:24:46 +0000 (11:24 -0400)]
gitignore: ignore all build* subdirs in main directory

Now that meson builds require a separate build dir, everybody's bound to have
at least one. So let's accept the convention that build*/ is for builds, and
apply a blanket ignore rule, we shouldn't have any important files named build*
in the main directory.

7 years agoMerge pull request #5774 from keszybz/printf-annotations
Djalal Harouni [Sat, 22 Apr 2017 23:03:42 +0000 (01:03 +0200)]
Merge pull request #5774 from keszybz/printf-annotations

Printf annotation improvements

7 years agoMerge pull request #5756 from keszybz/make-cleanups
Martin Pitt [Fri, 21 Apr 2017 19:36:56 +0000 (21:36 +0200)]
Merge pull request #5756 from keszybz/make-cleanups

Various meson-independent cleanups from the meson patchset

7 years agokernel-install: remove unneeded modules.* files created by depmod (#5766)
Yu Watanabe [Fri, 21 Apr 2017 18:03:17 +0000 (03:03 +0900)]
kernel-install: remove unneeded modules.* files created by depmod (#5766)

Fixes #5765.

7 years agocoredump: fix non-literal string used in printf
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:28:19 +0000 (14:28 -0400)]
coredump: fix non-literal string used in printf

This was exposed by the previous commit. This could be potentially
unpleasant, but we are saved by the fact that this code path was only
taken for journald crashes, where we control COMM and know that it doesn't
contain any special characters. Use log_dispatch which does not do any
format processing to push the message out.

7 years agobasic/log: expose log_dispatch
Zbigniew Jędrzejewski-Szmek [Fri, 21 Apr 2017 16:52:54 +0000 (12:52 -0400)]
basic/log: expose log_dispatch

This is useful when we want to avoid printf formatting on the message.
It's nicer than using log_struct with "%s" as the format, because printf
is slow and with a large message (like from a backtrace) this would require
extra unnecessary memory.

I'm not exposing all the fields in the wrapper: only level and errno.
Those are the most likely to be useful.

7 years agotree-wide: mark log_struct with _printf_ and fix fallout
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:15:28 +0000 (14:15 -0400)]
tree-wide: mark log_struct with _printf_ and fix fallout

log_struct takes multiple format strings, each one followed by arguments.
The _printf_ annotation is not sufficiently flexible to express this,
but we can still annotate the first format string, though not its
arguments (because their number is unknown).

With the annotation, the places which specified the message id or similar
as the first pattern cause a warning from -Wformat-nonliteral. This can
be trivially fixed by putting the MESSAGE= first.

This change will help find issues where a non-literal is erroneously used
as the pattern.

7 years agoµhttpd-util: use #pragma to silence warning about nonliteral pattern
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:45:30 +0000 (14:45 -0400)]
µhttpd-util: use #pragma to silence warning about nonliteral pattern

This is safe, because we're taking a pattern which was already marked with
_printf_ and appending a literal string.

7 years agobus: include sd-{bus,messages}.h the same as other systemd headers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 22:50:13 +0000 (18:50 -0400)]
bus: include sd-{bus,messages}.h the same as other systemd headers

This is our own header, we should include use the local-include syntax
("" not <>), to make it clear we are including the one from the build tree.
All other includes of files from src/systemd/ use this scheme.

7 years agomicrohttpd-util: silence warnings about deprecated options
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:37:24 +0000 (16:37 -0400)]
microhttpd-util: silence warnings about deprecated options

C.f. 21b6ff368438bd3e809c2fabe73038eb305df296.

7 years agotest-exec-util: drop duplicate const
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:32:52 +0000 (16:32 -0400)]
test-exec-util: drop duplicate const

gcc-7 warns about this with -Wduplicate-decl-specifier.

7 years agobasic/random-util: add new header for getrandom()
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:13:27 +0000 (16:13 -0400)]
basic/random-util: add new header for getrandom()

There's some confusion: older man pages specify that linux/random.h
contains getrandom, but newer glibc has it in sys/random.h. Detect if
the newer header is available and include it. We still need the older
header for the flags.

7 years agolibshared: fix compilation without libblkid
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:05:05 +0000 (19:05 -0400)]
libshared: fix compilation without libblkid

This reverts a75e27eba75e27eb fixed the case of libcryptsetup=no, libblkid=yes,
but broke the case of libcryptsetup=no, libblkid=yes. Instead of trying to define
the function only when used, which would result in too much ifdeffery, just silence
the warning.

7 years agobasic/missing.h: drop inclusion of macro.h
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:04:15 +0000 (19:04 -0400)]
basic/missing.h: drop inclusion of macro.h

It's not necessary for anything.

7 years agoMakefile.am: remove duplicated rules for efi
Zbigniew Jędrzejewski-Szmek [Tue, 11 Apr 2017 03:27:55 +0000 (23:27 -0400)]
Makefile.am: remove duplicated rules for efi

Specifying the same rule with a slightly different dep list was not useful,
since make cannot distinguish rules with the same input / output. (It possibly
could have two rules with different dependency list, but here all dependencies
that are different between the two rules are always present, so the two rules
are effectively the same.)

7 years agoman: fix small typo (#5778)
AsciiWolf [Fri, 21 Apr 2017 13:01:09 +0000 (15:01 +0200)]
man: fix small typo (#5778)

7 years agonetworkd: route - support 'onlink' routes (#5734)
Susant Sahani [Fri, 21 Apr 2017 09:22:30 +0000 (14:52 +0530)]
networkd: route - support 'onlink' routes (#5734)

This work based on Tom's original patch
teg@1312172

By setting GatewayOnlink=yes, the kernel will assume that the gateway is onlink
even if there is no route to it.

Resolves issue #1283.

7 years agounits: systemd-resolved should start before network-online.target and nss-lookup...
Yu Watanabe [Fri, 21 Apr 2017 09:21:17 +0000 (18:21 +0900)]
units: systemd-resolved should start before network-online.target and nss-lookup.target (#5691)

systemd-resolved provides
1. local API via NSS and D-Bus
2. kind of a local "DNS proxy" through its stub listener
The 1st item should be started before nss-lookup.target.
The 2nd item should be started before network-online.target,
because if the networking works in general, then DNS (and DNS proxy) should too.

Fixes #5650

7 years agonetworkd: vlan add GVRP support (#5761)
Susant Sahani [Fri, 21 Apr 2017 09:01:59 +0000 (14:31 +0530)]
networkd: vlan add GVRP support (#5761)

Add support to configure GVRP.

Closes #5760

7 years agocore: move checking default_dependencies into target_add_default_dependencies. (...
iplayinsun [Fri, 21 Apr 2017 09:00:47 +0000 (18:00 +0900)]
core: move checking default_dependencies into target_add_default_dependencies. (#5762)

Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.

7 years agoima: Ensure policy exists before asking the kernel to load it (#5777)
Benjamin Gilbert [Fri, 21 Apr 2017 08:53:40 +0000 (01:53 -0700)]
ima: Ensure policy exists before asking the kernel to load it (#5777)

e8e42b31c5a950a7b43d64f4a531ec59750e823e added support for having the
kernel load the IMA policy directly, but didn't check that the policy
file exists.  If not, this produced a kernel message:

    IMA: policy update failed

7 years agol10n: update Czech Translation (#5776)
AsciiWolf [Fri, 21 Apr 2017 06:38:37 +0000 (08:38 +0200)]
l10n: update Czech Translation (#5776)

7 years agohwdb: fix warning "atkbd serio0: Unknown key pressed" (#5772)
Franck Bui [Thu, 20 Apr 2017 19:09:13 +0000 (21:09 +0200)]
hwdb: fix warning "atkbd serio0: Unknown key pressed" (#5772)

At each time pressing the WiFi Fn key on Dell Latitude E7270 laptop, the system
reports the following error/warning messages:

  atkbd serio0: Unknown key pressed (translated set 2, code 0x88 on isa0060/serio0).
  atkbd serio0: Use 'setkeycodes e008 ' to make it known.

This is due to commit 0e33634 which was added to fix
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/1441849.

However on Dell Latitude E7* models, we need to restore the old generic
behavior which consists in ignoring the key event since it's already done by
the HW.

Indeed the hardware has a specific driver (dell_wmi) to handle rfkill in the
hardware level. So, as long as the hardware handles, the best is to leave as
is.

This patch was originally written by Takashi Iwai.

Fixes #5047

7 years agobasic/log: fix _printf_ annotation on log_object_internalv
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:09:47 +0000 (14:09 -0400)]
basic/log: fix _printf_ annotation on log_object_internalv

Fixup for 4b58153dd22172d817055d2a09a0cdf3f4bd9db3.

I saw this because of a clang warning. With gcc the -Wformat-nonliteral warning
doesn't seem to work as expected.

In two places, a string constructed with strjoina is used as the pattern. This
is safe, because we're taking a pattern which was already marked with _printf_
and prepending a known value to it.  Those places are marked with #pragma to
silence the warning.

7 years agoman: Fix reference to timer-sync.target instead of time-sync.target (#5764)
Philip Withnall [Thu, 20 Apr 2017 10:34:26 +0000 (11:34 +0100)]
man: Fix reference to timer-sync.target instead of time-sync.target (#5764)

Also fix an erroneous reference to it in the NEWS file, for posterity.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
7 years agoMakefile.am: link dbus-org.freedesktop.network1 alias in /etc
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 15:59:58 +0000 (11:59 -0400)]
Makefile.am: link dbus-org.freedesktop.network1 alias in /etc

This makes dbus-org.freedesktop.network1.service like dbus-org.freedesktop.resolve1.service.
When systemd-networkd.service is disabled, the alias is also removed.

7 years agotest-compress*: silence warning about unused definitions when w/o both xz and lz4
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 13:28:50 +0000 (09:28 -0400)]
test-compress*: silence warning about unused definitions when w/o both xz and lz4

I think it's nice to mark the test as skipped instead of omitting
it entirely, hence #ifdefs in the code instead of excluding the test
in Makefile.am/meson.build.

7 years agoconfigure: restore check for glib libraries
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 15:03:00 +0000 (11:03 -0400)]
configure: restore check for glib libraries

This is a partial revert of 2375607039517c88df. We still have code
guarded by HAVE_GLIB in tests.

v2:
- do not define the automake conditional, it wasn't used anywhere
- rename --disable-gudev to --disable-glib

v3:
- do not cause an error if the libs are not found, this is supposed
  to be an "auto" dep by default.

7 years agorc-local-generator: drop duplicate definitions for rc.local
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:30:58 +0000 (19:30 -0400)]
rc-local-generator: drop duplicate definitions for rc.local

We always define those paths in the configure scripts.

7 years agobasic/def.h: drop TTY_GID definition
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 04:12:40 +0000 (00:12 -0400)]
basic/def.h: drop TTY_GID definition

We already provide a definition through the configuration system, this
one is duplicate.

7 years agounits: drop explicit NotifyAccess setting from journald's unit file (#5749)
Michal Sekletar [Wed, 19 Apr 2017 06:52:40 +0000 (08:52 +0200)]
units: drop explicit NotifyAccess setting from journald's unit file (#5749)

systemd-journald service consists of only single process and that is the
MainPID. Make unit file shorter and drop NotifyAccess=all since it is
not useful in such case.

https://lists.freedesktop.org/archives/systemd-devel/2017-April/038667.html

7 years agohwdb: MS Surface Pro Type Cover touchpad integration (#5751)
Sarang S. Dalal [Wed, 19 Apr 2017 06:52:08 +0000 (08:52 +0200)]
hwdb: MS Surface Pro Type Cover touchpad integration (#5751)

Sets ID_INPUT_TOUCHPAD_INTEGRATION=internal for Microsoft Surface Pro Type Covers (IDs should cover at least the type covers for the Surface Pro 3 and 4). This is needed so that libinput can disable the touchpad while typing.

7 years agotree-wide: fix wrong indent (#5757)
Yu Watanabe [Wed, 19 Apr 2017 06:48:29 +0000 (15:48 +0900)]
tree-wide: fix wrong indent (#5757)

Fixes wrong indent introduced by the commit 43688c49d1fdb585196d94e2e30bb29755fa591b.

7 years agoMerge pull request #5708 from vcatechnology/arm-cross-compile
Lennart Poettering [Mon, 17 Apr 2017 13:49:06 +0000 (15:49 +0200)]
Merge pull request #5708 from vcatechnology/arm-cross-compile

ARM32 cross-compile fixes

7 years agoMerge pull request #5731 from jprvita/hwdb-acer
Martin Pitt [Thu, 13 Apr 2017 10:48:39 +0000 (12:48 +0200)]
Merge pull request #5731 from jprvita/hwdb-acer

Acer hwdb keymap updates

7 years agologinctl: fix typo causing ignoring multiple session IDs (#5732)
slodki [Thu, 13 Apr 2017 10:34:59 +0000 (12:34 +0200)]
loginctl: fix typo causing ignoring multiple session IDs (#5732)

Fixes #5733

7 years agoMerge pull request #5690 from yuwata/fix-5621
Djalal Harouni [Wed, 12 Apr 2017 18:22:03 +0000 (20:22 +0200)]
Merge pull request #5690 from yuwata/fix-5621

core: downgrade error message if command is prefixed with `-` and the…

7 years agohwdb: Add power button mapping for Acer models
Chris Chiu [Wed, 12 Apr 2017 13:03:47 +0000 (09:03 -0400)]
hwdb: Add power button mapping for Acer models

The power key keycode e076 is emitted on several different Acer laptop
models, and it is expected that it will also be used on upcoming models.
Verified on the following models:

Aspire ES1-421
Aspire ES1-432
Aspire A515-51
Aspire A515-51G
Aspire A517-51
Aspire A517-51G
Nitro AN515-31

7 years agohwdb: Fix airplane mode key for all Acer series
Chris Chiu [Wed, 12 Apr 2017 13:03:35 +0000 (09:03 -0400)]
hwdb: Fix airplane mode key for all Acer series

According to the key code v2.02 from Acer, scancode E0 86 will be
generated for airplane mode hotkey. Verified on Aspire, TravelMate,
Easynote and Predator.

7 years agohwdb: Map 0x8a to F20 on the Acer Travelmate P648-G2-MG
João Paulo Rechi Vita [Tue, 4 Apr 2017 14:48:06 +0000 (10:48 -0400)]
hwdb: Map 0x8a to F20 on the Acer Travelmate P648-G2-MG

This model emits 0x9a for the microphone mute button above the keyboard,
so let's map it to correct keycode.

7 years agoman: document how to include an equals sign in a value provided to Environment= ...
Mark Stosberg [Tue, 11 Apr 2017 21:19:06 +0000 (17:19 -0400)]
man: document how to include an equals sign in a value provided to Environment= (#5710)

It wasn't clear before how an equals sign in an "Environment=" value might be
handled. Ref:
http://stackoverflow.com/questions/43278883/how-to-write-systemd-environment-variables-value-which-contains/43280157

7 years agonetworkd: Add bridge port priority setting (#5545)
Dimitri John Ledkov [Tue, 11 Apr 2017 21:17:31 +0000 (22:17 +0100)]
networkd: Add bridge port priority setting (#5545)

Allow setting bridge port priority in the Bridge section of the network file,
similar to e.g. port path cost setting.

Set the default to an invalid value of 128, and only set the port priority when
it's not 128. Unlike e.g. path cost, zero is a valid priority value.

Add a networkd-test.py to check that bridge port priority is correctly set.

Incidently, fix bridge port cost type and document valid ranges.

7 years agotest/TEST-12-ISSUE-3171: specify -w1 option to netcat due to default change. (#5722)
Dimitri John Ledkov [Tue, 11 Apr 2017 19:34:29 +0000 (20:34 +0100)]
test/TEST-12-ISSUE-3171: specify -w1 option to netcat due to default change. (#5722)

On Ubuntu 17.04 (zesty zapus) netcat-openbsd was upgraded from 1.105-7ubuntu1
to 1.130-3, at the same time the defaults got changed from -q0 to -q-1
(infinity) the net result is that `echo A | nc -U' call now hangs, preventing
the testcase to complete. One could use the old default of -q0, but that option
is not available in some netcat implementations. Thus settle to specify -w1
instead to mitigate the testcase hang.

7 years agotmpfiles: downgrade error message when operation is not supported (#5692)
Yu Watanabe [Mon, 10 Apr 2017 11:22:18 +0000 (20:22 +0900)]
tmpfiles: downgrade error message when operation is not supported (#5692)

Fixes #5607

7 years agocore: fix values of BindPaths and BindReadOnlyPaths properties on 32-bit platforms...
Evgeny Vereshchagin [Mon, 10 Apr 2017 11:20:17 +0000 (14:20 +0300)]
core: fix values of BindPaths and BindReadOnlyPaths properties on 32-bit platforms (#5713)

$ busctl get-property \
    org.freedesktop.systemd1 \
    /org/freedesktop/systemd1/unit/run_2dr471de87550554a6dbb165501c33c5dab_2eservice \
    org.freedesktop.systemd1.Service BindReadOnlyPaths

a(ssbt) 1 "/etc" "/etc" false 9228635523571007488

The correct values are 0 and 16384

7 years agocore: downgrade legit error logs (#5705)
umuttl [Mon, 10 Apr 2017 11:12:25 +0000 (13:12 +0200)]
core: downgrade legit error logs (#5705)

manager_sync_bus_names() function retrieves the dbus names
and compares it with unit bus names. It could be right
after the list is retrieved, the dbus peer is disconnected.
In this case it is really not an ERROR print if
sd_bus_get_name_creds() or sd_bus_creds_get_unique_name()
fail.

7 years agoRemove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)
Nathaniel R. Lewis [Thu, 6 Apr 2017 19:13:14 +0000 (12:13 -0700)]
Remove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)

At present, devices implementing the BTN_DPAD_UP/DOWN/LEFT/RIGHT
codes will be incorrectly classified as key devices.  This causes
devices respecting the Linux gamepad spec (such as the DS3 as of
kernel 4.12) to be classified as keyboards by X11.

This is caused by the test_key function checking all codes on
[KEY_OK, BTN_TRIGGER_HAPPY).  Unfortunately the BTN_DPAD_* codes
are placed between KEY_LIGHTS_TOGGLE and KEY_ALS_TOGGLE.  This
patch splits the upper key block check into the block before and
after the BTN_DPAD_* codes.  An array is used to avoid dedicated,
per block loops in the event that more event codes are added in
the future.

7 years agobuild-sys: correct blkid.h includes
Matt Clarkson [Thu, 6 Apr 2017 13:12:17 +0000 (14:12 +0100)]
build-sys: correct blkid.h includes

When using pkg-config to determine the include flags for blkid the
flags are returned as:

    $ pkg-config blkid --cflags
    -I/usr/include/blkid -I/usr/include/uuid

We use the <blkid/blkid.h> include which would be correct when using
the default compiler /usr/include header search path. However, when
cross-compiling the blkid.h will not be installed at /usr/include and
highly likely in a temporary system root. It is futher compounded if
the cross-compile packages are split up and the blkid package is not
available in the same sysroot as the compiler.

Regardless of the compilation setup, the correct include path should be
<blkid.h> if using the pkg-config returned CFLAGS.

7 years agobuild-sys: correct ARM32 GNU EFI boot binary build
Matt Clarkson [Thu, 6 Apr 2017 13:12:15 +0000 (14:12 +0100)]
build-sys: correct ARM32 GNU EFI boot binary build

Due to ARM not having an EFI capable objcopy we need to use the binary
output argument. This is correctly set up for AArch64 but is missed
when building for ARM32. This patch adds the ARCH_ARM automake define
which can then be used in the makefile to determine if to use the
correct linker flags.

The addition of the ARM32 flags is a copy and paste from the AArch64 to
create a logical OR for the ARCH_AARCH64 and ARCH_ARM variables. I
couldn't figure out a better way to create the conditional with basic
Make language constructs.

7 years agobuild-sys: correctly search for gnu-efi header
Matt Clarkson [Thu, 6 Apr 2017 13:12:11 +0000 (14:12 +0100)]
build-sys: correctly search for gnu-efi header

When the user provides the --with-efi-includedir we incorrectly search
for the header at /usr/include not the provided location. This patch
changes the check to use the provided value so that non-standard header
locations are supported.

This situation occurs commonly when cross-compiling systemd because the
GNU EFI headers and library will not be installed into the root
locations but highly likely a temporary system root.

7 years agoMerge pull request #5706 from keszybz/make-cleanups
Lennart Poettering [Wed, 5 Apr 2017 10:10:11 +0000 (12:10 +0200)]
Merge pull request #5706 from keszybz/make-cleanups

Move busctl to its own dir and other cleanups

7 years agologind: Stopped inhibitions should be considered inactive (#5698)
afrantzis [Wed, 5 Apr 2017 08:32:55 +0000 (11:32 +0300)]
logind: Stopped inhibitions should be considered inactive (#5698)

7 years agobuild-sys: drop obsolete hook from Makefile.am
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 02:39:30 +0000 (22:39 -0400)]
build-sys: drop obsolete hook from Makefile.am

7 years agoudev: rename gperf struct name to match other headers
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2017 00:02:58 +0000 (20:02 -0400)]
udev: rename gperf struct name to match other headers

This makes it easier to use the same generator script as for other
gperf scripts. With automake each gperf file had it's own rule, but
with meson I'm trying to use one script, and this inconsistency made
that harder.

7 years agotree-wide: standardize on $(PACKAGE_VERSION) for the version string
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 16:15:33 +0000 (12:15 -0400)]
tree-wide: standardize on $(PACKAGE_VERSION) for the version string

We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents.
$(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and
drop the other define.

7 years agobuild-sys: drop undefined target ref from Makefile.am
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:52:47 +0000 (20:52 -0400)]
build-sys: drop undefined target ref from Makefile.am

7 years agobuild-sys: drop undefined var ref from Makefile.am
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:52:03 +0000 (20:52 -0400)]
build-sys: drop undefined var ref from Makefile.am

7 years agobuild-sys: use a single ENABLE_LOGIND conditional
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:12:36 +0000 (20:12 -0400)]
build-sys: use a single ENABLE_LOGIND conditional

We used ENABLE_LOGIND for the automake conditional, and HAVE_LOGIND
for the ifdef. That wasn't wrong, but it certainly was confusing.

Also, move the ifdeffery to avoid warning about unused static function
logind_set_wall_message() when logind is disabled.

7 years agoshared/dissect-image: fix warning about unused function when !HAVE_BLKID
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2017 03:21:20 +0000 (23:21 -0400)]
shared/dissect-image: fix warning about unused function when !HAVE_BLKID

7 years agoMove busctl sources to src/busctl
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2017 02:49:02 +0000 (22:49 -0400)]
Move busctl sources to src/busctl

busctl is not part of libsystemd, and should not be stored under libsystemd.
In particular this is confusing because busctl is linked with libshared, but
stuff in libsystemd is not supposed to depend on libshared.

7 years agopo: fix typo in pt_BR
Martin Pitt [Tue, 4 Apr 2017 10:08:46 +0000 (12:08 +0200)]
po: fix typo in pt_BR

See https://github.com/systemd/systemd/pull/5694#issuecomment-291446842

7 years agoman: fix <function> tag (#5686)
Lucas Werkmeister [Tue, 4 Apr 2017 06:47:30 +0000 (08:47 +0200)]
man: fix <function> tag (#5686)

7 years agoUpdate Brazilian Portuguese translation (#5694)
Rafael Fontenelle [Mon, 3 Apr 2017 21:29:09 +0000 (18:29 -0300)]
Update Brazilian Portuguese translation (#5694)

7 years agohwdb: Asus TP300LJ accelerometer quirks (#5681)
wiertel [Mon, 3 Apr 2017 07:53:10 +0000 (09:53 +0200)]
hwdb: Asus TP300LJ accelerometer quirks (#5681)

iio-sensor-proxy expects the accelerometer oriented as follows:
positive x - to the right, positive y - up (opposite to gravity).
The hardware in the Asus TP300LJ-DW049H is however oriented
differently:
positive x - down, positive y - to the left
This commit adds a ACCEL_MOUNT_MATRIX quirk for this
particular laptop model.

7 years agocore: downgrade error message if command is prefixed with `-` and the command is...
Yu Watanabe [Mon, 3 Apr 2017 06:38:33 +0000 (15:38 +0900)]
core: downgrade error message if command is prefixed with `-` and the command is not found

Fixes #5621

7 years agoMerge pull request #5589 from jasonreeder/claimed_address_fix
Lennart Poettering [Sat, 1 Apr 2017 09:41:58 +0000 (11:41 +0200)]
Merge pull request #5589 from jasonreeder/claimed_address_fix

libsystemd-network: sd-ipv4ll: acquire new address after claimed addr…