Commit graph

28789 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 5c23128dab 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
2017-04-23 21:47:26 -04:00
Zbigniew Jędrzejewski-Szmek 521e7c3aea 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.
2017-04-23 21:47:26 -04:00
Zbigniew Jędrzejewski-Szmek bab8c072fd 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.
2017-04-23 21:28:45 -04:00
Djalal Harouni 74e941c022 Merge pull request #5774 from keszybz/printf-annotations
Printf annotation improvements
2017-04-23 01:03:42 +02:00
Martin Pitt 56744c037d Merge pull request #5756 from keszybz/make-cleanups
Various meson-independent cleanups from the meson patchset
2017-04-21 21:36:56 +02:00
Yu Watanabe 301fb51922 kernel-install: remove unneeded modules.* files created by depmod (#5766)
Fixes #5765.
2017-04-21 14:03:17 -04:00
Zbigniew Jędrzejewski-Szmek ae2173d66b 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.
2017-04-21 13:39:50 -04:00
Zbigniew Jędrzejewski-Szmek 93484b4790 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.
2017-04-21 13:39:03 -04:00
Zbigniew Jędrzejewski-Szmek ba360bb05c 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.
2017-04-21 13:37:04 -04:00
Zbigniew Jędrzejewski-Szmek c8304ba902 µ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.
2017-04-21 13:36:48 -04:00
Zbigniew Jędrzejewski-Szmek 62cc1c55cb 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.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 58eb279840 microhttpd-util: silence warnings about deprecated options
C.f. 21b6ff3684.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 4fa3993be9 test-exec-util: drop duplicate const
gcc-7 warns about this with -Wduplicate-decl-specifier.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 5224c2c706 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.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek d1c536f502 libshared: fix compilation without libblkid
This reverts a75e27eb. a75e27eb 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.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 4ca0d5ca4a basic/missing.h: drop inclusion of macro.h
It's not necessary for anything.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek d0e6ea7d5b 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.)
2017-04-21 12:05:55 -04:00
AsciiWolf 320ac7a627 man: fix small typo (#5778) 2017-04-21 15:01:09 +02:00
Susant Sahani 28959f7d3e 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.
2017-04-21 11:22:30 +02:00
Yu Watanabe 3e06055500 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
2017-04-21 11:21:17 +02:00
Susant Sahani c8b2118405 networkd: vlan add GVRP support (#5761)
Add support to configure GVRP.

Closes #5760
2017-04-21 11:01:59 +02:00
iplayinsun 41c237af80 core: move checking default_dependencies into target_add_default_dependencies. (#5762)
Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.
2017-04-21 11:00:47 +02:00
Benjamin Gilbert a2c74c0ce8 ima: Ensure policy exists before asking the kernel to load it (#5777)
e8e42b31c5 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
2017-04-21 10:53:40 +02:00
AsciiWolf 5bf1386624 l10n: update Czech Translation (#5776) 2017-04-21 08:38:37 +02:00
Franck Bui 47a3b4fb87 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
2017-04-20 21:09:13 +02:00
Zbigniew Jędrzejewski-Szmek 032b75419d basic/log: fix _printf_ annotation on log_object_internalv
Fixup for 4b58153dd2.

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.
2017-04-20 14:42:43 -04:00
Philip Withnall 46ae28d8c3 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>
2017-04-20 12:34:26 +02:00
Zbigniew Jędrzejewski-Szmek fb369a5bdf 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.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek ccc717fa5c 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.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek 86cebca72b configure: restore check for glib libraries
This is a partial revert of 2375607039. 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.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek f96c10bdca rc-local-generator: drop duplicate definitions for rc.local
We always define those paths in the configure scripts.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek f8bde603fd basic/def.h: drop TTY_GID definition
We already provide a definition through the configuration system, this
one is duplicate.
2017-04-19 19:27:01 -04:00
Michal Sekletar 6f0e6bd253 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
2017-04-19 08:52:40 +02:00
Sarang S. Dalal 31673303b9 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.
2017-04-19 08:52:08 +02:00
Yu Watanabe da4128543f tree-wide: fix wrong indent (#5757)
Fixes wrong indent introduced by the commit 43688c49d1.
2017-04-19 08:48:29 +02:00
Lennart Poettering 948a3241de Merge pull request #5708 from vcatechnology/arm-cross-compile
ARM32 cross-compile fixes
2017-04-17 15:49:06 +02:00
Martin Pitt 193a2825ce Merge pull request #5731 from jprvita/hwdb-acer
Acer hwdb keymap updates
2017-04-13 12:48:39 +02:00
slodki b0d08b056e loginctl: fix typo causing ignoring multiple session IDs (#5732)
Fixes #5733
2017-04-13 12:34:59 +02:00
Djalal Harouni 67d293da11 Merge pull request #5690 from yuwata/fix-5621
core: downgrade error message if command is prefixed with `-` and the…
2017-04-12 20:22:03 +02:00
Chris Chiu 80aa468d1d 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
2017-04-12 09:03:47 -04:00
Chris Chiu d8d51328fe 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.
2017-04-12 09:03:35 -04:00
João Paulo Rechi Vita ceb2619f48 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.
2017-04-12 09:02:34 -04:00
Mark Stosberg b8e485faf1 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
2017-04-11 23:19:06 +02:00
Dimitri John Ledkov b56be2966a 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.
2017-04-11 23:17:31 +02:00
Dimitri John Ledkov c618423a5a 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.
2017-04-11 22:34:29 +03:00
Yu Watanabe c258349f1a tmpfiles: downgrade error message when operation is not supported (#5692)
Fixes #5607
2017-04-10 13:22:18 +02:00
Evgeny Vereshchagin c9b0610856 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
2017-04-10 13:20:17 +02:00
umuttl ddbf0d4b92 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.
2017-04-10 13:12:25 +02:00
Nathaniel R. Lewis f472d466ec 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.
2017-04-06 21:13:14 +02:00
Matt Clarkson 6b5cf3ea62 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.
2017-04-06 14:33:02 +01:00