]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #5420 from OpenDZ/tixxdz/namespace-fixes-v2
authorLennart Poettering <lennart@poettering.net>
Tue, 9 May 2017 18:42:32 +0000 (20:42 +0200)
committerGitHub <noreply@github.com>
Tue, 9 May 2017 18:42:32 +0000 (20:42 +0200)
Namespace: RootImage= RootDirectory= and MountAPIVFS fixes

342 files changed:
.dir-locals.el
.github/CONTRIBUTING.md
.gitignore
.mkosi/mkosi.arch
.mkosi/mkosi.debian
.mkosi/mkosi.fedora
Makefile-man.am
Makefile.am
NEWS
README
README.md
TODO
catalog/meson.build [new file with mode: 0644]
configure.ac
docs/sysvinit/meson.build [new file with mode: 0644]
docs/var-log/meson.build [new file with mode: 0644]
hwdb/60-evdev.hwdb
hwdb/60-keyboard.hwdb
hwdb/60-sensor.hwdb
hwdb/70-mouse.hwdb
hwdb/70-touchpad.hwdb
hwdb/acpi-update.py
hwdb/meson.build [new file with mode: 0644]
hwdb/parse_hwdb.py
man/90-rearrange-path.py
man/custom-entities.ent.in [new file with mode: 0644]
man/environment.d.xml
man/journalctl.xml
man/kernel-command-line.xml
man/less-variables.xml
man/logind.conf.xml
man/machinectl.xml
man/meson.build [new file with mode: 0644]
man/pam_systemd.xml
man/resolved.conf.xml
man/rules/meson.build [new file with mode: 0644]
man/sd_bus_message_append.xml
man/sd_id128_randomize.xml
man/sd_journal_get_catalog.xml
man/sd_journal_get_fd.xml
man/sd_login_monitor_new.xml
man/systemctl.xml
man/systemd-ask-password.xml
man/systemd-coredump.xml
man/systemd-delta.xml
man/systemd-environment-d-generator.xml
man/systemd-hibernate-resume-generator.xml
man/systemd-hibernate-resume@.service.xml
man/systemd-mount.xml
man/systemd-resolve.xml
man/systemd-vconsole-setup.service.xml
man/systemd.environment-generator.xml
man/systemd.exec.xml
man/systemd.journal-fields.xml
man/systemd.mount.xml
man/systemd.netdev.xml
man/systemd.network.xml
man/systemd.service.xml
man/systemd.special.xml
man/systemd.time.xml
man/systemd.timer.xml
man/systemd.unit.xml
man/udevadm.xml
meson.build [new file with mode: 0644]
meson_options.txt [new file with mode: 0644]
mkosi.build
network/meson.build [new file with mode: 0644]
po/cs.po
po/meson.build [new file with mode: 0644]
po/pt_BR.po
po/sv.po
rules/.gitignore
rules/50-udev-default.rules.in [moved from rules/50-udev-default.rules with 98% similarity]
rules/60-cdrom_id.rules
rules/60-persistent-input.rules
rules/meson.build [new file with mode: 0644]
shell-completion/bash/meson.build [new file with mode: 0644]
shell-completion/bash/systemctl.in
shell-completion/zsh/_sd_outputmodes
shell-completion/zsh/meson.build [new file with mode: 0644]
src/analyze/analyze.c
src/analyze/meson.build [new file with mode: 0644]
src/basic/af-to-name.awk [new file with mode: 0644]
src/basic/arphrd-to-name.awk [new file with mode: 0644]
src/basic/blkid-util.h
src/basic/cap-to-name.awk [new file with mode: 0644]
src/basic/def.h
src/basic/dirent-util.c
src/basic/dirent-util.h
src/basic/errno-to-name.awk [new file with mode: 0644]
src/basic/extract-word.c
src/basic/extract-word.h
src/basic/generate-af-list.sh [new file with mode: 0755]
src/basic/generate-arphrd-list.sh [new file with mode: 0755]
src/basic/generate-cap-list.sh [new file with mode: 0755]
src/basic/generate-errno-list.sh [new file with mode: 0755]
src/basic/generate-gperfs.py [new file with mode: 0755]
src/basic/glob-util.c
src/basic/glob-util.h
src/basic/in-addr-util.c
src/basic/in-addr-util.h
src/basic/journal-importer.c
src/basic/log.c
src/basic/log.h
src/basic/meson.build [new file with mode: 0644]
src/basic/missing.h
src/basic/parse-util.c
src/basic/random-util.c
src/basic/rm-rf.c
src/boot/bootctl.c
src/boot/efi/boot.c
src/boot/efi/measure.c
src/boot/efi/measure.h
src/boot/efi/meson.build [new file with mode: 0644]
src/boot/efi/no-undefined-symbols.sh [new file with mode: 0755]
src/boot/efi/stub.c
src/busctl/busctl-introspect.c [moved from src/libsystemd/sd-bus/busctl-introspect.c with 100% similarity]
src/busctl/busctl-introspect.h [moved from src/libsystemd/sd-bus/busctl-introspect.h with 100% similarity]
src/busctl/busctl.c [moved from src/libsystemd/sd-bus/busctl.c with 100% similarity]
src/cgtop/cgtop.c
src/core/busname.c
src/core/dbus-execute.c
src/core/dbus-unit.c
src/core/dbus.c
src/core/device.c
src/core/execute.c
src/core/ima-setup.c
src/core/job.c
src/core/job.h
src/core/load-fragment-gperf-nulstr.awk [new file with mode: 0644]
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/main.c
src/core/meson.build [new file with mode: 0644]
src/core/selinux-access.c
src/core/service.c
src/core/target.c
src/core/transaction.c
src/core/unit.c
src/core/unit.h
src/coredump/coredump.c
src/coredump/meson.build [new file with mode: 0644]
src/fstab-generator/fstab-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/hostname/meson.build [new file with mode: 0644]
src/hwdb/hwdb.c
src/import/meson.build [new file with mode: 0644]
src/import/pull-common.c
src/import/pull-job.c
src/import/pull-job.h
src/import/pull-raw.c
src/import/pull-tar.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal-remote/log-generator.py
src/journal-remote/meson.build [new file with mode: 0644]
src/journal-remote/microhttpd-util.c
src/journal-remote/microhttpd-util.h
src/journal/audit_type-to-name.awk [new file with mode: 0644]
src/journal/fsprg.c
src/journal/generate-audit_type-list.sh [new file with mode: 0755]
src/journal/journal-file.c
src/journal/journalctl.c
src/journal/journald-native.c
src/journal/journald-server.c
src/journal/meson.build [new file with mode: 0644]
src/journal/sd-journal.c
src/journal/test-compress-benchmark.c
src/journal/test-compress.c
src/kernel-install/50-depmod.install
src/kernel-install/meson.build [new file with mode: 0644]
src/libsystemd-network/meson.build [new file with mode: 0644]
src/libsystemd-network/network-internal.c
src/libsystemd-network/network-internal.h
src/libsystemd-network/sd-ipv4ll.c
src/libsystemd-network/sd-lldp.c
src/libsystemd-network/sd-ndisc.c
src/libsystemd/libsystemd.sym
src/libsystemd/meson.build [new file with mode: 0644]
src/libsystemd/sd-bus/DIFFERENCES [deleted file]
src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
src/libsystemd/sd-bus/PORTING-DBUS1 [deleted file]
src/libsystemd/sd-bus/bus-convenience.c
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-message.h
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-bus/test-bus-track.c
src/libsystemd/sd-netlink/netlink-types.c
src/libsystemd/sd-netlink/netlink-types.h
src/libsystemd/sd-netlink/netlink-util.h
src/libsystemd/sd-netlink/rtnl-message.c
src/libudev/libudev.pc.in
src/libudev/meson.build [new file with mode: 0644]
src/locale/localed.c
src/locale/meson.build [new file with mode: 0644]
src/login/loginctl.c
src/login/logind-inhibit.c
src/login/logind.c
src/login/meson.build [new file with mode: 0644]
src/machine/machinectl.c
src/machine/meson.build [new file with mode: 0644]
src/network/meson.build [new file with mode: 0644]
src/network/netdev/geneve.c [new file with mode: 0644]
src/network/netdev/geneve.h [new file with mode: 0644]
src/network/netdev/netdev-gperf.gperf
src/network/netdev/netdev.c
src/network/netdev/netdev.h
src/network/netdev/vlan.c
src/network/netdev/vlan.h
src/network/netdev/vxlan.c
src/network/netdev/vxlan.h
src/network/networkd-address-label.c [new file with mode: 0644]
src/network/networkd-address-label.h [new file with mode: 0644]
src/network/networkd-conf.c
src/network/networkd-ipv4ll.c
src/network/networkd-ipv6-proxy-ndp.c
src/network/networkd-link.c
src/network/networkd-link.h
src/network/networkd-ndisc.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h
src/network/networkd-route.c
src/network/networkd-route.h
src/nspawn/meson.build [new file with mode: 0644]
src/nspawn/nspawn.c
src/rc-local-generator/rc-local-generator.c
src/resolve/dns_type-to-name.awk [new file with mode: 0644]
src/resolve/generate-dns_type-gperf.py [new file with mode: 0755]
src/resolve/generate-dns_type-list.sed [new file with mode: 0644]
src/resolve/meson.build [new file with mode: 0644]
src/resolve/resolve-tool.c
src/resolve/resolved-bus.c
src/resolve/resolved-conf.c
src/resolve/resolved-dns-server.c
src/resolve/resolved-dns-transaction.c
src/resolve/resolved-dns-trust-anchor.c
src/resolve/resolved-gperf.gperf
src/resolve/resolved-link.c
src/resolve/resolved-llmnr.c
src/resolve/resolved-manager.c
src/resolve/resolved-mdns.c
src/resolve/resolved.conf.in
src/shared/base-filesystem.c
src/shared/cgroup-show.c
src/shared/cgroup-show.h
src/shared/conf-parser.c
src/shared/conf-parser.h
src/shared/dissect-image.c
src/shared/efivars.c
src/shared/generator.c
src/shared/generator.h
src/shared/logs-show.c
src/shared/meson.build [new file with mode: 0644]
src/shared/output-mode.c
src/shared/output-mode.h
src/shared/pager.c
src/shared/seccomp-util.c
src/shared/seccomp-util.h
src/shared/sleep-config.c
src/sulogin-shell/.gitignore [new file with mode: 0644]
src/sulogin-shell/meson.build [new file with mode: 0644]
src/sulogin-shell/systemd-sulogin-shell.in [new file with mode: 0755]
src/systemctl/systemctl.c
src/systemd/_sd-common.h
src/systemd/meson.build [new file with mode: 0644]
src/systemd/sd-bus.h
src/systemd/sd-event.h
src/systemd/sd-ipv4ll.h
src/systemd/sd-netlink.h
src/sysv-generator/sysv-generator.c
src/test/generate-sym-test.py [new file with mode: 0755]
src/test/meson.build [new file with mode: 0644]
src/test/test-dlopen.c [new file with mode: 0644]
src/test/test-exec-util.c
src/test/test-glob-util.c
src/test/test-hashmap-ordered.awk [new file with mode: 0644]
src/test/test-libudev.c
src/test/test-nss.c
src/test/test-path-util.c
src/test/test-sizeof.c
src/test/test-udev.c
src/timedate/meson.build [new file with mode: 0644]
src/timesync/meson.build [new file with mode: 0644]
src/timesync/timesyncd-conf.c
src/tmpfiles/tmpfiles.c
src/udev/generate-keyboard-keys-list.sh [new file with mode: 0755]
src/udev/meson.build [new file with mode: 0644]
src/udev/scsi_id/scsi_id.c
src/udev/udev-builtin-blkid.c
src/udev/udev-builtin-input_id.c
src/udev/udev-builtin-keyboard.c
src/udev/udev-builtin-net_id.c
src/udev/udev-ctrl.c
src/udev/udev.pc.in
src/udev/udevadm-hwdb.c
src/udev/udevadm-info.c
src/udev/udevadm-test.c
src/udev/udevadm.c
src/udev/udevd.c
src/update-done/update-done.c
src/vconsole/meson.build [new file with mode: 0644]
src/vconsole/vconsole-setup.c
sysctl.d/meson.build [new file with mode: 0644]
system-preset/90-systemd.preset
sysusers.d/basic.conf.in
sysusers.d/meson.build [new file with mode: 0644]
test/README.testsuite
test/TEST-12-ISSUE-3171/test.sh
test/create-sys-script.py
test/meson.build [new file with mode: 0644]
test/networkd-test.py
test/rule-syntax-check.py
test/sys-script.py
test/sysv-generator-test.py
test/test-efi-create-disk.sh
test/test-exec-deserialization.py [new file with mode: 0755]
tmpfiles.d/meson.build [new file with mode: 0644]
tools/catalog-report.py [changed mode: 0644->0755]
tools/gdb-sd_dump_hashmaps.py
tools/make-directive-index.py
tools/make-man-index.py
tools/make-man-rules.py [changed mode: 0644->0755]
tools/meson-check-compilation.sh [new file with mode: 0755]
tools/meson-check-help.sh [new file with mode: 0755]
tools/meson-git-contrib.sh [new file with mode: 0755]
tools/meson-hwdb-update.sh [new file with mode: 0755]
tools/meson-link-test.c [new file with mode: 0644]
tools/meson-make-symlink.sh [new file with mode: 0755]
tools/xml_helper.py [changed mode: 0644->0755]
units/emergency.service.in
units/meson-add-wants.sh [new file with mode: 0755]
units/meson.build [new file with mode: 0644]
units/quotaon.service.in
units/rescue.service.in
units/serial-getty@.service.m4
units/systemd-journal-upload.service.in
units/systemd-journald.service.in
units/systemd-networkd.service.m4.in
units/systemd-quotacheck.service.in
units/systemd-resolved.service.m4.in
units/user/meson.build [new file with mode: 0644]

index 3e1b2d76c070c5f36504eae6fd5d37c815ef6cdd..5ef7e11634cd942602ba45b97e7e86a9e62d070e 100644 (file)
@@ -20,4 +20,8 @@
             (eval . (c-set-offset 'arglist-intro '++))
             (eval . (c-set-offset 'arglist-close 0))))
  (nxml-mode . ((nxml-child-indent . 2)
-               (fill-column . 119))))
+               (fill-column . 119)))
+ (meson-mode . ((meson-indent-basic . 8)))
+ (sh-mode . ((sh-basic-offset . 8)
+             (sh-indentation . 8)))
+ (awk-mode . ((c-basic-offset . 8))))
index abee9cc740a96aa73bc56c866403e057df1b1e34..68b948a161ac3af802d7edce28c369ac1fe017aa 100644 (file)
@@ -4,13 +4,17 @@ We welcome contributions from everyone. However, please follow the following gui
 
 ## Filing Issues
 
-* We use GitHub Issues **exclusively** for tracking **bugs** and **feature** **requests** of systemd. If you are looking for help, please contact our [mailing list](http://lists.freedesktop.org/mailman/listinfo/systemd-devel) instead.
+* We use GitHub Issues **exclusively** for tracking **bugs** and **feature** **requests** of systemd. If you are looking for help, please contact our [mailing list](https://lists.freedesktop.org/mailman/listinfo/systemd-devel) instead.
 * We only track bugs in the **two** **most** **recently** **released** **versions** of systemd in the GitHub Issue tracker. If you are using an older version of systemd, please contact your distribution's bug tracker instead.
 * When filing an issue, specify the **systemd** **version** you are experiencing the issue with. Also, indicate which **distribution** you are using.
 * Please include an explanation how to reproduce the issue you are pointing out.
 
 Following these guidelines makes it easier for us to process your issue, and ensures we won't close your issue right-away for being misfiled.
 
+## Security vulnerability reports
+
+If you discover a security vulnerability, we'd appreciate a non-public disclosure. The issue tracker and mailing list listed above are fully public. If you need to reach systemd developers in a non-public way, report the issue in one of the "big" distributions using systemd: [Fedora](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=systemd) (be sure to check "Security Sensitive Bug" under "Show Advanced Fields"), [Ubuntu](https://launchpad.net/ubuntu/+source/systemd/+filebug) (be sure to change "This bug contains information that is" from "Public" to "Private Security"), or [Debian](mailto:security@debian.org). Various systemd developers are active distribution maintainers and will propagate the information about the bug to other parties.
+
 ## Posting Pull Requests
 
 * Make sure to post PRs only relative to a very recent git master.
index 01cb6e7db7ef6c0890cc558260be477d6161180b..7cbf0a9e0c0a848b8611a6232205b20a345e623f 100644 (file)
@@ -28,7 +28,7 @@
 /TAGS
 /ata_id
 /bootctl
-/build-aux
+/build*
 /busctl
 /cdrom_id
 /collect
index 4c44f288aeca6c54f7f112cd9f9f5f5865d9f644..b2e5e14a920edfd501a416b5c8d5e7274f13c140 100644 (file)
@@ -32,8 +32,6 @@ RootSize=2G
 Cache=/var/cache/pacman/pkg/
 BuildPackages=
         acl
-        autoconf
-        automake
         bzip2
         cryptsetup
         curl
@@ -58,7 +56,7 @@ BuildPackages=
         libxkbcommon
         libxslt
         lz4
-        make
+        meson
         pam
         pkgconfig
         python
index a68d9dfa116c0139434fb6f26ad6b7e9b587f718..468a6d8654e1b3a3fde6e46e2ab245e22086c58b 100644 (file)
@@ -32,8 +32,6 @@ RootSize=2G
 [Packages]
 BuildPackages=
         acl
-        autoconf
-        automake
         diffutils
         docbook-xml
         docbook-xsl
@@ -68,7 +66,7 @@ BuildPackages=
         libsmartcols-dev
         libtool
         libxkbcommon-dev
-        make
+        meson
         pkg-config
         python3
         python3-lxml
index 1b8dd47ca4fb763b7852e8b8511ad29458f51462..00129a5af36b21ab728b8d59ccb7b232e25e0e8c 100644 (file)
@@ -20,7 +20,7 @@
 
 [Distribution]
 Distribution=fedora
-Release=25
+Release=26
 
 [Output]
 Format=raw_btrfs
@@ -32,8 +32,7 @@ RootSize=3G
 [Packages]
 BuildPackages=
         audit-libs-devel
-        autoconf
-        automake
+        meson
         bzip2-devel
         cryptsetup-devel
         dbus-devel
@@ -62,8 +61,8 @@ BuildPackages=
         libtool
         libxkbcommon-devel
         libxslt
+        lz4
         lz4-devel
-        make
         pam-devel
         pkgconfig
         python3-devel
index d5626411a530a9dafb1dfb00c6159602efd8fef8..f21cc527f0bca330bc9ab23bcf3f39a1ec5b002e 100644 (file)
@@ -11,7 +11,6 @@ MANPAGES += \
        man/bootup.7 \
        man/busctl.1 \
        man/daemon.7 \
-       man/environment.d.5 \
        man/file-hierarchy.7 \
        man/halt.8 \
        man/hostname.5 \
@@ -111,15 +110,12 @@ MANPAGES += \
        man/systemd-debug-generator.8 \
        man/systemd-delta.1 \
        man/systemd-detect-virt.1 \
-       man/systemd-environment-d-generator.8 \
        man/systemd-escape.1 \
        man/systemd-fsck@.service.8 \
        man/systemd-fstab-generator.8 \
        man/systemd-getty-generator.8 \
        man/systemd-gpt-auto-generator.8 \
        man/systemd-halt.service.8 \
-       man/systemd-hibernate-resume-generator.8 \
-       man/systemd-hibernate-resume@.service.8 \
        man/systemd-inhibit.1 \
        man/systemd-initctl.service.8 \
        man/systemd-journald.service.8 \
@@ -130,7 +126,6 @@ MANPAGES += \
        man/systemd-nspawn.1 \
        man/systemd-path.1 \
        man/systemd-remount-fs.service.8 \
-       man/systemd-resolve.1 \
        man/systemd-run.1 \
        man/systemd-sleep.conf.5 \
        man/systemd-socket-activate.1 \
@@ -148,7 +143,6 @@ MANPAGES += \
        man/systemd.1 \
        man/systemd.automount.5 \
        man/systemd.device.5 \
-       man/systemd.environment-generator.7 \
        man/systemd.exec.5 \
        man/systemd.generator.7 \
        man/systemd.journal-fields.7 \
@@ -187,7 +181,6 @@ MANPAGES += \
        man/udev_new.3 \
        man/udevadm.8
 MANPAGES_ALIAS += \
-       man/30-systemd-environment-d-generator.8 \
        man/SD_ALERT.3 \
        man/SD_BUS_ERROR_ACCESS_DENIED.3 \
        man/SD_BUS_ERROR_ADDRESS_IN_USE.3 \
@@ -326,6 +319,7 @@ MANPAGES_ALIAS += \
        man/sd_bus_message_append_array_space.3 \
        man/sd_bus_message_append_string_iovec.3 \
        man/sd_bus_message_append_string_space.3 \
+       man/sd_bus_message_appendv.3 \
        man/sd_bus_message_get_realtime_usec.3 \
        man/sd_bus_message_get_reply_cookie.3 \
        man/sd_bus_message_get_seqnum.3 \
@@ -462,7 +456,6 @@ MANPAGES_ALIAS += \
        man/systemd-ask-password-wall.service.8 \
        man/systemd-fsck-root.service.8 \
        man/systemd-fsck.8 \
-       man/systemd-hibernate-resume.8 \
        man/systemd-hibernate.service.8 \
        man/systemd-hybrid-sleep.service.8 \
        man/systemd-initctl.8 \
@@ -546,7 +539,6 @@ MANPAGES_ALIAS += \
        man/udev_ref.3 \
        man/udev_unref.3 \
        man/user.conf.d.5
-man/30-systemd-environment-d-generator.8: man/systemd-environment-d-generator.8
 man/SD_ALERT.3: man/sd-daemon.3
 man/SD_BUS_ERROR_ACCESS_DENIED.3: man/sd-bus-errors.3
 man/SD_BUS_ERROR_ADDRESS_IN_USE.3: man/sd-bus-errors.3
@@ -685,6 +677,7 @@ man/sd_bus_message_append_array_memfd.3: man/sd_bus_message_append_array.3
 man/sd_bus_message_append_array_space.3: man/sd_bus_message_append_array.3
 man/sd_bus_message_append_string_iovec.3: man/sd_bus_message_append_string_memfd.3
 man/sd_bus_message_append_string_space.3: man/sd_bus_message_append_string_memfd.3
+man/sd_bus_message_appendv.3: man/sd_bus_message_append.3
 man/sd_bus_message_get_realtime_usec.3: man/sd_bus_message_get_monotonic_usec.3
 man/sd_bus_message_get_reply_cookie.3: man/sd_bus_message_get_cookie.3
 man/sd_bus_message_get_seqnum.3: man/sd_bus_message_get_monotonic_usec.3
@@ -821,7 +814,6 @@ man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8
 man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8
 man/systemd-fsck-root.service.8: man/systemd-fsck@.service.8
 man/systemd-fsck.8: man/systemd-fsck@.service.8
-man/systemd-hibernate-resume.8: man/systemd-hibernate-resume@.service.8
 man/systemd-hibernate.service.8: man/systemd-suspend.service.8
 man/systemd-hybrid-sleep.service.8: man/systemd-suspend.service.8
 man/systemd-initctl.8: man/systemd-initctl.service.8
@@ -905,9 +897,6 @@ man/udev_monitor_unref.3: man/udev_monitor_new_from_netlink.3
 man/udev_ref.3: man/udev_new.3
 man/udev_unref.3: man/udev_new.3
 man/user.conf.d.5: man/systemd-system.conf.5
-man/30-systemd-environment-d-generator.html: man/systemd-environment-d-generator.html
-       $(html-alias)
-
 man/SD_ALERT.html: man/sd-daemon.html
        $(html-alias)
 
@@ -1322,6 +1311,9 @@ man/sd_bus_message_append_string_iovec.html: man/sd_bus_message_append_string_me
 man/sd_bus_message_append_string_space.html: man/sd_bus_message_append_string_memfd.html
        $(html-alias)
 
+man/sd_bus_message_appendv.html: man/sd_bus_message_append.html
+       $(html-alias)
+
 man/sd_bus_message_get_realtime_usec.html: man/sd_bus_message_get_monotonic_usec.html
        $(html-alias)
 
@@ -1730,9 +1722,6 @@ man/systemd-fsck-root.service.html: man/systemd-fsck@.service.html
 man/systemd-fsck.html: man/systemd-fsck@.service.html
        $(html-alias)
 
-man/systemd-hibernate-resume.html: man/systemd-hibernate-resume@.service.html
-       $(html-alias)
-
 man/systemd-hibernate.service.html: man/systemd-suspend.service.html
        $(html-alias)
 
@@ -2038,6 +2027,19 @@ MANPAGES_ALIAS += \
 
 endif
 
+if ENABLE_ENVIRONMENT_D
+MANPAGES += \
+       man/environment.d.5 \
+       man/systemd-environment-d-generator.8 \
+       man/systemd.environment-generator.7
+MANPAGES_ALIAS += \
+       man/30-systemd-environment-d-generator.8
+man/30-systemd-environment-d-generator.8: man/systemd-environment-d-generator.8
+man/30-systemd-environment-d-generator.html: man/systemd-environment-d-generator.html
+       $(html-alias)
+
+endif
+
 if ENABLE_FIRSTBOOT
 MANPAGES += \
        man/systemd-firstboot.1
@@ -2049,6 +2051,18 @@ man/systemd-firstboot.service.html: man/systemd-firstboot.html
 
 endif
 
+if ENABLE_HIBERNATE
+MANPAGES += \
+       man/systemd-hibernate-resume-generator.8 \
+       man/systemd-hibernate-resume@.service.8
+MANPAGES_ALIAS += \
+       man/systemd-hibernate-resume.8
+man/systemd-hibernate-resume.8: man/systemd-hibernate-resume@.service.8
+man/systemd-hibernate-resume.html: man/systemd-hibernate-resume@.service.html
+       $(html-alias)
+
+endif
+
 if ENABLE_HOSTNAMED
 MANPAGES += \
        man/hostnamectl.1 \
@@ -2183,6 +2197,7 @@ MANPAGES += \
        man/dnssec-trust-anchors.d.5 \
        man/nss-resolve.8 \
        man/resolved.conf.5 \
+       man/systemd-resolve.1 \
        man/systemd-resolved.service.8
 MANPAGES_ALIAS += \
        man/libnss_resolve.so.2.8 \
index d4e940c9cf15af93231c892b9c8e2b23a3c48baa..7f5e1c39a1592140d748423fc02a51f3ae0833a8 100644 (file)
@@ -59,7 +59,7 @@ polkitrulesdir=$(datadir)/polkit-1/rules.d
 polkitpkladir=$(localstatedir)/lib/polkit-1/localauthority/10-vendor.d
 bashcompletiondir=@bashcompletiondir@
 zshcompletiondir=@zshcompletiondir@
-rpmmacrosdir=$(prefix)/lib/rpm/macros.d
+rpmmacrosdir=@rpmmacrosdir@
 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
 varlogdir=$(localstatedir)/log
@@ -178,6 +178,7 @@ CLEANFILES = $(BUILT_SOURCES) \
        $(pkgconfiglib_DATA) \
        $(nodist_bashcompletion_data) \
        $(nodist_zshcompletion_data) \
+       $(nodist_rpmmacros_DATA) \
        $(in_files:.in=) $(in_in_files:.in.in=) \
        $(m4_files:.m4=)
 
@@ -442,6 +443,12 @@ userenvgenerator_PROGRAMS = \
        30-systemd-environment-d-generator
 endif
 
+rootlibexec_SCRIPTS = \
+       src/sulogin-shell/systemd-sulogin-shell
+
+EXTRA_DIST += \
+       src/sulogin-shell/systemd-sulogin-shell.in
+
 dist_bashcompletion_data = \
        shell-completion/bash/busctl \
        shell-completion/bash/journalctl \
@@ -650,7 +657,7 @@ EXTRA_DIST += \
        units/initrd-switch-root.service.in \
        units/systemd-nspawn@.service.in \
        units/systemd-update-done.service.in \
-    units/tmp.mount.m4
+       units/tmp.mount.m4
 
 if HAVE_SYSV_COMPAT
 nodist_systemunit_DATA += \
@@ -677,8 +684,6 @@ dist_doc_DATA = \
        LICENSE.LGPL2.1 \
        LICENSE.GPL2 \
        DISTRO_PORTING \
-       src/libsystemd/sd-bus/PORTING-DBUS1 \
-       src/libsystemd/sd-bus/DIFFERENCES \
        src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
 
 EXTRA_DIST += \
@@ -744,9 +749,11 @@ man/index.html: man/systemd.index.html
        $(AM_V_LN)$(LN_S) -f systemd.index.html $@
 
 if HAVE_PYTHON
+if ENABLE_MANPAGES
 noinst_DATA += \
        man/index.html
 endif
+endif
 
 CLEANFILES += \
        man/index.html
@@ -1005,8 +1012,7 @@ libbasic_la_CFLAGS = \
 libbasic_la_LIBADD = \
        $(SELINUX_LIBS) \
        $(CAP_LIBS) \
-       -lrt \
-       -lm
+       -lrt
 
 # -----------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -1499,8 +1505,10 @@ polkitpolicy_in_in_files += \
 pkgconfigdata_DATA += \
        src/core/systemd.pc
 
+if ENABLE_RPM_MACROS
 nodist_rpmmacros_DATA = \
        src/core/macros.systemd
+endif
 
 BUILT_SOURCES += \
        src/core/triggers.systemd
@@ -2131,6 +2139,10 @@ test_acl_util_LDADD = \
 test_seccomp_SOURCES = \
        src/test/test-seccomp.c
 
+test_seccomp_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(SECCOMP_CFLAGS)
+
 test_seccomp_LDADD = \
        libsystemd-shared.la \
        $(SECCOMP_LIBS)
@@ -2176,9 +2188,6 @@ test_selinux_LDADD = \
 test_sizeof_SOURCES = \
        src/test/test-sizeof.c
 
-test_sizeof_LDADD = \
-       libsystemd-shared.la
-
 BUILT_SOURCES += \
        src/test/test-hashmap-ordered.c
 
@@ -2430,6 +2439,7 @@ test_execute_SOURCES = \
 
 test_execute_CFLAGS = \
        $(AM_CFLAGS) \
+       $(SECCOMP_CFLAGS) \
        $(MOUNT_CFLAGS)
 
 test_execute_LDADD = \
@@ -2813,9 +2823,6 @@ systemd_detect_virt_SOURCES = \
 systemd_detect_virt_LDADD = \
        libsystemd-shared.la
 
-INSTALL_EXEC_HOOKS += \
-       systemd-detect-virt-install-hook
-
 # ------------------------------------------------------------------------------
 systemd_delta_SOURCES = \
        src/delta/delta.c
@@ -2979,28 +2986,35 @@ if ARCH_AARCH64
 efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
 EFI_FORMAT = -O binary
 else
+if ARCH_ARM
+efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
+EFI_FORMAT = -O binary
+else
 EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
 endif
 endif
 endif
+endif
 
 # ------------------------------------------------------------------------------
-systemd_boot_headers = \
-       src/boot/efi/util.h \
+efi_headers = \
        src/boot/efi/console.h \
+       src/boot/efi/disk.h \
        src/boot/efi/graphics.h \
-       src/boot/efi/pefile.h \
+       src/boot/efi/linux.h \
        src/boot/efi/measure.h \
-       src/boot/efi/disk.h
+       src/boot/efi/pefile.h \
+       src/boot/efi/splash.h \
+       src/boot/efi/util.h
 
 systemd_boot_sources = \
-       src/boot/efi/util.c \
+       src/boot/efi/boot.c \
        src/boot/efi/console.c \
-       src/boot/efi/graphics.c \
-       src/boot/efi/pefile.c \
        src/boot/efi/disk.c \
+       src/boot/efi/graphics.c \
        src/boot/efi/measure.c \
-       src/boot/efi/boot.c
+       src/boot/efi/pefile.c \
+       src/boot/efi/util.c
 
 EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
 
@@ -3012,7 +3026,7 @@ if ENABLE_EFI
 if HAVE_GNUEFI
 bootlib_DATA = $(systemd_boot)
 
-$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
+$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(efi_headers))
        @$(MKDIR_P) $(top_builddir)/src/boot/efi/
        $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
 
@@ -3030,24 +3044,15 @@ endif
 CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
 
 # ------------------------------------------------------------------------------
-stub_headers = \
-       src/boot/efi/util.h \
-       src/boot/efi/pefile.h \
-       src/boot/efi/disk.h \
-       src/boot/efi/graphics.h \
-       src/boot/efi/splash.h \
-       src/boot/efi/measure.h \
-       src/boot/efi/linux.h
-
 stub_sources = \
-       src/boot/efi/util.c \
-       src/boot/efi/pefile.c \
        src/boot/efi/disk.c \
        src/boot/efi/graphics.c \
-       src/boot/efi/splash.c \
        src/boot/efi/linux.c \
        src/boot/efi/measure.c \
-       src/boot/efi/stub.c
+       src/boot/efi/pefile.c \
+       src/boot/efi/splash.c \
+       src/boot/efi/stub.c \
+       src/boot/efi/util.c
 
 EXTRA_DIST += \
        $(stub_sources) \
@@ -3062,10 +3067,6 @@ if ENABLE_EFI
 if HAVE_GNUEFI
 bootlib_DATA += $(stub)
 
-$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
-       @$(MKDIR_P) $(top_builddir)/src/boot/efi/
-       $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
 $(stub_solib): $(stub_objects)
        $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
                -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
@@ -3083,8 +3084,8 @@ CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
 # ------------------------------------------------------------------------------
 CLEANFILES += test-efi-disk.img
 
-test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh
-       $(AM_V_GEN)test/test-efi-create-disk.sh
+test-efi-disk.img: $(systemd_boot) $(stub) test/splash.bmp test/test-efi-create-disk.sh
+       $(AM_V_GEN)test/test-efi-create-disk.sh $@ $(systemd_boot) $(stub) test/splash.bmp
 
 test-efi: test-efi-disk.img
        $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
@@ -3411,7 +3412,6 @@ noinst_LTLIBRARIES += \
 
 EXTRA_DIST += \
        src/libsystemd/libsystemd.pc.in \
-       src/libsystemd/sd-bus/DIFFERENCES \
        src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
 
 libsystemd_la_SOURCES =
@@ -3608,9 +3608,9 @@ test_resolve_LDADD = \
        libsystemd-shared.la
 
 busctl_SOURCES = \
-       src/libsystemd/sd-bus/busctl.c \
-       src/libsystemd/sd-bus/busctl-introspect.c \
-       src/libsystemd/sd-bus/busctl-introspect.h
+       src/busctl/busctl.c \
+       src/busctl/busctl-introspect.c \
+       src/busctl/busctl-introspect.h
 
 busctl_LDADD = \
        libsystemd-shared.la
@@ -3820,7 +3820,6 @@ dist_network_DATA = \
        network/80-container-vz.network
 
 dist_udevrules_DATA += \
-       rules/50-udev-default.rules \
        rules/60-block.rules \
        rules/60-drm.rules \
        rules/60-evdev.rules \
@@ -3838,6 +3837,7 @@ dist_udevrules_DATA += \
        rules/80-net-setup-link.rules
 
 nodist_udevrules_DATA += \
+       rules/50-udev-default.rules \
        rules/99-systemd.rules
 
 udevconfdir = $(sysconfdir)/udev
@@ -3848,6 +3848,7 @@ pkgconfigdata_DATA += \
        src/udev/udev.pc
 
 EXTRA_DIST += \
+       rules/50-udev-default.rules.in \
        rules/99-systemd.rules.in \
        src/udev/udev.pc.in
 
@@ -3878,7 +3879,7 @@ src/udev/keyboard-keys-list.txt:
        $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($$2 != "KEY_MAX") { print $$2 } }' > $@
 
 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
+       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key_name { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
 
 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
        $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
@@ -4562,10 +4563,8 @@ libsystemd_journal_internal_la_SOURCES += \
 libsystemd_journal_internal_la_LIBADD += \
        $(GCRYPT_LIBS)
 
-# fsprg.c is a drop-in file using void pointer arithmetic
 libsystemd_journal_internal_la_CFLAGS += \
-       $(GCRYPT_CFLAGS) \
-       -Wno-pointer-arith
+       $(GCRYPT_CFLAGS)
 endif
 
 noinst_LTLIBRARIES += \
@@ -5021,10 +5020,6 @@ systemd_localed_LDADD = \
        libsystemd-shared.la \
        -ldl
 
-systemd_localed_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(XKBCOMMON_CFLAGS)
-
 nodist_systemunit_DATA += \
        units/systemd-localed.service
 
@@ -5081,8 +5076,6 @@ dist_zshcompletion_data += \
        shell-completion/zsh/_localectl
 endif
 
-.PHONY: update-kbd-model-map
-
 polkitpolicy_in_files += \
        src/locale/org.freedesktop.locale1.policy.in
 
@@ -5613,6 +5606,9 @@ GENERAL_ALIASES += \
 nodist_pkgsysconf_DATA += \
        src/resolve/resolved.conf
 
+dist_rootlibexec_DATA += \
+       src/resolve/resolv.conf
+
 libnss_resolve_la_SOURCES = \
        src/nss-resolve/nss-resolve.sym \
        src/nss-resolve/nss-resolve.c
@@ -5751,9 +5747,6 @@ EXTRA_DIST += \
        units/systemd-resolved.service.m4.in \
        src/resolve/resolved.conf.in
 
-dist_rootlibexec_DATA += \
-       src/resolve/resolv.conf
-
 # ------------------------------------------------------------------------------
 if ENABLE_NETWORKD
 rootlibexec_PROGRAMS += \
@@ -5788,6 +5781,8 @@ libnetworkd_core_la_SOURCES = \
        src/network/netdev/veth.c \
        src/network/netdev/vxlan.h \
        src/network/netdev/vxlan.c \
+       src/network/netdev/geneve.h \
+       src/network/netdev/geneve.c \
        src/network/netdev/vlan.h \
        src/network/netdev/vlan.c \
        src/network/netdev/macvlan.h \
@@ -5824,6 +5819,8 @@ libnetworkd_core_la_SOURCES = \
        src/network/networkd-network-bus.c \
        src/network/networkd-address.h \
        src/network/networkd-address.c \
+       src/network/networkd-address-label.h \
+       src/network/networkd-address-label.c \
        src/network/networkd-route.h \
        src/network/networkd-route.c \
        src/network/networkd-fdb.h \
@@ -5934,10 +5931,8 @@ dist_dbuspolicy_DATA += \
 GENERAL_ALIASES += \
        $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \
        $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
-       $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
-
-SYSTEM_UNIT_ALIASES += \
-       systemd-networkd.service dbus-org.freedesktop.network1.service
+       $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service \
+       $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/dbus-org.freedesktop.network1.service
 
 BUSNAMES_TARGET_WANTS += \
        org.freedesktop.network1.busname
@@ -5960,7 +5955,8 @@ EXTRA_DIST += \
        src/network/systemd-networkd.pkla \
        units/systemd-networkd.service.m4.in \
        units/systemd-networkd-wait-online.service.in \
-       test/networkd-test.py
+       test/networkd-test.py \
+       test/test-exec-deserialization.py
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOGIND
@@ -6272,7 +6268,6 @@ substitutions = \
        '|exec_prefix=$(exec_prefix)|' \
        '|libdir=$(libdir)|' \
        '|includedir=$(includedir)|' \
-       '|VERSION=$(VERSION)|' \
        '|rootprefix=$(rootprefix)|' \
        '|udevlibexecdir=$(udevlibexecdir)|' \
        '|SUSHELL=$(SUSHELL)|' \
@@ -6296,6 +6291,7 @@ substitutions = \
        '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
+       '|DEV_KVM_MODE=$(DEV_KVM_MODE)|' \
        '|TTY_GID=$(TTY_GID)|' \
        '|systemsleepdir=$(systemsleepdir)|' \
        '|systemshutdowndir=$(systemshutdowndir)|' \
@@ -6329,6 +6325,10 @@ src/core/%.systemd: src/core/%.systemd.in
 src/%.policy.in: src/%.policy.in.in
        $(SED_PROCESS)
 
+src/sulogin-shell/%: src/sulogin-shell/%.in
+       $(SED_PROCESS)
+       $(AM_V_GEN)chmod +x $@
+
 shell-completion/%: shell-completion/%.in
        $(SED_PROCESS)
 
@@ -6372,8 +6372,10 @@ nodist_polkitpolicy_DATA = \
        $(polkitpolicy_files) \
        $(polkitpolicy_in_in_files:.policy.in.in=.policy)
 polkitrules_DATA = $(polkitrules_files)
+if ENABLE_POLKIT_PKLA
 polkitpkla_DATA = $(polkitpkla_files)
 endif
+endif
 
 EXTRA_DIST += \
        $(polkitpolicy_in_files) \
@@ -6396,7 +6398,7 @@ XSLTPROC_FLAGS = \
        --stringparam funcsynopsis.style ansi \
        --stringparam man.authors.section.enabled 0 \
        --stringparam man.copyright.section.enabled 0 \
-       --stringparam systemd.version $(VERSION) \
+       --stringparam systemd.version $(PACKAGE_VERSION) \
        --path '$(builddir)/man:$(srcdir)/man'
 
 XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
@@ -6568,6 +6570,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
        --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
        --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
        --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
+       --with-rpmmacrosdir=$$dc_install_base/$(rpmmacrosdir) \
        --with-rootprefix=$$dc_install_base \
        --enable-compat-libs
 
@@ -6611,29 +6614,22 @@ dist-check-includes: $(public_headers)
        done; exit $$res
 
 .PHONY: hwdb-update
-hwdb-update:
-       ( cd $(top_srcdir)/hwdb && \
-       wget -O usb.ids 'http://www.linux-usb.org/usb.ids' && \
-       wget -O pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' && \
-       wget -O ma-large.txt 'http://standards.ieee.org/develop/regauth/oui/oui.txt' && \
-       wget -O ma-medium.txt 'http://standards.ieee.org/develop/regauth/oui28/mam.txt' && \
-       wget -O ma-small.txt 'http://standards.ieee.org/develop/regauth/oui36/oui36.txt' && \
-       wget -O pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export' && \
-       wget -O acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export' && \
-       ./ids-update.pl && \
-       ./acpi-update.py > 20-acpi-vendor.hwdb.base && \
-       patch -p0 -o- 20-acpi-vendor.hwdb.base < 20-acpi-vendor.hwdb.patch > 20-acpi-vendor.hwdb )
+hwdb-update: tools/meson-hwdb-update.sh
+       $< $(top_srcdir)/hwdb
 
 .PHONY: built-sources
 built-sources: $(BUILT_SOURCES)
 
 .PHONY: git-tag
 git-tag:
-       git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
+       git tag -s "v$(PACKAGE_VERSION)" -m "systemd $(PACKAGE_VERSION)"
 
 .PHONY: git-tar
 git-tar:
-       git archive --format=tar --prefix=systemd-$(VERSION)/ HEAD | gzip > systemd-$(VERSION).tar.gz
+       git archive -o systemd-$(PACKAGE_VERSION).tar.gz --prefix=systemd-$(PACKAGE_VERSION)/ HEAD
+
+%.asc: %
+       gpg2 --detach-sign -a -o $@ $<
 
 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
 
@@ -6775,14 +6771,17 @@ cppcheck:
 print-%:
        @echo $($*)
 
+.PHONY: git-contrib
 git-contrib:
        @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | sed 's/ / /g' | awk '{ print $$0 "," }' | sort -u
 
 EXTRA_DIST += \
         tools/gdb-sd_dump_hashmaps.py
 
+.PHONY: list-keys
 list-keys:
        gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
 
+.PHONY: add-key
 add-key:
        gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -
diff --git a/NEWS b/NEWS
index 9687bb81a91ab80023db7648326cff8f412b27e5..73ee35f53c86acaea8d55a13185ebe4fbcd8585a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ systemd System and Service Manager
 
 CHANGES WITH 233:
 
+        * This version requires at least gperf 3.1 for building, 3.0 is not
+          sufficient.
+
         * The "hybrid" control group mode has been modified to improve
           compatibility with "legacy" cgroups-v1 setups. Specifically, the
           "hybrid" setup of /sys/fs/cgroup is now pretty much identical to
@@ -3315,7 +3318,7 @@ CHANGES WITH 216:
           like Cockpit which register web clients as PAM sessions.
 
         * timer units with at least one OnCalendar= setting will now
-          be started only after timer-sync.target has been
+          be started only after time-sync.target has been
           reached. This way they will not elapse before the system
           clock has been corrected by a local NTP client or
           similar. This is particular useful on RTC-less embedded
diff --git a/README b/README
index 30b5f7187650f5c10744c870fba37d62caa1225e..d7477510a9c5adec656fe603b47eed4ca4d4739d 100644 (file)
--- a/README
+++ b/README
@@ -156,21 +156,47 @@ REQUIREMENTS:
         dracut (optional)
         PolicyKit (optional)
 
-        When building from git, the following tools are needed:
+        Two build systems are supported: meson + ninja-build and autools + make.
+
+        The following tools are needed with both systems:
 
         pkg-config
-        docbook-xsl
-        xsltproc
+        gperf >= 3.1
+        docbook-xsl (optional, required for documentation)
+        xsltproc    (optional, required for documentation)
+        python-lxml (optional, required to build the indices)
+
+        When building with meson, python and ninja-build are required.
+
+        To build in directory build/:
+          meson build/ && ninja -C build
+
+        Any configuration options can be specfied as -Darg=value... arguments
+        to meson. After the build directory is initially configured, meson will
+        refuse to run again, and options must be changed with:
+          mesonconf -Darg=value...
+        mesonconf without any arguments will print out available options and
+        their current values.
+
+        Useful commands:
+          ninja -v some/target
+          ninja test
+          sudo ninja install
+          DESTDIR=... ninja install
+
+        When building with autotools, the following tools are needed:
+
         automake
         autoconf
         libtool
         intltool
-        gperf
         python (optional)
-        python-lxml (optional, but required to build the indices)
 
-        The build system is initialized with ./autogen.sh. A tar ball
-        can be created with:
+        The build system is initialized with ./autogen.sh and the usual
+          ./configure && make
+        should be used.
+
+        A tar ball can be created with:
           git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz
 
         When systemd-hostnamed is used, it is strongly recommended to
index 82fb799b4276e8a3570000d0648ce1ee6ead0e82..c406aca8dc0cbd3ffc81f1d161c1797ff8ebce37 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # systemd - System and Service Manager
 
+<a href="https://in.waw.pl/systemd-github-state/systemd-systemd-issues.svg"><img align="right" src="https://in.waw.pl/systemd-github-state/systemd-systemd-issues-small.svg" alt="Count of open issues over time"></a>
+<a href="https://in.waw.pl/systemd-github-state/systemd-systemd-pull-requests.svg"><img align="right" src="https://in.waw.pl/systemd-github-state/systemd-systemd-pull-requests-small.svg" alt="Count of open pull requests over time"></a>
 [![Build Status](https://semaphoreci.com/api/v1/projects/28a5a3ca-3c56-4078-8b5e-7ed6ef912e14/443470/shields_badge.svg)](https://semaphoreci.com/systemd/systemd)<br/>
 [![Coverity Scan Status](https://scan.coverity.com/projects/350/badge.svg)](https://scan.coverity.com/projects/350)
 
diff --git a/TODO b/TODO
index 3cf4ce393c6d7b832f28e0820631622c7e1f8def..bc46e33e4781db6bbe494afa4e5433e59e75605d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -24,6 +24,11 @@ Janitorial Clean-ups:
 
 Features:
 
+* add some optional flag to ReadWritePaths= and friends, that has the effect
+  that we create the dir in question when the service is started. Example:
+
+  ReadWritePaths=:/var/lib/foobar
+
 * sort generated hwdb files alphabetically when we import them, so that git
   diffs remain minimal (in particular: the OUI databases we import are not
   sorted, and not stable)
diff --git a/catalog/meson.build b/catalog/meson.build
new file mode 100644 (file)
index 0000000..6d205b1
--- /dev/null
@@ -0,0 +1,28 @@
+in_files = '''
+        systemd.bg.catalog
+        systemd.be.catalog
+        systemd.be@latin.catalog
+        systemd.fr.catalog
+        systemd.it.catalog
+        systemd.pl.catalog
+        systemd.pt_BR.catalog
+        systemd.ru.catalog
+        systemd.zh_CN.catalog
+        systemd.zh_TW.catalog
+        systemd.catalog
+'''.split()
+
+support_url = get_option('support-url')
+support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url)
+build_catalog_dir = meson.current_build_dir()
+
+foreach file : in_files
+        custom_target(
+                file,
+                input : file + '.in',
+                output: file,
+                command : [sed, support_sed, '@INPUT@'],
+                capture : true,
+                install : true,
+                install_dir : catalogdir)
+endforeach
index 3835413ad59e4412687ee53059c89f0131a6aa1a..f59f3faf38459ffab7681873c0895f0c36ef904f 100644 (file)
@@ -57,6 +57,7 @@ AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is
 SET_ARCH(X86_64, x86_64*)
 SET_ARCH(IA32, i*86*)
 SET_ARCH(MIPS, mips*)
+SET_ARCH(ARM, arm*)
 SET_ARCH(AARCH64, aarch64*)
 
 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
@@ -327,7 +328,6 @@ AC_CHECK_DECLS([
         pivot_root,
         name_to_handle_at,
         setns,
-        getrandom,
         renameat2,
         kcmp,
         keyctl,
@@ -342,6 +342,13 @@ AC_CHECK_DECLS([
 #include <sched.h>
 #include <string.h>
 #include <linux/loop.h>
+]])
+
+AC_CHECK_DECLS([getrandom],
+               [AC_DEFINE([USE_SYS_RANDOM_H], [], [sys/random.h is usable])],
+               [AC_CHECK_DECLS([getrandom], [], [], [[
+#include <sys/random.h>
+]])], [[
 #include <linux/random.h>
 ]])
 
@@ -360,7 +367,8 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
                 IFLA_PHYS_PORT_ID,
                 IFLA_BOND_AD_INFO,
                 IFLA_VLAN_PROTOCOL,
-                IFLA_VXLAN_REMCSUM_NOPARTIAL,
+                IFLA_VXLAN_GPE,
+                IFLA_GENEVE_LABEL,
                 IFLA_IPTUN_ENCAP_DPORT,
                 IFLA_GRE_ENCAP_DPORT,
                 IFLA_BRIDGE_VLAN_INFO,
@@ -397,6 +405,16 @@ AS_IF([test "x$enable_dbus" != "xno"], [
                 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
 
+# ------------------------------------------------------------------------------
+have_glib=no
+AC_ARG_ENABLE(glib, AS_HELP_STRING([--disable-glib], [disable usage of glib,gobject,gio in tests]))
+AS_IF([test "x$enable_glib" != "xno"], [
+        PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0],
+                [AC_DEFINE(HAVE_GLIB, 1, [Define if glib,gobject,gio are available]) have_glib=yes],
+                [have_glib=no])
+        AS_IF([test "x$have_glib" = "xno" -a "x$enable_glib" = "xyes"],
+                [AC_MSG_ERROR([*** glib support requested but libraries not found])])])
+
 # ------------------------------------------------------------------------------
 have_utmp=yes
 AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
@@ -1113,7 +1131,7 @@ if test "x$enable_logind" != "xno"; then
         have_logind=yes
 fi
 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
-AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
+AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(ENABLE_LOGIND, [1], [Logind support available]) ])
 
 AC_ARG_WITH([kill-user-processes],
         [AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])])
@@ -1205,6 +1223,16 @@ AC_ARG_WITH(system-gid-max,
 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
 AC_SUBST(SYSTEM_GID_MAX)
 
+# ------------------------------------------------------------------------------
+
+AC_ARG_WITH(dev-kvm-mode,
+        AS_HELP_STRING([--with-dev-kvm-mode=MODE],
+                [/dev/kvm access mode, defaults to "0660"]),
+        [DEV_KVM_MODE="$withval"],
+        [DEV_KVM_MODE="0660"])
+
+AC_SUBST(DEV_KVM_MODE, [$DEV_KVM_MODE], [/dev/kvm access mode])
+
 # ------------------------------------------------------------------------------
 have_localed=no
 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
@@ -1228,8 +1256,14 @@ AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit supp
 if test "x$enable_polkit" != "xno"; then
         AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
         have_polkit=yes
+
+        # also enable support for *.pkla files on old polkit
+        PKG_CHECK_MODULES(POLKIT, [ polkit-gobject-1 < 0.106 ],
+                           [polkit_pkla=yes],
+                           [polkit_pkla=no])
 fi
 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
+AM_CONDITIONAL(ENABLE_POLKIT_PKLA, [test "x$polkit_pkla" = "xyes"])
 
 # ------------------------------------------------------------------------------
 have_resolved=no
@@ -1297,6 +1331,9 @@ AM_COND_IF(ARCH_IA32, [
 AM_COND_IF(ARCH_X86_64, [
         EFI_MACHINE_TYPE_NAME=x64])
 
+AM_COND_IF(ARCH_ARM, [
+        EFI_MACHINE_TYPE_NAME=arm])
+
 AM_COND_IF(ARCH_AARCH64, [
         EFI_MACHINE_TYPE_NAME=aa64])
 
@@ -1306,7 +1343,13 @@ AC_SUBST([EFI_MACHINE_TYPE_NAME])
 have_gnuefi=no
 AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [enable optional gnuefi support]))
 AS_IF([test "x$enable_gnuefi" != "xno"], [
-        AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
+        AC_ARG_WITH(efi-includedir,
+                AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
+                [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
+        )
+        AC_SUBST([EFI_INC_DIR])
+
+        AC_CHECK_HEADERS(${EFI_INC_DIR}/efi/${EFI_ARCH}/efibind.h,
                 [AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
                  have_gnuefi=yes],
                 [AS_IF([test "x$enable_gnuefi" = xyes],
@@ -1335,12 +1378,6 @@ AS_IF([test "x$enable_gnuefi" != "xno"], [
               [AS_IF([test "x$enable_gnuefi" = xyes],
                      [AC_MSG_ERROR([*** gnuefi support requested but files not found])],
                      [have_gnuefi=no])])
-
-        AC_ARG_WITH(efi-includedir,
-                AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
-                [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
-        )
-        AC_SUBST([EFI_INC_DIR])
 ])
 AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
 
@@ -1571,6 +1608,12 @@ AC_ARG_WITH([pamconfdir],
 AM_CONDITIONAL(ENABLE_PAM_CONFIG, [test "$with_pamconfdir" != "no"])
 AX_NORMALIZE_PATH([with_pamconfdir])
 
+AC_ARG_WITH([rpmmacrosdir],
+        AS_HELP_STRING([--with-rpmmacrosdir=DIR], [directory to store macros for RPM]),
+        [], [with_rpmmacrosdir=\${prefix}/lib/rpm/macros.d])
+AM_CONDITIONAL(ENABLE_RPM_MACROS, [test "$with_rpmmacrosdir" != "no"])
+AX_NORMALIZE_PATH([with_rpmmacrosdir])
+
 AC_ARG_ENABLE([split-usr],
         AS_HELP_STRING([--enable-split-usr], [assume that /bin, /sbin aren't symlinks into /usr]),
         [],
@@ -1641,6 +1684,7 @@ AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
 AC_SUBST([pamlibdir], [$with_pamlibdir])
 AC_SUBST([pamconfdir], [$with_pamconfdir])
+AC_SUBST([rpmmacrosdir], [$with_rpmmacrosdir])
 AC_SUBST([rootprefix], [$with_rootprefix])
 AC_SUBST([rootlibdir], [$with_rootlibdir])
 
@@ -1651,7 +1695,7 @@ AC_CONFIG_FILES([
 
 AC_OUTPUT
 AC_MSG_RESULT([
-        $PACKAGE_NAME $VERSION
+        $PACKAGE_NAME $PACKAGE_VERSION
 
         libcryptsetup:                     ${have_libcryptsetup}
         PAM:                               ${have_pam}
@@ -1700,7 +1744,7 @@ AC_MSG_RESULT([
         default DNS servers:               ${DNS_SERVERS}
         default DNSSEC mode:               ${DEFAULT_DNSSEC_MODE}
         coredump:                          ${have_coredump}
-        polkit:                            ${have_polkit}
+        polkit:                            ${have_polkit} (legacy pkla support: ${polkit_pkla})
         efi:                               ${have_efi}
         gnuefi:                            ${have_gnuefi}
         efi arch:                          ${EFI_ARCH}
@@ -1714,6 +1758,7 @@ AC_MSG_RESULT([
         blkid:                             ${have_blkid}
         libmount:                          ${have_libmount}
         dbus:                              ${have_dbus}
+        glib:                              ${have_glib}
         nss-myhostname:                    ${have_myhostname}
         hwdb:                              ${enable_hwdb}
         tpm:                               ${have_tpm}
@@ -1740,6 +1785,7 @@ AC_MSG_RESULT([
         build Python:                      ${PYTHON}
         PAM modules dir:                   ${with_pamlibdir}
         PAM configuration dir:             ${with_pamconfdir}
+        RPM macros dir:                    ${with_rpmmacrosdir}
         D-Bus policy dir:                  ${with_dbuspolicydir}
         D-Bus session dir:                 ${with_dbussessionservicedir}
         D-Bus system dir:                  ${with_dbussystemservicedir}
@@ -1753,6 +1799,7 @@ AC_MSG_RESULT([
         TTY GID:                           ${TTY_GID}
         maximum system UID:                ${SYSTEM_UID_MAX}
         maximum system GID:                ${SYSTEM_GID_MAX}
+        /dev/kvm access mode:              ${DEV_KVM_MODE}
         certificate root:                  ${CERTIFICATEROOT}
         support URL:                       ${SUPPORT_URL}
         nobody user name:                  ${NOBODY_USER_NAME}
diff --git a/docs/sysvinit/meson.build b/docs/sysvinit/meson.build
new file mode 100644 (file)
index 0000000..79d1bab
--- /dev/null
@@ -0,0 +1,9 @@
+file = configure_file(
+        input : 'README.in',
+        output : 'README',
+        configuration : substs)
+
+if conf.get('HAVE_SYSV_COMPAT', false)
+        install_data(file,
+                     install_dir : sysvinit_path)
+endif
diff --git a/docs/var-log/meson.build b/docs/var-log/meson.build
new file mode 100644 (file)
index 0000000..d8364e3
--- /dev/null
@@ -0,0 +1,9 @@
+file = configure_file(
+        input : 'README.in',
+        output : 'README',
+        configuration : substs)
+
+if conf.get('HAVE_SYSV_COMPAT', false)
+        install_data(file,
+                     install_dir : varlogdir)
+endif
index fd9078393bca88b983b3599a93a1ec443a3b42e7..82814701b71e5e4a09e217613d93363eae438bcd 100644 (file)
@@ -115,6 +115,13 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pn?550C?:*
  EVDEV_ABS_35=::31
  EVDEV_ABS_36=::30
 
+# Asus UX301L
+evdev:name:Elan Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnUX301LAA:*
+ EVDEV_ABS_00=::30
+ EVDEV_ABS_01=::29
+ EVDEV_ABS_35=::30
+ EVDEV_ABS_36=::29
+
 # Asus UX305
 evdev:name:Elan Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnUX305UA:*
  EVDEV_ABS_00=0:3097:32
@@ -178,6 +185,15 @@ evdev:name:AlpsPS/2 ALPS GlidePoint:dmi:bvn*:bvr*:bd*:svnDellInc.:pnXPSM1530*
  EVDEV_ABS_00=85:947:15
  EVDEV_ABS_01=154:726:18
 
+#####
+# Sun
+#####
+
+# Fujitsu Component - USB Touch Panel
+evdev:input:b0003v0430p0530*
+ EVDEV_ABS_00=0:4096:16
+ EVDEV_ABS_01=0:4096:16
+
 #########################################
 # Google
 #########################################
@@ -338,6 +354,13 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn305V4A/
  EVDEV_ABS_35=0:2480:28
  EVDEV_ABS_36=0:1116:24
 
+# Samsung 880Z5E
+evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn870Z5E/880Z5E/680Z5E*
+ EVDEV_ABS_00=::30
+ EVDEV_ABS_01=::29
+ EVDEV_ABS_35=::30
+ EVDEV_ABS_36=::29
+
 #########################################
 # Toshiba
 #########################################
@@ -346,3 +369,12 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn305V4A/
 evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:*svnTOSHIBA:pnTECRAM11*
  EVDEV_ABS_00=90:962:11
  EVDEV_ABS_01=51:681:14
+
+#########################################
+# Waltop
+#########################################
+
+# WALTOP International Corp. Slim Tablet
+evdev:input:b0003v172Fp0031*
+ EVDEV_ABS_00=0:10000:400
+ EVDEV_ABS_01=0:6250:400
index 1aa729f04797379f6c74367dff94af5a6d59f1b0..c35b90707df11725664e286a5af3ce7a26dc6713 100644 (file)
@@ -1,7 +1,14 @@
 # This file is part of systemd.
 #
-# Keyboard mapping of scan codes to key codes, and
-# scan codes to add to the AT keyboard's 'force-release' list.
+# This file contains 3 types of metadata to apply to keyboards and
+# keyboard-like input devices:
+# - Key mapping
+# - Hard-coded layouts
+# - Absence of modifier LEDs
+#
+# The matching process is the same for the different types of metadata.
+#
+# ########################### MATCHING #######################################
 #
 # The lookup keys are composed in:
 #   60-evdev.rules
 #    /sys/class/input/input?/capabilities/ev" and <vendor> is the
 #    firmware-provided string exported by the kernel DMI modalias,
 #    see /sys/class/dmi/id/modalias
+
+
+# ######################### KEY MAPPING ######################################
+#
+# Keyboard mapping of scan codes to key codes, and
+# scan codes to add to the AT keyboard's 'force-release' list.
 #
 # Scan codes are specified as:
 #   KEYBOARD_KEY_<hex scan code>=<key code identifier>
@@ -84,6 +97,7 @@
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnGateway*:pnA0A1*:pvr*
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svneMachines:pneMachines*E725:pvr*
+ KEYBOARD_KEY_86=wlan                                   # Fn+F3 or Fn+Q for comunication key
  KEYBOARD_KEY_a5=help                                   # Fn+F1
  KEYBOARD_KEY_a6=setup                                  # Fn+F2 Acer eSettings
  KEYBOARD_KEY_a7=battery                                # Fn+F3 Power Management
@@ -105,6 +119,7 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svneMachines:pneMachines*E725:pvr*
  KEYBOARD_KEY_f3=prog2                                  # "P2" programmable button
  KEYBOARD_KEY_f4=prog1                                  # "P1" programmable button
  KEYBOARD_KEY_f5=presentation
+ KEYBOARD_KEY_f6=power                                  # Power button
  KEYBOARD_KEY_f8=fn
  KEYBOARD_KEY_f9=prog1                                  # Launch NTI shadow
 
@@ -144,6 +159,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnTravelMate*C3[01]0*:pvr*
  KEYBOARD_KEY_6b=fn
  KEYBOARD_KEY_6c=screenlock                             # FIXME: lock tablet device/buttons
 
+# Travelmate P648-G2-MG
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnTravelMate*P648-G2-MG*:pvr*
+ KEYBOARD_KEY_8a=f20                                    # Microphone mute button; should be micmute
+
 # on some models this isn't brightnessup
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5210*:pvr*
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5220*:pvr*
@@ -158,6 +177,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*1640:*
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnAOA*:pvr*
  KEYBOARD_KEY_a9=!switchvideomode                       # Fn+F5
 
+# Easynote models
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnPackard*Bell*:pnEasynote*:pvr*
+ KEYBOARD_KEY_86=wlan                                   # Fn+F3 or Fn+Q for comunication key
+
 ###########################################################
 # Alienware
 ###########################################################
@@ -291,6 +314,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnPrecision*:pvr*
  KEYBOARD_KEY_88=!                                      # wireless switch
  KEYBOARD_KEY_9e=!f21
 
+# Dell Latitude E7*
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*E7*:pvr*
+ KEYBOARD_KEY_88=unknown                                # Fn-PrtScr rfkill - handled in HW
+
 # Dell XPS
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS*:pvr*
  KEYBOARD_KEY_8c=!unknown
@@ -1274,9 +1301,13 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDIXONSP:pnDIXON*:pvr*
  KEYBOARD_KEY_ae=!                                      # volume down
  KEYBOARD_KEY_b0=!                                      # volume up
 
-###########################################################
-# Fixed layout devices
-###########################################################
+######################### FIXED LAYOUT DEVICES #############################
+# This section lists devices for which only one keyboard layout is possible
+# or useful such as devices which "type" expecting the user's keymap to match
+# a particular one. For example, barcode readers and OTP keys.
+#
+# The layout must be an xkb compatible layout (defined with XKB_FIXED_LAYOUT),
+# with an accompanying variant (defined with XKB_FIXED_VARIANT) if necessary.
 
 # Yubico Yubico Yubikey II"
 evdev:input:b0003v1050p0010*
@@ -1288,3 +1319,16 @@ evdev:input:b0003v1050p0116*
 evdev:input:b0003v05FEp1010*
  XKB_FIXED_LAYOUT="us"
  XKB_FIXED_VARIANT=""
+
+######################### LACK OF MODIFIER LEDS ############################
+# This section lists keyboard which do not have their own LEDs for some
+# modifiers. Only Caps-Lock (KEYBOARD_LED_CAPSLOCK) and Num-Lock
+# (KEYBOARD_LED_CAPSLOCK) are currently handled and need their values set
+# to "0" to indicate the absence of LED.
+#
+# Presence of a LED is implicit when the property is absent.
+
+# Logitech K750
+evdev:input:b0003v046Dp4002*
+ KEYBOARD_LED_NUMLOCK=0
+ KEYBOARD_LED_CAPSLOCK=0
index 454f4037615dc0926ef87321118f6ee3e2f12c93..2436ca73679c3f8fc3d42cf25a49ea86b549b334 100644 (file)
@@ -47,6 +47,9 @@
 sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP500LB*
  ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 0
 
+sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP300LJ*
+ ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
+
 #########################################
 # Endless
 #########################################
index 772534f4958f9f9bd81f9f7e97a69fe12332ebe1..d49c472926a21c5fe77220eac769df955cfb5bbf 100644 (file)
@@ -243,6 +243,14 @@ mouse:usb:v093ap2510:name:PixArt USB Optical Mouse:
 mouse:usb:v093ap2510:name:PIXART USB OPTICAL MOUSE:
  MOUSE_DPI=1000@125
 
+##########################################
+# IBM
+##########################################
+
+# IBM USB Travel Mouse (MO32BO)
+mouse:usb:v04b3p3107:name:*
+ MOUSE_DPI=800@125
+
 ##########################################
 # Lenovo
 ##########################################
index 82a4b7a575ed9b9131474c2637618ab8356a70fc..12d97de69b2043052f39d69879a2c8274ab7467a 100644 (file)
@@ -53,3 +53,10 @@ touchpad:usb:v05ac*
 ###########################################################
 touchpad:usb:v056a*
  ID_INPUT_TOUCHPAD_INTEGRATION=external
+
+###########################################################
+# Microsoft (Surface Type Covers)
+###########################################################
+touchpad:usb:v045ep07*
+ ID_INPUT_TOUCHPAD_INTEGRATION=internal
index 50da531dc659de9d189a9f9deae0caa2c14c722e..2c23b057fb2c43d9d286f2547c002b7c259c087f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 
 from html.parser import HTMLParser
 from enum import Enum
diff --git a/hwdb/meson.build b/hwdb/meson.build
new file mode 100644 (file)
index 0000000..1f01811
--- /dev/null
@@ -0,0 +1,42 @@
+hwdb_files = files('''
+        20-pci-vendor-model.hwdb
+        20-pci-classes.hwdb
+        20-usb-vendor-model.hwdb
+        20-usb-classes.hwdb
+        20-sdio-vendor-model.hwdb
+        20-sdio-classes.hwdb
+        20-bluetooth-vendor-product.hwdb
+        20-acpi-vendor.hwdb
+        20-OUI.hwdb
+        20-net-ifname.hwdb
+        60-evdev.hwdb
+        60-keyboard.hwdb
+        60-sensor.hwdb
+        70-mouse.hwdb
+        70-pointingstick.hwdb
+        70-touchpad.hwdb
+'''.split())
+
+if conf.get('ENABLE_HWDB', false)
+        install_data(hwdb_files,
+                     install_dir : udevhwdbdir)
+
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
+
+        meson.add_install_script('sh', '-c',
+                                 'test -n "$DESTDIR" || @0@/systemd-hwdb update'
+                                 .format(rootbindir))
+endif
+
+############################################################
+
+parse_hwdb_py = find_program('parse_hwdb.py')
+test('parse-hwdb',
+     parse_hwdb_py)
+
+############################################################
+
+run_target(
+        'update',
+        command : [hwdb_update_sh, meson.current_source_dir()])
index b57e6f75aa2160ab58601e3b22a732b2df308ada..adf8a1963ea536d3e8fd267a52f2459cf68a9d1b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 # This file is part of systemd. It is distrubuted under the MIT license, see
@@ -112,6 +112,8 @@ def property_grammar():
              ('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))),
              ('XKB_FIXED_LAYOUT', STRING),
              ('XKB_FIXED_VARIANT', STRING),
+             ('KEYBOARD_LED_NUMLOCK', Literal('0')),
+             ('KEYBOARD_LED_CAPSLOCK', Literal('0')),
              ('ACCEL_MOUNT_MATRIX', mount_matrix),
             )
     fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
index c6ff32210f6753034e6f18715da471ba20c15631..7537d5e915812194c8c5b7b45b75cd3b19b19532 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 
 """
 
diff --git a/man/custom-entities.ent.in b/man/custom-entities.ent.in
new file mode 100644 (file)
index 0000000..0257c2a
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!ENTITY MOUNT_PATH @MOUNT_PATH@>
+<!ENTITY UMOUNT_PATH @UMOUNT_PATH@>
+<!ENTITY systemgeneratordir @SYSTEM_GENERATOR_PATH@>
+<!ENTITY usergeneratordir @USER_GENERATOR_PATH@>
+<!ENTITY systemenvgeneratordir @SYSTEM_ENV_GENERATOR_PATH@>
+<!ENTITY userenvgeneratordir @USER_ENV_GENERATOR_PATH@>
index be7758a2f92d05b3a136428cf1c2bf5c062c3399..78b949160b46046e08b6298724242dca584b2b5d 100644 (file)
@@ -20,7 +20,8 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="environment.d" xmlns:xi="http://www.w3.org/2001/XInclude">
+<refentry id="environment.d" conditional='ENABLE_ENVIRONMENT_D'
+    xmlns:xi="http://www.w3.org/2001/XInclude">
 
   <refentryinfo>
     <title>environment.d</title>
index cae5312db25e2876ee488c93eb359411eb53826c..444b9160735043155643e0e5d5d153fd2e1aae97 100644 (file)
 
             <varlistentry>
               <term>
-                <option>short-precise</option>
+                <option>short-iso-precise</option>
               </term>
               <listitem>
-                <para>is very similar, but shows timestamps with full
+                <para>as for <option>short-iso</option> but includes full
                 microsecond precision.</para>
               </listitem>
             </varlistentry>
 
+            <varlistentry>
+              <term>
+                <option>short-precise</option>
+              </term>
+              <listitem>
+                <para>is very similar, but shows classic syslog timestamps
+                with full microsecond precision.</para>
+              </listitem>
+            </varlistentry>
+
             <varlistentry>
               <term>
                 <option>short-monotonic</option>
index f02ca3e7bc999138ff933995c22dff5385adf39d..00fb6f6c0d013bc6602f67ff3dcf072e16ef2d52 100644 (file)
@@ -59,8 +59,8 @@
     kernel command line arguments.</para>
 
     <para>For command line parameters understood by the kernel, please
-    see <ulink
-    url="https://www.kernel.org/doc/Documentation/kernel-parameters.txt"><filename>kernel-parameters.txt</filename></ulink>
+    see
+    <ulink url="https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html"><filename>kernel-parameters.html</filename></ulink>
     and
     <citerefentry project='man-pages'><refentrytitle>bootparam</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
 
index 1f34cbc1bfe3ec492dcefb639dfed1711ba5dfed..396481c937253335fffa586ecf0c93c287476f44 100644 (file)
@@ -12,8 +12,8 @@
       <listitem><para>Pager to use when <option>--no-pager</option> is not given; overrides
       <varname>$PAGER</varname>. If neither <varname>$SYSTEMD_PAGER</varname> nor <varname>$PAGER</varname> are set, a
       set of well-known pager implementations are tried in turn, including
-      <citerefentry><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
-      <citerefentry><refentrytitle>more</refentrytitle><manvolnum>1</manvolnum></citerefentry>, until one is found. If
+      <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
+      <citerefentry project='man-pages'><refentrytitle>more</refentrytitle><manvolnum>1</manvolnum></citerefentry>, until one is found. If
       no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string
       or the value <literal>cat</literal> is equivalent to passing <option>--no-pager</option>.</para></listitem>
     </varlistentry>
index 994e0e114041a6a19d1549e63116e45d0f81725e..16f51af72c43615bb19c21969e8d743b8ab9d4f5 100644 (file)
 
         <para>A different application may disable logind's handling of system power and
         sleep keys and the lid switch by taking a low-level inhibitor lock
-        ("handle-power-key", "handle-suspend-key", "handle-hibernate-key",
-        "handle-lid-switch"). This is most commonly used by graphical desktop environments
+        (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
+        <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>).
+        This is most commonly used by graphical desktop environments
         to take over suspend and hibernation handling, and to use their own configuration
         mechanisms. If a low-level inhibitor lock is taken, logind will not take any
         action when that key or switch is triggered and the <varname>Handle*=</varname>
         <listitem><para>Controls whether actions that <command>systemd-logind</command>
         takes when the power and sleep keys and the lid switch are triggered are subject
         to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor
-        locks ("handle-*-key"), are always honored, irrespective of this setting.</para>
+        locks (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
+        <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>),
+        are always honored, irrespective of this setting.</para>
 
         <para>These settings take boolean arguments. If <literal>no</literal>, the
         inhibitor locks taken by applications are respected. If <literal>yes</literal>,
index 7a159aecdc782001a231c17bb6d0fc105643e358..46dcb44ca675ab4f058ca61294adf5eb8edaac81 100644 (file)
         is automatically derived from the last component of the URL,
         with its suffix removed.</para>
 
-        <para>The image is verified before it is made available,
-        unless <option>--verify=no</option> is specified. Verification
-        is done via SHA256SUMS and SHA256SUMS.gpg files that need to
-        be made available on the same web server, under the same URL
-        as the <filename>.tar</filename> file, but with the last
-        component (the filename) of the URL replaced. With
-        <option>--verify=checksum</option>, only the SHA256 checksum
-        for the file is verified, based on the
-        <filename>SHA256SUMS</filename> file. With
-        <option>--verify=signature</option>, the SHA256SUMS file is
-        first verified with detached GPG signature file
-        <filename>SHA256SUMS.gpg</filename>. The public key for this
-        verification step needs to be available in
+        <para>The image is verified before it is made available, unless
+        <option>--verify=no</option> is specified.
+        Verification is done either via an inline signed file with the name
+        of the image and the suffix <filename>.sha256</filename> or via
+        separate <filename>SHA256SUMS</filename> and
+        <filename>SHA256SUMS.gpg</filename> files.
+        The signature files need to be made available on the same web
+        server, under the same URL as the <filename>.tar</filename> file.
+        With <option>--verify=checksum</option>, only the SHA256 checksum
+        for the file is verified, based on the <filename>.sha256</filename>
+        suffixed file or the<filename>SHA256SUMS</filename> file.
+        With <option>--verify=signature</option>, the sha checksum file is
+        first verified with the inline signature in the
+        <filename>.sha256</filename> file or the detached GPG signature file
+        <filename>SHA256SUMS.gpg</filename>.
+        The public key for this verification step needs to be available in
         <filename>/usr/lib/systemd/import-pubring.gpg</filename> or
         <filename>/etc/systemd/import-pubring.gpg</filename>.</para>
 
diff --git a/man/meson.build b/man/meson.build
new file mode 100644 (file)
index 0000000..4f2ddad
--- /dev/null
@@ -0,0 +1,204 @@
+# This is lame, I know, but meson has no other include mechanism
+subdir('rules')
+
+want_man = get_option('man')
+want_html = get_option('html')
+xsltproc = find_program('xsltproc',
+                        required : want_man == 'true' or want_html == 'true')
+want_man = want_man != 'false' and xsltproc.found()
+want_html = want_html != 'false' and xsltproc.found()
+
+xsltproc_flags = [
+        '--nonet',
+        '--xinclude',
+        '--stringparam', 'man.output.quietly', '1',
+        '--stringparam', 'funcsynopsis.style', 'ansi',
+        '--stringparam', 'man.authors.section.enabled', '0',
+        '--stringparam', 'man.copyright.section.enabled', '0',
+        '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()),
+        '--path',
+        '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())]
+
+custom_man_xsl = files('custom-man.xsl')
+custom_html_xsl = files('custom-html.xsl')
+xslt_cmd = [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags
+
+custom_entities_ent = configure_file(
+        input : 'custom-entities.ent.in',
+        output : 'custom-entities.ent',
+        configuration : conf)
+
+man_pages = []
+html_pages = []
+source_xml_files = []
+foreach tuple : manpages
+        stem = tuple[0]
+        section = tuple[1]
+        aliases = tuple[2]
+        condition = tuple[3]
+
+        xml = stem + '.xml'
+        html = stem + '.html'
+        man = stem + '.' + section
+
+        manaliases = []
+        htmlaliases = []
+        foreach alias : aliases
+                manaliases += [alias + '.' + section]
+                htmlaliases += [alias + '.html']
+        endforeach
+
+        mandirn = join_paths(get_option('mandir'), 'man' + section)
+
+        if condition == '' or conf.get(condition, false)
+                p1 = custom_target(
+                        man,
+                        input : xml,
+                        output : [man] + manaliases,
+                        command : xslt_cmd + [custom_man_xsl, '@INPUT@'],
+                        depend_files : custom_entities_ent,
+                        install : want_man,
+                        install_dir : mandirn)
+                man_pages += [p1]
+
+                p2 = []
+                foreach htmlalias : htmlaliases
+                        link = custom_target(
+                                htmlalias,
+                                input : p2,
+                                output : htmlalias,
+                                command : ['ln', '-fs', html, '@OUTPUT@'])
+                        if want_html
+                                dst = join_paths(docdir, 'html', htmlalias)
+                                cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
+                                meson.add_install_script('sh', '-c', cmd)
+                                p2 += [link]
+                        endif
+                        html_pages += [link]
+                endforeach
+
+                p3 = custom_target(
+                        html,
+                        input : xml,
+                        output : html,
+                        command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
+                        depend_files : custom_entities_ent,
+                        depends : p2,
+                        install : want_html,
+                        install_dir : join_paths(docdir, 'html'))
+                html_pages += [p3]
+
+                source_xml_files += files(tuple[0] + '.xml')
+        else
+                message('Skipping @0@.@1@ because @2@ is false'.format(stem, section, condition))
+        endif
+endforeach
+
+############################################################
+
+have_lxml = run_command(xml_helper_py).returncode() == 0
+if not have_lxml
+        message('python-lxml not available, not making man page indices')
+endif
+
+systemd_directives_xml = custom_target(
+        'systemd.directives.xml',
+        input : source_xml_files,
+        output : 'systemd.directives.xml',
+        command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files)
+
+nonindex_xml_files = source_xml_files + [systemd_directives_xml]
+systemd_index_xml = custom_target(
+        'systemd.index.xml',
+        input : nonindex_xml_files,
+        output : 'systemd.index.xml',
+        command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files)
+
+foreach tuple : [['systemd.directives', '7', systemd_directives_xml],
+                 ['systemd.index',      '7', systemd_index_xml]]
+        stem = tuple[0]
+        section = tuple[1]
+        xml = tuple[2]
+
+        html = stem + '.html'
+        man = stem + '.' + section
+
+        mandirn = join_paths(get_option('mandir'), 'man' + section)
+
+        p1 = custom_target(
+                man,
+                input : xml,
+                output : man,
+                command : xslt_cmd + [custom_man_xsl, '@INPUT@'],
+                install : want_man and have_lxml,
+                install_dir : mandirn)
+        man_pages += [p1]
+
+        p2 = []
+        if html == 'systemd.index.html'
+                htmlalias = 'index.html'
+                link = custom_target(
+                        htmlalias,
+                        input : p2,
+                        output : htmlalias,
+                        command : ['ln', '-fs', html, '@OUTPUT@'])
+                if want_html
+                        dst = join_paths(docdir, 'html', htmlalias)
+                        cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
+                        meson.add_install_script('sh', '-c', cmd)
+                        p2 += [link]
+                endif
+                html_pages += [link]
+        endif
+
+        p3 = custom_target(
+                html,
+                input : xml,
+                output : html,
+                command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
+                depend_files : custom_entities_ent,
+                depends : p2,
+                install : want_html and have_lxml,
+                install_dir : join_paths(docdir, 'html'))
+        html_pages += [p3]
+endforeach
+
+# cannot use run_target until https://github.com/mesonbuild/meson/issues/1644 is resolved
+man = custom_target(
+        'man',
+        output : 'man',
+        depends : man_pages,
+        command : ['echo'])
+
+html = run_target(
+        'html',
+        depends : html_pages,
+        output : 'html',
+        command : ['echo'])
+
+run_target(
+        'doc-sync',
+        depends : man_pages + html_pages,
+        command : ['rsync', '-rlv',
+                   '--delete-excluded',
+                   '--include=man',
+                   '--include=*.html',
+                   '--exclude=*',
+                   '--omit-dir-times',
+                   meson.current_build_dir(),
+                   get_option('www-target')])
+
+############################################################
+
+if git.found()
+        run_target(
+                'update-man-rules',
+                # slightly strange syntax because of
+                # https://github.com/mesonbuild/meson/issues/1643
+                # and https://github.com/mesonbuild/meson/issues/1512
+                command : ['sh', '-c',
+                           'cd @0@ && '.format(meson.build_root()) +
+                           'python3 @0@/tools/make-man-rules.py --meson `git ls-files ":/man/*.xml"` >t && '.format(meson.source_root()) +
+                           'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
+                depend_files : custom_entities_ent)
+endif
index 6e1aa0dd9a64a79f6c6c74d1afb0cfde166b7dce..cef5445c1ce4609b116df98ac8e958606228b89e 100644 (file)
@@ -88,7 +88,7 @@
       and so will the user's slice unit.</para></listitem>
 
       <listitem><para>If the last concurrent session of a user ends,
-      the <varname>$XDG_RUNTIME_DIR</varname> directory and all its
+      the user runtime directory <filename>/run/user/$UID</filename> and all its
       contents are removed, too.</para></listitem>
     </orderedlist>
 
         offers the greatest possible file system feature set the
         operating system provides. For further details, see the <ulink
         url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
-        Base Directory Specification</ulink>.</para></listitem>
+        Base Directory Specification</ulink>. <varname>$XDG_RUNTIME_DIR</varname>
+        is not set if the current user is not the original user of the session.</para></listitem>
       </varlistentry>
 
     </variablelist>
index 4fc1ef1b33b7cb18a18990494f61dbc59c3b30c2..7babc5c5c41df64f20c78c42d9f6d5775cd757de 100644 (file)
         global setting is on.</para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>MulticastDNS=</varname></term>
+        <listitem><para>Takes a boolean argument or
+        <literal>resolve</literal>. Controls Multicast DNS support (<ulink
+        url="https://tools.ietf.org/html/rfc6762">RFC 6762</ulink>) on
+        the local host. If true, enables full Multicast DNS responder and
+        resolver support. If false, disables both. If set to
+        <literal>resolve</literal>, only resolution support is enabled,
+        but responding is disabled. Note that
+        <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+        also maintains per-link Multicast DNS settings. Multicast DNS will be
+        enabled on a link only if the per-link and the
+        global setting is on.</para></listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>DNSSEC=</varname></term>
         <listitem><para>Takes a boolean argument or
diff --git a/man/rules/meson.build b/man/rules/meson.build
new file mode 100644 (file)
index 0000000..1508b01
--- /dev/null
@@ -0,0 +1,766 @@
+# Do not edit. Generated by make-man-rules.py.
+manpages = [
+['binfmt.d', '5', [], 'ENABLE_BINFMT'],
+ ['bootctl', '1', [], 'ENABLE_EFI'],
+ ['bootup', '7', [], ''],
+ ['busctl', '1', [], ''],
+ ['coredump.conf', '5', ['coredump.conf.d'], 'ENABLE_COREDUMP'],
+ ['coredumpctl', '1', [], 'ENABLE_COREDUMP'],
+ ['crypttab', '5', [], 'HAVE_LIBCRYPTSETUP'],
+ ['daemon', '7', [], ''],
+ ['dnssec-trust-anchors.d',
+  '5',
+  ['systemd.negative', 'systemd.positive'],
+  'ENABLE_RESOLVED'],
+ ['environment.d', '5', [], 'ENABLE_ENVIRONMENT_D'],
+ ['file-hierarchy', '7', [], ''],
+ ['halt', '8', ['poweroff', 'reboot'], ''],
+ ['hostname', '5', [], ''],
+ ['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'],
+ ['hwdb', '7', [], 'ENABLE_HWDB'],
+ ['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'],
+ ['journal-upload.conf', '5', ['journal-upload.conf.d'], 'HAVE_MICROHTTPD'],
+ ['journalctl', '1', [], ''],
+ ['journald.conf', '5', ['journald.conf.d'], ''],
+ ['kernel-command-line', '7', [], ''],
+ ['kernel-install', '8', [], ''],
+ ['libudev', '3', [], ''],
+ ['locale.conf', '5', [], ''],
+ ['localectl', '1', [], 'ENABLE_LOCALED'],
+ ['localtime', '5', [], ''],
+ ['loginctl', '1', [], 'ENABLE_LOGIND'],
+ ['logind.conf', '5', ['logind.conf.d'], 'ENABLE_LOGIND'],
+ ['machine-id', '5', [], ''],
+ ['machine-info', '5', [], ''],
+ ['machinectl', '1', [], 'ENABLE_MACHINED'],
+ ['modules-load.d', '5', [], 'HAVE_KMOD'],
+ ['networkctl', '1', [], 'ENABLE_NETWORKD'],
+ ['networkd.conf', '5', ['networkd.conf.d'], 'ENABLE_NETWORKD'],
+ ['nss-myhostname', '8', ['libnss_myhostname.so.2'], 'HAVE_MYHOSTNAME'],
+ ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_MACHINED'],
+ ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_RESOLVED'],
+ ['nss-systemd', '8', ['libnss_systemd.so.2'], ''],
+ ['os-release', '5', [], ''],
+ ['pam_systemd', '8', [], 'HAVE_PAM'],
+ ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVED'],
+ ['runlevel', '8', [], 'HAVE_UTMP'],
+ ['sd-bus-errors',
+  '3',
+  ['SD_BUS_ERROR_ACCESS_DENIED',
+   'SD_BUS_ERROR_ADDRESS_IN_USE',
+   'SD_BUS_ERROR_AUTH_FAILED',
+   'SD_BUS_ERROR_BAD_ADDRESS',
+   'SD_BUS_ERROR_DISCONNECTED',
+   'SD_BUS_ERROR_FAILED',
+   'SD_BUS_ERROR_FILE_EXISTS',
+   'SD_BUS_ERROR_FILE_NOT_FOUND',
+   'SD_BUS_ERROR_INCONSISTENT_MESSAGE',
+   'SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED',
+   'SD_BUS_ERROR_INVALID_ARGS',
+   'SD_BUS_ERROR_INVALID_SIGNATURE',
+   'SD_BUS_ERROR_IO_ERROR',
+   'SD_BUS_ERROR_LIMITS_EXCEEDED',
+   'SD_BUS_ERROR_MATCH_RULE_INVALID',
+   'SD_BUS_ERROR_MATCH_RULE_NOT_FOUND',
+   'SD_BUS_ERROR_NAME_HAS_NO_OWNER',
+   'SD_BUS_ERROR_NOT_SUPPORTED',
+   'SD_BUS_ERROR_NO_MEMORY',
+   'SD_BUS_ERROR_NO_NETWORK',
+   'SD_BUS_ERROR_NO_REPLY',
+   'SD_BUS_ERROR_NO_SERVER',
+   'SD_BUS_ERROR_PROPERTY_READ_ONLY',
+   'SD_BUS_ERROR_SERVICE_UNKNOWN',
+   'SD_BUS_ERROR_TIMEOUT',
+   'SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN',
+   'SD_BUS_ERROR_UNKNOWN_INTERFACE',
+   'SD_BUS_ERROR_UNKNOWN_METHOD',
+   'SD_BUS_ERROR_UNKNOWN_OBJECT',
+   'SD_BUS_ERROR_UNKNOWN_PROPERTY'],
+  ''],
+ ['sd-bus', '3', [], ''],
+ ['sd-daemon',
+  '3',
+  ['SD_ALERT',
+   'SD_CRIT',
+   'SD_DEBUG',
+   'SD_EMERG',
+   'SD_ERR',
+   'SD_INFO',
+   'SD_NOTICE',
+   'SD_WARNING'],
+  ''],
+ ['sd-event', '3', [], ''],
+ ['sd-id128',
+  '3',
+  ['SD_ID128_CONST_STR',
+   'SD_ID128_FORMAT_STR',
+   'SD_ID128_FORMAT_VAL',
+   'SD_ID128_MAKE',
+   'SD_ID128_MAKE_STR',
+   'SD_ID128_NULL',
+   'sd_id128_equal',
+   'sd_id128_is_null',
+   'sd_id128_t'],
+  ''],
+ ['sd-journal', '3', [], ''],
+ ['sd-login', '3', [], 'HAVE_PAM'],
+ ['sd_booted', '3', [], ''],
+ ['sd_bus_add_match', '3', [], ''],
+ ['sd_bus_creds_get_pid',
+  '3',
+  ['sd_bus_creds_get_audit_login_uid',
+   'sd_bus_creds_get_audit_session_id',
+   'sd_bus_creds_get_cgroup',
+   'sd_bus_creds_get_cmdline',
+   'sd_bus_creds_get_comm',
+   'sd_bus_creds_get_description',
+   'sd_bus_creds_get_egid',
+   'sd_bus_creds_get_euid',
+   'sd_bus_creds_get_exe',
+   'sd_bus_creds_get_fsgid',
+   'sd_bus_creds_get_fsuid',
+   'sd_bus_creds_get_gid',
+   'sd_bus_creds_get_owner_uid',
+   'sd_bus_creds_get_ppid',
+   'sd_bus_creds_get_selinux_context',
+   'sd_bus_creds_get_session',
+   'sd_bus_creds_get_sgid',
+   'sd_bus_creds_get_slice',
+   'sd_bus_creds_get_suid',
+   'sd_bus_creds_get_supplementary_gids',
+   'sd_bus_creds_get_tid',
+   'sd_bus_creds_get_tid_comm',
+   'sd_bus_creds_get_tty',
+   'sd_bus_creds_get_uid',
+   'sd_bus_creds_get_unique_name',
+   'sd_bus_creds_get_unit',
+   'sd_bus_creds_get_user_slice',
+   'sd_bus_creds_get_user_unit',
+   'sd_bus_creds_get_well_known_names',
+   'sd_bus_creds_has_bounding_cap',
+   'sd_bus_creds_has_effective_cap',
+   'sd_bus_creds_has_inheritable_cap',
+   'sd_bus_creds_has_permitted_cap'],
+  ''],
+ ['sd_bus_creds_new_from_pid',
+  '3',
+  ['sd_bus_creds_get_augmented_mask',
+   'sd_bus_creds_get_mask',
+   'sd_bus_creds_ref',
+   'sd_bus_creds_unref',
+   'sd_bus_creds_unrefp'],
+  ''],
+ ['sd_bus_default',
+  '3',
+  ['sd_bus_default_system',
+   'sd_bus_default_user',
+   'sd_bus_open',
+   'sd_bus_open_system',
+   'sd_bus_open_system_machine',
+   'sd_bus_open_system_remote',
+   'sd_bus_open_user'],
+  ''],
+ ['sd_bus_error',
+  '3',
+  ['SD_BUS_ERROR_MAKE_CONST',
+   'SD_BUS_ERROR_NULL',
+   'sd_bus_error_copy',
+   'sd_bus_error_free',
+   'sd_bus_error_get_errno',
+   'sd_bus_error_has_name',
+   'sd_bus_error_is_set',
+   'sd_bus_error_set',
+   'sd_bus_error_set_const',
+   'sd_bus_error_set_errno',
+   'sd_bus_error_set_errnof',
+   'sd_bus_error_set_errnofv',
+   'sd_bus_error_setf'],
+  ''],
+ ['sd_bus_error_add_map',
+  '3',
+  ['SD_BUS_ERROR_END', 'SD_BUS_ERROR_MAP', 'sd_bus_error_map'],
+  ''],
+ ['sd_bus_get_fd', '3', [], ''],
+ ['sd_bus_message_append', '3', ['sd_bus_message_appendv'], ''],
+ ['sd_bus_message_append_array',
+  '3',
+  ['sd_bus_message_append_array_iovec',
+   'sd_bus_message_append_array_memfd',
+   'sd_bus_message_append_array_space'],
+  ''],
+ ['sd_bus_message_append_basic', '3', [], ''],
+ ['sd_bus_message_append_string_memfd',
+  '3',
+  ['sd_bus_message_append_string_iovec', 'sd_bus_message_append_string_space'],
+  ''],
+ ['sd_bus_message_append_strv', '3', [], ''],
+ ['sd_bus_message_get_cookie', '3', ['sd_bus_message_get_reply_cookie'], ''],
+ ['sd_bus_message_get_monotonic_usec',
+  '3',
+  ['sd_bus_message_get_realtime_usec', 'sd_bus_message_get_seqnum'],
+  ''],
+ ['sd_bus_message_read_basic', '3', [], ''],
+ ['sd_bus_negotiate_fds',
+  '3',
+  ['sd_bus_negotiate_creds', 'sd_bus_negotiate_timestamp'],
+  ''],
+ ['sd_bus_new', '3', ['sd_bus_ref', 'sd_bus_unref', 'sd_bus_unrefp'], ''],
+ ['sd_bus_path_encode',
+  '3',
+  ['sd_bus_path_decode', 'sd_bus_path_decode_many', 'sd_bus_path_encode_many'],
+  ''],
+ ['sd_bus_process', '3', [], ''],
+ ['sd_bus_request_name', '3', ['sd_bus_release_name'], ''],
+ ['sd_bus_track_add_name',
+  '3',
+  ['sd_bus_track_add_sender',
+   'sd_bus_track_contains',
+   'sd_bus_track_count',
+   'sd_bus_track_count_name',
+   'sd_bus_track_count_sender',
+   'sd_bus_track_first',
+   'sd_bus_track_next',
+   'sd_bus_track_remove_name',
+   'sd_bus_track_remove_sender'],
+  ''],
+ ['sd_bus_track_new',
+  '3',
+  ['sd_bus_track_get_bus',
+   'sd_bus_track_get_recursive',
+   'sd_bus_track_get_userdata',
+   'sd_bus_track_ref',
+   'sd_bus_track_set_recursive',
+   'sd_bus_track_set_userdata',
+   'sd_bus_track_unref',
+   'sd_bus_track_unrefp'],
+  ''],
+ ['sd_event_add_child',
+  '3',
+  ['sd_event_child_handler_t', 'sd_event_source_get_child_pid'],
+  ''],
+ ['sd_event_add_defer',
+  '3',
+  ['sd_event_add_exit', 'sd_event_add_post', 'sd_event_handler_t'],
+  ''],
+ ['sd_event_add_io',
+  '3',
+  ['sd_event_io_handler_t',
+   'sd_event_source',
+   'sd_event_source_get_io_events',
+   'sd_event_source_get_io_fd',
+   'sd_event_source_get_io_revents',
+   'sd_event_source_set_io_events',
+   'sd_event_source_set_io_fd'],
+  ''],
+ ['sd_event_add_signal',
+  '3',
+  ['sd_event_signal_handler_t', 'sd_event_source_get_signal'],
+  ''],
+ ['sd_event_add_time',
+  '3',
+  ['sd_event_source_get_time',
+   'sd_event_source_get_time_accuracy',
+   'sd_event_source_get_time_clock',
+   'sd_event_source_set_time',
+   'sd_event_source_set_time_accuracy',
+   'sd_event_time_handler_t'],
+  ''],
+ ['sd_event_exit', '3', ['sd_event_get_exit_code'], ''],
+ ['sd_event_get_fd', '3', [], ''],
+ ['sd_event_new',
+  '3',
+  ['sd_event',
+   'sd_event_default',
+   'sd_event_get_tid',
+   'sd_event_ref',
+   'sd_event_unref',
+   'sd_event_unrefp'],
+  ''],
+ ['sd_event_now', '3', [], ''],
+ ['sd_event_run', '3', ['sd_event_loop'], ''],
+ ['sd_event_set_watchdog', '3', ['sd_event_get_watchdog'], ''],
+ ['sd_event_source_get_event', '3', [], ''],
+ ['sd_event_source_get_pending', '3', [], ''],
+ ['sd_event_source_set_description',
+  '3',
+  ['sd_event_source_get_description'],
+  ''],
+ ['sd_event_source_set_enabled',
+  '3',
+  ['SD_EVENT_OFF',
+   'SD_EVENT_ON',
+   'SD_EVENT_ONESHOT',
+   'sd_event_source_get_enabled'],
+  ''],
+ ['sd_event_source_set_prepare', '3', [], ''],
+ ['sd_event_source_set_priority',
+  '3',
+  ['SD_EVENT_PRIORITY_IDLE',
+   'SD_EVENT_PRIORITY_IMPORTANT',
+   'SD_EVENT_PRIORITY_NORMAL',
+   'sd_event_source_get_priority'],
+  ''],
+ ['sd_event_source_set_userdata', '3', ['sd_event_source_get_userdata'], ''],
+ ['sd_event_source_unref',
+  '3',
+  ['sd_event_source_ref', 'sd_event_source_unrefp'],
+  ''],
+ ['sd_event_wait',
+  '3',
+  ['SD_EVENT_ARMED',
+   'SD_EVENT_EXITING',
+   'SD_EVENT_FINISHED',
+   'SD_EVENT_INITIAL',
+   'SD_EVENT_PENDING',
+   'SD_EVENT_PREPARING',
+   'SD_EVENT_RUNNING',
+   'sd_event_dispatch',
+   'sd_event_get_iteration',
+   'sd_event_get_state',
+   'sd_event_prepare'],
+  ''],
+ ['sd_get_seats',
+  '3',
+  ['sd_get_machine_names', 'sd_get_sessions', 'sd_get_uids'],
+  'HAVE_PAM'],
+ ['sd_id128_get_machine',
+  '3',
+  ['sd_id128_get_boot',
+   'sd_id128_get_invocation',
+   'sd_id128_get_machine_app_specific'],
+  ''],
+ ['sd_id128_randomize', '3', [], ''],
+ ['sd_id128_to_string', '3', ['sd_id128_from_string'], ''],
+ ['sd_is_fifo',
+  '3',
+  ['sd_is_mq',
+   'sd_is_socket',
+   'sd_is_socket_inet',
+   'sd_is_socket_sockaddr',
+   'sd_is_socket_unix',
+   'sd_is_special'],
+  ''],
+ ['sd_journal_add_match',
+  '3',
+  ['sd_journal_add_conjunction',
+   'sd_journal_add_disjunction',
+   'sd_journal_flush_matches'],
+  ''],
+ ['sd_journal_enumerate_fields',
+  '3',
+  ['SD_JOURNAL_FOREACH_FIELD', 'sd_journal_restart_fields'],
+  ''],
+ ['sd_journal_get_catalog', '3', ['sd_journal_get_catalog_for_message_id'], ''],
+ ['sd_journal_get_cursor', '3', ['sd_journal_test_cursor'], ''],
+ ['sd_journal_get_cutoff_realtime_usec',
+  '3',
+  ['sd_journal_get_cutoff_monotonic_usec'],
+  ''],
+ ['sd_journal_get_data',
+  '3',
+  ['SD_JOURNAL_FOREACH_DATA',
+   'sd_journal_enumerate_data',
+   'sd_journal_get_data_threshold',
+   'sd_journal_restart_data',
+   'sd_journal_set_data_threshold'],
+  ''],
+ ['sd_journal_get_fd',
+  '3',
+  ['SD_JOURNAL_APPEND',
+   'SD_JOURNAL_INVALIDATE',
+   'SD_JOURNAL_NOP',
+   'sd_journal_get_events',
+   'sd_journal_get_timeout',
+   'sd_journal_process',
+   'sd_journal_reliable_fd',
+   'sd_journal_wait'],
+  ''],
+ ['sd_journal_get_realtime_usec', '3', ['sd_journal_get_monotonic_usec'], ''],
+ ['sd_journal_get_usage', '3', [], ''],
+ ['sd_journal_has_runtime_files', '3', ['sd_journal_has_persistent_files'], ''],
+ ['sd_journal_next',
+  '3',
+  ['SD_JOURNAL_FOREACH',
+   'SD_JOURNAL_FOREACH_BACKWARDS',
+   'sd_journal_next_skip',
+   'sd_journal_previous',
+   'sd_journal_previous_skip'],
+  ''],
+ ['sd_journal_open',
+  '3',
+  ['SD_JOURNAL_CURRENT_USER',
+   'SD_JOURNAL_LOCAL_ONLY',
+   'SD_JOURNAL_OS_ROOT',
+   'SD_JOURNAL_RUNTIME_ONLY',
+   'SD_JOURNAL_SYSTEM',
+   'sd_journal',
+   'sd_journal_close',
+   'sd_journal_open_directory',
+   'sd_journal_open_directory_fd',
+   'sd_journal_open_files',
+   'sd_journal_open_files_fd'],
+  ''],
+ ['sd_journal_print',
+  '3',
+  ['SD_JOURNAL_SUPPRESS_LOCATION',
+   'sd_journal_perror',
+   'sd_journal_printv',
+   'sd_journal_send',
+   'sd_journal_sendv'],
+  ''],
+ ['sd_journal_query_unique',
+  '3',
+  ['SD_JOURNAL_FOREACH_UNIQUE',
+   'sd_journal_enumerate_unique',
+   'sd_journal_restart_unique'],
+  ''],
+ ['sd_journal_seek_head',
+  '3',
+  ['sd_journal_seek_cursor',
+   'sd_journal_seek_monotonic_usec',
+   'sd_journal_seek_realtime_usec',
+   'sd_journal_seek_tail'],
+  ''],
+ ['sd_journal_stream_fd', '3', [], ''],
+ ['sd_listen_fds',
+  '3',
+  ['SD_LISTEN_FDS_START', 'sd_listen_fds_with_names'],
+  ''],
+ ['sd_login_monitor_new',
+  '3',
+  ['sd_login_monitor',
+   'sd_login_monitor_flush',
+   'sd_login_monitor_get_events',
+   'sd_login_monitor_get_fd',
+   'sd_login_monitor_get_timeout',
+   'sd_login_monitor_unref',
+   'sd_login_monitor_unrefp'],
+  'HAVE_PAM'],
+ ['sd_machine_get_class', '3', ['sd_machine_get_ifindices'], ''],
+ ['sd_notify',
+  '3',
+  ['sd_notifyf', 'sd_pid_notify', 'sd_pid_notify_with_fds', 'sd_pid_notifyf'],
+  ''],
+ ['sd_pid_get_session',
+  '3',
+  ['sd_peer_get_cgroup',
+   'sd_peer_get_machine_name',
+   'sd_peer_get_owner_uid',
+   'sd_peer_get_session',
+   'sd_peer_get_slice',
+   'sd_peer_get_unit',
+   'sd_peer_get_user_slice',
+   'sd_peer_get_user_unit',
+   'sd_pid_get_cgroup',
+   'sd_pid_get_machine_name',
+   'sd_pid_get_owner_uid',
+   'sd_pid_get_slice',
+   'sd_pid_get_unit',
+   'sd_pid_get_user_slice',
+   'sd_pid_get_user_unit'],
+  'HAVE_PAM'],
+ ['sd_seat_get_active',
+  '3',
+  ['sd_seat_can_graphical',
+   'sd_seat_can_multi_session',
+   'sd_seat_can_tty',
+   'sd_seat_get_sessions'],
+  'HAVE_PAM'],
+ ['sd_session_is_active',
+  '3',
+  ['sd_session_get_class',
+   'sd_session_get_desktop',
+   'sd_session_get_display',
+   'sd_session_get_remote_host',
+   'sd_session_get_remote_user',
+   'sd_session_get_seat',
+   'sd_session_get_service',
+   'sd_session_get_state',
+   'sd_session_get_tty',
+   'sd_session_get_type',
+   'sd_session_get_uid',
+   'sd_session_get_vt',
+   'sd_session_is_remote'],
+  'HAVE_PAM'],
+ ['sd_uid_get_state',
+  '3',
+  ['sd_uid_get_display',
+   'sd_uid_get_seats',
+   'sd_uid_get_sessions',
+   'sd_uid_is_on_seat'],
+  'HAVE_PAM'],
+ ['sd_watchdog_enabled', '3', [], ''],
+ ['shutdown', '8', [], ''],
+ ['sysctl.d', '5', [], ''],
+ ['systemctl', '1', [], ''],
+ ['systemd-analyze', '1', [], ''],
+ ['systemd-ask-password-console.service',
+  '8',
+  ['systemd-ask-password-console.path',
+   'systemd-ask-password-wall.path',
+   'systemd-ask-password-wall.service'],
+  ''],
+ ['systemd-ask-password', '1', [], ''],
+ ['systemd-backlight@.service', '8', ['systemd-backlight'], 'ENABLE_BACKLIGHT'],
+ ['systemd-binfmt.service', '8', ['systemd-binfmt'], 'ENABLE_BINFMT'],
+ ['systemd-cat', '1', [], ''],
+ ['systemd-cgls', '1', [], ''],
+ ['systemd-cgtop', '1', [], ''],
+ ['systemd-coredump',
+  '8',
+  ['systemd-coredump.socket', 'systemd-coredump@.service'],
+  'ENABLE_COREDUMP'],
+ ['systemd-cryptsetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'],
+ ['systemd-cryptsetup@.service',
+  '8',
+  ['systemd-cryptsetup'],
+  'HAVE_LIBCRYPTSETUP'],
+ ['systemd-debug-generator', '8', [], ''],
+ ['systemd-delta', '1', [], ''],
+ ['systemd-detect-virt', '1', [], ''],
+ ['systemd-environment-d-generator',
+  '8',
+  ['30-systemd-environment-d-generator'],
+  'ENABLE_ENVIRONMENT_D'],
+ ['systemd-escape', '1', [], ''],
+ ['systemd-firstboot', '1', ['systemd-firstboot.service'], 'ENABLE_FIRSTBOOT'],
+ ['systemd-fsck@.service',
+  '8',
+  ['systemd-fsck', 'systemd-fsck-root.service'],
+  ''],
+ ['systemd-fstab-generator', '8', [], ''],
+ ['systemd-getty-generator', '8', [], ''],
+ ['systemd-gpt-auto-generator', '8', [], ''],
+ ['systemd-halt.service',
+  '8',
+  ['systemd-kexec.service',
+   'systemd-poweroff.service',
+   'systemd-reboot.service',
+   'systemd-shutdown'],
+  ''],
+ ['systemd-hibernate-resume-generator', '8', [], 'ENABLE_HIBERNATE'],
+ ['systemd-hibernate-resume@.service',
+  '8',
+  ['systemd-hibernate-resume'],
+  'ENABLE_HIBERNATE'],
+ ['systemd-hostnamed.service', '8', ['systemd-hostnamed'], 'ENABLE_HOSTNAMED'],
+ ['systemd-hwdb', '8', [], 'ENABLE_HWDB'],
+ ['systemd-importd.service', '8', ['systemd-importd'], 'ENABLE_IMPORTD'],
+ ['systemd-inhibit', '1', [], ''],
+ ['systemd-initctl.service',
+  '8',
+  ['systemd-initctl', 'systemd-initctl.socket'],
+  ''],
+ ['systemd-journal-gatewayd.service',
+  '8',
+  ['systemd-journal-gatewayd', 'systemd-journal-gatewayd.socket'],
+  'HAVE_MICROHTTPD'],
+ ['systemd-journal-remote', '8', [], 'HAVE_MICROHTTPD'],
+ ['systemd-journal-upload', '8', [], 'HAVE_MICROHTTPD'],
+ ['systemd-journald.service',
+  '8',
+  ['systemd-journald',
+   'systemd-journald-audit.socket',
+   'systemd-journald-dev-log.socket',
+   'systemd-journald.socket'],
+  ''],
+ ['systemd-localed.service', '8', ['systemd-localed'], 'ENABLE_LOCALED'],
+ ['systemd-logind.service', '8', ['systemd-logind'], 'ENABLE_LOGIND'],
+ ['systemd-machine-id-commit.service', '8', [], ''],
+ ['systemd-machine-id-setup', '1', [], ''],
+ ['systemd-machined.service', '8', ['systemd-machined'], 'ENABLE_MACHINED'],
+ ['systemd-modules-load.service', '8', ['systemd-modules-load'], 'HAVE_KMOD'],
+ ['systemd-mount', '1', ['systemd-umount'], ''],
+ ['systemd-networkd-wait-online.service',
+  '8',
+  ['systemd-networkd-wait-online'],
+  'ENABLE_NETWORKD'],
+ ['systemd-networkd.service', '8', ['systemd-networkd'], 'ENABLE_NETWORKD'],
+ ['systemd-notify', '1', [], ''],
+ ['systemd-nspawn', '1', [], ''],
+ ['systemd-path', '1', [], ''],
+ ['systemd-quotacheck.service',
+  '8',
+  ['systemd-quotacheck'],
+  'ENABLE_QUOTACHECK'],
+ ['systemd-random-seed.service',
+  '8',
+  ['systemd-random-seed'],
+  'ENABLE_RANDOMSEED'],
+ ['systemd-remount-fs.service', '8', ['systemd-remount-fs'], ''],
+ ['systemd-resolve', '1', [], 'ENABLE_RESOLVED'],
+ ['systemd-resolved.service', '8', ['systemd-resolved'], 'ENABLE_RESOLVED'],
+ ['systemd-rfkill.service',
+  '8',
+  ['systemd-rfkill', 'systemd-rfkill.socket'],
+  'ENABLE_RFKILL'],
+ ['systemd-run', '1', [], ''],
+ ['systemd-sleep.conf', '5', ['sleep.conf.d'], ''],
+ ['systemd-socket-activate', '1', [], ''],
+ ['systemd-socket-proxyd', '8', [], ''],
+ ['systemd-suspend.service',
+  '8',
+  ['systemd-hibernate.service',
+   'systemd-hybrid-sleep.service',
+   'systemd-sleep'],
+  ''],
+ ['systemd-sysctl.service', '8', ['systemd-sysctl'], ''],
+ ['systemd-system-update-generator', '8', [], ''],
+ ['systemd-system.conf',
+  '5',
+  ['system.conf.d', 'systemd-user.conf', 'user.conf.d'],
+  ''],
+ ['systemd-sysusers', '8', ['systemd-sysusers.service'], ''],
+ ['systemd-sysv-generator', '8', [], 'HAVE_SYSV_COMPAT'],
+ ['systemd-timedated.service', '8', ['systemd-timedated'], 'ENABLE_TIMEDATED'],
+ ['systemd-timesyncd.service', '8', ['systemd-timesyncd'], 'ENABLE_TIMESYNCD'],
+ ['systemd-tmpfiles',
+  '8',
+  ['systemd-tmpfiles-clean.service',
+   'systemd-tmpfiles-clean.timer',
+   'systemd-tmpfiles-setup-dev.service',
+   'systemd-tmpfiles-setup.service'],
+  ''],
+ ['systemd-tty-ask-password-agent', '1', [], ''],
+ ['systemd-udevd.service',
+  '8',
+  ['systemd-udevd',
+   'systemd-udevd-control.socket',
+   'systemd-udevd-kernel.socket'],
+  ''],
+ ['systemd-update-done.service', '8', ['systemd-update-done'], ''],
+ ['systemd-update-utmp.service',
+  '8',
+  ['systemd-update-utmp', 'systemd-update-utmp-runlevel.service'],
+  'HAVE_UTMP'],
+ ['systemd-user-sessions.service', '8', ['systemd-user-sessions'], 'HAVE_PAM'],
+ ['systemd-vconsole-setup.service',
+  '8',
+  ['systemd-vconsole-setup'],
+  'ENABLE_VCONSOLE'],
+ ['systemd-veritysetup-generator', '8', [], 'HAVE_LIBCRYPTSETUP'],
+ ['systemd-veritysetup@.service',
+  '8',
+  ['systemd-veritysetup'],
+  'HAVE_LIBCRYPTSETUP'],
+ ['systemd-volatile-root.service', '8', ['systemd-volatile-root'], ''],
+ ['systemd', '1', ['init'], ''],
+ ['systemd.automount', '5', [], ''],
+ ['systemd.device', '5', [], ''],
+ ['systemd.environment-generator', '7', [], 'ENABLE_ENVIRONMENT_D'],
+ ['systemd.exec', '5', [], ''],
+ ['systemd.generator', '7', [], ''],
+ ['systemd.journal-fields', '7', [], ''],
+ ['systemd.kill', '5', [], ''],
+ ['systemd.link', '5', [], ''],
+ ['systemd.mount', '5', [], ''],
+ ['systemd.netdev', '5', [], 'ENABLE_NETWORKD'],
+ ['systemd.network', '5', [], 'ENABLE_NETWORKD'],
+ ['systemd.nspawn', '5', [], ''],
+ ['systemd.offline-updates', '7', [], ''],
+ ['systemd.path', '5', [], ''],
+ ['systemd.preset', '5', [], ''],
+ ['systemd.resource-control', '5', [], ''],
+ ['systemd.scope', '5', [], ''],
+ ['systemd.service', '5', [], ''],
+ ['systemd.slice', '5', [], ''],
+ ['systemd.socket', '5', [], ''],
+ ['systemd.special', '7', [], ''],
+ ['systemd.swap', '5', [], ''],
+ ['systemd.target', '5', [], ''],
+ ['systemd.time', '7', [], ''],
+ ['systemd.timer', '5', [], ''],
+ ['systemd.unit', '5', [], ''],
+ ['sysusers.d', '5', [], 'ENABLE_SYSUSERS'],
+ ['telinit', '8', [], ''],
+ ['timedatectl', '1', [], 'ENABLE_TIMEDATED'],
+ ['timesyncd.conf', '5', ['timesyncd.conf.d'], 'ENABLE_TIMESYNCD'],
+ ['tmpfiles.d', '5', [], ''],
+ ['udev', '7', [], ''],
+ ['udev.conf', '5', [], ''],
+ ['udev_device_get_syspath',
+  '3',
+  ['udev_device_get_action',
+   'udev_device_get_devnode',
+   'udev_device_get_devnum',
+   'udev_device_get_devpath',
+   'udev_device_get_devtype',
+   'udev_device_get_driver',
+   'udev_device_get_is_initialized',
+   'udev_device_get_parent',
+   'udev_device_get_parent_with_subsystem_devtype',
+   'udev_device_get_subsystem',
+   'udev_device_get_sysname',
+   'udev_device_get_sysnum',
+   'udev_device_get_udev'],
+  ''],
+ ['udev_device_has_tag',
+  '3',
+  ['udev_device_get_devlinks_list_entry',
+   'udev_device_get_properties_list_entry',
+   'udev_device_get_property_value',
+   'udev_device_get_sysattr_list_entry',
+   'udev_device_get_sysattr_value',
+   'udev_device_get_tags_list_entry',
+   'udev_device_set_sysattr_value'],
+  ''],
+ ['udev_device_new_from_syspath',
+  '3',
+  ['udev_device_new_from_device_id',
+   'udev_device_new_from_devnum',
+   'udev_device_new_from_environment',
+   'udev_device_new_from_subsystem_sysname',
+   'udev_device_ref',
+   'udev_device_unref'],
+  ''],
+ ['udev_enumerate_add_match_subsystem',
+  '3',
+  ['udev_enumerate_add_match_is_initialized',
+   'udev_enumerate_add_match_parent',
+   'udev_enumerate_add_match_property',
+   'udev_enumerate_add_match_sysattr',
+   'udev_enumerate_add_match_sysname',
+   'udev_enumerate_add_match_tag',
+   'udev_enumerate_add_nomatch_subsystem',
+   'udev_enumerate_add_nomatch_sysattr'],
+  ''],
+ ['udev_enumerate_new',
+  '3',
+  ['udev_enumerate_ref', 'udev_enumerate_unref'],
+  ''],
+ ['udev_enumerate_scan_devices',
+  '3',
+  ['udev_enumerate_add_syspath',
+   'udev_enumerate_get_list_entry',
+   'udev_enumerate_get_udev',
+   'udev_enumerate_scan_subsystems'],
+  ''],
+ ['udev_list_entry',
+  '3',
+  ['udev_list_entry_get_by_name',
+   'udev_list_entry_get_name',
+   'udev_list_entry_get_next',
+   'udev_list_entry_get_value'],
+  ''],
+ ['udev_monitor_filter_update',
+  '3',
+  ['udev_monitor_filter_add_match_subsystem_devtype',
+   'udev_monitor_filter_add_match_tag',
+   'udev_monitor_filter_remove'],
+  ''],
+ ['udev_monitor_new_from_netlink',
+  '3',
+  ['udev_monitor_ref', 'udev_monitor_unref'],
+  ''],
+ ['udev_monitor_receive_device',
+  '3',
+  ['udev_monitor_enable_receiving',
+   'udev_monitor_get_fd',
+   'udev_monitor_get_udev',
+   'udev_monitor_set_receive_buffer_size'],
+  ''],
+ ['udev_new', '3', ['udev_ref', 'udev_unref'], ''],
+ ['udevadm', '8', [], ''],
+ ['vconsole.conf', '5', [], 'ENABLE_VCONSOLE']
+]
+# Really, do not edit.
index 132ce66434626bb836d45b86918f4a755fcf8625..2c28ee715433fb654fd741017a9eaea9f9640a5a 100644 (file)
@@ -45,6 +45,7 @@
 
   <refnamediv>
     <refname>sd_bus_message_append</refname>
+    <refname>sd_bus_message_appendv</refname>
 
     <refpurpose>Attach fields to a D-Bus message based on a type
     string</refpurpose>
         <paramdef>const char *<parameter>types</parameter></paramdef>
         <paramdef>…</paramdef>
       </funcprototype>
+
+      <funcprototype>
+          <funcdef>int sd_bus_message_appendv</funcdef>
+          <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
+          <paramdef>const char *<parameter>types</parameter></paramdef>
+          <paramdef>va_list <parameter>ap</parameter></paramdef>
+      </funcprototype>
+
     </funcsynopsis>
   </refsynopsisdiv>
 
     values for each entry matching the element type of
     the dictionary entries.</para>
 
+    <para>The <function>sd_bus_message_appendv()</function> is equivalent to
+    the function <function>sd_bus_message_append()</function>,
+    except that it is called with a <literal>va_list</literal> instead of
+    a variable number of arguments. This function does not call the
+    <function>va_end()</function> macro. Because it invokes the
+    <function>va_arg()</function> macro, the value of ap
+    is undefined after the call.</para>
+
     <para>For further details on the D-Bus type system, please consult
     the <ulink
     url="http://dbus.freedesktop.org/doc/dbus-specification.html#type-system">D-Bus
@@ -238,8 +255,8 @@ sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d);</programlisting>
   <refsect1>
     <title>Return Value</title>
 
-    <para>On success, this call returns 0 or a positive
-    integer. On failure, this call returns a negative
+    <para>On success, these functions return 0 or a positive
+    integer. On failure, these functions return a negative
     errno-style error code.</para>
   </refsect1>
 
index ab449d29378cd6c38d9f55db2e55093a23d4d4ac..852a9fd7ebbb5ebbdac2a88e591569d3de6e7808 100644 (file)
@@ -77,7 +77,7 @@
     <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
 
     <para><citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
-    <option>--new-id</option> option may be used as a command line
+    <option>--new-id128</option> option may be used as a command line
     front-end for <function>sd_id128_randomize()</function>.</para>
   </refsect1>
 
index 604deb4e8cacc78bb15b157ddc405bdf94a6a4f9..92ed0dea069f9d58bd8e4b7d8865eaaecd3b6192 100644 (file)
 
     <para>Function <function>sd_journal_get_catalog()</function> is thread-agnostic and only a
     single thread may operate on a given <structname>sd_journal</structname> object. Function
-    <function>sd_journal_get_catalog_for_message_id() is thread-safe.</function></para>
+    <function>sd_journal_get_catalog_for_message_id()</function> is thread-safe.</para>
 
     <para>The <function>sd_journal_get_catalog()</function> and
     <function>sd_journal_get_catalog_for_message_id()</function>
index 61293f7f99d3527193b72bdca5f288b23b006938..2e686caccbc84befbd91867217e83c4722a913f3 100644 (file)
@@ -146,7 +146,7 @@ if (t == (uint64_t) -1)
 else {
   struct timespec ts;
   uint64_t n;
-  clock_getttime(CLOCK_MONOTONIC, &amp;ts);
+  clock_gettime(CLOCK_MONOTONIC, &amp;ts);
   n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
   msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
 }</programlisting>
@@ -304,7 +304,7 @@ int wait_for_changes(sd_journal *j) {
   else {
     struct timespec ts;
     uint64_t n;
-    clock_getttime(CLOCK_MONOTONIC, &amp;ts);
+    clock_gettime(CLOCK_MONOTONIC, &amp;ts);
     n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
     msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
   }
index 5625ab9207c8a0d51be9d4ff1fc797f7e0de43b3..129c99f97d9995a0ca9271560c54fb8d4fdba525 100644 (file)
@@ -203,7 +203,7 @@ if (t == (uint64_t) -1)
 else {
          struct timespec ts;
          uint64_t n;
-         clock_getttime(CLOCK_MONOTONIC, &amp;ts);
+         clock_gettime(CLOCK_MONOTONIC, &amp;ts);
          n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
          msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
 }</programlisting>
index 7e1864c4f1a6ce93a996466ca9d90752c59ea8f1..d4afb36f8591a859e55be84a95146520da0c77a7 100644 (file)
@@ -907,7 +907,7 @@ Sun 2017-02-26 20:57:49 EST  2h 3min left  Sun 2017-02-26 11:56:36 EST  6h ago
 
               <programlisting>$ systemctl status bluetooth
 ● bluetooth.service - Bluetooth service
-   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
+   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
    Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
      Docs: man:bluetoothd(8)
  Main PID: 930 (bluetoothd)
index 51d8ef5d82eb7ca3146853a6295240571c80d420..16ec257014e75489eab57bd19682d6be1866e754 100644 (file)
     <para>
       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd-ask-password-console.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>systemd-tty-ask-password</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>systemd-tty-ask-password-agent</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry project='die-net'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry project='die-net'><refentrytitle>plymouth</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>
index 2c285bcb22008ca1e373b063bb975b036b95811b..d71fdc644ff0d512723b39be5c6f28b4b47bbfc8 100644 (file)
 
     <para>In order to by used in the <option>--backtrace</option> mode, an appropriate backtrace
     handler must be installed on the sender side. For example, in case of
-    <citerefentry><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry>, this
+    <citerefentry project='die-net'><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry>, this
     means a <varname>sys.excepthook</varname> must installed, see
     <ulink url="https://github.com/keszybz/systemd-coredump-python">systemd-coredump-python</ulink>.
     </para>
index 6628213209d5fc1220dc200500828da28013e6f9..be241f6950f7b5105adea873f77ba85a4458dc34 100644 (file)
@@ -63,7 +63,7 @@
     compare configuration files that override other configuration
     files. Files in <filename>/etc</filename> have highest priority,
     files in <filename>/run</filename> have the second highest
-    priority, …, files in <filename>/lib</filename> have lowest
+    priority, …, files in <filename>/usr/lib</filename> have lowest
     priority. Files in a directory with higher priority override files
     with the same name in directories of lower priority. In addition,
     certain configuration files can have <literal>.d</literal>
index cc00a5256d6bbff32456476bf26d29010a8e7270..7950aa98a5c431cd44841de961f2e336200e4e38 100644 (file)
@@ -23,7 +23,7 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="systemd-environment-d-generator">
+<refentry id="systemd-environment-d-generator" conditional='ENABLE_ENVIRONMENT_D'>
 
   <refentryinfo>
     <title>systemd-environment-d-generator</title>
index d811b9b551bdeff4428dfc2f1e4b4a7a371788a4..3bbb6ab989426fded92243f311792a0ef4c9323b 100644 (file)
@@ -19,7 +19,7 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="systemd-hibernate-resume-generator">
+<refentry id="systemd-hibernate-resume-generator" conditional='ENABLE_HIBERNATE'>
 
   <refentryinfo>
     <title>systemd-hibernate-resume-generator</title>
index 7d008274478d868c29199c3ba562047c93261b19..a968adf0a9f7596a4eb6946eb21bef72731e24b5 100644 (file)
@@ -19,7 +19,7 @@
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
-<refentry id="systemd-hibernate-resume@.service">
+<refentry id="systemd-hibernate-resume@.service" conditional='ENABLE_HIBERNATE'>
 
   <refentryinfo>
     <title>systemd-hibernate-resume@.service</title>
index 8bba28678741d17908480aa8bf8372f2a57d4931..71a4ed5a2b43f2d16f4dde8b34e1ba271b791ba3 100644 (file)
@@ -76,7 +76,7 @@
     <replaceable>WHERE</replaceable>.</para>
 
     <para>In many ways, <command>systemd-mount</command> is similar to the lower-level
-    <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> command, however instead
+    <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> command, however instead
     of executing the mount operation directly and immediately, <command>systemd-mount</command> schedules it through
     the service manager job queue, so that it may pull in further dependencies (such as parent mounts, or a file system
     checker to execute a priori), and may make use of the auto-mounting logic.</para>
     <title>See Also</title>
     <para>
       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+      <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
index 50da971b07958a7dfa596404b3bab3afe4c8df19..e3ef26bb81e174eaa497869406f475b85804123e 100644 (file)
@@ -21,7 +21,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="systemd-resolve"
+<refentry id="systemd-resolve" conditional='ENABLE_RESOLVED'
           xmlns:xi="http://www.w3.org/2001/XInclude">
 
   <refentryinfo>
index f2da2a7b772fe9f701eaebae065c18bb8e47450c..6df82aed32f77f07820689fcca34a4235d8e6b4b 100644 (file)
@@ -59,7 +59,7 @@
 
     <para><filename>systemd-vconsole-setup</filename> is a helper used to prepare either all virtual consoles, or — if
       the optional <replaceable>TTY</replaceable> parameter is provided — a specific one. When the system is booting up
-      it's called by <citerefentry><command>udev</command></citerefentry> during vtconsole subsystem initialization.
+      it's called by <citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> during vtconsole subsystem initialization.
       <productname>Systemd</productname> also calls it internally as needed via
       <filename>systemd-vconsole-setup.service</filename>. The helper calls
       <citerefentry project='mankier'><refentrytitle>loadkeys</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
index fedbd601755cda0966433bae1bad3ac3483566c6..ff8be928337727234165328598178998d5715c8b 100644 (file)
@@ -24,7 +24,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="systemd.environment-generator" xmlns:xi="http://www.w3.org/2001/XInclude">
+<refentry id="systemd.environment-generator" conditional='ENABLE_ENVIRONMENT_D'
+    xmlns:xi="http://www.w3.org/2001/XInclude">
   <refentryinfo>
     <title>systemd.environment-generator</title>
     <productname>systemd</productname>
index 5d4986b6bfb508900881b734487be50b1245d2de..2e9cfa89ddf3f923c42d902a878aa0f09a2fd072 100644 (file)
       <varlistentry>
         <term><varname>RootImage=</varname></term>
         <listitem><para>Takes a path to a block device node or regular file as argument. This call is similar to
-        <varname>RootDirectory=</varname> however mounts a file system hierarchy from a block device node or loopack
+        <varname>RootDirectory=</varname> however mounts a file system hierarchy from a block device node or loopback
         file instead of a directory. The device node or file system image file needs to contain a file system without a
         partition table, or a file system within an MBR/MS-DOS or GPT partition table with only a single
         Linux-compatible partition, or a set of file systems within a GPT partition table that follows the <ulink
         assignments have no effect. Variable expansion is not
         performed inside the strings, however, specifier expansion is
         possible. The $ character has no special meaning. If you need
-        to assign a value containing spaces to a variable, use double
+        to assign a value containing spaces or the equals sign to a variable, use double
         quotes (") for the assignment.</para>
 
         <para>Example:
 
         <listitem><para>Restricts access to Linux namespace functionality for the processes of this unit. For details
         about Linux namespaces, see
-        <citerefentry><refentrytitle>namespaces</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Either takes a
+        <citerefentry project='man-pages'><refentrytitle>namespaces</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Either takes a
         boolean argument, or a space-separated list of namespace type identifiers. If false (the default), no
         restrictions on namespace creation and switching are made. If true, access to any kind of namespacing is
         prohibited. Otherwise, a space-separated list of namespace type identifiers must be specified, consisting of
         the specified flags parameters into account. Note that — if this option is used — in addition to restricting
         creation and switching of the specified types of namespaces (or all of them, if true) access to the
         <function>setns()</function> system call with a zero flags parameter is prohibited.  This setting is only
-        supported on x86, x86-64, s390 and s390x, and enforces no restrictions on other architectures. If running in user
+        supported on x86, x86-64, mips, mips-le, mips64, mips64-le, mips64-n32, mips64-le-n32, ppc64, ppc64-le,
+        s390 and s390x, and enforces no restrictions on other architectures. If running in user
         mode, or in system mode, but without the <constant>CAP_SYS_ADMIN</constant> capability (e.g. setting
         <varname>User=</varname>), <varname>NoNewPrivileges=yes</varname> is implied.  </para></listitem>
       </varlistentry>
index 747d985aa11deb1547818d2849ccc5fd286d6aea..b82c1300ca056e316f36bed7727d9874ede71c62 100644 (file)
@@ -87,7 +87,7 @@
           recommended to be a UUID-compatible ID, but this is not
           enforced, and formatted differently. Developers can generate
           a new ID for this purpose with <command>journalctl
-          <option>--new-id</option></command>.
+          <option>--new-id128</option></command>.
           </para>
         </listitem>
       </varlistentry>
         <listitem>
           <para>The process, user, and group ID of the process the
           journal entry originates from formatted as a decimal
-          string.</para>
+          string. Note that entries obtained via <literal>stdout</literal> or
+          <literal>stderr</literal> of forked processes will contain credentials valid for a parent
+          process (that initiated the connection to <command>systemd-journald</command>).</para>
         </listitem>
       </varlistentry>
 
index 4a404fb424f4066c84b21712ac513f067a0b7b3a..b4e2c79bdeb82e1f3a92994fdd508f4cffd9637c 100644 (file)
         <listitem><para>The block device backed file system will be upgraded
         to <varname>BindsTo=</varname> dependency. This option is only useful
         when mounting file systems manually with
-        <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+        <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
         as the default dependency in this case is <varname>Requires=</varname>.
         This option is already implied by entries in <filename>/etc/fstab</filename>
         or by mount units.
index 39e69480ec4548222867ceed9d8131ae53009530..71cf2f2a50a43c889e3940ff790b235d9e5a494b 100644 (file)
           <row><entry><varname>vxlan</varname></entry>
           <entry>A virtual extensible LAN (vxlan), for connecting Cloud computing deployments.</entry></row>
 
+          <row><entry><varname>geneve</varname></entry>
+          <entry>A GEneric NEtwork Virtualization Encapsulation (GENEVE) netdev driver.</entry></row>
+
           <row><entry><varname>vrf</varname></entry>
           <entry>A Virtual Routing and Forwarding (<ulink url="https://www.kernel.org/doc/Documentation/networking/vrf.txt">VRF</ulink>) interface to create separate routing and forwarding domains.</entry></row>
 
             This option is compulsory.</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><varname>GVRP=</varname></term>
+          <listitem>
+            <para>The Generic VLAN Registration Protocol (GVRP) is a protocol that
+            allows automatic learning of VLANs on a network. A boolean. When unset,
+            the kernel's default setting applies.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>MVRP=</varname></term>
+          <listitem>
+            <para>Multiple VLAN Registration Protocol (MVRP) formerly known as GARP VLAN
+            Registration Protocol (GVRP) is a standards-based Layer 2 network protocol,
+            for automatic configuration of VLAN information on switches. It was defined
+            in the 802.1ak amendment to 802.1Q-2005. A boolean. When unset, the kernel's
+            default setting applies.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>LooseBinding=</varname></term>
+          <listitem>
+            <para>The VLAN loose binding mode, in which only the operational state is passed
+            from the parent to the associated VLANs, but the VLAN device state is not changed.
+            A boolean. When unset, the kernel's default setting applies.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>ReorderHeader=</varname></term>
+          <listitem>
+            <para>The VLAN reorder header is set VLAN interfaces behave like physical interfaces.
+            A boolean. When unset, the kernel's default setting applies.</para>
+          </listitem>
+        </varlistentry>
       </variablelist>
-
   </refsect1>
 
   <refsect1>
       <listitem>
         <para>Configures the default destination UDP port on a per-device basis.
         If destination port is not specified then Linux kernel default will be used.
-        Set destination port 4789 to get the IANA assigned value,
-        and destination port 0 to get default values.</para>
+        Set destination port 4789 to get the IANA assigned value. If not set or if the
+        destination port is assigned the empty string the default port of 4789 is used.</para>
       </listitem>
     </varlistentry>
     <varlistentry>
           ports, and allows overriding via configuration.</para>
         </listitem>
       </varlistentry>
+    <varlistentry>
+      <term><varname>FlowLabel=</varname></term>
+        <listitem>
+          <para>Specifies the flow label to use in outgoing packets.
+          The valid range is 0-1048575.
+          </para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>[GENEVE] Section Options</title>
+    <para>The <literal>[GENEVE]</literal> section only applies for
+    netdevs of kind <literal>geneve</literal>, and accepts the
+    following keys:</para>
+
+    <variablelist class='network-directives'>
+      <varlistentry>
+        <term><varname>Id=</varname></term>
+        <listitem>
+          <para>Specifies the Virtual Network Identifer (VNI) to use. Ranges [0-16777215].</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>Remote=</varname></term>
+        <listitem>
+          <para>Specifies the unicast destination IP address to use in outgoing packets.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>TOS=</varname></term>
+        <listitem>
+          <para>Specifies the TOS value to use in outgoing packets. Ranges [1-255].</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>TTL=</varname></term>
+        <listitem>
+          <para>Specifies the TTL value to use in outgoing packets. Ranges [1-255].</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>UDPChecksum=</varname></term>
+        <listitem>
+          <para>A boolean. When true, specifies if UDP checksum is calculated for transmitted packets over IPv4.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>UDP6ZeroChecksumTx=</varname></term>
+        <listitem>
+          <para>A boolean. When true, skip UDP checksum calculation for transmitted packets over IPv6.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>UDP6ZeroChecksumRx=</varname></term>
+        <listitem>
+          <para>A boolean. When true, allows incoming UDP packets over IPv6 with zero checksum field.</para>
+        </listitem>
+      </varlistentry>
+    <varlistentry>
+      <term><varname>DestinationPort=</varname></term>
+      <listitem>
+        <para>Specifies destination port. Defaults to 6081. If not set or assigned the empty string, the default
+        port of 6081 is used.</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><varname>FlowLabel=</varname></term>
+        <listitem>
+          <para>Specifies the flow label to use in outgoing packets.</para>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </refsect1>
   <refsect1>
index b807ebf29b8040d31a5c7176145c37757023126e..08cbe9be0840e7325e173eade2d5e1122f55fcd7 100644 (file)
             <para>This setting is read by
             <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
             "Search domains" correspond to the <varname>domain</varname> and <varname>search</varname> entries in
-            <citerefentry><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+            <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
             Domain name routing has no equivalent in the traditional glibc API, which has no concept of domain
             name servers limited to a specific link.</para>
           </listitem>
         </para></listitem>
         </varlistentry>
         <varlistentry>
-          <term><varname>IPv6ProxyNDPAddress=</varname></term>
-          <listitem><para>An IPv6 address, for which Neighbour Advertisement
-          messages will be proxied.
-          Proxy NDP (Neighbor Discovery Protocol) is a technique for IPv6 to
-          allow routing of addresses to a different destination when peers expect them
-          to be present on a certain physical link.
+          <term><varname>IPv6ProxyNDP=</varname></term>
+          <listitem><para>A boolean. Configures proxy NDP for IPv6. Proxy NDP (Neighbor Discovery
+          Protocol) is a technique for IPv6 to allow routing of addresses to a different
+          destination when peers expect them to be present on a certain physical link.
           In this case a router answers Neighbour Advertisement messages intended for
           another machine by offering its own MAC address as destination.
-          Unlike proxy ARP for IPv4, is not enabled globally, but will only send Neighbour
+          Unlike proxy ARP for IPv4, it is not enabled globally, but will only send Neighbour
           Advertisement messages for addresses in the IPv6 neighbor proxy table,
-          which can also be shown by <command>ip -6 neighbour show proxy</command>
-          This option may be specified more than once. systemd-networkd will control the
-          per-interface `proxy_ndp` switch for each configured interface, depending on whether
-          there are <option>IPv6ProxyNDPAddress=</option> entries configured and add these to
-          the kernels IPv6 neighbor proxy table.
-          Defaults to unset.
+          which can also be shown by <command>ip -6 neighbour show proxy</command>.
+          systemd-networkd will control the per-interface `proxy_ndp` switch for each configured
+          interface depending on this option.
+          Defautls to unset.
+        </para></listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>IPv6ProxyNDPAddress=</varname></term>
+          <listitem><para>An IPv6 address, for which Neighbour Advertisement messages will be
+          proxied. This option may be specified more than once. systemd-networkd will add the
+          <option>IPv6ProxyNDPAddress=</option> entries to the kernel's IPv6 neighbor proxy table.
+          This option implies <option>IPv6ProxyNDP=true</option> but has no effect if
+          <option>IPv6ProxyNDP</option> has been set to false. Defaults to unset.
         </para></listitem>
         </varlistentry>
         <varlistentry>
       </variablelist>
   </refsect1>
 
+    <refsect1>
+    <title>[IPv6AddressLabel] Section Options</title>
+
+      <para>An <literal>[IPv6AddressLabel]</literal> section accepts the
+      following keys. Specify several <literal>[IPv6AddressLabel]</literal>
+      sections to configure several addresse labels. IPv6 address labels are
+      used for address selection. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>.
+      Precedence is managed by userspace, and only the label itself is stored in the kernel</para>
+
+      <variablelist class='network-directives'>
+        <varlistentry>
+          <term><varname>Label=</varname></term>
+          <listitem>
+            <para> The label for the prefix (an unsigned integer) ranges 0 to 4294967294.
+            0xffffffff is reserved. This key is mandatory.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>Prefix=</varname></term>
+          <listitem>
+            <para>IPv6 prefix is an address with a prefix length, separated by a slash <literal>/</literal> character.
+            This key is mandatory. </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+  </refsect1>
+
   <refsect1>
     <title>[Route] Section Options</title>
       <para>The <literal>[Route]</literal> section accepts the
             <para>As in the <literal>[Network]</literal> section.</para>
           </listitem>
         </varlistentry>
+         <varlistentry>
+           <term><varname>GatewayOnlink=</varname></term>
+           <listitem>
+             <para>The <literal>GatewayOnlink</literal> option tells the kernel that it does not have
+             to check if the gateway is reachable directly by the current machine (i.e., the kernel does
+             not need to check if the gateway is attached to the local network), so that we can insert the
+             route in the kernel table without it being complained about. A boolean, defaults to <literal>no</literal>.
+             </para>
+           </listitem>
+         </varlistentry>
         <varlistentry>
           <term><varname>Destination=</varname></term>
           <listitem>
             <para>The metric of the route (an unsigned integer).</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><varname>IPv6Preference=</varname></term>
+          <listitem>
+            <para>Specifies the route preference as defined in <ulink
+            url="https://tools.ietf.org/html/rfc4191">RFC4191</ulink> for Router Discovery messages.
+            Which can be one of <literal>low</literal> the route has a lowest priority,
+            <literal>medium</literal> the route has a default priority or
+            <literal>high</literal> the route has a highest priority.</para>
+          </listitem>
+        </varlistentry>
         <varlistentry>
           <term><varname>Scope=</varname></term>
           <listitem>
           </para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><varname>Protocol=</varname></term>
+          <listitem>
+            <para>The Protocol identifier for the route. Takes a number between 0 and 255 or the special values
+            <literal>kernel</literal>, <literal>boot</literal> and <literal>static</literal>. Defaults to
+            <literal>static</literal>.
+            </para>
+          </listitem>
+        </varlistentry>
       </variablelist>
   </refsect1>
 
             <para>Sets the "cost" of sending packets of this interface.
             Each port in a bridge may have a different speed and the cost
             is used to decide which link to use. Faster interfaces
-            should have lower costs.</para>
+            should have lower costs. It is an interger value between 1 and
+            65535.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>Priority=</varname></term>
+          <listitem>
+            <para>Sets the "priority" of sending packets on this interface.
+            Each port in a bridge may have a different priority which is used
+            to decide which link to use. Lower value means higher priority.
+            It is an interger value between 0 to 63. Networkd does not set any
+            default, meaning the kernel default value of 32 is used.</para>
           </listitem>
         </varlistentry>
       </variablelist>
@@ -1513,7 +1585,7 @@ VRF=vrf1
       <title>MacVTap</title>
       <para>This brings up a network interface <literal>macvtap-test</literal>
       and attaches it to <literal>enp0s25</literal>.</para>
-      <programlisting># /lib/systemd/network/25-macvtap.network
+      <programlisting># /usr/lib/systemd/network/25-macvtap.network
 [Match]
 Name=enp0s25
 
index 52eb2bb4247d2293fa9d4b3f797e11ddf7faa90a..9a0b72aca93b486ec2ef96ea6b9bb9a3b45d7c14 100644 (file)
         process has to exit before systemd starts follow-up units.
         <varname>RemainAfterExit=</varname> is particularly useful for
         this type of service. This is the implied default if neither
-        <varname>Type=</varname> or <varname>ExecStart=</varname> are
+        <varname>Type=</varname> nor <varname>ExecStart=</varname> are
         specified.</para>
 
         <para>Behavior of <option>dbus</option> is similar to
         multiple command lines, following the same scheme as described
         for <varname>ExecStart=</varname> above. Use of this setting
         is optional. After the commands configured in this option are
-        run, all processes remaining for a service are terminated
+        run, it is implied that the service is stopped, and any processes
+        remaining for it are terminated
         according to the <varname>KillMode=</varname> setting (see
         <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
         If this option is not specified, the process is terminated by
 
         <para>As exceptions to the setting above, the service will not
         be restarted if the exit code or signal is specified in
-        <varname>RestartPreventExitStatus=</varname> (see below).
-        Also, the services will always be restarted if the exit code
-        or signal is specified in
+        <varname>RestartPreventExitStatus=</varname> (see below) or
+        the service is stopped with <command>systemctl stop</command>
+        or an equivalent operation. Also, the services will always be
+        restarted if the exit code or signal is specified in
         <varname>RestartForceExitStatus=</varname> (see below).</para>
 
         <para>Note that service restart is subject to unit start rate
index fa3dc1c5d44f8a952943a0905e3ccd3d30784cad..66c45e39a3cd402fac8f9e40b3cc2ac99a0270e8 100644 (file)
   <refsect1>
     <title>Special Passive User Units</title>
 
-    <refsect2>
-      <title>graphical-session.target</title>
-
-      <para>This target is active whenever any graphical session is running. It
-      is used to stop user services which only apply to a graphical (X,
-      Wayland, etc.) session when the session is terminated. Such services
-      should have <literal>PartOf=graphical-session.target</literal> in their
-      <literal>[Unit]</literal> section. A target for a particular session
-      (e. g.  <filename>gnome-session.target</filename>) starts and stops
-      <literal>graphical-session.target</literal> with
-      <literal>BindsTo=graphical-session.target</literal>.</para>
-
-      <para>Which services are started by a session target is determined by the
-      <literal>Wants=</literal> and <literal>Requires=</literal> dependencies.
-      For services that can be enabled independently, symlinks in
-      <literal>.wants/</literal> and <literal>.requires/</literal> should be
-      used, see
-      <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
-      Those symlinks should either be shipped in packages, or should be added
-      dynamically after installation, for example using <literal>systemctl add-wants</literal>, see
-      <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
-      </para>
+    <variablelist>
+      <varlistentry>
+        <term><filename>graphical-session.target</filename></term>
+        <listitem>
+          <para>This target is active whenever any graphical session is running. It is used to stop user services which
+          only apply to a graphical (X, Wayland, etc.) session when the session is terminated. Such services should
+          have <literal>PartOf=graphical-session.target</literal> in their <literal>[Unit]</literal> section. A target
+          for a particular session (e. g.  <filename>gnome-session.target</filename>) starts and stops
+          <literal>graphical-session.target</literal> with <literal>BindsTo=graphical-session.target</literal>.</para>
+
+          <para>Which services are started by a session target is determined by the <literal>Wants=</literal> and
+          <literal>Requires=</literal> dependencies.  For services that can be enabled independently, symlinks in
+          <literal>.wants/</literal> and <literal>.requires/</literal> should be used, see
+          <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.  Those
+          symlinks should either be shipped in packages, or should be added dynamically after installation, for example
+          using <literal>systemctl add-wants</literal>, see
+          <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+          </para>
 
-      <example>
-        <title>Nautilus as part of a GNOME session</title>
+          <example>
+            <title>Nautilus as part of a GNOME session</title>
 
-        <para><literal>gnome-session.target</literal> pulls in Nautilus as
-        top-level service:</para>
+            <para><literal>gnome-session.target</literal> pulls in Nautilus as top-level service:</para>
 
-        <programlisting>[Unit]
+            <programlisting>[Unit]
 Description=User systemd services for GNOME graphical session
 Wants=nautilus.service
-BindsTo=graphical-session.target
-        </programlisting>
+BindsTo=graphical-session.target</programlisting>
 
-        <para><literal>nautilus.service</literal> gets stopped when the session stops:</para>
+            <para><literal>nautilus.service</literal> gets stopped when the session stops:</para>
 
-        <programlisting>[Unit]
+            <programlisting>[Unit]
 Description=Render the desktop icons with Nautilus
 PartOf=graphical-session.target
 
 [Service]
-…
-        </programlisting>
-      </example>
-    </refsect2>
-
-    <refsect2>
-      <title>graphical-session-pre.target</title>
-
-      <para>This target contains services which set up the environment or
-      global configuration of a graphical session, such as SSH/GPG agents
-      (which need to export an environment variable into all desktop processes)
-      or migration of obsolete d-conf keys after an OS upgrade (which needs to
-      happen before starting any process that might use them). This target must
-      be started before starting a graphical session
-      like <filename>gnome-session.target</filename>.</para>
-    </refsect2>
+…</programlisting>
+          </example>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><filename>graphical-session-pre.target</filename></term>
+        <listitem>
+          <para>This target contains services which set up the environment or global configuration of a graphical
+          session, such as SSH/GPG agents (which need to export an environment variable into all desktop processes) or
+          migration of obsolete d-conf keys after an OS upgrade (which needs to happen before starting any process that
+          might use them). This target must be started before starting a graphical session like
+          <filename>gnome-session.target</filename>.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
 
   </refsect1>
 
index d30c6cffc97e0f15ba6c739f77852b027331c152..659f14328e79b96a0cce90cb49c9fdb50e77f462 100644 (file)
     the local timezone, similar to the supported syntax of timestamps (see above). Non-local timezones except for UTC
     are not supported.</para>
 
-    <para>The special expressions
-    <literal>minutely</literal>,
-    <literal>hourly</literal>, <literal>daily</literal>,
-    <literal>monthly</literal>, <literal>weekly</literal>,
-    <literal>yearly</literal>,
-    <literal>quarterly</literal>,
-    <literal>semiannually</literal> may be used as
-    calendar events which refer to
-    <literal>*-*-* *:*:00</literal>,
-    <literal>*-*-* *:00:00</literal>,
-    <literal>*-*-* 00:00:00</literal>,
-    <literal>*-*-01 00:00:00</literal>,
-    <literal>Mon *-*-* 00:00:00</literal>,
-    <literal>*-01-01 00:00:00</literal>,
-    <literal>*-01,04,07,10-01 00:00:00</literal> and
-    <literal>*-01,07-01 00:00:00</literal>, respectively.
-    </para>
+  <para>The following special expressions may be used as shorthands for longer normalized forms:</para>
+
+    <programlisting>    minutely → *-*-* *:*:00
+      hourly → *-*-* *:00:00
+       daily → *-*-* 00:00:00
+     monthly → *-*-01 00:00:00
+      weekly → Mon *-*-* 00:00:00
+      yearly → *-01-01 00:00:00
+   quarterly → *-01,04,07,10-01 00:00:00
+semiannually → *-01,07-01 00:00:00
+   </programlisting>
 
     <para>Examples for valid timestamps and their
     normalized form:</para>
index 4fe140e4bc3c0aa7cf2db574ab8880469386ac1e..26a47a1e5ab12d2bc30ff87b2bd951c2c038ec90 100644 (file)
@@ -93,7 +93,7 @@
     on <filename>timers.target</filename>, as well as <varname>Conflicts=</varname> and <varname>Before=</varname> on
     <filename>shutdown.target</filename> to ensure that they are stopped cleanly prior to system shutdown.  Timer units
     with at least one <varname>OnCalendar=</varname> directive will have an additional <varname>After=</varname>
-    dependency on <filename>timer-sync.target</filename> to avoid being started before the system clock has been
+    dependency on <filename>time-sync.target</filename> to avoid being started before the system clock has been
     correctly set. Only timer units involved with early boot or late system shutdown should disable the
     <varname>DefaultDependencies=</varname> option.</para>
   </refsect1>
         <para>Note that timers do not necessarily expire at the
         precise time configured with this setting, as it is subject to
         the <varname>AccuracySec=</varname> setting
-        below.</para></listitem>
+        below.</para>
+
+       <para>May be specified more than once.</para></listitem>
       </varlistentry>
 
       <varlistentry>
index 44841ac7dd6c732907d247e13d5c34cb31f2dbb5..a7c37a00189373053d2704a26983b67bcf9f3a74 100644 (file)
 
       <varlistentry>
         <term><varname>JobTimeoutSec=</varname></term>
+        <term><varname>JobRunningTimeoutSec=</varname></term>
         <term><varname>JobTimeoutAction=</varname></term>
         <term><varname>JobTimeoutRebootArgument=</varname></term>
 
-        <listitem><para>When a job for this unit is queued, a time-out may be configured. If this time limit is
-        reached, the job will be cancelled, the unit however will not change state or even enter the
-        <literal>failed</literal> mode. This value defaults to <literal>infinity</literal> (job timeouts disabled),
-        except for device units. NB: this timeout is independent from any unit-specific timeout (for example, the
-        timeout set with <varname>TimeoutStartSec=</varname> in service units) as the job timeout has no effect on the
-        unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful
-        to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort
-        only the job waiting for the unit state to change.</para>
+        <listitem><para>When a job for this unit is queued, a time-out <varname>JobTimeoutSec=</varname> may be
+        configured. Similarly, <varname>JobRunningTimeoutSec=</varname> starts counting when the queued job is actually
+        started. If either time limit is reached, the job will be cancelled, the unit however will not change state or
+        even enter the <literal>failed</literal> mode. This value defaults to <literal>infinity</literal> (job timeouts
+        disabled), except for device units (<varname>JobRunningTimeoutSec=</varname> defaults to
+        <varname>DefaultTimeoutStartSec=</varname>). NB: this timeout is independent from any unit-specific timeout
+        (for example, the timeout set with <varname>TimeoutStartSec=</varname> in service units) as the job timeout has
+        no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific
+        timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however
+        is useful to abort only the job waiting for the unit state to change.</para>
 
         <para><varname>JobTimeoutAction=</varname>
         optionally configures an additional
@@ -1384,7 +1387,7 @@ WantedBy=multi-user.target</programlisting>
       ordered appropriately (<varname>After=</varname>). Thirdly, in
       order to harden the service a bit more, the administrator would
       like to set the <varname>PrivateTmp=</varname> setting (see
-      <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+      <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
       for details). And lastly, the administrator would like to reset
       the niceness of the service to its default value of 0.</para>
 
index 1c7921f5bdd853a0ba6bc78096825dc940bc06a4..8d4fe31ec1c3a3b3060818a07a454c0b7ea81538 100644 (file)
           <term><option>-s</option></term>
           <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
           <listitem>
-            <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
+            <para>Filter kernel uevents and udev events by subsystem[/devtype]. Only events with a matching subsystem value will pass.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
           <term><option>-t</option></term>
           <term><option>--tag-match=<replaceable>string</replaceable></option></term>
           <listitem>
-            <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
+            <para>Filter udev events by tag. Only udev events with a given tag attached will pass.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
diff --git a/meson.build b/meson.build
new file mode 100644 (file)
index 0000000..14a2053
--- /dev/null
@@ -0,0 +1,2496 @@
+project('systemd', 'c',
+        version : '233',
+        license : 'LGPLv2+',
+        default_options: [
+                'c_std=gnu99',
+                'prefix=/usr',
+                'sysconfdir=/etc',
+                'localstatedir=/var',
+        ],
+        meson_version : '>= 0.40',
+       )
+
+# We need the same data in three different formats, ugh!
+# Also, for hysterical reasons, we use different variable
+# names, sometimes. Not all variables are included in every
+# set. Ugh, ugh, ugh!
+conf = configuration_data()
+conf.set_quoted('PACKAGE_STRING',  meson.project_name() + ' ' + meson.project_version())
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+
+substs = configuration_data()
+substs.set('PACKAGE_URL',          'https://www.freedesktop.org/wiki/Software/systemd')
+substs.set('PACKAGE_VERSION',      meson.project_version())
+
+m4_defines = []
+
+#####################################################################
+
+rootprefixdir = get_option('rootprefix')
+if get_option('split-usr')
+        conf.set('HAVE_SPLIT_USR', true)
+        rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
+else
+        rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
+endif
+
+sysvinit_path = get_option('sysvinit-path')
+sysvrcnd_path = get_option('sysvrcnd-path')
+if sysvinit_path != '' or sysvrcnd_path != ''
+        conf.set('HAVE_SYSV_COMPAT', true,
+                 description : 'SysV init scripts and rcN.d links are supported')
+        m4_defines += ['-DHAVE_SYSV_COMPAT']
+endif
+
+# join_paths ignore the preceding arguments if an absolute component is
+# encountered, so this should canonicalize various paths when they are
+# absolute or relative.
+prefixdir = get_option('prefix')
+if not prefixdir.startswith('/')
+        error('Prefix is not absolute: "@0@"'.format(prefixdir))
+endif
+bindir = join_paths(prefixdir, get_option('bindir'))
+libdir = join_paths(prefixdir, get_option('libdir'))
+sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
+includedir = join_paths(prefixdir, get_option('includedir'))
+datadir = join_paths(prefixdir, get_option('datadir'))
+localstatedir = join_paths('/', get_option('localstatedir'))
+
+rootbindir = join_paths(rootprefixdir, 'bin')
+rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
+
+rootlibdir = get_option('rootlibdir')
+if rootlibdir == ''
+        rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
+endif
+
+# Dirs of external packages
+pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
+pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
+polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
+polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
+polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
+varlogdir = join_paths(localstatedir, 'log')
+xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
+rpmmacrosdir = get_option('rpmmacrosdir')
+
+# Our own paths
+pkgdatadir = join_paths(datadir, 'systemd')
+environmentdir = join_paths(prefixdir, 'lib/environment.d')
+pkgsysconfdir = join_paths(sysconfdir, 'systemd')
+userunitdir = join_paths(prefixdir, 'lib/systemd/user')
+userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
+tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
+sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
+sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
+binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
+modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
+networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
+pkgincludedir = join_paths(includedir, 'systemd')
+systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
+usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
+systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
+userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
+systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
+systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
+systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
+systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
+udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
+udevhomedir = udevlibexecdir
+udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
+udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
+catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
+kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
+factorydir = join_paths(datadir, 'factory')
+docdir = join_paths(datadir, 'doc/systemd')
+bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
+testsdir = join_paths(prefixdir, 'lib/systemd/tests')
+systemdstatedir = join_paths(localstatedir, 'lib/systemd')
+catalogstatedir = join_paths(systemdstatedir, 'catalog')
+randomseeddir = join_paths(localstatedir, 'lib/systemd')
+
+dbuspolicydir = get_option('dbuspolicydir')
+if dbuspolicydir == ''
+        dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
+endif
+
+dbussessionservicedir = get_option('dbussessionservicedir')
+if dbussessionservicedir == ''
+        dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
+endif
+
+dbussystemservicedir = get_option('dbussystemservicedir')
+if dbussystemservicedir == ''
+        dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
+endif
+
+pamlibdir = get_option('pamlibdir')
+if pamlibdir == ''
+        pamlibdir = join_paths(rootlibdir, 'security')
+endif
+
+pamconfdir = get_option('pamconfdir')
+if pamconfdir == ''
+        pamconfdir = join_paths(sysconfdir, 'pam.d')
+endif
+
+conf.set_quoted('PKGSYSCONFDIR',                              pkgsysconfdir)
+conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH',                    join_paths(pkgsysconfdir, 'system'))
+conf.set_quoted('SYSTEM_DATA_UNIT_PATH',                      systemunitdir)
+conf.set_quoted('SYSTEM_SYSVINIT_PATH',                       sysvinit_path)
+conf.set_quoted('SYSTEM_SYSVRCND_PATH',                       sysvrcnd_path)
+conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START',                 get_option('rc-local'))
+conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP',                  get_option('halt-local'))
+conf.set_quoted('USER_CONFIG_UNIT_PATH',                      join_paths(pkgsysconfdir, 'user'))
+conf.set_quoted('USER_DATA_UNIT_PATH',                        userunitdir)
+conf.set_quoted('CERTIFICATE_ROOT',                           get_option('certificate-root'))
+conf.set_quoted('CATALOG_DATABASE',                           join_paths(catalogstatedir, 'database'))
+conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH',                  join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
+conf.set_quoted('SYSTEMD_BINARY_PATH',                        join_paths(rootlibexecdir, 'systemd'))
+conf.set_quoted('SYSTEMD_FSCK_PATH',                          join_paths(rootlibexecdir, 'systemd-fsck'))
+conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH',               join_paths(rootlibexecdir, 'systemd-shutdown'))
+conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH',                  join_paths(rootlibexecdir, 'systemd-sleep'))
+conf.set_quoted('SYSTEMCTL_BINARY_PATH',                      join_paths(rootbindir, 'systemctl'))
+conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
+conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH',           join_paths(bindir, 'systemd-stdio-bridge'))
+conf.set_quoted('ROOTPREFIX',                                 rootprefixdir)
+conf.set_quoted('RANDOM_SEED_DIR',                            randomseeddir)
+conf.set_quoted('RANDOM_SEED',                                join_paths(randomseeddir, 'random-seed'))
+conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH',                    join_paths(rootlibexecdir, 'systemd-cryptsetup'))
+conf.set_quoted('SYSTEM_GENERATOR_PATH',                      systemgeneratordir)
+conf.set_quoted('USER_GENERATOR_PATH',                        usergeneratordir)
+conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH',                  systemenvgeneratordir)
+conf.set_quoted('USER_ENV_GENERATOR_PATH',                    userenvgeneratordir)
+conf.set_quoted('SYSTEM_SHUTDOWN_PATH',                       systemshutdowndir)
+conf.set_quoted('SYSTEM_SLEEP_PATH',                          systemsleepdir)
+conf.set_quoted('SYSTEMD_KBD_MODEL_MAP',                      join_paths(pkgdatadir, 'kbd-model-map'))
+conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP',              join_paths(pkgdatadir, 'language-fallback-map'))
+conf.set_quoted('UDEVLIBEXECDIR',                             udevlibexecdir)
+conf.set_quoted('POLKIT_AGENT_BINARY_PATH',                   join_paths(bindir, 'pkttyagent'))
+conf.set_quoted('LIBDIR',                                     libdir)
+conf.set_quoted('ROOTLIBDIR',                                 rootlibdir)
+conf.set_quoted('ROOTLIBEXECDIR',                             rootlibexecdir)
+conf.set_quoted('BOOTLIBDIR',                                 bootlibdir)
+conf.set_quoted('SYSTEMD_PULL_PATH',                          join_paths(rootlibexecdir, 'systemd-pull'))
+conf.set_quoted('SYSTEMD_IMPORT_PATH',                        join_paths(rootlibexecdir, 'systemd-import'))
+conf.set_quoted('SYSTEMD_EXPORT_PATH',                        join_paths(rootlibexecdir, 'systemd-export'))
+conf.set_quoted('VENDOR_KEYRING_PATH',                        join_paths(rootlibexecdir, 'import-pubring.gpg'))
+conf.set_quoted('USER_KEYRING_PATH',                          join_paths(pkgsysconfdir, 'import-pubring.gpg'))
+conf.set_quoted('DOCUMENT_ROOT',                              join_paths(pkgdatadir, 'gatewayd'))
+
+conf.set_quoted('ABS_BUILD_DIR',                              meson.build_root())
+conf.set_quoted('ABS_SRC_DIR',                                meson.source_root())
+
+substs.set('prefix',                                          prefixdir)
+substs.set('exec_prefix',                                     prefixdir)
+substs.set('libdir',                                          libdir)
+substs.set('rootlibdir',                                      rootlibdir)
+substs.set('includedir',                                      includedir)
+substs.set('pkgsysconfdir',                                   pkgsysconfdir)
+substs.set('bindir',                                          bindir)
+substs.set('rootbindir',                                      rootbindir)
+substs.set('rootlibexecdir',                                  rootlibexecdir)
+substs.set('systemunitdir',                                   systemunitdir)
+substs.set('userunitdir',                                     userunitdir)
+substs.set('systempresetdir',                                 systempresetdir)
+substs.set('userpresetdir',                                   userpresetdir)
+substs.set('udevhwdbdir',                                     udevhwdbdir)
+substs.set('udevrulesdir',                                    udevrulesdir)
+substs.set('udevlibexecdir',                                  udevlibexecdir)
+substs.set('catalogdir',                                      catalogdir)
+substs.set('tmpfilesdir',                                     tmpfilesdir)
+substs.set('sysusersdir',                                     sysusersdir)
+substs.set('sysctldir',                                       sysctldir)
+substs.set('binfmtdir',                                       binfmtdir)
+substs.set('modulesloaddir',                                  modulesloaddir)
+substs.set('systemgeneratordir',                              systemgeneratordir)
+substs.set('usergeneratordir',                                usergeneratordir)
+substs.set('systemenvgeneratordir',                           systemenvgeneratordir)
+substs.set('userenvgeneratordir',                             userenvgeneratordir)
+substs.set('systemshutdowndir',                               systemshutdowndir)
+substs.set('systemsleepdir',                                  systemsleepdir)
+substs.set('VARLOGDIR',                                       varlogdir)
+substs.set('CERTIFICATEROOT',                                 get_option('certificate-root'))
+substs.set('SYSTEMCTL',                                       join_paths(rootbindir, 'systemctl'))
+substs.set('RANDOM_SEED',                                     join_paths(randomseeddir, 'random-seed'))
+substs.set('SYSTEM_SYSVINIT_PATH',                            sysvinit_path)
+substs.set('SYSTEM_SYSVRCND_PATH',                            sysvrcnd_path)
+substs.set('RC_LOCAL_SCRIPT_PATH_START',                      get_option('rc-local'))
+substs.set('RC_LOCAL_SCRIPT_PATH_STOP',                       get_option('halt-local'))
+
+#####################################################################
+
+cc = meson.get_compiler('c')
+pkgconfig = import('pkgconfig')
+check_compilation_sh = find_program('tools/meson-check-compilation.sh')
+
+foreach arg : ['-Wundef',
+               '-Wlogical-op',
+               '-Wmissing-include-dirs',
+               '-Wold-style-definition',
+               '-Wpointer-arith',
+               '-Winit-self',
+               '-Wdeclaration-after-statement',
+               '-Wfloat-equal',
+               '-Wsuggest-attribute=noreturn',
+               '-Werror=missing-prototypes',
+               '-Werror=implicit-function-declaration',
+               '-Werror=missing-declarations',
+               '-Werror=return-type',
+               '-Werror=incompatible-pointer-types',
+               '-Werror=format=2',
+               '-Wstrict-prototypes',
+               '-Wredundant-decls',
+               '-Wmissing-noreturn',
+               '-Wshadow',
+               '-Wendif-labels',
+               '-Wstrict-aliasing=2',
+               '-Wwrite-strings',
+               '-Werror=overflow',
+               '-Wdate-time',
+               '-Wnested-externs',
+               '-ffast-math',
+               '-fno-common',
+               '-fdiagnostics-show-option',
+               '-fno-strict-aliasing',
+               '-fvisibility=hidden',
+               '-fstack-protector',
+               '-fstack-protector-strong',
+               '-fPIE',
+               '--param=ssp-buffer-size=4',
+              ]
+        if cc.has_argument(arg)
+                add_project_arguments(arg, language : 'c')
+        endif
+endforeach
+
+# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
+# arguments, just emits a warnings. So test for the "positive" version instead.
+foreach arg : ['unused-parameter',
+               'missing-field-initializers',
+               'unused-result',
+               'format-signedness']
+        if cc.has_argument('-W' + arg)
+                add_project_arguments('-Wno-' + arg, language : 'c')
+        endif
+endforeach
+
+if cc.compiles('
+   #include <time.h>
+   #include <inttypes.h>
+   typedef uint64_t usec_t;
+   usec_t now(clockid_t clock);
+   int main(void) {
+           struct timespec now;
+           return 0;
+   }
+', name : '-Werror=shadow with local shadowing')
+        add_project_arguments('-Werror=shadow', language : 'c')
+endif
+
+if cc.get_id() == 'clang'
+        foreach arg : ['-Wno-typedef-redefinition',
+                       '-Wno-gnu-variable-sized-type-not-at-end',
+                      ]
+                if cc.has_argument(arg,
+                                   name : '@0@ is supported'.format(arg))
+                        add_project_arguments(arg, language : 'c')
+                endif
+        endforeach
+endif
+
+link_test_c = files('tools/meson-link-test.c')
+
+# --as-needed and --no-undefined are provided by meson by default,
+# run mesonconf to see what is enabled
+foreach arg : ['-Wl,-z,relro',
+               '-Wl,-z,now',
+               '-pie',
+               '-Wl,-fuse-ld=gold',
+              ]
+
+        have = run_command(check_compilation_sh,
+                           cc.cmd_array(), '-x', 'c', arg,
+                           '-include', link_test_c).returncode() == 0
+        message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+        if have
+                add_project_link_arguments(arg, language : 'c')
+        endif
+endforeach
+
+if get_option('buildtype') != 'debug'
+        foreach arg : ['-ffunction-sections',
+                       '-fdata-sections']
+                if cc.has_argument(arg,
+                                   name : '@0@ is supported'.format(arg))
+                        add_project_arguments(arg, language : 'c')
+                endif
+        endforeach
+
+        foreach arg : ['-Wl,--gc-sections']
+                have = run_command(check_compilation_sh,
+                                   cc.cmd_array(), '-x', 'c', arg,
+                                   '-include', link_test_c).returncode() == 0
+                message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+                if have
+                        add_project_link_arguments(arg, language : 'c')
+                endif
+        endforeach
+endif
+
+cpp = ' '.join(cc.cmd_array()) + ' -E'
+
+#####################################################################
+# compilation result tests
+
+conf.set('_GNU_SOURCE', true)
+conf.set('__SANE_USERSPACE_TYPES__', true)
+
+conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
+conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
+conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
+conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
+conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
+conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
+conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
+
+decl_headers = '''
+#include <uchar.h>
+#include <linux/ethtool.h>
+'''
+# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
+
+foreach decl : ['char16_t',
+                'char32_t',
+                'key_serial_t',
+                'struct ethtool_link_settings',
+               ]
+
+        # We get -1 if the size cannot be determined
+        have = cc.sizeof(decl, prefix : decl_headers) > 0
+        conf.set('HAVE_' + decl.underscorify().to_upper(), have)
+endforeach
+
+foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
+                ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
+                ['IFLA_VRF_TABLE',                   'linux/if_link.h'],
+                ['IFLA_MACVLAN_FLAGS',               'linux/if_link.h'],
+                ['IFLA_IPVLAN_MODE',                 'linux/if_link.h'],
+                ['IFLA_PHYS_PORT_ID',                'linux/if_link.h'],
+                ['IFLA_BOND_AD_INFO',                'linux/if_link.h'],
+                ['IFLA_VLAN_PROTOCOL',               'linux/if_link.h'],
+                ['IFLA_VXLAN_REMCSUM_NOPARTIAL',     'linux/if_link.h'],
+                ['IFLA_VXLAN_GPE',                   'linux/if_link.h'],
+                ['IFLA_GENEVE_LABEL',                'linux/if_link.h'],
+                # if_tunnel.h is buggy and cannot be included on its own
+                ['IFLA_VTI_REMOTE',                  'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_IPTUN_ENCAP_DPORT',           'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_ENCAP_DPORT',             'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_BRIDGE_VLAN_INFO',            'linux/if_bridge.h'],
+                ['IFLA_BRPORT_PROXYARP',             'linux/if_link.h'],
+                ['IFLA_BRPORT_LEARNING_SYNC',        'linux/if_link.h'],
+                ['IFLA_BR_VLAN_DEFAULT_PVID',        'linux/if_link.h'],
+                ['NDA_IFINDEX',                      'linux/neighbour.h'],
+                ['IFA_FLAGS',                        'linux/if_addr.h'],
+                ['LO_FLAGS_PARTSCAN',                'linux/loop.h'],
+               ]
+        prefix = decl.length() > 2 ? decl[2] : ''
+        have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
+        conf.set10('HAVE_DECL_' + decl[0], have)
+endforeach
+
+skip = false
+foreach ident : ['secure_getenv', '__secure_getenv']
+        if not skip and cc.has_function(ident)
+                conf.set('HAVE_' + ident.to_upper(), true)
+                skip = true
+        endif
+endforeach
+
+foreach ident : [
+        ['memfd_create',      '''#include <sys/memfd.h>'''],
+        ['gettid',            '''#include <sys/types.h>'''],
+        ['pivot_root',        '''#include <stdlib.h>'''],     # no known header declares pivot_root
+        ['name_to_handle_at', '''#define _GNU_SOURCE
+                                 #include <sys/types.h>
+                                 #include <sys/stat.h>
+                                 #include <fcntl.h>'''],
+        ['setns',             '''#define _GNU_SOURCE
+                                 #include <sched.h>'''],
+        ['renameat2',         '''#include <stdio.h>'''],
+        ['kcmp',              '''#include <linux/kcmp.h>'''],
+        ['keyctl',            '''#include <sys/types.h>
+                                 #include <keyutils.h>'''],
+        ['copy_file_range',   '''#include <sys/syscall.h>
+                                 #include <unistd.h>'''],
+        ['explicit_bzero' ,   '''#include <string.h>'''],
+]
+
+        have = cc.has_function(ident[0], prefix : ident[1])
+        conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
+endforeach
+
+if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
+        conf.set('USE_SYS_RANDOM_H', true)
+        conf.set10('HAVE_DECL_GETRANDOM', true)
+else
+        have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
+        conf.set10('HAVE_DECL_GETRANDOM', have)
+endif
+
+#####################################################################
+
+sed = find_program('sed')
+grep = find_program('grep')
+awk = find_program('awk')
+m4 = find_program('m4')
+stat = find_program('stat')
+git = find_program('git', required : false)
+etags = find_program('etags', required : false)
+
+meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
+mkdir_p = 'mkdir -p $DESTDIR/@0@'
+test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
+splash_bmp = files('test/splash.bmp')
+
+# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
+# /usr/sbin, /sbin, and fall back to the default from middle column.
+progs = [['telinit',    '/lib/sysvinit/telinit'],
+         ['quotaon',    '/usr/sbin/quotaon'    ],
+         ['quotacheck', '/usr/sbin/quotacheck' ],
+         ['kill',       '/usr/bin/kill'        ],
+         ['kmod',       '/usr/bin/kmod'        ],
+         ['kexec',      '/usr/sbin/kexec'      ],
+         ['sulogin',    '/usr/sbin/sulogin'    ],
+         ['mount',      '/usr/bin/mount',      'MOUNT_PATH'],
+         ['umount',     '/usr/bin/umount',     'UMOUNT_PATH'],
+         ['loadkeys',   '/usr/bin/loadkeys',   'KBD_LOADKEYS'],
+         ['setfont',    '/usr/bin/setfont',    'KBD_SETFONT'],
+        ]
+foreach prog : progs
+        path = get_option(prog[0] + '-path')
+        if path != ''
+                message('Using @1@ for @0@'.format(prog[0], path))
+        else
+                exe = find_program(prog[0],
+                                   '/usr/sbin/' + prog[0],
+                                   '/sbin/' + prog[0],
+                                   required: false)
+                path = exe.found() ? exe.path() : prog[1]
+        endif
+        name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
+        conf.set_quoted(name, path)
+        substs.set(name, path)
+endforeach
+
+if run_command('ln', '--relative', '--help').returncode() != 0
+        error('ln does not support --relative')
+endif
+
+############################################################
+
+gperf = find_program('gperf')
+
+gperf_test_format = '''
+#include <string.h>
+const char * in_word_set(const char *, @0@);
+@1@
+'''
+gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
+gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
+gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
+if cc.compiles(gperf_test)
+        gperf_len_type = 'size_t'
+else
+        gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
+        if cc.compiles(gperf_test)
+                gperf_len_type = 'unsigned'
+        else
+                error('unable to determine gperf len type')
+        endif
+endif
+message('gperf len type is @0@'.format(gperf_len_type))
+conf.set('GPERF_LEN_TYPE', gperf_len_type,
+         description : 'The type of gperf "len" parameter')
+
+############################################################
+
+if not cc.has_header('sys/capability.h')
+        error('POSIX caps headers not found')
+endif
+foreach header : ['linux/btrfs.h',
+                  'linux/memfd.h',
+                  'linux/vm_sockets.h',
+                  'valgrind/memcheck.h',
+                  'valgrind/valgrind.h',
+                 ]
+
+        conf.set('HAVE_' + header.underscorify().to_upper(),
+                 cc.has_header(header))
+endforeach
+
+############################################################
+
+conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
+
+default_hierarchy = get_option('default-hierarchy')
+conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
+                description : 'default cgroup hierarchy as string')
+if default_hierarchy == 'legacy'
+        conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
+elif default_hierarchy == 'hybrid'
+        conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
+else
+        conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
+endif
+
+time_epoch = get_option('time-epoch')
+if time_epoch == ''
+        NEWS = files('NEWS')
+        time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
+endif
+time_epoch = time_epoch.to_int()
+conf.set('TIME_EPOCH', time_epoch)
+
+system_uid_max = get_option('system-uid-max')
+if system_uid_max == ''
+        system_uid_max = run_command(
+                awk,
+                'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
+                '/etc/login.defs').stdout()
+endif
+system_uid_max = system_uid_max.to_int()
+conf.set('SYSTEM_UID_MAX', system_uid_max)
+substs.set('systemuidmax', system_uid_max)
+message('maximum system UID is @0@'.format(system_uid_max))
+
+conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
+conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
+
+system_gid_max = get_option('system-gid-max')
+if system_gid_max == ''
+        system_gid_max = run_command(
+                awk,
+                'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
+                '/etc/login.defs').stdout()
+endif
+system_gid_max = system_gid_max.to_int()
+conf.set('SYSTEM_GID_MAX', system_gid_max)
+substs.set('systemgidmax', system_gid_max)
+message('maximum system GID is @0@'.format(system_gid_max))
+
+tty_gid = get_option('tty-gid')
+conf.set('TTY_GID', tty_gid)
+substs.set('TTY_GID', tty_gid)
+
+if get_option('adm-group')
+        m4_defines += ['-DENABLE_ADM_GROUP']
+endif
+
+if get_option('wheel-group')
+        m4_defines += ['-DENABLE_WHEEL_GROUP']
+endif
+
+substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
+
+kill_user_processes = get_option('default-kill-user-processes')
+conf.set10('KILL_USER_PROCESSES', kill_user_processes)
+substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
+
+default_dnssec = get_option('default-dnssec')
+conf.set('DEFAULT_DNSSEC_MODE',
+         'DNSSEC_' + default_dnssec.underscorify().to_upper())
+substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
+
+dns_servers = get_option('dns-servers')
+conf.set_quoted('DNS_SERVERS', dns_servers)
+substs.set('DNS_SERVERS', dns_servers)
+
+ntp_servers = get_option('ntp-servers')
+conf.set_quoted('NTP_SERVERS', ntp_servers)
+substs.set('NTP_SERVERS', ntp_servers)
+
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+
+substs.set('SUSHELL', get_option('debug-shell'))
+substs.set('DEBUGTTY', get_option('debug-tty'))
+
+debug = get_option('debug')
+if debug != ''
+        foreach name : debug.split(',')
+                if name == 'hashmap'
+                        conf.set('ENABLE_DEBUG_HASHMAP', true)
+                elif name == 'mmap-cache'
+                        conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
+                else
+                        message('unknown debug option "@0@", ignoring'.format(name))
+                endif
+        endforeach
+endif
+
+#####################################################################
+
+threads = dependency('threads')
+librt = cc.find_library('rt')
+libm = cc.find_library('m')
+libdl = cc.find_library('dl')
+libcrypt = cc.find_library('crypt')
+
+libcap = dependency('libcap', required : false)
+if not libcap.found()
+        # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
+        libcap = cc.find_library('cap')
+endif
+
+libmount = dependency('mount',
+                      version : '>= 2.27')
+
+want_seccomp = get_option('seccomp')
+if want_seccomp != 'false'
+        libseccomp = dependency('libseccomp',
+                                version : '>= 2.3.1',
+                                required : want_seccomp == 'true')
+        if libseccomp.found()
+                conf.set('HAVE_SECCOMP', true)
+                m4_defines += ['-DHAVE_SECCOMP']
+        endif
+else
+        libseccomp = []
+endif
+
+want_selinux = get_option('selinux')
+if want_selinux != 'false'
+        libselinux = dependency('libselinux',
+                                version : '>= 2.1.9',
+                                required : want_selinux == 'true')
+        if libselinux.found()
+                conf.set('HAVE_SELINUX', true)
+                m4_defines += ['-DHAVE_SELINUX']
+        endif
+else
+        libselinux = []
+endif
+
+want_apparmor = get_option('apparmor')
+if want_apparmor != 'false'
+        libapparmor = dependency('libapparmor',
+                                 required : want_apparmor == 'true')
+        if libapparmor.found()
+                conf.set('HAVE_APPARMOR', true)
+                m4_defines += ['-DHAVE_APPARMOR']
+        endif
+else
+        libapparmor = []
+endif
+
+smack_run_label = get_option('smack-run-label')
+if smack_run_label != ''
+        conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
+        m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
+endif
+
+want_polkit = get_option('polkit')
+install_polkit = false
+install_polkit_pkla = false
+if want_polkit != 'false'
+        conf.set('ENABLE_POLKIT', true)
+        install_polkit = true
+
+        libpolkit = dependency('polkit-gobject-1',
+                               required : false)
+        if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
+                message('Old polkit detected, will install pkla files')
+                install_polkit_pkla = true
+        endif
+endif
+
+want_acl = get_option('acl')
+if want_acl != 'false'
+        libacl = cc.find_library('acl', required : want_acl == 'true')
+        if libacl.found()
+                conf.set('HAVE_ACL', true)
+                m4_defines += ['-DHAVE_ACL']
+        endif
+else
+        libacl = []
+endif
+
+want_audit = get_option('audit')
+if want_audit != 'false'
+        libaudit = dependency('audit', required : want_audit == 'true')
+        conf.set('HAVE_AUDIT', libaudit.found())
+else
+        libaudit = []
+endif
+
+want_blkid = get_option('blkid')
+if want_blkid != 'false'
+        libblkid = dependency('blkid', required : want_blkid == 'true')
+        conf.set('HAVE_BLKID', libblkid.found())
+else
+        libblkid = []
+endif
+
+want_kmod = get_option('kmod')
+if want_kmod != 'false'
+        libkmod = dependency('libkmod',
+                             version : '>= 15',
+                             required : want_kmod == 'true')
+        conf.set('HAVE_KMOD', libkmod.found())
+else
+        libkmod = []
+endif
+
+want_pam = get_option('pam')
+if want_pam != 'false'
+        libpam = cc.find_library('pam', required : want_pam == 'true')
+        libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
+        if libpam.found() and libpam_misc.found()
+                conf.set('HAVE_PAM', true)
+                m4_defines += ['-DHAVE_PAM']
+        endif
+else
+        libpam = []
+        libpam_misc = []
+endif
+
+want_microhttpd = get_option('microhttpd')
+if want_microhttpd != 'false'
+        libmicrohttpd = dependency('libmicrohttpd',
+                                   version : '>= 0.9.33',
+                                   required : want_microhttpd == 'true')
+        if libmicrohttpd.found()
+                conf.set('HAVE_MICROHTTPD', true)
+                m4_defines += ['-DHAVE_MICROHTTPD']
+        endif
+else
+        libmicrohttpd = []
+endif
+
+want_libcryptsetup = get_option('libcryptsetup')
+if want_libcryptsetup != 'false'
+        libcryptsetup = dependency('libcryptsetup',
+                                   version : '>= 1.6.0',
+                                   required : want_libcryptsetup == 'true')
+        conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
+else
+        libcryptsetup = []
+endif
+
+want_libcurl = get_option('libcurl')
+if want_libcurl != 'false'
+        libcurl = dependency('libcurl',
+                             version : '>= 7.32.0',
+                             required : want_libcurl == 'true')
+        if libcurl.found()
+                conf.set('HAVE_LIBCURL', true)
+                m4_defines += ['-DHAVE_LIBCURL']
+        endif
+else
+        libcurl = []
+endif
+
+want_libidn = get_option('libidn')
+if want_libidn != 'false'
+        libidn = dependency('libidn',
+                            required : want_libidn == 'true')
+        if libidn.found()
+                conf.set('HAVE_LIBIDN', true)
+                m4_defines += ['-DHAVE_LIBIDN']
+        endif
+else
+        libidn = []
+endif
+
+want_libiptc = get_option('libiptc')
+if want_libiptc != 'false'
+        libiptc = dependency('libiptc',
+                             required : want_libiptc == 'true')
+        if libiptc.found()
+                conf.set('HAVE_LIBIPTC', true)
+                m4_defines += ['-DHAVE_LIBIPTC']
+        endif
+else
+        libiptc = []
+endif
+
+want_qrencode = get_option('qrencode')
+if want_qrencode != 'false'
+        libqrencode = dependency('libqrencode',
+                                 required : want_qrencode == 'true')
+        conf.set('HAVE_QRENCODE', libqrencode.found())
+else
+        libqrencode = []
+endif
+
+want_gnutls = get_option('gnutls')
+if want_gnutls != 'false'
+        libgnutls = dependency('gnutls',
+                               version : '>= 3.1.4',
+                               required : want_gnutls == 'true')
+        conf.set('HAVE_GNUTLS', libgnutls.found())
+else
+        libgnutls = []
+endif
+
+want_elfutils = get_option('elfutils')
+if want_elfutils != 'false'
+        libdw = dependency('libdw',
+                           required : want_elfutils == 'true')
+        conf.set('HAVE_ELFUTILS', libdw.found())
+else
+        libdw = []
+endif
+
+want_zlib = get_option('zlib')
+if want_zlib != 'false'
+        libz = dependency('zlib',
+                          required : want_zlib == 'true')
+        conf.set('HAVE_ZLIB', libz.found())
+else
+        libz = []
+endif
+
+want_bzip2 = get_option('bzip2')
+if want_bzip2 != 'false'
+        libbzip2 = cc.find_library('bz2',
+                                   required : want_bzip2 == 'true')
+        conf.set('HAVE_BZIP2', libbzip2.found())
+else
+        libbzip2 = []
+endif
+
+want_xz = get_option('xz')
+if want_xz != 'false'
+        libxz = dependency('liblzma',
+                           required : want_xz == 'true')
+        conf.set('HAVE_XZ', libxz.found())
+else
+        libxz = []
+endif
+
+want_lz4 = get_option('lz4')
+if want_lz4 != 'false'
+        liblz4 = dependency('liblz4',
+                            required : want_lz4 == 'true')
+        conf.set('HAVE_LZ4', liblz4.found())
+else
+        liblz4 = []
+endif
+
+want_glib = get_option('glib')
+if want_glib != 'false'
+        libglib =    dependency('glib-2.0',
+                                version : '>= 2.22.0',
+                                required : want_glib == 'true')
+        libgobject = dependency('gobject-2.0',
+                                version : '>= 2.22.0',
+                                required : want_glib == 'true')
+        libgio =     dependency('gio-2.0',
+                                required : want_glib == 'true')
+        have = libglib.found() and libgobject.found() and libgio.found()
+        conf.set('HAVE_GLIB', have)
+else
+        libglib = []
+        libgobject = []
+        libgio = []
+endif
+
+want_xkbcommon = get_option('xkbcommon')
+if want_xkbcommon != 'false'
+        libxkbcommon = dependency('xkbcommon',
+                                  version : '>= 0.3.0',
+                                  required : want_xkbcommon == 'true')
+        conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
+else
+        libxkbcommon = []
+endif
+
+want_dbus = get_option('dbus')
+if want_dbus != 'false'
+        libdbus = dependency('dbus-1',
+                             version : '>= 1.3.2',
+                             required : want_dbus == 'true')
+        conf.set('HAVE_DBUS', libdbus.found())
+else
+        libdbus = []
+endif
+
+want_gcrypt = get_option('gcrypt')
+if want_gcrypt != 'false'
+        libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
+        libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
+
+        have_deps = libgcrypt.found() and libgpg_error.found()
+        conf.set('HAVE_GCRYPT', have_deps)
+        if not have_deps
+                # link to neither of the libs if one is not found
+                libgcrypt = []
+                libgpg_error = []
+        endif
+else
+        libgcrypt = []
+        libgpg_error = []
+endif
+
+want_importd = get_option('importd')
+if want_importd != 'false'
+        have_deps = (conf.get('HAVE_LIBCURL', false) and
+                     conf.get('HAVE_ZLIB', false) and
+                     conf.get('HAVE_BZIP2', false) and
+                     conf.get('HAVE_XZ', false) and
+                     conf.get('HAVE_GCRYPT', false))
+        conf.set('ENABLE_IMPORTD', have_deps)
+        if want_importd == 'true' and not have_deps
+                error('importd support was requested, but dependencies are not available')
+        endif
+endif
+
+want_remote = get_option('remote')
+if want_remote != 'false'
+        have_deps = [conf.get('HAVE_MICROHTTPD', false),
+                     conf.get('HAVE_LIBCURL', false)]
+        # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
+        # it's possible to build one without the other. Complain only if
+        # support was explictly requested. The auxiliary files like sysusers
+        # config should be installed when any of the programs are built.
+        if want_remote == 'true' and not (have_deps[0] and have_deps[1])
+                error('remote support was requested, but dependencies are not available')
+        endif
+        conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
+endif
+
+foreach pair : [['utmp',          'HAVE_UTMP'],
+                ['hibernate',     'ENABLE_HIBERNATE'],
+                ['environment-d', 'ENABLE_ENVIRONMENT_D'],
+                ['binfmt',        'ENABLE_BINFMT'],
+                ['coredump',      'ENABLE_COREDUMP'],
+                ['resolve',       'ENABLE_RESOLVED'],
+                ['logind',        'ENABLE_LOGIND'],
+                ['hostnamed',     'ENABLE_HOSTNAMED'],
+                ['localed',       'ENABLE_LOCALED'],
+                ['machined',      'ENABLE_MACHINED'],
+                ['networkd',      'ENABLE_NETWORKD'],
+                ['timedated',     'ENABLE_TIMEDATED'],
+                ['timesyncd',     'ENABLE_TIMESYNCD'],
+                ['myhostname',    'HAVE_MYHOSTNAME'],
+                ['firstboot',     'ENABLE_FIRSTBOOT'],
+                ['randomseed',    'ENABLE_RANDOMSEED'],
+                ['backlight',     'ENABLE_BACKLIGHT'],
+                ['vconsole',      'ENABLE_VCONSOLE'],
+                ['quotacheck',    'ENABLE_QUOTACHECK'],
+                ['sysusers',      'ENABLE_SYSUSERS'],
+                ['tmpfiles',      'ENABLE_TMPFILES'],
+                ['hwdb',          'ENABLE_HWDB'],
+                ['rfkill',        'ENABLE_RFKILL'],
+                ['ldconfig',      'ENABLE_LDCONFIG'],
+                ['efi',           'ENABLE_EFI'],
+                ['tpm',           'SD_BOOT_LOG_TPM'],
+                ['ima',           'HAVE_IMA'],
+                ['smack',         'HAVE_SMACK'],
+               ]
+
+        if get_option(pair[0])
+                conf.set(pair[1], true)
+                m4_defines += ['-D' + pair[1]]
+        endif
+endforeach
+
+want_tests = get_option('tests')
+install_tests = get_option('install-tests')
+tests = []
+
+#####################################################################
+
+if get_option('efi')
+        efi_arch = host_machine.cpu_family()
+
+        if efi_arch == 'x86'
+                EFI_MACHINE_TYPE_NAME = 'ia32'
+                gnu_efi_arch = 'ia32'
+        elif efi_arch == 'x86_64'
+                EFI_MACHINE_TYPE_NAME = 'x64'
+                gnu_efi_arch = 'x86_64'
+        elif efi_arch == 'arm'
+                EFI_MACHINE_TYPE_NAME = 'arm'
+                gnu_efi_arch = 'arm'
+        elif efi_arch == 'aarch64'
+                EFI_MACHINE_TYPE_NAME = 'aa64'
+                gnu_efi_arch = 'aarch64'
+        else
+                EFI_MACHINE_TYPE_NAME = ''
+                gnu_efi_arch = ''
+        endif
+
+        conf.set('ENABLE_EFI', true)
+        conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
+
+        conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
+endif
+
+#####################################################################
+
+config_h = configure_file(
+        output : 'config.h',
+        configuration : conf)
+
+includes = include_directories('src/basic',
+                               'src/shared',
+                               'src/systemd',
+                               'src/journal',
+                               'src/resolve',
+                               'src/timesync',
+                               'src/login',
+                               'src/udev',
+                               'src/libudev',
+                               'src/core',
+                               'src/libsystemd/sd-bus',
+                               'src/libsystemd/sd-device',
+                               'src/libsystemd/sd-hwdb',
+                               'src/libsystemd/sd-id128',
+                               'src/libsystemd/sd-netlink',
+                               'src/libsystemd/sd-network',
+                               'src/libsystemd-network',
+                              )
+
+add_project_arguments('-include', 'config.h', language : 'c')
+
+gcrypt_util_sources = files('src/shared/gcrypt-util.h',
+                            'src/shared/gcrypt-util.c')
+
+subdir('po')
+subdir('catalog')
+subdir('src/systemd')
+subdir('src/basic')
+subdir('src/libsystemd')
+subdir('src/libsystemd-network')
+subdir('src/journal')
+subdir('src/login')
+
+libjournal_core = static_library(
+        'journal-core',
+        libjournal_core_sources,
+        journald_gperf_c,
+        include_directories : includes,
+        install : false)
+
+libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
+libsystemd = shared_library(
+        'systemd',
+        libsystemd_internal_sources,
+        journal_internal_sources,
+        version : '0.18.0',
+        include_directories : includes,
+        link_args : ['-shared',
+                     '-Wl,--version-script=' + libsystemd_sym_path],
+        link_with : [libbasic],
+        dependencies : [threads,
+                        libgcrypt,
+                        librt,
+                        libxz,
+                        liblz4],
+        link_depends : libsystemd_sym,
+        install : true,
+        install_dir : rootlibdir)
+
+############################################################
+
+# binaries that have --help and are intended for use by humans,
+# usually, but not always, installed in /bin.
+public_programs = []
+
+subdir('src/libudev')
+subdir('src/shared')
+subdir('src/core')
+subdir('src/udev')
+subdir('src/network')
+
+subdir('src/analyze')
+subdir('src/journal-remote')
+subdir('src/coredump')
+subdir('src/hostname')
+subdir('src/import')
+subdir('src/kernel-install')
+subdir('src/locale')
+subdir('src/machine')
+subdir('src/nspawn')
+subdir('src/resolve')
+subdir('src/timedate')
+subdir('src/timesync')
+subdir('src/vconsole')
+subdir('src/sulogin-shell')
+subdir('src/boot/efi')
+
+subdir('src/test')
+subdir('test')
+
+############################################################
+
+# only static linking apart from libdl, to make sure that the
+# module is linked to all libraries that it uses.
+test_dlopen = executable(
+        'test-dlopen',
+        test_dlopen_c,
+        include_directories : includes,
+        link_with : [libbasic],
+        dependencies : [libdl])
+
+foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
+                 ['systemd',     '',               []],
+                 ['mymachines', 'ENABLE_MACHINED', []],
+                 ['resolve',    'ENABLE_RESOLVED', [libdl]]]
+
+        condition = tuple[1] == '' or conf.get(tuple[1], false)
+        if condition
+                module = tuple[0]
+                extra_deps = tuple[2]
+
+                sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
+                version_script_arg = join_paths(meson.current_source_dir(), sym)
+
+                nss = shared_library(
+                        'nss_' + module,
+                        'src/nss-@0@/nss-@0@.c'.format(module),
+                        version : '2',
+                        include_directories : includes,
+                        link_args : ['-shared',
+                                     '-Wl,--version-script=' + version_script_arg,
+                                     '-Wl,--undefined'],
+                        link_with : [libsystemd_internal,
+                                     libbasic],
+                        dependencies : [threads,
+                                        librt] + extra_deps,
+                        link_depends : sym,
+                        install : true,
+                        install_dir : rootlibdir)
+
+                # We cannot use shared_module because it does not support version suffix.
+                # Unfortunately shared_library insists on creating the symlink…
+                meson.add_install_script('sh', '-c',
+                                         'rm $DESTDIR@0@/libnss_@1@.so'
+                                         .format(rootlibdir, module))
+
+                test('dlopen-nss_' + module,
+                     test_dlopen,
+                     args : [nss.full_path()]) # path to dlopen must include a slash
+        endif
+endforeach
+
+############################################################
+
+executable('systemd',
+           systemd_sources,
+           include_directories : includes,
+           link_with : [libcore,
+                        libshared],
+           dependencies : [threads,
+                           librt,
+                           libseccomp,
+                           libselinux,
+                           libmount,
+                           libblkid],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-analyze',
+                 systemd_analyze_sources,
+                 include_directories : includes,
+                 link_with : [libcore,
+                              libshared],
+                 dependencies : [threads,
+                                 librt,
+                                 libseccomp,
+                                 libselinux,
+                                 libmount,
+                                 libblkid],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+executable('systemd-journald',
+           systemd_journald_sources,
+           include_directories : includes,
+           link_with : [libjournal_core,
+                        libshared],
+           dependencies : [threads,
+                           libxz,
+                           liblz4,
+                           libselinux],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-cat',
+                 systemd_cat_sources,
+                 include_directories : includes,
+                 link_with : [libjournal_core,
+                              libshared],
+                 dependencies : [threads],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('journalctl',
+                 journalctl_sources,
+                 include_directories : includes,
+                 link_with : [libshared],
+                 dependencies : [threads,
+                                 libqrencode,
+                                 libxz,
+                                 liblz4],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+executable('systemd-getty-generator',
+           'src/getty-generator/getty-generator.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : systemgeneratordir)
+
+executable('systemd-debug-generator',
+           'src/debug-generator/debug-generator.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : systemgeneratordir)
+
+executable('systemd-fstab-generator',
+           'src/fstab-generator/fstab-generator.c',
+           'src/core/mount-setup.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : systemgeneratordir)
+
+if conf.get('ENABLE_ENVIRONMENT_D', false)
+        executable('30-systemd-environment-d-generator',
+                   'src/environment-d-generator/environment-d-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : userenvgeneratordir)
+
+        meson.add_install_script(meson_make_symlink,
+                                 join_paths(sysconfdir, 'environment'),
+                                 join_paths(environmentdir, '99-environment.conf'))
+endif
+
+if conf.get('ENABLE_HIBERNATE', false)
+        executable('systemd-hibernate-resume-generator',
+                   'src/hibernate-resume/hibernate-resume-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+
+        executable('systemd-hibernate-resume',
+                   'src/hibernate-resume/hibernate-resume.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('HAVE_BLKID', false)
+        executable('systemd-gpt-auto-generator',
+                   'src/gpt-auto-generator/gpt-auto-generator.c',
+                   'src/basic/blkid-util.h',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : libblkid,
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+
+        exe = executable('systemd-dissect',
+                         'src/dissect/dissect.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootlibexecdir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_RESOLVED', false)
+        executable('systemd-resolved',
+                   systemd_resolved_sources,
+                   gcrypt_util_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [threads,
+                                   libgcrypt,
+                                   libgpg_error,
+                                   libm,
+                                   libidn],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('systemd-resolve',
+                         systemd_resolve_sources,
+                         gcrypt_util_sources,
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [threads,
+                                         libgcrypt,
+                                         libgpg_error,
+                                         libm,
+                                         libidn],
+                         install_rpath : rootlibexecdir,
+                         install : true)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_LOGIND', false)
+        executable('systemd-logind',
+                   systemd_logind_sources,
+                   include_directories : includes,
+                   link_with : [liblogind_core,
+                                libshared],
+                   dependencies : [threads,
+                                   libacl],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('loginctl',
+                         loginctl_sources,
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [threads,
+                                         liblz4,
+                                         libxz],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+
+        exe = executable('systemd-inhibit',
+                         'src/login/inhibit.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+
+        if conf.get('HAVE_PAM', false)
+                version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
+                pam_systemd = shared_library(
+                        'pam_systemd',
+                        pam_systemd_c,
+                        name_prefix : '',
+                        include_directories : includes,
+                        link_args : ['-shared',
+                                     '-Wl,--version-script=' + version_script_arg],
+                        link_with : [libsystemd_internal,
+                                     libshared_static],
+                        dependencies : [threads,
+                                        libpam,
+                                        libpam_misc],
+                        link_depends : pam_systemd_sym,
+                        install : true,
+                        install_dir : pamlibdir)
+
+                test('dlopen-pam_systemd',
+                     test_dlopen,
+                     args : [pam_systemd.full_path()]) # path to dlopen must include a slash
+        endif
+endif
+
+if conf.get('HAVE_PAM', false)
+        executable('systemd-user-sessions',
+                   'src/user-sessions/user-sessions.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
+        exe = executable('bootctl',
+                         'src/boot/bootctl.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [libblkid],
+                         install_rpath : rootlibexecdir,
+                         install : true)
+        public_programs += [exe]
+endif
+
+exe = executable('systemd-socket-activate', 'src/activate/activate.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 dependencies : [threads],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemctl', 'src/systemctl/systemctl.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 dependencies : [threads,
+                                 libcap,
+                                 libselinux,
+                                 libxz,
+                                 liblz4],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+if conf.get('ENABLE_BACKLIGHT', false)
+        executable('systemd-backlight',
+                   'src/backlight/backlight.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('ENABLE_RFKILL', false)
+        executable('systemd-rfkill',
+                   'src/rfkill/rfkill.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+executable('systemd-system-update-generator',
+           'src/system-update-generator/system-update-generator.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : systemgeneratordir)
+
+if conf.get('HAVE_LIBCRYPTSETUP', false)
+        executable('systemd-cryptsetup',
+                   'src/cryptsetup/cryptsetup.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libcryptsetup],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        executable('systemd-cryptsetup-generator',
+                   'src/cryptsetup/cryptsetup-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libcryptsetup],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+
+        executable('systemd-veritysetup',
+                   'src/veritysetup/veritysetup.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libcryptsetup],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        executable('systemd-veritysetup-generator',
+                   'src/veritysetup/veritysetup-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libcryptsetup],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+endif
+
+if conf.get('HAVE_SYSV_COMPAT', false)
+        executable('systemd-sysv-generator',
+                   'src/sysv-generator/sysv-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+
+        executable('systemd-rc-local-generator',
+                   'src/rc-local-generator/rc-local-generator.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : systemgeneratordir)
+endif
+
+if conf.get('ENABLE_HOSTNAMED', false)
+        executable('systemd-hostnamed',
+                   'src/hostname/hostnamed.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('hostnamectl',
+                         'src/hostname/hostnamectl.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_LOCALED', false)
+        if conf.get('HAVE_XKBCOMMON', false)
+                # logind will load libxkbcommon.so dynamically on its own
+                deps = [libdl]
+        else
+                deps = []
+        endif
+
+        executable('systemd-localed',
+                   systemd_localed_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : deps,
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('localectl',
+                         localectl_sources,
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_TIMEDATED', false)
+        executable('systemd-timedated',
+                   'src/timedate/timedated.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('timedatectl',
+                         'src/timedate/timedatectl.c',
+                         include_directories : includes,
+                         install_rpath : rootlibexecdir,
+                         link_with : [libshared],
+                         install : true)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_TIMESYNCD', false)
+        executable('systemd-timesyncd',
+                   systemd_timesyncd_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [threads,
+                                   libm],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('ENABLE_MACHINED', false)
+        executable('systemd-machined',
+                   systemd_machined_sources,
+                   include_directories : includes,
+                   link_with : [libmachine_core,
+                                libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('machinectl',
+                         'src/machine/machinectl.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [threads,
+                                         libxz,
+                                         liblz4],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_IMPORTD', false)
+        executable('systemd-importd',
+                   systemd_importd_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [threads],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        systemd_pull = executable('systemd-pull',
+                                  systemd_pull_sources,
+                                  include_directories : includes,
+                                  link_with : [libshared],
+                                  dependencies : [libcurl,
+                                                  libz,
+                                                  libbzip2,
+                                                  libxz,
+                                                  libgcrypt],
+                                  install_rpath : rootlibexecdir,
+                                  install : true,
+                                  install_dir : rootlibexecdir)
+
+        systemd_import = executable('systemd-import',
+                                    systemd_import_sources,
+                                    include_directories : includes,
+                                    link_with : [libshared],
+                                    dependencies : [libcurl,
+                                                    libz,
+                                                    libbzip2,
+                                                    libxz],
+                                    install_rpath : rootlibexecdir,
+                                    install : true,
+                                    install_dir : rootlibexecdir)
+
+        systemd_export = executable('systemd-export',
+                                    systemd_export_sources,
+                                    include_directories : includes,
+                                    link_with : [libshared],
+                                    dependencies : [libcurl,
+                                                    libz,
+                                                    libbzip2,
+                                                    libxz],
+                                    install_rpath : rootlibexecdir,
+                                    install : true,
+                                    install_dir : rootlibexecdir)
+        public_programs += [systemd_pull, systemd_import, systemd_export]
+endif
+
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
+        exe = executable('systemd-journal-upload',
+                         systemd_journal_upload_sources,
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [threads,
+                                         libcurl,
+                                         libgnutls,
+                                         libxz,
+                                         liblz4],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootlibexecdir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+        s_j_remote = executable('systemd-journal-remote',
+                                systemd_journal_remote_sources,
+                                include_directories : includes,
+                                link_with : [libshared],
+                                dependencies : [threads,
+                                                libmicrohttpd,
+                                                libgnutls,
+                                                libxz,
+                                                liblz4],
+                                install_rpath : rootlibexecdir,
+                                install : true,
+                                install_dir : rootlibexecdir)
+
+        s_j_gatewayd = executable('systemd-journal-gatewayd',
+                                  systemd_journal_gatewayd_sources,
+                                  include_directories : includes,
+                                  link_with : [libshared],
+                                  dependencies : [threads,
+                                                  libmicrohttpd,
+                                                  libgnutls,
+                                                  libxz,
+                                                  liblz4],
+                                  install_rpath : rootlibexecdir,
+                                  install : true,
+                                  install_dir : rootlibexecdir)
+        public_programs += [s_j_remote, s_j_gatewayd]
+endif
+
+if conf.get('ENABLE_COREDUMP', false)
+        executable('systemd-coredump',
+                   systemd_coredump_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [threads,
+                                   libacl,
+                                   libdw,
+                                   libxz,
+                                   liblz4],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        exe = executable('coredumpctl',
+                         coredumpctl_sources,
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [threads,
+                                         libxz,
+                                         liblz4],
+                         install_rpath : rootlibexecdir,
+                         install : true)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_BINFMT', false)
+        exe = executable('systemd-binfmt',
+                         'src/binfmt/binfmt.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootlibexecdir)
+        public_programs += [exe]
+
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(binfmtdir))
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
+endif
+
+if conf.get('ENABLE_VCONSOLE', false)
+        executable('systemd-vconsole-setup',
+                   'src/vconsole/vconsole-setup.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('ENABLE_RANDOMSEED', false)
+        executable('systemd-random-seed',
+                   'src/random-seed/random-seed.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+if conf.get('ENABLE_FIRSTBOOT', false)
+        executable('systemd-firstboot',
+                   'src/firstboot/firstboot.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libcrypt],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootbindir)
+endif
+
+executable('systemd-remount-fs',
+           'src/remount-fs/remount-fs.c',
+           'src/core/mount-setup.c',
+           'src/core/mount-setup.h',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-machine-id-setup',
+           'src/machine-id-setup/machine-id-setup-main.c',
+           'src/core/machine-id-setup.c',
+           'src/core/machine-id-setup.h',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootbindir)
+
+executable('systemd-fsck',
+           'src/fsck/fsck.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-sleep',
+           'src/sleep/sleep.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-sysctl',
+                 'src/sysctl/sysctl.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootlibexecdir)
+public_programs += [exe]
+
+executable('systemd-ac-power',
+           'src/ac-power/ac-power.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-detect-virt',
+                 'src/detect-virt/detect-virt.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemd-delta',
+                 'src/delta/delta.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemd-escape',
+                 'src/escape/escape.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+exe = executable('systemd-notify',
+                 'src/notify/notify.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+executable('systemd-volatile-root',
+           'src/volatile-root/volatile-root.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-cgroups-agent',
+           'src/cgroups-agent/cgroups-agent.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-path',
+                 'src/path/path.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemd-ask-password',
+                 'src/ask-password/ask-password.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+executable('systemd-reply-password',
+           'src/reply-password/reply-password.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-tty-ask-password-agent',
+                 'src/tty-ask-password-agent/tty-ask-password-agent.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+exe = executable('systemd-cgls',
+                 'src/cgls/cgls.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemd-cgtop',
+                 'src/cgtop/cgtop.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+executable('systemd-initctl',
+           'src/initctl/initctl.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+exe = executable('systemd-mount',
+                 'src/mount/mount-tool.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+meson.add_install_script(meson_make_symlink,
+                         'systemd-mount', join_paths(bindir, 'systemd-umount'))
+
+exe = executable('systemd-run',
+                 'src/run/run.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('systemd-stdio-bridge',
+                 'src/stdio-bridge/stdio-bridge.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+exe = executable('busctl',
+                 'src/busctl/busctl.c',
+                 'src/busctl/busctl-introspect.c',
+                 'src/busctl/busctl-introspect.h',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+if conf.get('ENABLE_SYSUSERS', false)
+        exe = executable('systemd-sysusers',
+                         'src/sysusers/sysusers.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_TMPFILES', false)
+        exe = executable('systemd-tmpfiles',
+                         'src/tmpfiles/tmpfiles.c',
+                         include_directories : includes,
+                         link_with : [libshared],
+                         dependencies : [libacl],
+                         install_rpath : rootlibexecdir,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_HWDB', false)
+        exe = executable('systemd-hwdb',
+                         'src/hwdb/hwdb.c',
+                         'src/libsystemd/sd-hwdb/hwdb-internal.h',
+                         include_directories : includes,
+                         link_with : [libudev_internal],
+                         install_rpath : udev_rpath,
+                         install : true,
+                         install_dir : rootbindir)
+        public_programs += [exe]
+endif
+
+if conf.get('ENABLE_QUOTACHECK', false)
+        executable('systemd-quotacheck',
+                   'src/quotacheck/quotacheck.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+exe = executable('systemd-socket-proxyd',
+                 'src/socket-proxy/socket-proxyd.c',
+                 include_directories : includes,
+                 link_with : [libshared],
+                 dependencies : [threads],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootlibexecdir)
+public_programs += [exe]
+
+exe = executable('systemd-udevd',
+                 systemd_udevd_sources,
+                 include_directories : includes,
+                 link_with : [libudev_core,
+                              libsystemd_network,
+                              libudev_internal],
+                 dependencies : [threads,
+                                 libkmod,
+                                 libidn,
+                                 libacl,
+                                 libblkid],
+                 install_rpath : udev_rpath,
+                 install : true,
+                 install_dir : rootlibexecdir)
+public_programs += [exe]
+
+exe = executable('udevadm',
+                 udevadm_sources,
+                 include_directories : includes,
+                 link_with : [libudev_core,
+                              libsystemd_network,
+                              libudev_internal],
+                 dependencies : [threads,
+                                 libkmod,
+                                 libidn,
+                                 libacl,
+                                 libblkid],
+                 install_rpath : udev_rpath,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+executable('systemd-shutdown',
+           systemd_shutdown_sources,
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-update-done',
+           'src/update-done/update-done.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-update-utmp',
+           'src/update-utmp/update-utmp.c',
+           include_directories : includes,
+           link_with : [libshared],
+           dependencies : [libaudit],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+if conf.get('HAVE_KMOD', false)
+        executable('systemd-modules-load',
+                   'src/modules-load/modules-load.c',
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [libkmod],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(modulesloaddir))
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
+endif
+
+exe = executable('systemd-nspawn',
+                 systemd_nspawn_sources,
+                 'src/core/mount-setup.c', # FIXME: use a variable?
+                 'src/core/mount-setup.h',
+                 'src/core/loopback-setup.c',
+                 'src/core/loopback-setup.h',
+                 include_directories : [includes, include_directories('src/nspawn')],
+                 link_with : [libshared],
+                 dependencies : [libacl,
+                                 libblkid,
+                                 libseccomp,
+                                 libselinux],
+                 install_rpath : rootlibexecdir,
+                 install : true)
+public_programs += [exe]
+
+if conf.get('ENABLE_NETWORKD', false)
+        executable('systemd-networkd',
+                   systemd_networkd_sources,
+                   include_directories : includes,
+                   link_with : [libnetworkd_core,
+                                libsystemd_network,
+                                libudev_internal,
+                                libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        executable('systemd-networkd-wait-online',
+                   systemd_networkd_wait_online_sources,
+                   include_directories : includes,
+                   link_with : [libnetworkd_core,
+                                libshared],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+endif
+
+exe = executable('networkctl',
+                 networkctl_sources,
+                 include_directories : includes,
+                 link_with : [libsystemd_network,
+                              libshared],
+                 install_rpath : rootlibexecdir,
+                 install : true,
+                 install_dir : rootbindir)
+public_programs += [exe]
+
+############################################################
+
+foreach tuple : tests
+        sources = tuple[0]
+        link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
+        dependencies = tuple[2]
+        condition = tuple.length() >= 4 ? tuple[3] : ''
+        type = tuple.length() >= 5 ? tuple[4] : ''
+        defs = tuple.length() >= 6 ? tuple[5] : []
+        incs = tuple.length() >= 7 ? tuple[6] : includes
+        timeout = 30
+
+        name = sources[0].split('/')[-1].split('.')[0]
+        if type.startswith('timeout=')
+                timeout = type.split('=')[1].to_int()
+                type = ''
+        endif
+
+        if condition == '' or conf.get(condition, false)
+                install = install_tests and type == ''
+
+                exe = executable(
+                        name,
+                        sources,
+                        include_directories : incs,
+                        link_with : link_with,
+                        dependencies : dependencies,
+                        c_args : defs,
+                        install_rpath : rootlibexecdir,
+                        install : install,
+                        install_dir : testsdir)
+
+                if type == 'manual'
+                        message('@0@ is a manual test'.format(name))
+                elif type == 'unsafe' and want_tests != 'unsafe'
+                        message('@0@ is an unsafe test'.format(name))
+                else
+                        test(name, exe,
+                             env : test_env,
+                             timeout : timeout)
+                endif
+        else
+                message('Not compiling @0@ because @1@ is not true'.format(name, condition))
+        endif
+endforeach
+
+test_libsystemd_sym = executable(
+        'test-libsystemd-sym',
+        test_libsystemd_sym_c,
+        include_directories : includes,
+        link_with : [libsystemd],
+        install : install_tests,
+        install_dir : testsdir)
+test('test-libsystemd-sym',
+     test_libsystemd_sym)
+
+test_libudev_sym = executable(
+        'test-libudev-sym',
+        test_libudev_sym_c,
+        include_directories : includes,
+        c_args : ['-Wno-deprecated-declarations'],
+        link_with : [libudev],
+        install : install_tests,
+        install_dir : testsdir)
+test('test-libudev-sym',
+     test_libudev_sym)
+
+############################################################
+
+make_directive_index_py = find_program('tools/make-directive-index.py')
+make_man_index_py = find_program('tools/make-man-index.py')
+xml_helper_py = find_program('tools/xml_helper.py')
+hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
+
+subdir('units')
+subdir('sysctl.d')
+subdir('sysusers.d')
+subdir('tmpfiles.d')
+subdir('rules')
+subdir('hwdb')
+subdir('network')
+subdir('man')
+subdir('shell-completion/bash')
+subdir('shell-completion/zsh')
+subdir('docs/sysvinit')
+subdir('docs/var-log')
+
+# FIXME: figure out if the warning is true:
+# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
+install_subdir('factory/etc',
+               install_dir : factorydir)
+
+
+install_data('xorg/50-systemd-user.sh',
+             install_dir : xinitrcdir)
+install_data('system-preset/90-systemd.preset',
+             install_dir : systempresetdir)
+install_data('README',
+             'NEWS',
+             'CODING_STYLE',
+             'DISTRO_PORTING',
+             'ENVIRONMENT.md',
+             'LICENSE.GPL2',
+             'LICENSE.LGPL2.1',
+             'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
+             install_dir : docdir)
+
+meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
+meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
+
+############################################################
+
+meson_check_help = find_program('tools/meson-check-help.sh')
+
+foreach exec : public_programs
+        name = exec.full_path().split('/')[-1]
+        test('check-help-' + name,
+             meson_check_help,
+             args : [exec.full_path()])
+endforeach
+
+############################################################
+
+if git.found() and etags.found()
+        all_files = run_command(
+                git,
+                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                 'ls-files',
+                 ':/*.[ch]'])
+        all_files = files(all_files.stdout().split())
+
+        custom_target(
+                'TAGS',
+                output : 'TAGS',
+                input : all_files,
+                command : [etags, '-o', '@OUTPUT@'] + all_files)
+endif
+
+if git.found()
+        meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
+        run_target(
+                'git-contrib',
+                command : [meson_git_contrib_sh])
+endif
+
+if git.found()
+        git_head = run_command(
+                git,
+                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                 'rev-parse', 'HEAD']).stdout().strip()
+        git_head_short = run_command(
+                git,
+                ['--git-dir=@0@/.git'.format(meson.source_root()),
+                 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
+
+        run_target(
+                'git-snapshot',
+                command : ['git', 'archive',
+                           '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
+                                                                 git_head_short),
+                           '--prefix', 'systemd-@0@/'.format(git_head),
+                           'HEAD'])
+endif
+
+############################################################
+
+status = [
+        '@0@ @1@'.format(meson.project_name(), meson.project_version()),
+
+        'prefix:                            @0@'.format(prefixdir),
+        'rootprefix:                        @0@'.format(rootprefixdir),
+        'sysconf dir:                       @0@'.format(sysconfdir),
+        'includedir:                        @0@'.format(includedir),
+        'lib dir:                           @0@'.format(libdir),
+        'rootlib dir:                       @0@'.format(rootlibdir),
+        'SysV init scripts:                 @0@'.format(sysvinit_path),
+        'SysV rc?.d directories:            @0@'.format(sysvrcnd_path),
+        'PAM modules dir:                   @0@'.format(pamlibdir),
+        'PAM configuration dir:             @0@'.format(pamconfdir),
+        'RPM macros dir:                    @0@'.format(rpmmacrosdir),
+        'D-Bus policy dir:                  @0@'.format(dbuspolicydir),
+        'D-Bus session dir:                 @0@'.format(dbussessionservicedir),
+        'D-Bus system dir:                  @0@'.format(dbussystemservicedir),
+        'bash completions dir:              @0@'.format(bashcompletiondir),
+        'zsh completions dir:               @0@'.format(zshcompletiondir),
+        'extra start script:                @0@'.format(get_option('rc-local')),
+        'extra stop script:                 @0@'.format(get_option('halt-local')),
+        'debug shell:                       @0@ @ @1@'.format(get_option('debug-shell'),
+                                                              get_option('debug-tty')),
+        'TTY GID:                           @0@'.format(tty_gid),
+        'maximum system UID:                @0@'.format(system_uid_max),
+        'maximum system GID:                @0@'.format(system_gid_max),
+        '/dev/kvm access mode:              @0@'.format(get_option('dev-kvm-mode')),
+        'certificate root:                  @0@'.format(get_option('certificate-root')),
+        'support URL:                       @0@'.format(support_url),
+        'nobody user name:                  @0@'.format(get_option('nobody-user')),
+        'nobody group name:                 @0@'.format(get_option('nobody-group')),
+        'fallback hostname:                 @0@'.format(get_option('fallback-hostname')),
+
+        'default DNSSEC mode:               @0@'.format(default_dnssec),
+        'default cgroup hierarchy:          @0@'.format(default_hierarchy),
+        'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
+
+alt_dns_servers = '\n                                            '.join(dns_servers.split(' '))
+alt_ntp_servers = '\n                                            '.join(ntp_servers.split(' '))
+status += [
+        'default DNS servers:               @0@'.format(alt_dns_servers),
+        'default NTP servers:               @0@'.format(alt_ntp_servers)]
+
+alt_time_epoch = run_command('date', '-Is', '-u', '-d',
+                             '@@0@'.format(time_epoch)).stdout().strip()
+status += [
+        'time epoch:                        @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
+
+# TODO:
+# CFLAGS:   ${OUR_CFLAGS} ${CFLAGS}
+# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
+# LDFLAGS:  ${OUR_LDFLAGS} ${LDFLAGS}
+
+if conf.get('ENABLE_EFI', false)
+        status += [
+                'efi arch:                          @0@'.format(efi_arch)]
+
+        if have_gnu_efi
+                status += [
+                        'EFI machine type:                  @0@'.format(EFI_MACHINE_TYPE_NAME),
+                        'EFI CC                             @0@'.format(efi_cc),
+                        'EFI libdir:                        @0@'.format(efi_libdir),
+                        'EFI ldsdir:                        @0@'.format(efi_ldsdir),
+                        'EFI includedir:                    @0@'.format(efi_incdir)]
+        endif
+endif
+
+found = []
+missing = []
+
+foreach tuple : [
+        ['libcryptsetup'],
+        ['PAM'],
+        ['AUDIT'],
+        ['IMA'],
+        ['AppArmor'],
+        ['SELinux'],
+        ['SECCOMP'],
+        ['SMACK'],
+        ['zlib'],
+        ['xz'],
+        ['lz4'],
+        ['bzip2'],
+        ['ACL'],
+        ['gcrypt'],
+        ['qrencode'],
+        ['microhttpd'],
+        ['gnutls'],
+        ['libcurl'],
+        ['libidn'],
+        ['libiptc'],
+        ['elfutils'],
+        ['binfmt'],
+        ['vconsole'],
+        ['quotacheck'],
+        ['tmpfiles'],
+        ['environment.d'],
+        ['sysusers'],
+        ['firstboot'],
+        ['randomseed'],
+        ['backlight'],
+        ['rfkill'],
+        ['logind'],
+        ['machined'],
+        ['importd'],
+        ['hostnamed'],
+        ['timedated'],
+        ['timesyncd'],
+        ['localed'],
+        ['networkd'],
+        ['resolved'],
+        ['coredump'],
+        ['polkit'],
+        ['legacy pkla',      install_polkit_pkla],
+        ['efi'],
+        ['gnu-efi',          have_gnu_efi],
+        ['kmod'],
+        ['xkbcommon'],
+        ['blkid'],
+        ['dbus'],
+        ['glib'],
+        ['nss-myhostname',   conf.get('HAVE_MYHOSTNAME', false)],
+        ['hwdb'],
+        ['tpm'],
+        ['man pages',        want_man],
+        ['html pages',       want_html],
+        ['man page indices', want_man and have_lxml],
+        ['split /usr',       conf.get('HAVE_SPLIT_USR', false)],
+        ['SysV compat'],
+        ['utmp'],
+        ['ldconfig'],
+        ['hibernate'],
+        ['adm group',        get_option('adm-group')],
+        ['wheel group',      get_option('wheel-group')],
+        ['debug hashmap'],
+        ['debug mmap cache'],
+]
+
+        cond = tuple.get(1, '')
+        if cond == ''
+                ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
+                ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
+                cond = conf.get(ident1, false) or conf.get(ident2, false)
+        endif
+        if cond
+                found += [tuple[0]]
+        else
+                missing += [tuple[0]]
+        endif
+endforeach
+
+status += [
+        'enabled features: @0@'.format(', '.join(found)),
+        'disabled features: @0@'.format(', '.join(missing))]
+message('\n         '.join(status))
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644 (file)
index 0000000..4e99b25
--- /dev/null
@@ -0,0 +1,248 @@
+# -*- mode: meson -*-
+
+option('split-usr', type : 'boolean', value : false,
+       description : '''assume that /bin, /sbin aren't symlinks into /usr''')
+option('rootlibdir', type : 'string',
+       description : '''[/usr]/lib/x86_64-linux-gnu or such''')
+option('rootprefix', type : 'string',
+       description : '''override the root prefix''')
+option('link-udev-shared', type : 'boolean',
+       description : 'link systemd-udev and its helpers to libsystemd-shared.so')
+
+option('sysvinit-path', type : 'string', value : '/etc/init.d',
+       description : 'the directory where the SysV init scripts are located')
+option('sysvrcnd-path', type : 'string', value : '/etc/rc.d',
+       description : 'the base directory for SysV rcN.d directories')
+option('telinit-path', type : 'string', description : 'path to telinit')
+option('rc-local', type : 'string',
+       value : '/etc/rc.local')
+option('halt-local', type : 'string',
+       value : '/usr/sbin/halt.local')
+
+option('quotaon-path', type : 'string', description : 'path to quotaon')
+option('quotacheck-path', type : 'string', description : 'path to quotacheck')
+option('kill-path', type : 'string', description : 'path to kill')
+option('kmod-path', type : 'string', description : 'path to kmod')
+option('kexec-path', type : 'string', description : 'path to kexec')
+option('sulogin-path', type : 'string', description : 'path to sulogin')
+option('mount-path', type : 'string', description : 'path to mount')
+option('umount-path', type : 'string', description : 'path to umount')
+option('loadkeys-path', type : 'string', description : 'path to loadkeys')
+option('setfont-path', type : 'string', description : 'path to setfont')
+
+option('debug-shell', type : 'string', value : '/bin/sh',
+       description : 'path to debug shell binary')
+option('debug-tty', type : 'string', value : '/dev/tty9',
+       description : 'specify the tty device for debug shell')
+option('debug', type : 'string',
+       description : 'enable extra debugging (hashmap,mmap-cache)')
+
+option('utmp', type : 'boolean',
+       description : 'support for utmp/wtmp log handling')
+option('hibernate', type : 'boolean',
+       description : 'support for hibernation')
+option('ldconfig', type : 'boolean',
+       description : 'support for dynamic linker cache creation')
+option('resolve', type : 'boolean',
+       description : 'systemd-resolved stack')
+option('efi', type : 'boolean',
+       description : 'enable systemd-boot and bootctl')
+option('tpm', type : 'boolean', value : false,
+       description : 'TPM should be used to log events and extend the registers')
+option('environment-d', type : 'boolean',
+       description : 'support for environment.d')
+option('binfmt', type : 'boolean',
+       description : 'support for custom binary formats')
+option('coredump', type : 'boolean',
+       description : 'install the coredump handler')
+option('logind', type : 'boolean',
+       description : 'install the systemd-logind stack')
+option('hostnamed', type : 'boolean',
+       description : 'install the systemd-hostnamed stack')
+option('localed', type : 'boolean',
+       description : 'install the systemd-localed stack')
+option('machined', type : 'boolean',
+       description : 'install the systemd-machined stack')
+option('networkd', type : 'boolean',
+       description : 'install the systemd-networkd stack')
+option('timedated', type : 'boolean',
+       description : 'install the systemd-timedated daemon')
+option('timesyncd', type : 'boolean',
+       description : 'install the systemd-timesyncd daemon')
+option('remote', type : 'boolean',
+       description : 'support for "journal over the network"')
+option('myhostname', type : 'boolean',
+       description : 'nss-myhostname support')
+option('firstboot', type : 'boolean',
+       description : 'support for firstboot mechanism')
+option('randomseed', type : 'boolean',
+       description : 'support for restoring random seed')
+option('backlight', type : 'boolean',
+       description : 'support for restoring backlight state')
+option('vconsole', type : 'boolean',
+       description : 'support for vconsole configuration')
+option('quotacheck', type : 'boolean',
+       description : 'support for the quotacheck tools')
+option('sysusers', type : 'boolean',
+       description : 'support for the sysusers configuration')
+option('tmpfiles', type : 'boolean',
+       description : 'support for tmpfiles.d')
+option('importd', type : 'boolean',
+       description : 'install the systemd-importd daemon')
+option('hwdb', type : 'boolean',
+       description : 'support for the hardware database')
+option('rfkill', type : 'boolean',
+       description : 'support for the rfkill tools')
+option('man', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'build and install man pages')
+option('html', type : 'combo', choices : ['auto', 'true', 'false'],
+       value : 'false',
+       description : 'build and install html pages')
+
+option('certificate-root', type : 'string', value : '/etc/ssl',
+       description : 'the prefix for TLS certificates')
+option('dbuspolicydir', type : 'string',
+       description : 'D-Bus policy directory')
+option('dbussessionservicedir', type : 'string',
+       description : 'D-Bus session service directory')
+option('dbussystemservicedir', type : 'string',
+       description : 'D-Bus system service directory')
+option('pkgconfigdatadir', type : 'string', value : 'share/pkgconfig',
+       description : 'directory for ')
+option('pkgconfiglibdir', type : 'string', value : '',
+       description : 'directory for ')
+option('rpmmacrosdir', type : 'string', value : 'lib/rpm/macros.d',
+       description : 'directory for rpm macros ["no" disables]')
+option('pamlibdir', type : 'string',
+       description : 'directory for PAM modules')
+option('pamconfdir', type : 'string',
+       description : 'directory for PAM configuration ["no" disables]')
+
+option('fallback-hostname', type : 'string', value : 'localhost',
+       description : 'the hostname used if none configured')
+option('default-hierarchy', type : 'combo',
+       choices : ['legacy', 'hybrid', 'unified'], value : 'hybrid',
+       description : 'default cgroup hierarchy')
+option('time-epoch', type : 'string',
+       description : 'time epoch for time clients')
+option('system-uid-max', type : 'string',
+       description : 'maximum system UID')
+option('system-gid-max', type : 'string',
+       description : 'maximum system GID')
+option('tty-gid', type : 'string',
+       description : 'the numeric GID of the "tty" group',
+       value : '5')
+option('adm-group', type : 'boolean',
+       description : 'the ACL for adm group should be added')
+option('wheel-group', type : 'boolean',
+       description : 'the ACL for wheel group should be added')
+option('nobody-user', type : 'string',
+       description : 'The name of the nobody user (the one with UID 65534)',
+       value : 'nobody')
+option('nobody-group', type : 'string',
+       description : 'The name of the nobody group (the one with GID 65534)',
+       value : 'nobody')
+option('dev-kvm-mode', type : 'string', value : '0660',
+       description : '/dev/kvm access mode')
+option('default-kill-user-processes', type : 'boolean',
+       description : 'the default value for KillUserProcesses= setting')
+
+option('default-dnssec', type : 'combo',
+       description : 'default DNSSEC mode',
+       choices : ['yes', 'allow-downgrade', 'no'],
+       value : 'allow-downgrade')
+option('dns-servers', type : 'string',
+       description : 'space-separated list of default DNS servers',
+       value : '8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844')
+option('ntp-servers', type : 'string',
+       description : 'space-separated list of default NTP servers',
+       value : 'time1.google.com time2.google.com time3.google.com time4.google.com')
+option('support-url', type : 'string',
+       description : 'the support URL to show in catalog entries included in systemd',
+       value : 'https://lists.freedesktop.org/mailman/listinfo/systemd-devel')
+option('www-target', type : 'string',
+       description : 'the address and dir to upload docs too',
+       value : 'www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd')
+
+option('seccomp', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'SECCOMP support')
+option('selinux', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'SELinux support')
+option('apparmor', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'AppArmor support')
+option('smack', type : 'boolean',
+       description : 'SMACK support')
+option('smack-run-label', type : 'string',
+       description : 'run systemd --system itself with a specific SMACK label')
+option('polkit', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'PolicyKit support')
+option('ima', type : 'boolean',
+       description : 'IMA support')
+
+option('acl', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libacl support')
+option('audit', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libaudit support')
+option('blkid', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libblkid support')
+option('kmod', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'support for loadable modules')
+option('pam', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'PAM support')
+option('microhttpd', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libµhttpd support')
+option('libcryptsetup', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libcryptsetup support')
+option('libcurl', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libcurl support')
+option('libidn', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libidn support')
+option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libiptc support')
+option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libqrencode support')
+option('gcrypt', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'gcrypt support')
+option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'gnutls support')
+option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'elfutils support')
+option('zlib', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'zlib compression support')
+option('bzip2', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'bzip2 compression support')
+option('xz', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'xz compression support')
+option('lz4', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'lz4 compression support')
+option('xkbcommon', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'xkbcommon keymap support')
+option('glib', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libglib support (for tests only)')
+option('dbus', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'libdbus support (for tests only)')
+
+option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'gnu-efi support for sd-boot')
+option('efi-cc', type : 'string', value : 'gcc',
+       description : 'the compiler to use for EFI modules')
+option('efi-ld', type : 'string', value : 'ld',
+       description : 'the linker to use for EFI modules')
+option('efi-libdir', type : 'string',
+       description : 'path to the EFI lib directory')
+option('efi-ldsdir', type : 'string',
+       description : 'path to the EFI lds directory')
+option('efi-includedir', type : 'string', value : '/usr/include/efi',
+       description : 'path to the EFI header directory')
+option('tpm-pcrindex', type : 'string', value : '8',
+       description : 'TPM PCR register number to use')
+
+option('bashcompletiondir', type : 'string',
+       description : 'directory for bash completion scripts ["no" disables]')
+option('zshcompletiondir', type : 'string',
+       description : 'directory for zsh completion scripts ["no" disables]')
+
+option('tests', type : 'combo', choices : ['true', 'unsafe'],
+       description : 'enable extra tests with =unsafe')
+option('install-tests', type : 'boolean', value : 'false',
+       description : 'install test executables')
index 872841eb63e39e0b2386c46c9c22558646666713..2231118da5f489b80a0de59ef58c7b226b70db6a 100755 (executable)
 # This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
 # Simply invoke "mkosi" in the project directory to build an OS image.
 
-./autogen.sh c
-make -j `nproc`
-
-make check
-make install
+export LC_CTYPE=C.UTF-8
+meson build
+ninja -C build all
+ninja -C build test
+ninja -C build install
 
 mkdir -p $DESTDIR/etc
 
diff --git a/network/meson.build b/network/meson.build
new file mode 100644 (file)
index 0000000..e9f9bba
--- /dev/null
@@ -0,0 +1,12 @@
+if conf.get('ENABLE_NETWORKD', false)
+        install_data('80-container-host0.network',
+                     '80-container-ve.network',
+                     '80-container-vz.network',
+                     install_dir : networkdir)
+
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format(join_paths(sysconfdir, 'systemd/network')))
+endif
+
+install_data('99-default.link',
+             install_dir : networkdir)
index 014ed4266ce82015e6b976d52185d8e34dcdd91e..5f294f897c06405aa805f66818b520d88eff37be 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,15 +1,15 @@
 # Czech translation for systemd.
-# Copyright (C) 2016 systemd's author and translators.
+# Copyright (C) 2016-2017 systemd's author and translators.
 # This file is distributed under the same license as the systemd package.
-# Daniel Maixner <xskipy@gmail.com>, 2016
-# Daniel Rusek <mail@asciiwolf.com>, 2016
+# Daniel Maixner <xskipy@gmail.com>, 2016.
+# Daniel Rusek <mail@asciiwolf.com>, 2016, 2017.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: systemd master\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-04-23 14:24+0200\n"
-"PO-Revision-Date: 2017-02-07 18:38+0100\n"
+"PO-Revision-Date: 2017-04-20 23:00+0200\n"
 "Last-Translator: Daniel Rusek <mail@asciiwolf.com>\n"
 "Language: cs\n"
 "MIME-Version: 1.0\n"
@@ -26,36 +26,35 @@ msgstr "Odeslat heslo zpět do systému"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:2
 msgid "Authentication is required to send the entered passphrase back to the system."
-msgstr "Autentizace je vyžadována pro odeslání zadaného hesla do systému."
+msgstr "Pro odeslání zadaného hesla do systému je vyžadováno ověření."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3
 msgid "Manage system services or other units"
-msgstr "Správa systémových služeb nebo dalších jednotek"
+msgstr "Spravovat systémové služby nebo další jednotky"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4
 msgid "Authentication is required to manage system services or other units."
-msgstr ""
-"Autentizace je vyžadována pro správu systémových služeb nebo dalších jednotek."
+msgstr "Pro správu systémových služeb nebo dalších jednotek je vyžadováno ověření."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5
 msgid "Manage system service or unit files"
-msgstr "Správa systémové služby nebo souborů jednotky"
+msgstr "Spravovat systémové služby nebo soubory jednotek"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6
 msgid "Authentication is required to manage system service or unit files."
-msgstr "Autentizace je vyžadována pro správu systémové služby nebo souborů jednotky."
+msgstr "Pro správu systémových služeb nebo souborů jednotek je vyžadováno ověření."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7
 msgid "Set or unset system and service manager environment variables"
-msgstr "Nastavení nebo rušení proměnných správce systému a služeb"
+msgstr "Nastavit nebo rušit proměnné správce systému a služeb"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8
 msgid ""
 "Authentication is required to set or unset system and service manager environment "
 "variables."
 msgstr ""
-"Autentizace je vyžadována pro nastavení nebo rušení proměnných správce systému a "
-"služeb."
+"Pro nastavení nebo rušení proměnných správce systému a služeb je vyžadováno "
+"ověření."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9
 msgid "Reload the systemd state"
@@ -63,53 +62,51 @@ msgstr "Znovu načíst stav systemd"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:10
 msgid "Authentication is required to reload the systemd state."
-msgstr "Autentizace je vyžadována pro znovu načtení stavu systemd."
+msgstr "Pro znovu načtení stavu systemd je vyžadováno ověření."
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:1
 msgid "Set host name"
-msgstr "Nastavení názvu stroje"
+msgstr "Nastavit název stroje"
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:2
 msgid "Authentication is required to set the local host name."
-msgstr "Autentizace je vyžadována pro nastavení lokálního názvu stroje."
+msgstr "Pro nastavení lokálního názvu stroje je vyžadováno ověření."
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:3
 msgid "Set static host name"
-msgstr "Nastavení statického názvu stoje"
+msgstr "Nastavit statický název stoje"
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:4
 msgid ""
 "Authentication is required to set the statically configured local host name, as "
 "well as the pretty host name."
 msgstr ""
-"Autentizace je vyžadována pro nastavení staticky konfigurovaného názvu lokálního "
-"stroje, stejně tak pro změnu uživatelsky přívětivého jména."
+"Pro nastavení staticky konfigurovaného názvu lokálního stroje, stejně tak pro "
+"změnu uživatelsky přívětivého jména je vyžadováno ověření."
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:5
 msgid "Set machine information"
-msgstr "Nastavení informací o stroji"
+msgstr "Nastavit informace o stroji"
 
 #: ../src/hostname/org.freedesktop.hostname1.policy.in.h:6
 msgid "Authentication is required to set local machine information."
-msgstr "Autentizace je vyžadována pro nastavení informací o stroji."
+msgstr "Pro nastavení informací o stroji je vyžadováno ověření."
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:1
 msgid "Import a VM or container image"
-msgstr "Import obrazu virtuální stroje nebo kontejneru"
+msgstr "Importovat obraz virtuální stroje nebo kontejneru"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:2
 msgid "Authentication is required to import a VM or container image"
-msgstr ""
-"Autentizace je vyžadována pro import obrazu virtuálního stroje nebo kontejneru"
+msgstr "Pro import obrazu virtuálního stroje nebo kontejneru je vyžadováno ověření"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:3
 msgid "Export a VM or container image"
-msgstr "Export obrazu virtuálního stroje nebo kontejneru"
+msgstr "Exportovat obraz virtuálního stroje nebo kontejneru"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:4
 msgid "Authentication is required to export a VM or container image"
-msgstr ""
-"Autentizace je vyžadována pro export obrazu virtuálního stroje nebo kontejneru"
+msgstr "Pro export obrazu virtuálního stroje nebo kontejneru je vyžadováno ověření"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:5
 msgid "Download a VM or container image"
@@ -117,24 +114,23 @@ msgstr "Stáhnout obraz virtuálního stroje nebo kontejneru"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:6
 msgid "Authentication is required to download a VM or container image"
-msgstr ""
-"Autentizace je vyžadována pro stažení obrazu virtuálního stroje nebo kontejneru"
+msgstr "Pro stažení obrazu virtuálního stroje nebo kontejneru je vyžadováno ověření"
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:1
 msgid "Set system locale"
-msgstr "Nastavení lokalizace systému"
+msgstr "Nastavit lokalizaci systému"
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:2
 msgid "Authentication is required to set the system locale."
-msgstr "Autentizace je vyžadována pro nastavení lokalizace systému."
+msgstr "Pro nastavení lokalizace systému je vyžadováno ověření."
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:3
 msgid "Set system keyboard settings"
-msgstr "Nastavení systémové konfigurace klávesnice"
+msgstr "Nastavit systémovou konfiguraci klávesnice"
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:4
 msgid "Authentication is required to set the system keyboard settings."
-msgstr "Autentizace je vyžadována pro nastavení systémové konfigurace klávesnice."
+msgstr "Pro nastavení systémové konfigurace klávesnice je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:1
 msgid "Allow applications to inhibit system shutdown"
@@ -142,7 +138,7 @@ msgstr "Povolit aplikacím zakázat vypnutí systému"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:2
 msgid "Authentication is required for an application to inhibit system shutdown."
-msgstr "Autentizace je vyžadována pro povolení aplikacím zakázat vypnutí systému."
+msgstr "Pro povolení aplikacím zakázat vypnutí systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:3
 msgid "Allow applications to delay system shutdown"
@@ -150,7 +146,7 @@ msgstr "Povolit aplikacím odložit vypnutí systému"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:4
 msgid "Authentication is required for an application to delay system shutdown."
-msgstr "Autentizace je vyžadována pro povolení aplikacím odložit vypnutí systému."
+msgstr "Pro povolení aplikacím odložit vypnutí systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:5
 msgid "Allow applications to inhibit system sleep"
@@ -158,7 +154,7 @@ msgstr "Povolit aplikacím zakázat uspání systému"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:6
 msgid "Authentication is required for an application to inhibit system sleep."
-msgstr "Autentizace je vyžadována pro povolení aplikacím zakázat uspání systému."
+msgstr "Pro povolení aplikacím zakázat uspání systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:7
 msgid "Allow applications to delay system sleep"
@@ -166,7 +162,7 @@ msgstr "Povolit aplikacím odložit uspání systému"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:8
 msgid "Authentication is required for an application to delay system sleep."
-msgstr "Autentizace je vyžadována pro povolení aplikacím odložit uspání systému."
+msgstr "Pro povolení aplikacím odložit uspání systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:9
 msgid "Allow applications to inhibit automatic system suspend"
@@ -176,8 +172,7 @@ msgstr "Povolit aplikacím zakázat automatické vypnutí systému"
 msgid ""
 "Authentication is required for an application to inhibit automatic system suspend."
 msgstr ""
-"Autentizace je vyžadována pro povolení aplikacím zakázat automatické vypnutí "
-"systému."
+"Pro povolení aplikacím zakázat automatické vypnutí systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:11
 msgid "Allow applications to inhibit system handling of the power key"
@@ -188,8 +183,8 @@ msgid ""
 "Authentication is required for an application to inhibit system handling of the "
 "power key."
 msgstr ""
-"Autentizace je vyžadována pro povolení aplikacím zakázat chovaní systému na "
-"stisknutí vypínacího tlačítka."
+"Pro povolení aplikacím zakázat chovaní systému na stisknutí vypínacího tlačítka je "
+"vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:13
 msgid "Allow applications to inhibit system handling of the suspend key"
@@ -200,8 +195,8 @@ msgid ""
 "Authentication is required for an application to inhibit system handling of the "
 "suspend key."
 msgstr ""
-"Autentizace je vyžadována pro povolení aplikacím zakázat chovaní systému na "
-"stisknutí uspávacího tlačítka."
+"Pro povolení aplikacím zakázat chovaní systému na stisknutí uspávacího tlačítka je "
+"vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:15
 msgid "Allow applications to inhibit system handling of the hibernate key"
@@ -212,8 +207,8 @@ msgid ""
 "Authentication is required for an application to inhibit system handling of the "
 "hibernate key."
 msgstr ""
-"Autentizace je vyžadována pro povolení aplikacím zakázat chovaní systému na "
-"stisknutí tlačítka hibernace."
+"Pro povolení aplikacím zakázat chovaní systému na stisknutí tlačítka hibernace je "
+"vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:17
 msgid "Allow applications to inhibit system handling of the lid switch"
@@ -224,8 +219,8 @@ msgid ""
 "Authentication is required for an application to inhibit system handling of the "
 "lid switch."
 msgstr ""
-"Autentizace je vyžadována pro povolení aplikacím zakázat chovaní systému na "
-"zavření víka."
+"Pro povolení aplikacím zakázat chovaní systému na zavření víka je vyžadováno "
+"ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:19
 msgid "Allow non-logged-in user to run programs"
@@ -234,7 +229,7 @@ msgstr "Povolit nepřihlášenému uživateli spouštět programy"
 #: ../src/login/org.freedesktop.login1.policy.in.h:20
 msgid "Explicit request is required to run programs as a non-logged-in user."
 msgstr ""
-"Speciální požadavek je třeba ke spuštění programů jako nepřihlášený uživatel."
+"Ke spuštění programů jako nepřihlášený uživatel je třeba speciální požadavek."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:21
 msgid "Allow non-logged-in users to run programs"
@@ -242,33 +237,33 @@ msgstr "Povolit nepřihlášeným uživatelům spouštět programy"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:22
 msgid "Authentication is required to run programs as a non-logged-in user."
-msgstr "Autentizace je vyžadována ke spuštění programů jako nepřihlášený uživatel."
+msgstr "Ke spuštění programů jako nepřihlášený uživatel je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:23
 msgid "Allow attaching devices to seats"
-msgstr "Povolit připojování zařízení ke stanovišti"
+msgstr "Povolit připojování zařízení ke stanovištím"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:24
 msgid "Authentication is required for attaching a device to a seat."
-msgstr "Autentizace je vyžadována pro připojování zařízení ke stanovišti."
+msgstr "Pro připojování zařízení ke stanovišti je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:25
 msgid "Flush device to seat attachments"
-msgstr "Odstranění přiřazení zařízení ke stanovištím"
+msgstr "Odstranit přiřazení zařízení ke stanovištím"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:26
 msgid "Authentication is required for resetting how devices are attached to seats."
 msgstr ""
-"Autentizace je vyžadována pro reset způsobu jak jsou zařízení přiřazována ke "
-"stanovištím."
+"Pro reset způsobu jak jsou zařízení přiřazována ke stanovištím je vyžadováno "
+"ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:27
 msgid "Power off the system"
-msgstr "Vypnutí systému"
+msgstr "Vypnout systém"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:28
 msgid "Authentication is required for powering off the system."
-msgstr "Autentizace je vyžadována pro vypnutí systému."
+msgstr "Pro vypnutí systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:29
 msgid "Power off the system while other users are logged in"
@@ -279,8 +274,7 @@ msgid ""
 "Authentication is required for powering off the system while other users are "
 "logged in."
 msgstr ""
-"Autentizace je vyžadována pro vypnutí systému, když jsou přihlášeni další "
-"uživatelé."
+"Pro vypnutí systému, když jsou přihlášeni další uživatelé je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:31
 msgid "Power off the system while an application asked to inhibit it"
@@ -291,8 +285,7 @@ msgid ""
 "Authentication is required for powering off the system while an application asked "
 "to inhibit it."
 msgstr ""
-"Autentizace je vyžadována pro vypnutí systému, když aplikace požádala o zákaz "
-"vypnutí."
+"Pro vypnutí systému, když aplikace požádala o zákaz vypnutí je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:33
 msgid "Reboot the system"
@@ -300,7 +293,7 @@ msgstr "Restartovat systém"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:34
 msgid "Authentication is required for rebooting the system."
-msgstr "Autentizace je vyžadována pro restartovaní systému."
+msgstr "Pro restartování systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:35
 msgid "Reboot the system while other users are logged in"
@@ -311,8 +304,8 @@ msgid ""
 "Authentication is required for rebooting the system while other users are logged "
 "in."
 msgstr ""
-"Autentizace je vyžadována pro restart systému, když jsou přihlášeni další "
-"uživatelé."
+"Pro restartování systému, když jsou přihlášeni další uživatelé je vyžadováno "
+"ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:37
 msgid "Reboot the system while an application asked to inhibit it"
@@ -323,16 +316,16 @@ msgid ""
 "Authentication is required for rebooting the system while an application asked to "
 "inhibit it."
 msgstr ""
-"Autentizace je vyžadována pro restart systému, když aplikace požádala o zákaz "
-"restartu."
+"Pro restartování systému, když aplikace požádala o zákaz restartu je vyžadováno "
+"ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:39
 msgid "Suspend the system"
-msgstr "Uspání systému"
+msgstr "Uspat systém"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:40
 msgid "Authentication is required for suspending the system."
-msgstr "Autentizace je vyžadována pro uspání systému."
+msgstr "Pro uspání systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:41
 msgid "Suspend the system while other users are logged in"
@@ -343,7 +336,7 @@ msgid ""
 "Authentication is required for suspending the system while other users are logged "
 "in."
 msgstr ""
-"Autentizace je vyžadována pro uspání systému, když jsou přihlášeni další uživatelé."
+"Pro uspání systému, když jsou přihlášeni další uživatelé je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:43
 msgid "Suspend the system while an application asked to inhibit it"
@@ -354,16 +347,15 @@ msgid ""
 "Authentication is required for suspending the system while an application asked to "
 "inhibit it."
 msgstr ""
-"Autentizace je vyžadována pro uspání systému, když aplikace požádala o zákaz "
-"uspání."
+"Pro uspání systému, když aplikace požádala o zákaz uspání je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:45
 msgid "Hibernate the system"
-msgstr "Hibernace systému"
+msgstr "Hibernovat systém"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:46
 msgid "Authentication is required for hibernating the system."
-msgstr "Autentizace je vyžadována k hibernaci systému."
+msgstr "Pro hibernaci systému je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:47
 msgid "Hibernate the system while other users are logged in"
@@ -374,37 +366,35 @@ msgid ""
 "Authentication is required for hibernating the system while other users are logged "
 "in."
 msgstr ""
-"Autentizace je vyžadována pro hibernaci systému, když jsou přihlášeni další "
-"uživatelé."
+"Pro hibernaci systému, když jsou přihlášeni další uživatelé je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:49
 msgid "Hibernate the system while an application asked to inhibit it"
-msgstr "Hibernace systému, i když aplikace požádala o zákaz hibernace"
+msgstr "Hibernovat systém, i když aplikace požádala o zákaz hibernace"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:50
 msgid ""
 "Authentication is required for hibernating the system while an application asked "
 "to inhibit it."
 msgstr ""
-"Autentizace je vyžadována pro hibernaci systému, když aplikace požádala o zákaz "
-"hibernace."
+"Pro hibernaci systému, když aplikace požádala o zákaz hibernace je vyžadováno "
+"ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:51
 msgid "Manage active sessions, users and seats"
-msgstr "Správa aktivních sezení, uživatelů a stanovišť"
+msgstr "Spravovat aktivní sezení, uživatele a stanoviště"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:52
 msgid "Authentication is required for managing active sessions, users and seats."
-msgstr ""
-"Autentizace je vyžadována pro správu aktivních sezení, uživatelů a stanovišť."
+msgstr "Pro správu aktivních sezení, uživatelů a stanovišť je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:53
 msgid "Lock or unlock active sessions"
-msgstr "Zamčení nebo odemčení aktivních sezení"
+msgstr "Zamknout nebo odemknout aktivní sezení"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:54
 msgid "Authentication is required to lock or unlock active sessions."
-msgstr "Autentizace je vyžadována pro zamčení nebo odemčení aktivních sezení."
+msgstr "Pro zamčení nebo odemčení aktivních sezení je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:55
 msgid "Allow indication to the firmware to boot to setup interface"
@@ -414,8 +404,7 @@ msgstr "Povolit indikaci firmwaru bootovat instalační prostředí"
 msgid ""
 "Authentication is required to indicate to the firmware to boot to setup interface."
 msgstr ""
-"Autentizace je vyžadována k povolení indikace firmwaru bootovat instalační "
-"prostředí."
+"K povolení indikace firmwaru bootovat instalační prostředí je vyžadováno ověření."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:57
 msgid "Set a wall message"
@@ -423,7 +412,7 @@ msgstr "Nastavit zprávu všem uživatelům"
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:58
 msgid "Authentication is required to set a wall message"
-msgstr "Autentizace je vyžadována k nastavení zprávy všem uživatelům"
+msgstr "K nastavení zprávy všem uživatelům je vyžadováno ověření"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:1
 msgid "Log into a local container"
@@ -431,7 +420,7 @@ msgstr "Přihlásit se do lokálního kontejneru"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:2
 msgid "Authentication is required to log into a local container."
-msgstr "Autentizace je vyžadována pro přihlášení do lokálního kontejneru."
+msgstr "Pro přihlášení do lokálního kontejneru je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:3
 msgid "Log into the local host"
@@ -439,39 +428,39 @@ msgstr "Přihlásit se na lokální stroj"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:4
 msgid "Authentication is required to log into the local host."
-msgstr "Autentizace je vyžadována pro přihlášení k lokálnímu stroji."
+msgstr "Pro přihlášení k lokálnímu stroji je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:5
 msgid "Acquire a shell in a local container"
-msgstr "Získání shellu v lokálním kontejneru"
+msgstr "Získat shell v lokálním kontejneru"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:6
 msgid "Authentication is required to acquire a shell in a local container."
-msgstr "Autentizace je vyžadována pro získání shellu v lokálním kontejneru."
+msgstr "Pro získání shellu v lokálním kontejneru je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:7
 msgid "Acquire a shell on the local host"
-msgstr "Získání shellu na lokálním stroji"
+msgstr "Získat shell na lokálním stroji"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:8
 msgid "Authentication is required to acquire a shell on the local host."
-msgstr "Autentizace je vyžadována pro získání shellu na lokálním stroji."
+msgstr "Pro získání shellu na lokálním stroji je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:9
 msgid "Acquire a pseudo TTY in a local container"
-msgstr "Získání Pseudo TTY v lokálním kontejneru"
+msgstr "Získat pseudo TTY v lokálním kontejneru"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:10
 msgid "Authentication is required to acquire a pseudo TTY in a local container."
-msgstr "Autentizace je vyžadována pro získání pseudo TTY v lokálním kontejneru."
+msgstr "Pro získání pseudo TTY v lokálním kontejneru je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:11
 msgid "Acquire a pseudo TTY on the local host"
-msgstr "Získání pseudo TTY na lokálním stroji"
+msgstr "Získat pseudo TTY na lokálním stroji"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:12
 msgid "Authentication is required to acquire a pseudo TTY on the local host."
-msgstr "Autentizace je vyžadována pro získání pseudo TTY na lokálním stroji."
+msgstr "Pro získání pseudo TTY na lokálním stroji je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:13
 msgid "Manage local virtual machines and containers"
@@ -479,8 +468,7 @@ msgstr "Spravovat lokální virtuální stroje a kontejnery"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:14
 msgid "Authentication is required to manage local virtual machines and containers."
-msgstr ""
-"Autentizace je vyžadována pro správu lokálních virtuálních strojů a kontejnerů."
+msgstr "Pro správu lokálních virtuálních strojů a kontejnerů je vyžadováno ověření."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:15
 msgid "Manage local virtual machine and container images"
@@ -489,7 +477,8 @@ msgstr "Spravovat lokální obrazy virtuálních strojů a kontejnerů"
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:16
 msgid ""
 "Authentication is required to manage local virtual machine and container images."
-msgstr "Autentizace je vyžadována ke správě obrazů virtuálních strojů a kontejnerů."
+msgstr ""
+"Pro správu obrazů lokálních virtuálních strojů a kontejnerů je vyžadováno ověření."
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1
 msgid "Set system time"
@@ -497,7 +486,7 @@ msgstr "Nastavit systémový čas"
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:2
 msgid "Authentication is required to set the system time."
-msgstr "Autentizace je vyžadována pro nastavení systémového času."
+msgstr "Pro nastavení systémového času je vyžadováno ověření."
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:3
 msgid "Set system timezone"
@@ -505,7 +494,7 @@ msgstr "Nastavit systémovou časovou zónu"
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:4
 msgid "Authentication is required to set the system timezone."
-msgstr "Autentizace je vyžadována pro nastavení systémové časové zóny."
+msgstr "Pro nastavení systémové časové zóny je vyžadováno ověření."
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:5
 msgid "Set RTC to local timezone or UTC"
@@ -515,8 +504,8 @@ msgstr "Nastavit RTC na lokální časovou zónu nebo UTC"
 msgid ""
 "Authentication is required to control whether the RTC stores the local or UTC time."
 msgstr ""
-"Autentizace je vyžadována pro kontrolu jestli RTC ukládá lokální časovou zónu nebo "
-"UTC čas."
+"Pro kontrolu jestli RTC ukládá lokální časovou zónu nebo UTC čas je vyžadováno "
+"ověření."
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:7
 msgid "Turn network time synchronization on or off"
@@ -526,32 +515,32 @@ msgstr "Zapnout nebo vypnout synchronizaci s časem ze sítě"
 msgid ""
 "Authentication is required to control whether network time synchronization shall "
 "be enabled."
-msgstr "Autentizace je vyžadována pro kontrolu synchronizace času ze sítě."
+msgstr "Pro kontrolu synchronizace času ze sítě je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:459
 msgid "Authentication is required to start '$(unit)'."
-msgstr "Autentizace je vyžadována pro spuštění „$(unit)”."
+msgstr "Pro spuštění „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:460
 msgid "Authentication is required to stop '$(unit)'."
-msgstr "Autentizace je vyžadována pro vypnutí „$(unit)”."
+msgstr "Pro vypnutí „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:461
 msgid "Authentication is required to reload '$(unit)'."
-msgstr "Autentizace je vyžadována pro znovu načtení „$(unit)”."
+msgstr "Pro znovu načtení „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:462 ../src/core/dbus-unit.c:463
 msgid "Authentication is required to restart '$(unit)'."
-msgstr "Autentizace je vyžadována pro restart „$(unit)”."
+msgstr "Pro restart „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:570
 msgid "Authentication is required to kill '$(unit)'."
-msgstr "Autentizace je vyžadována pro ukončení „$(unit)”."
+msgstr "Pro ukončení „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:601
 msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
-msgstr "Autentizace je vyžadována pro resetování chybného stavu „$(unit)”."
+msgstr "Pro resetování chybného stavu „$(unit)” je vyžadováno ověření."
 
 #: ../src/core/dbus-unit.c:634
 msgid "Authentication is required to set properties on '$(unit)'."
-msgstr "Autentizace je vyžadována pro nastavení vlastností na „$(unit)”."
+msgstr "Pro nastavení vlastností na „$(unit)” je vyžadováno ověření."
diff --git a/po/meson.build b/po/meson.build
new file mode 100644 (file)
index 0000000..f89291b
--- /dev/null
@@ -0,0 +1,12 @@
+i18n = import('i18n')
+i18n.gettext(meson.project_name())
+
+#####################################################################
+
+intltool_merge = find_program('intltool-merge')
+po_dir = meson.current_source_dir()
+
+intltool_cache = join_paths(meson.current_build_dir(), 'intltool-merge-cache')
+intltool_command = [intltool_merge, '-x', '-u',
+                    '-c', intltool_cache,
+                    po_dir, '@INPUT@', '@OUTPUT@']
index 2a11371f97924d3a2ffeecac714c2f8a7b9fb105..a087a4786b649028480d4e3afdbaadef7dc45e5b 100644 (file)
@@ -1,23 +1,22 @@
 # Brazilian Portuguese translation for systemd.
-# Copyright (C) 2015 systemd's COPYRIGHT HOLDER
+# Copyright (C) 2017 systemd's COPYRIGHT HOLDER
 # This file is distributed under the same license as the systemd package.
-# Rafael Ferreira <rafael.f.f1@gmail.com>, 2014.
 # Enrico Nicoletto <liverig@gmail.com>, 2014.
-#
+# Rafael Fontenelle <rafaelff@gnome.org>, 2015, 2017.
 msgid ""
 msgstr ""
 "Project-Id-Version: systemd master\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-22 16:37+0100\n"
-"PO-Revision-Date: 2015-01-10 12:23-0300\n"
-"Last-Translator: Rafael Ferreira <rafael.f.f1@gmail.com>\n"
+"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
+"POT-Creation-Date: 2016-11-17 03:29+0000\n"
+"PO-Revision-Date: 2017-04-03 14:25-0200\n"
+"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
 "Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n"
 "Language: pt_BR\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 1.7.1\n"
+"X-Generator: Virtaal 1.0.0-beta1\n"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1
 msgid "Send passphrase back to system"
@@ -31,15 +30,14 @@ msgstr ""
 "sistema."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:3
-#, fuzzy
 msgid "Manage system services or other units"
-msgstr "Gerenciar unidades e serviços do sistema"
+msgstr "Gerenciar serviços do sistema e outras unidades"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:4
-#, fuzzy
 msgid "Authentication is required to manage system services or other units."
 msgstr ""
-"É necessária autenticação para gerenciar unidades e serviços do sistema."
+"É necessária autenticação para gerenciar serviços do sistema ou outras "
+"unidades."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5
 msgid "Manage system service or unit files"
@@ -52,18 +50,18 @@ msgstr ""
 "sistema."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7
-#, fuzzy
 msgid "Set or unset system and service manager environment variables"
-msgstr "Acesso privilegiado ao gerenciador de serviço e de sistema"
+msgstr ""
+"Definir ou retirar definição de variáveis de ambiente de gerenciador de "
+"serviço e sistema"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8
-#, fuzzy
 msgid ""
 "Authentication is required to set or unset system and service manager "
 "environment variables."
 msgstr ""
-"É necessária autenticação para gerenciar arquivos \"unit\" e \"service\" do "
-"sistema."
+"É necessária autenticação para definir ou retirar definição de variáveis de "
+"ambiente de gerenciador de serviço e sistema."
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9
 msgid "Reload the systemd state"
@@ -103,30 +101,27 @@ msgstr "É necessária autenticação para definir informações de máquina loc
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:1
 msgid "Import a VM or container image"
-msgstr ""
+msgstr "Importar uma VM ou imagem contêiner"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:2
-#, fuzzy
 msgid "Authentication is required to import a VM or container image"
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para importar uma VM ou imagem contêiner"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:3
 msgid "Export a VM or container image"
-msgstr ""
+msgstr "Exportar uma VM ou imagem contêiner"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:4
-#, fuzzy
 msgid "Authentication is required to export a VM or container image"
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para exportar uma VM ou imagem contêiner"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:5
 msgid "Download a VM or container image"
-msgstr ""
+msgstr "Baixar uma VM ou imagem contêiner"
 
 #: ../src/import/org.freedesktop.import1.policy.in.h:6
-#, fuzzy
 msgid "Authentication is required to download a VM or container image"
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para baixar uma VM ou imagem contêiner"
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:1
 msgid "Set system locale"
@@ -254,48 +249,61 @@ msgstr ""
 "sistema sobre o interruptor da tela."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:19
+#| msgid "Allow non-logged-in users to run programs"
+msgid "Allow non-logged-in user to run programs"
+msgstr ""
+"Permitir que programas sejam executados por usuário que não possui sessão"
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:20
+#| msgid "Authentication is required to run programs as a non-logged-in user."
+msgid "Explicit request is required to run programs as a non-logged-in user."
+msgstr ""
+"É necessária requisição explícita para executar programas como usuário sem "
+"sessão aberta."
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:21
 msgid "Allow non-logged-in users to run programs"
 msgstr ""
 "Permitir que programas sejam executados por usuários que não possuem sessão"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:20
+#: ../src/login/org.freedesktop.login1.policy.in.h:22
 msgid "Authentication is required to run programs as a non-logged-in user."
 msgstr ""
 "É necessária autenticação para executar programas como usuário sem sessão "
 "aberta."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:21
+#: ../src/login/org.freedesktop.login1.policy.in.h:23
 msgid "Allow attaching devices to seats"
 msgstr "Permitir conectar dispositivos em estações"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:22
+#: ../src/login/org.freedesktop.login1.policy.in.h:24
 msgid "Authentication is required for attaching a device to a seat."
 msgstr "É necessária autenticação para conectar um dispositivo em uma estação."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:23
+#: ../src/login/org.freedesktop.login1.policy.in.h:25
 msgid "Flush device to seat attachments"
 msgstr "Liberar dispositivo para conexões da estação"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:24
+#: ../src/login/org.freedesktop.login1.policy.in.h:26
 msgid ""
 "Authentication is required for resetting how devices are attached to seats."
 msgstr ""
 "É necessária autenticação para redefinir a quantidade de dispositivos "
 "conectados na estação."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:25
+#: ../src/login/org.freedesktop.login1.policy.in.h:27
 msgid "Power off the system"
 msgstr "Desligar o sistema"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:26
+#: ../src/login/org.freedesktop.login1.policy.in.h:28
 msgid "Authentication is required for powering off the system."
 msgstr "É necessária autenticação para desligar o sistema."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:27
+#: ../src/login/org.freedesktop.login1.policy.in.h:29
 msgid "Power off the system while other users are logged in"
 msgstr "Desligar o sistema enquanto outros usuários estão conectados"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:28
+#: ../src/login/org.freedesktop.login1.policy.in.h:30
 msgid ""
 "Authentication is required for powering off the system while other users are "
 "logged in."
@@ -303,11 +311,11 @@ msgstr ""
 "É necessária autenticação para desligar o sistema enquanto outros usuários "
 "estão conectados."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:29
+#: ../src/login/org.freedesktop.login1.policy.in.h:31
 msgid "Power off the system while an application asked to inhibit it"
 msgstr "Desligar o sistema enquanto um aplicativo solicitou inibição"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:30
+#: ../src/login/org.freedesktop.login1.policy.in.h:32
 msgid ""
 "Authentication is required for powering off the system while an application "
 "asked to inhibit it."
@@ -315,19 +323,19 @@ msgstr ""
 "É necessária autenticação para desligar o sistema enquanto um aplicativo "
 "solicitou inibição."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:31
+#: ../src/login/org.freedesktop.login1.policy.in.h:33
 msgid "Reboot the system"
 msgstr "Reiniciar o sistema"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:32
+#: ../src/login/org.freedesktop.login1.policy.in.h:34
 msgid "Authentication is required for rebooting the system."
 msgstr "É necessária autenticação para reiniciar o sistema."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:33
+#: ../src/login/org.freedesktop.login1.policy.in.h:35
 msgid "Reboot the system while other users are logged in"
 msgstr "Reiniciar o sistema enquanto outros usuários estiverem conectados"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:34
+#: ../src/login/org.freedesktop.login1.policy.in.h:36
 msgid ""
 "Authentication is required for rebooting the system while other users are "
 "logged in."
@@ -335,11 +343,11 @@ msgstr ""
 "É necessária autenticação para reiniciar o sistema enquanto outros usuários "
 "estiverem conectados."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:35
+#: ../src/login/org.freedesktop.login1.policy.in.h:37
 msgid "Reboot the system while an application asked to inhibit it"
 msgstr "Reiniciar o sistema enquanto um aplicativo solicitou inibição"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:36
+#: ../src/login/org.freedesktop.login1.policy.in.h:38
 msgid ""
 "Authentication is required for rebooting the system while an application "
 "asked to inhibit it."
@@ -347,19 +355,19 @@ msgstr ""
 "É necessária autenticação para reiniciar o sistema enquanto um aplicativo "
 "solicitou inibição."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:37
+#: ../src/login/org.freedesktop.login1.policy.in.h:39
 msgid "Suspend the system"
 msgstr "Suspender o sistema"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:38
+#: ../src/login/org.freedesktop.login1.policy.in.h:40
 msgid "Authentication is required for suspending the system."
 msgstr "É necessária autenticação para suspender o sistema."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:39
+#: ../src/login/org.freedesktop.login1.policy.in.h:41
 msgid "Suspend the system while other users are logged in"
 msgstr "Suspender o sistema enquanto outros usuários estiverem conectados"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:40
+#: ../src/login/org.freedesktop.login1.policy.in.h:42
 msgid ""
 "Authentication is required for suspending the system while other users are "
 "logged in."
@@ -367,11 +375,11 @@ msgstr ""
 "É necessária autenticação para suspender o sistema enquanto outros usuários "
 "estiverem conectados."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:41
+#: ../src/login/org.freedesktop.login1.policy.in.h:43
 msgid "Suspend the system while an application asked to inhibit it"
 msgstr "Suspender o sistema enquanto um aplicativo solicitou inibição"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:42
+#: ../src/login/org.freedesktop.login1.policy.in.h:44
 msgid ""
 "Authentication is required for suspending the system while an application "
 "asked to inhibit it."
@@ -379,19 +387,19 @@ msgstr ""
 "É necessária autenticação para suspender o sistema enquanto um aplicativo "
 "solicitou inibição."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:43
+#: ../src/login/org.freedesktop.login1.policy.in.h:45
 msgid "Hibernate the system"
 msgstr "Hibernar o sistema"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:44
+#: ../src/login/org.freedesktop.login1.policy.in.h:46
 msgid "Authentication is required for hibernating the system."
 msgstr "É necessária autenticação para hibernar o sistema."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:45
+#: ../src/login/org.freedesktop.login1.policy.in.h:47
 msgid "Hibernate the system while other users are logged in"
 msgstr "Hibernar o sistema enquanto outros usuários estiverem conectados"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:46
+#: ../src/login/org.freedesktop.login1.policy.in.h:48
 msgid ""
 "Authentication is required for hibernating the system while other users are "
 "logged in."
@@ -399,11 +407,11 @@ msgstr ""
 "É necessária autenticação para hibernar o sistema enquanto outros usuários "
 "estiverem conectados."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:47
+#: ../src/login/org.freedesktop.login1.policy.in.h:49
 msgid "Hibernate the system while an application asked to inhibit it"
 msgstr "Hibernar o sistema enquanto um aplicativo solicitou inibição"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:48
+#: ../src/login/org.freedesktop.login1.policy.in.h:50
 msgid ""
 "Authentication is required for hibernating the system while an application "
 "asked to inhibit it."
@@ -411,123 +419,121 @@ msgstr ""
 "É necessária autenticação para hibernar o sistema enquanto um aplicativo "
 "solicitou inibição."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:49
+#: ../src/login/org.freedesktop.login1.policy.in.h:51
 msgid "Manage active sessions, users and seats"
-msgstr ""
+msgstr "Gerenciar estações, usuários e sessões ativas"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:50
-#, fuzzy
+#: ../src/login/org.freedesktop.login1.policy.in.h:52
 msgid ""
 "Authentication is required for managing active sessions, users and seats."
-msgstr "É necessária autenticação para conectar um dispositivo em uma estação."
+msgstr ""
+"É necessária autenticação para gerenciar estações, usuários e sessões ativas."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:51
+#: ../src/login/org.freedesktop.login1.policy.in.h:53
 msgid "Lock or unlock active sessions"
-msgstr ""
+msgstr "Travar ou destravar sessões ativas"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:52
-#, fuzzy
+#: ../src/login/org.freedesktop.login1.policy.in.h:54
 msgid "Authentication is required to lock or unlock active sessions."
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para travar ou destravar sessões ativas."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:53
+#: ../src/login/org.freedesktop.login1.policy.in.h:55
 msgid "Allow indication to the firmware to boot to setup interface"
 msgstr ""
+"Permitir indicação para o firmware inicializar para a interface de "
+"configuração"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:54
-#, fuzzy
+#: ../src/login/org.freedesktop.login1.policy.in.h:56
 msgid ""
 "Authentication is required to indicate to the firmware to boot to setup "
 "interface."
-msgstr "É necessária autenticação para definir nome de máquina local."
+msgstr ""
+"É necessária autenticação para indicar para o firmware inicializar para a "
+"interface de configuração."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:55
+#: ../src/login/org.freedesktop.login1.policy.in.h:57
 msgid "Set a wall message"
-msgstr ""
+msgstr "Definir uma mensagem de parede"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:56
-#, fuzzy
+#: ../src/login/org.freedesktop.login1.policy.in.h:58
 msgid "Authentication is required to set a wall message"
-msgstr "É necessária autenticação para definir nome de máquina local."
+msgstr "É necessária autenticação para definir uma mensagem de parede"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:1
 msgid "Log into a local container"
 msgstr "Conectar a um contêiner local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:2
-#, fuzzy
 msgid "Authentication is required to log into a local container."
 msgstr "É necessária autenticação para se conectar a um contêiner local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:3
-#, fuzzy
 msgid "Log into the local host"
-msgstr "Conectar a um contêiner local"
+msgstr "Conectar a uma máquina local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:4
-#, fuzzy
 msgid "Authentication is required to log into the local host."
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para se conectar a uma máquina local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:5
-#, fuzzy
 msgid "Acquire a shell in a local container"
-msgstr "Conectar a um contêiner local"
+msgstr "Adquirir uma shell em um contêiner local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:6
-#, fuzzy
 msgid "Authentication is required to acquire a shell in a local container."
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr ""
+"É necessária autenticação para adquirir uma shell em um contêiner local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:7
 msgid "Acquire a shell on the local host"
-msgstr ""
+msgstr "Adquirir uma shell na máquina local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:8
-#, fuzzy
 msgid "Authentication is required to acquire a shell on the local host."
-msgstr "É necessária autenticação para definir nome de máquina local."
+msgstr ""
+"É necessária autenticação para adquirir uma shell em uma máquina local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:9
-#, fuzzy
 msgid "Acquire a pseudo TTY in a local container"
-msgstr "Conectar a um contêiner local"
+msgstr "Adquirir um pseudo TTY em um contêiner local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:10
-#, fuzzy
 msgid ""
 "Authentication is required to acquire a pseudo TTY in a local container."
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr ""
+"É necessária autenticação para adquirir um pseudo TTY em um contêiner local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:11
 msgid "Acquire a pseudo TTY on the local host"
-msgstr ""
+msgstr "Adquiri um pseudo TTY na máquina local"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:12
-#, fuzzy
 msgid "Authentication is required to acquire a pseudo TTY on the local host."
-msgstr "É necessária autenticação para definir nome de máquina local."
+msgstr ""
+"É necessária autenticação para adquirir um pseudo TTY em um máquina local."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:13
 msgid "Manage local virtual machines and containers"
-msgstr ""
+msgstr "Gerenciar máquinas virtuais locais e contêineres"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:14
-#, fuzzy
 msgid ""
 "Authentication is required to manage local virtual machines and containers."
-msgstr "É necessária autenticação para definir informações de máquina local."
+msgstr ""
+"É necessária autenticação para gerenciar máquinas virtuais locais e "
+"contêineres."
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:15
 msgid "Manage local virtual machine and container images"
-msgstr ""
+msgstr "Gerenciar máquinas virtuais locais e imagens contêineres"
 
 #: ../src/machine/org.freedesktop.machine1.policy.in.h:16
-#, fuzzy
 msgid ""
 "Authentication is required to manage local virtual machine and container "
 "images."
-msgstr "É necessária autenticação para definir informações de máquina local."
+msgstr ""
+"É necessária autenticação para gerenciar máquinas virtuais locais e imagens "
+"contêineres."
 
 #: ../src/timedate/org.freedesktop.timedate1.policy.in.h:1
 msgid "Set system time"
@@ -569,37 +575,31 @@ msgstr ""
 "É necessária autenticação para controlar se deve ser habilitada, ou não, a "
 "sincronização de horário através de rede."
 
-#: ../src/core/dbus-unit.c:428
-#, fuzzy
+#: ../src/core/dbus-unit.c:457
 msgid "Authentication is required to start '$(unit)'."
-msgstr "É necessária autenticação para definir o horário do sistema."
+msgstr "É necessária autenticação para iniciar '$(unit)'."
 
-#: ../src/core/dbus-unit.c:429
-#, fuzzy
+#: ../src/core/dbus-unit.c:458
 msgid "Authentication is required to stop '$(unit)'."
-msgstr "É necessária autenticação para definir o horário do sistema."
+msgstr "É necessária autenticação para parar '$(unit)'."
 
-#: ../src/core/dbus-unit.c:430
-#, fuzzy
+#: ../src/core/dbus-unit.c:459
 msgid "Authentication is required to reload '$(unit)'."
-msgstr "É necessária autenticação para recarregar o estado do sistema."
+msgstr "É necessária autenticação para recarregar '$(unit)'."
 
-#: ../src/core/dbus-unit.c:431 ../src/core/dbus-unit.c:432
-#, fuzzy
+#: ../src/core/dbus-unit.c:460 ../src/core/dbus-unit.c:461
 msgid "Authentication is required to restart '$(unit)'."
-msgstr "É necessária autenticação para definir o horário do sistema."
+msgstr "É necessária autenticação para reiniciar '$(unit)'."
 
-#: ../src/core/dbus-unit.c:535
-#, fuzzy
+#: ../src/core/dbus-unit.c:568
 msgid "Authentication is required to kill '$(unit)'."
-msgstr "É necessária autenticação para se conectar a um contêiner local."
+msgstr "É necessária autenticação para matar '$(unit)'."
 
-#: ../src/core/dbus-unit.c:565
-#, fuzzy
+#: ../src/core/dbus-unit.c:599
 msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
-msgstr "É necessária autenticação para definir nome de máquina local."
+msgstr ""
+"É necessária autenticação para reiniciar o estado \"failed\" de '$(unit)'."
 
-#: ../src/core/dbus-unit.c:597
-#, fuzzy
+#: ../src/core/dbus-unit.c:632
 msgid "Authentication is required to set properties on '$(unit)'."
-msgstr "É necessária autenticação para definir o horário do sistema."
+msgstr "É necessária autenticação para definir propriedades em '$(unit)'."
index 6ecf5479a474918d14fc56f020064c4f8e4feb0e..1de9b4650de6d5b8b7f06c04ce2d2ce54790e046 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,24 +1,23 @@
 # Swedish translation for systemd.
 # Copyright © 2015 systemd's COPYRIGHT HOLDER
 # This file is distributed under the same license as the systemd package.
-# Josef Andersson <josef.andersson@fripost.org>, 2015.
 # Sebastian Rasmussen <sebras@gmail.com>, 2015.
 # Andreas Henriksson <andreas@fatal.se>, 2016.
-#
+# Josef Andersson <l10nl18nsweja@gmail.com>, 2015, 2017.
 msgid ""
 msgstr ""
 "Project-Id-Version: systemd master\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-22 16:37+0100\n"
-"PO-Revision-Date: 2016-09-29 11:58+0200\n"
-"Last-Translator: Andreas Henriksson <andreas@fatal.se>\n"
+"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
+"POT-Creation-Date: 2017-03-01 15:50+0000\n"
+"PO-Revision-Date: 2017-03-19 21:18+0100\n"
+"Last-Translator: Josef Andersson <l10nl18nsweja@gmail.com>\n"
 "Language-Team: Swedish\n"
 "Language: sv\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 2.91.7\n"
+"X-Generator: Poedit 1.8.9\n"
 
 #: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1
 msgid "Send passphrase back to system"
@@ -134,7 +133,8 @@ msgstr "Ange systeminställningar för tangentbord"
 
 #: ../src/locale/org.freedesktop.locale1.policy.in.h:4
 msgid "Authentication is required to set the system keyboard settings."
-msgstr "Autentisering krävs för att ställa in systeminställningar för tangentbord."
+msgstr ""
+"Autentisering krävs för att ställa in systeminställningar för tangentbord."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:1
 msgid "Allow applications to inhibit system shutdown"
@@ -237,45 +237,54 @@ msgstr ""
 "av brytaren för datorhöljet."
 
 #: ../src/login/org.freedesktop.login1.policy.in.h:19
+msgid "Allow non-logged-in user to run programs"
+msgstr "Tillåt ej inloggad användare att köra program"
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:20
+msgid "Explicit request is required to run programs as a non-logged-in user."
+msgstr ""
+"Uttrycklig begäran krävs för att köra program som en icke inloggad användare."
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:21
 msgid "Allow non-logged-in users to run programs"
 msgstr "Tillåt ej inloggade användare att köra program"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:20
+#: ../src/login/org.freedesktop.login1.policy.in.h:22
 msgid "Authentication is required to run programs as a non-logged-in user."
 msgstr ""
 "Autentisering krävs för att köra program som en icke inloggad användare."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:21
+#: ../src/login/org.freedesktop.login1.policy.in.h:23
 msgid "Allow attaching devices to seats"
 msgstr "Tillåt att binda enheter till platser"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:22
+#: ../src/login/org.freedesktop.login1.policy.in.h:24
 msgid "Authentication is required for attaching a device to a seat."
 msgstr "Autentisering krävs för att binda en enhet till en plats."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:23
+#: ../src/login/org.freedesktop.login1.policy.in.h:25
 msgid "Flush device to seat attachments"
 msgstr "Töm bindningar för enhet-till-plats"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:24
+#: ../src/login/org.freedesktop.login1.policy.in.h:26
 msgid ""
 "Authentication is required for resetting how devices are attached to seats."
 msgstr ""
 "Autentisering krävs för att återställa hur enheter är bundna till platser."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:25
+#: ../src/login/org.freedesktop.login1.policy.in.h:27
 msgid "Power off the system"
 msgstr "Stäng av systemet"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:26
+#: ../src/login/org.freedesktop.login1.policy.in.h:28
 msgid "Authentication is required for powering off the system."
 msgstr "Autentisering krävs för att stänga av systemet."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:27
+#: ../src/login/org.freedesktop.login1.policy.in.h:29
 msgid "Power off the system while other users are logged in"
 msgstr "Stäng av systemet medan andra användare är inloggade"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:28
+#: ../src/login/org.freedesktop.login1.policy.in.h:30
 msgid ""
 "Authentication is required for powering off the system while other users are "
 "logged in."
@@ -283,11 +292,11 @@ msgstr ""
 "Autentisering krävs för att stänga av systemet medan andra användare är "
 "inloggade."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:29
+#: ../src/login/org.freedesktop.login1.policy.in.h:31
 msgid "Power off the system while an application asked to inhibit it"
 msgstr "Stäng av systemet även då ett program hindrar det"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:30
+#: ../src/login/org.freedesktop.login1.policy.in.h:32
 msgid ""
 "Authentication is required for powering off the system while an application "
 "asked to inhibit it."
@@ -295,19 +304,19 @@ msgstr ""
 "Autentisering krävs för att stänga av systemet även då ett program hindrar "
 "det."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:31
+#: ../src/login/org.freedesktop.login1.policy.in.h:33
 msgid "Reboot the system"
 msgstr "Starta om systemet"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:32
+#: ../src/login/org.freedesktop.login1.policy.in.h:34
 msgid "Authentication is required for rebooting the system."
 msgstr "Autentisering krävs för att starta om systemet."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:33
+#: ../src/login/org.freedesktop.login1.policy.in.h:35
 msgid "Reboot the system while other users are logged in"
 msgstr "Starta om systemet medan andra användare är inloggade"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:34
+#: ../src/login/org.freedesktop.login1.policy.in.h:36
 msgid ""
 "Authentication is required for rebooting the system while other users are "
 "logged in."
@@ -315,11 +324,11 @@ msgstr ""
 "Autentisering krävs för att starta om systemet medan andra användare är "
 "inloggade."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:35
+#: ../src/login/org.freedesktop.login1.policy.in.h:37
 msgid "Reboot the system while an application asked to inhibit it"
 msgstr "Starta om systemet även då ett program hindrar det"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:36
+#: ../src/login/org.freedesktop.login1.policy.in.h:38
 msgid ""
 "Authentication is required for rebooting the system while an application "
 "asked to inhibit it."
@@ -327,19 +336,19 @@ msgstr ""
 "Autentisering krävs för att starta om systemet även då ett program hindrar "
 "det."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:37
+#: ../src/login/org.freedesktop.login1.policy.in.h:39
 msgid "Suspend the system"
 msgstr "Försätt system i vänteläge"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:38
+#: ../src/login/org.freedesktop.login1.policy.in.h:40
 msgid "Authentication is required for suspending the system."
 msgstr "Autentisering krävs för att försätta system i vänteläge."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:39
+#: ../src/login/org.freedesktop.login1.policy.in.h:41
 msgid "Suspend the system while other users are logged in"
 msgstr "Försätt systemet i vänteläge medan andra användare är inloggade"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:40
+#: ../src/login/org.freedesktop.login1.policy.in.h:42
 msgid ""
 "Authentication is required for suspending the system while other users are "
 "logged in."
@@ -347,11 +356,11 @@ msgstr ""
 "Autentisering krävs för att försätta systemet i vänteläge medan andra "
 "användare är inloggade."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:41
+#: ../src/login/org.freedesktop.login1.policy.in.h:43
 msgid "Suspend the system while an application asked to inhibit it"
 msgstr "Försätt systemet i vänteläge även då ett program hindrar det"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:42
+#: ../src/login/org.freedesktop.login1.policy.in.h:44
 msgid ""
 "Authentication is required for suspending the system while an application "
 "asked to inhibit it."
@@ -359,19 +368,19 @@ msgstr ""
 "Autentisering krävs för att försätta ett program i vänteläge även då ett "
 "program hindrar det."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:43
+#: ../src/login/org.freedesktop.login1.policy.in.h:45
 msgid "Hibernate the system"
 msgstr "Försätt systemet i viloläge"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:44
+#: ../src/login/org.freedesktop.login1.policy.in.h:46
 msgid "Authentication is required for hibernating the system."
 msgstr "Autentisering krävs för att försätta systemet i viloläge."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:45
+#: ../src/login/org.freedesktop.login1.policy.in.h:47
 msgid "Hibernate the system while other users are logged in"
 msgstr "Försätt systemet i viloläge medan andra användare är inloggade"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:46
+#: ../src/login/org.freedesktop.login1.policy.in.h:48
 msgid ""
 "Authentication is required for hibernating the system while other users are "
 "logged in."
@@ -379,11 +388,11 @@ msgstr ""
 "Autentisering krävs för att försätta systemet i viloläge medan andra "
 "användare är inloggade."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:47
+#: ../src/login/org.freedesktop.login1.policy.in.h:49
 msgid "Hibernate the system while an application asked to inhibit it"
 msgstr "Försätt systemet i viloläge även då ett program hindrar det"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:48
+#: ../src/login/org.freedesktop.login1.policy.in.h:50
 msgid ""
 "Authentication is required for hibernating the system while an application "
 "asked to inhibit it."
@@ -391,30 +400,30 @@ msgstr ""
 "Autentisering krävs för att försätta ett program i viloläge även då ett "
 "program hindrar det."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:49
+#: ../src/login/org.freedesktop.login1.policy.in.h:51
 msgid "Manage active sessions, users and seats"
 msgstr "Hantera aktiva sessioner, användare och platser"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:50
+#: ../src/login/org.freedesktop.login1.policy.in.h:52
 msgid ""
 "Authentication is required for managing active sessions, users and seats."
 msgstr ""
 "Autentisering krävs för att hantera aktiva sessioner, användare och platser."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:51
+#: ../src/login/org.freedesktop.login1.policy.in.h:53
 msgid "Lock or unlock active sessions"
 msgstr "Lås eller lås upp aktiva sessioner"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:52
+#: ../src/login/org.freedesktop.login1.policy.in.h:54
 msgid "Authentication is required to lock or unlock active sessions."
 msgstr "Autentisering krävs för att låsa eller låsa upp aktiva sessioner."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:53
+#: ../src/login/org.freedesktop.login1.policy.in.h:55
 msgid "Allow indication to the firmware to boot to setup interface"
 msgstr ""
 "Tillåt indikering till firmware att starta upp i inställningsgränssnitt"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:54
+#: ../src/login/org.freedesktop.login1.policy.in.h:56
 msgid ""
 "Authentication is required to indicate to the firmware to boot to setup "
 "interface."
@@ -422,11 +431,11 @@ msgstr ""
 "Autentisering krävs för att indikera till firmware att starta upp till "
 "inställningsgränssnitt."
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:55
+#: ../src/login/org.freedesktop.login1.policy.in.h:57
 msgid "Set a wall message"
 msgstr "Ange ett väggmeddelande"
 
-#: ../src/login/org.freedesktop.login1.policy.in.h:56
+#: ../src/login/org.freedesktop.login1.policy.in.h:58
 msgid "Authentication is required to set a wall message"
 msgstr "Autentisering krävs för att ställa in ett väggmeddelande"
 
@@ -547,33 +556,33 @@ msgstr ""
 "Autentisering krävs för att kontrollera huruvida synkronisering av "
 "nätverkstid ska vara aktiverat."
 
-#: ../src/core/dbus-unit.c:428
+#: ../src/core/dbus-unit.c:457
 msgid "Authentication is required to start '$(unit)'."
 msgstr "Autentisering krävs för att starta \"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:429
+#: ../src/core/dbus-unit.c:458
 msgid "Authentication is required to stop '$(unit)'."
 msgstr "Autentisering krävs för att stoppa \"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:430
+#: ../src/core/dbus-unit.c:459
 msgid "Authentication is required to reload '$(unit)'."
 msgstr "Autentisering krävs för att läsa om tillståndet för \"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:431 ../src/core/dbus-unit.c:432
+#: ../src/core/dbus-unit.c:460 ../src/core/dbus-unit.c:461
 msgid "Authentication is required to restart '$(unit)'."
 msgstr "Autentisering krävs för att starta om \"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:535
+#: ../src/core/dbus-unit.c:568
 msgid "Authentication is required to kill '$(unit)'."
 msgstr "Autentisering krävs för att döda \"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:565
+#: ../src/core/dbus-unit.c:599
 msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
 msgstr ""
 "Autentisering krävs för att återställa det \"fallerade\" tillståndet för "
 "\"$(unit)\"."
 
-#: ../src/core/dbus-unit.c:597
+#: ../src/core/dbus-unit.c:632
 msgid "Authentication is required to set properties on '$(unit)'."
 msgstr "Autentisering krävs för att ställa in egenskaper på \"$(unit)\"."
 
index 93a50ddd804218fc41aaa7ca21156daa5f6bc3ec..ea6e216bad2d7f4ce966fab460ced4b8da160a31 100644 (file)
@@ -1 +1,2 @@
+/50-udev-default.rules
 /99-systemd.rules
similarity index 98%
rename from rules/50-udev-default.rules
rename to rules/50-udev-default.rules.in
index 3347c8cd89e98e14c60667d3102a42ead69b03b6..064f66a9769a7c2527d17bb9fa3236f0b2a7980d 100644 (file)
@@ -74,6 +74,8 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
 
 KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
 
+KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@"
+
 SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"
 
 LABEL="default_end"
index f91d8cb456f323b869264efe471fbd57850fbeef..288f8ce2f9621a726b2c444719810d4e2013ead3 100644 (file)
@@ -2,7 +2,7 @@
 
 ACTION=="remove", GOTO="cdrom_end"
 SUBSYSTEM!="block", GOTO="cdrom_end"
-KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
+KERNEL!="sr[0-9]*|vdisk*|xvd*", GOTO="cdrom_end"
 ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
 
 # unconditionally tag device as CDROM
index 607144bf8af8204f64a03fbf5602e606c597be50..91efbe7294318c7018c7c369bceef406ec857039 100644 (file)
@@ -3,6 +3,8 @@
 ACTION=="remove", GOTO="persistent_input_end"
 SUBSYSTEM!="input", GOTO="persistent_input_end"
 SUBSYSTEMS=="bluetooth", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end"
+# Bluetooth devices don't always have the bluetooth subsystem
+ATTRS{id/bustype}=="0005", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end"
 SUBSYSTEMS=="rmi4", ENV{ID_BUS}="rmi", GOTO="persistent_input_end"
 SUBSYSTEMS=="serio", ENV{ID_BUS}="i8042", GOTO="persistent_input_end"
 
diff --git a/rules/meson.build b/rules/meson.build
new file mode 100644 (file)
index 0000000..1cd37f3
--- /dev/null
@@ -0,0 +1,38 @@
+rules = files('''
+        60-block.rules
+        60-cdrom_id.rules
+        60-drm.rules
+        60-evdev.rules
+        60-persistent-alsa.rules
+        60-persistent-input.rules
+        60-persistent-storage.rules
+        60-persistent-storage-tape.rules
+        60-persistent-v4l.rules
+        60-sensor.rules
+        60-serial.rules
+        64-btrfs.rules
+        70-mouse.rules
+        70-touchpad.rules
+        75-net-description.rules
+        75-probe_mtd.rules
+        78-sound-card.rules
+        80-drivers.rules
+        80-net-setup-link.rules
+'''.split())
+
+install_data(rules,
+             install_dir : udevrulesdir)
+
+rules_in = '''
+        50-udev-default.rules
+        99-systemd.rules
+'''.split()
+
+foreach file : rules_in
+        gen = configure_file(
+                input : file + '.in',
+                output : file,
+                configuration : substs)
+        install_data(gen,
+                     install_dir : udevrulesdir)
+endforeach
diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
new file mode 100644 (file)
index 0000000..9399661
--- /dev/null
@@ -0,0 +1,50 @@
+bashcompletiondir = get_option('bashcompletiondir')
+if bashcompletiondir == ''
+        bash_completion = dependency('bash-completion', required : false)
+        if bash_completion.found()
+                bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
+        else
+                bashcompletiondir = join_paths(datadir, 'bash-completion/completions')
+        endif
+
+        message('bash completions: @0@'.format(bashcompletiondir))
+endif
+
+if bashcompletiondir != 'no'
+        bash_systemctl = configure_file(
+                input : 'systemctl.in',
+                output : 'systemctl',
+                configuration : substs)
+
+        items = [['busctl',              ''],
+                 ['journalctl',          ''],
+                 ['systemd-analyze',     ''],
+                 ['systemd-cat',         ''],
+                 ['systemd-cgls',        ''],
+                 ['systemd-cgtop',       ''],
+                 ['systemd-delta',       ''],
+                 ['systemd-detect-virt', ''],
+                 ['systemd-nspawn',      ''],
+                 ['systemd-path',        ''],
+                 ['systemd-run',         ''],
+                 ['udevadm',             ''],
+                 ['kernel-install',      ''],
+                 [bash_systemctl,        ''],
+                 ['bootctl',             'ENABLE_EFI'],
+                 ['coredumpctl',         'ENABLE_COREDUMP'],
+                 ['hostnamectl',         'ENABLE_HOSTNAMED'],
+                 ['localectl',           'ENABLE_LOCALED'],
+                 ['loginctl',            'ENABLE_LOGIND'],
+                 ['machinectl',          'ENABLE_MACHINED'],
+                 ['networkctl',          'ENABLE_NETWORKD'],
+                 ['systemd-resolve',     'ENABLE_RESOLVED'],
+                 ['timedatectl',         'ENABLE_TIMEDATED'],
+                ]
+
+        foreach item : items
+                if item[1] == '' or conf.get(item[1], false)
+                        install_data(item[0],
+                                     install_dir : bashcompletiondir)
+                endif
+        endforeach
+endif
index e4ccad879961a3bbeb3aafc4c2b9fd270b30a504..907d7dd55b09fe13ca8a9128a1ba1a61c6f78095 100644 (file)
@@ -172,7 +172,7 @@ _systemctl () {
                                 comps='full enable-only disable-only'
                         ;;
                         --output|-o)
-                                comps='short short-full short-iso short-precise short-monotonic short-unix verbose export json
+                                comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json
                                        json-pretty json-sse cat'
                         ;;
                         --machine|-M)
index 52617c6b7aaef8e83a270c19fbc5008b119caa72..2948f40130be08ddff5828b15dd4e0d29370cf5e 100644 (file)
@@ -1,5 +1,5 @@
 #autoload
 
 local -a _output_opts
-_output_opts=(short short-full short-iso short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat)
+_output_opts=(short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat)
 _describe -t output 'output mode' _output_opts || compadd "$@"
diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build
new file mode 100644 (file)
index 0000000..34408ce
--- /dev/null
@@ -0,0 +1,47 @@
+zshcompletiondir = get_option('zshcompletiondir')
+if zshcompletiondir == ''
+        zshcompletiondir = join_paths(datadir, 'zsh/site-functions')
+
+        message('zsh completions: @0@'.format(zshcompletiondir))
+endif
+
+if zshcompletiondir != 'no'
+        zsh_systemctl = configure_file(
+                input : '_systemctl.in',
+                output : '_systemctl',
+                configuration : substs)
+
+        items = [['_busctl',                   ''],
+                 ['_journalctl',               ''],
+                 ['_systemd-analyze',          ''],
+                 ['_systemd-delta',            ''],
+                 ['_systemd-nspawn',           ''],
+                 ['_systemd',                  ''],
+                 ['_systemd-run',              ''],
+                 ['_udevadm',                  ''],
+                 ['_kernel-install',           ''],
+                 ['_sd_hosts_or_user_at_host', ''],
+                 ['_sd_outputmodes',           ''],
+                 ['_sd_unit_files',            ''],
+                 ['_sd_machines',              ''],
+                 [zsh_systemctl,               ''],
+                 ['_bootctl',                  'ENABLE_EFI'],
+                 ['_coredumpctl',              'ENABLE_COREDUMP'],
+                 ['_hostnamectl',              'ENABLE_HOSTNAMED'],
+                 ['_localectl',                'ENABLE_LOCALED'],
+                 ['_loginctl',                 'ENABLE_LOGIND'],
+                 ['_machinectl',               'ENABLE_MACHINED'],
+                 ['_networkctl',               'ENABLE_NETWORKD'],
+                 ['_systemd-inhibit',          'ENABLE_LOGIND'],
+                 ['_systemd-resolve',          'ENABLE_RESOLVED'],
+                 ['_systemd-tmpfiles',         'ENABLE_TMPFILES'],
+                 ['_timedatectl',              'ENABLE_TIMEDATED'],
+                ]
+
+        foreach item : items
+                if item[1] == '' or conf.get(item[1], false)
+                        install_data(item[0],
+                                     install_dir : zshcompletiondir)
+                endif
+        endforeach
+endif
index ac0470b20d931fae3e323823c659529b4c75092d..1eb2ca0ccf63a2418a1e4e6a9f9cdc8465fd7bde 100644 (file)
@@ -627,7 +627,7 @@ static int analyze_plot(sd_bus *bus) {
             "<!-- that render these files properly but much slower are ImageMagick,   -->\n"
             "<!-- gimp, inkscape, etc. To display the files on your system, just      -->\n"
             "<!-- point your browser to this file.                                    -->\n\n"
-            "<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", VERSION);
+            "<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", PACKAGE_VERSION);
 
         /* style sheet */
         svg("<defs>\n  <style type=\"text/css\">\n    <![CDATA[\n"
diff --git a/src/analyze/meson.build b/src/analyze/meson.build
new file mode 100644 (file)
index 0000000..fcbd814
--- /dev/null
@@ -0,0 +1,5 @@
+systemd_analyze_sources = files('''
+        analyze.c
+        analyze-verify.c
+        analyze-verify.h
+'''.split())
diff --git a/src/basic/af-to-name.awk b/src/basic/af-to-name.awk
new file mode 100644 (file)
index 0000000..18d0a89
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN{
+        print "static const char* const af_names[] = { "
+}
+!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ {
+        printf "        [%s] = \"%s\",\n", $1, $1
+}
+END{
+        print "};"
+}
diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk
new file mode 100644 (file)
index 0000000..5a35673
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN{
+        print "static const char* const arphrd_names[] = { "
+}
+!/CISCO/ {
+        printf "        [ARPHRD_%s] = \"%s\",\n", $1, $1
+}
+END{
+        print "};"
+}
index 7aa75eb091242e3d17b137440a18ad7efa6d266b..1b9cace0407257d05aca29b3faf686642c125cdc 100644 (file)
@@ -20,7 +20,7 @@
 ***/
 
 #ifdef HAVE_BLKID
-#include <blkid/blkid.h>
+#include <blkid.h>
 #endif
 
 #include "util.h"
diff --git a/src/basic/cap-to-name.awk b/src/basic/cap-to-name.awk
new file mode 100644 (file)
index 0000000..402a782
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN{
+        print "static const char* const capability_names[] = { "
+}
+{
+        printf "        [%s] = \"%s\",\n", $1, tolower($1)
+}
+END{
+        print "};"
+}
index 200ea973c19041d4dbe2b9b33beb16b6a7c583b6..b1a3bc190bd0e39cd713f7ccca6550ce7ca19114 100644 (file)
                 .un.sun_path = "\0/org/freedesktop/plymouthd",  \
         }
 
-#ifndef TTY_GID
-#define TTY_GID 5
-#endif
-
 #define NOTIFY_FD_MAX 768
 #define NOTIFY_BUFFER_MAX PIPE_BUF
 
index 6b9d26773ea78868a50fdb662bb6ba8ea559bd64..5bf58bcdc36d442022e1ef6a82965e06aecfcdf2 100644 (file)
@@ -75,3 +75,14 @@ bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
 
         return endswith(de->d_name, suffix);
 }
+
+struct dirent* readdir_no_dot(DIR *dirp) {
+        struct dirent* d;
+
+        for (;;) {
+                d = readdir(dirp);
+                if (d && dot_or_dot_dot(d->d_name))
+                        continue;
+                return d;
+        }
+}
index b91d04908f9a01545ed7f68e4f32fbc91323288d..18b9db9b28c6c3d80bd3a5d422149f5b4c3b6cee 100644 (file)
@@ -31,6 +31,8 @@ int dirent_ensure_type(DIR *d, struct dirent *de);
 bool dirent_is_file(const struct dirent *de) _pure_;
 bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_;
 
+struct dirent* readdir_no_dot(DIR *dirp);
+
 #define FOREACH_DIRENT(de, d, on_error)                                 \
         for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
                 if (!de) {                                              \
diff --git a/src/basic/errno-to-name.awk b/src/basic/errno-to-name.awk
new file mode 100644 (file)
index 0000000..0878aba
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN{
+        print "static const char* const errno_names[] = { "
+}
+!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
+        printf "        [%s] = \"%s\",\n", $1, $1
+}
+END{
+        print "};"
+}
index f8cac3e911fddef4630ff78eb731077b508089bd..804f14c44c48ac02525086ceb289d1aa41177a80 100644 (file)
@@ -241,7 +241,12 @@ int extract_first_word_and_warn(
         return log_syntax(unit, LOG_ERR, filename, line, r, "Unable to decode word \"%s\", ignoring: %m", rvalue);
 }
 
-int extract_many_words(const char **p, const char *separators, ExtractFlags flags, ...) {
+/* We pass ExtractFlags as unsigned int (to avoid undefined behaviour when passing
+ * an object that undergoes default argument promotion as an argument to va_start).
+ * Let's make sure that ExtractFlags fits into an unsigned int. */
+assert_cc(sizeof(enum ExtractFlags) <= sizeof(unsigned));
+
+int extract_many_words(const char **p, const char *separators, unsigned flags, ...) {
         va_list ap;
         char **l;
         int n = 0, i, c, r;
index 21db5ef33fb550bb3e34644a9f510dcf7958079a..04746c6d085ed3db60902ebaf923a81e1fdde6b5 100644 (file)
@@ -32,4 +32,4 @@ typedef enum ExtractFlags {
 
 int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags);
 int extract_first_word_and_warn(const char **p, char **ret, const char *separators, ExtractFlags flags, const char *unit, const char *filename, unsigned line, const char *rvalue);
-int extract_many_words(const char **p, const char *separators, ExtractFlags flags, ...) _sentinel_;
+int extract_many_words(const char **p, const char *separators, unsigned flags, ...) _sentinel_;
diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh
new file mode 100755 (executable)
index 0000000..8d9cdd1
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh -eu
+
+$1 -E -dM -include sys/socket.h - </dev/null | \
+        grep -Ev 'AF_UNSPEC|AF_MAX' | \
+        awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
diff --git a/src/basic/generate-arphrd-list.sh b/src/basic/generate-arphrd-list.sh
new file mode 100755 (executable)
index 0000000..ee207fb
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh -eu
+
+$1 -dM -include net/if_arp.h - </dev/null | \
+        awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
+        sed -e 's/ARPHRD_//'
diff --git a/src/basic/generate-cap-list.sh b/src/basic/generate-cap-list.sh
new file mode 100755 (executable)
index 0000000..1d4a562
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh -eu
+
+$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
+        awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
+        grep -v CAP_LAST_CAP
diff --git a/src/basic/generate-errno-list.sh b/src/basic/generate-errno-list.sh
new file mode 100755 (executable)
index 0000000..e2bab8b
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh -eu
+
+$1 -dM -include errno.h - </dev/null | \
+        awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
diff --git a/src/basic/generate-gperfs.py b/src/basic/generate-gperfs.py
new file mode 100755 (executable)
index 0000000..d4cc9aa
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+"""Generate %-from-name.gperf from %-list.txt
+"""
+
+import sys
+
+name, prefix, input = sys.argv[1:]
+
+print("""\
+struct {}_name {{ const char* name; int id; }};
+%null-strings
+%%""".format(name))
+
+for line in open(input):
+    print("{0}, {1}{0}".format(line.rstrip(), prefix))
index 007198c269863a9f69ee4bfc8b75d3e66107770a..f611c42e4c3fc0f437cc088f5621c5bb264708a8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <dirent.h>
 #include <errno.h>
 #include <glob.h>
+#include <sys/types.h>
 
+#include "dirent-util.h"
 #include "glob-util.h"
 #include "macro.h"
+#include "path-util.h"
 #include "strv.h"
 
-int glob_exists(const char *path) {
-        _cleanup_globfree_ glob_t g = {};
+int safe_glob(const char *path, int flags, glob_t *pglob) {
         int k;
 
-        assert(path);
+        /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
+        assert(!(flags & GLOB_ALTDIRFUNC));
+
+        if (!pglob->gl_closedir)
+                pglob->gl_closedir = (void (*)(void *)) closedir;
+        if (!pglob->gl_readdir)
+                pglob->gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot;
+        if (!pglob->gl_opendir)
+                pglob->gl_opendir = (void *(*)(const char *)) opendir;
+        if (!pglob->gl_lstat)
+                pglob->gl_lstat = lstat;
+        if (!pglob->gl_stat)
+                pglob->gl_stat = stat;
 
         errno = 0;
-        k = glob(path, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
+        k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
 
         if (k == GLOB_NOMATCH)
-                return 0;
+                return -ENOENT;
         if (k == GLOB_NOSPACE)
                 return -ENOMEM;
         if (k != 0)
                 return errno > 0 ? -errno : -EIO;
+        if (strv_isempty(pglob->gl_pathv))
+                return -ENOENT;
 
-        return !strv_isempty(g.gl_pathv);
+        return 0;
 }
 
-int glob_extend(char ***strv, const char *path) {
+int glob_exists(const char *path) {
         _cleanup_globfree_ glob_t g = {};
         int k;
-        char **p;
 
-        errno = 0;
-        k = glob(path, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
+        assert(path);
 
-        if (k == GLOB_NOMATCH)
-                return -ENOENT;
-        if (k == GLOB_NOSPACE)
-                return -ENOMEM;
-        if (k != 0)
-                return errno > 0 ? -errno : -EIO;
-        if (strv_isempty(g.gl_pathv))
-                return -ENOENT;
+        k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g);
+        if (k == -ENOENT)
+                return false;
+        if (k < 0)
+                return k;
+        return true;
+}
+
+int glob_extend(char ***strv, const char *path) {
+        _cleanup_globfree_ glob_t g = {};
+        int k;
 
-        STRV_FOREACH(p, g.gl_pathv) {
-                k = strv_extend(strv, *p);
-                if (k < 0)
-                        return k;
-        }
+        k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g);
+        if (k < 0)
+                return k;
 
-        return 0;
+        return strv_extend_strv(strv, g.gl_pathv, false);
 }
index 5d8fb47a268c3a265aa8290051273aa2f9d4b6bc..e1f6083afaf911f05e01f5d18c62d009dca79f6d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <glob.h>
 #include <stdbool.h>
 #include <string.h>
 
 #include "macro.h"
 #include "string-util.h"
 
+/* Note: this function modifies pglob to set various functions. */
+int safe_glob(const char *path, int flags, glob_t *pglob);
+
 int glob_exists(const char *path);
 int glob_extend(char ***strv, const char *path);
 
index 3927df2955862436349fdee73e48487cd3eba5f1..d52fdad3ac974c670783a8c8bd4ef00bd040b2ae 100644 (file)
@@ -464,3 +464,45 @@ int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen)
 
         return -EAFNOSUPPORT;
 }
+
+int in_addr_prefix_from_string(const char *p, int family, union in_addr_union *ret_prefix, uint8_t *ret_prefixlen) {
+        union in_addr_union buffer;
+        const char *e, *l;
+        uint8_t k;
+        int r;
+
+        assert(p);
+
+        if (!IN_SET(family, AF_INET, AF_INET6))
+                return -EAFNOSUPPORT;
+
+        e = strchr(p, '/');
+        if (e)
+                l = strndupa(p, e - p);
+        else
+                l = p;
+
+        r = in_addr_from_string(family, l, &buffer);
+        if (r < 0)
+                return r;
+
+        k = FAMILY_ADDRESS_SIZE(family) * 8;
+
+        if (e) {
+                uint8_t n;
+
+                r = safe_atou8(e + 1, &n);
+                if (r < 0)
+                        return r;
+
+                if (n > k)
+                        return -ERANGE;
+
+                k = n;
+        }
+
+        *ret_prefix = buffer;
+        *ret_prefixlen = k;
+
+        return 0;
+}
index 51a5aa67e4101b6ec1934748dd5475e81a10a492..14e27246b59684d6f7594afaef7d423902a83311 100644 (file)
@@ -60,6 +60,7 @@ struct in_addr* in_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char
 int in_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen);
 int in_addr_default_subnet_mask(const struct in_addr *addr, struct in_addr *mask);
 int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen);
+int in_addr_prefix_from_string(const char *p, int family, union in_addr_union *ret_prefix, uint8_t *ret_prefixlen);
 
 static inline size_t FAMILY_ADDRESS_SIZE(int family) {
         assert(family == AF_INET || family == AF_INET6);
index 4c13e46a49e986d5d93b79b9b6750e9218b295a0..66119d2de14e0287dc228b2f6ee7232e59d75bed 100644 (file)
@@ -24,6 +24,7 @@
 #include "fd-util.h"
 #include "parse-util.h"
 #include "string-util.h"
+#include "unaligned.h"
 
 enum {
         IMPORTER_STATE_LINE = 0,    /* waiting to read, or reading line */
@@ -203,7 +204,7 @@ static int get_data_size(JournalImporter *imp) {
         if (r <= 0)
                 return r;
 
-        imp->data_size = le64toh( *(uint64_t *) data );
+        imp->data_size = unaligned_read_le64(data);
         if (imp->data_size > DATA_SIZE_MAX) {
                 log_error("Stream declares field with size %zu > DATA_SIZE_MAX = %u",
                           imp->data_size, DATA_SIZE_MAX);
@@ -314,7 +315,7 @@ int journal_importer_process_data(JournalImporter *imp) {
                         return r;
                 if (r == 0) {
                         imp->state = IMPORTER_STATE_EOF;
-                        return r;
+                        return 0;
                 }
                 assert(n > 0);
                 assert(line[n-1] == '\n');
index 36efc9ac7d8eaf598f776ba831c605d0f78f8070..0d0ced00bda33452404800240719bd54adde5ce0 100644 (file)
@@ -553,7 +553,7 @@ static int write_to_journal(
         return 1;
 }
 
-static int log_dispatch(
+int log_dispatch_internal(
                 int level,
                 int error,
                 const char *file,
@@ -653,7 +653,7 @@ int log_dump_internal(
         if (_likely_(LOG_PRI(level) > log_max_level))
                 return -error;
 
-        return log_dispatch(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
+        return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
 }
 
 int log_internalv(
@@ -680,7 +680,7 @@ int log_internalv(
 
         vsnprintf(buffer, sizeof(buffer), format, ap);
 
-        return log_dispatch(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
+        return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
 }
 
 int log_internal(
@@ -744,7 +744,8 @@ int log_object_internalv(
 
         vsnprintf(b, l, format, ap);
 
-        return log_dispatch(level, error, file, line, func, object_field, object, extra_field, extra, buffer);
+        return log_dispatch_internal(level, error, file, line, func,
+                                     object_field, object, extra_field, extra, buffer);
 }
 
 int log_object_internal(
@@ -788,7 +789,7 @@ static void log_assert(
 
         log_abort_msg = buffer;
 
-        log_dispatch(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
+        log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
 }
 
 noreturn void log_assert_failed(const char *text, const char *file, int line, const char *func) {
@@ -943,7 +944,7 @@ int log_struct_internal(
         if (!found)
                 return -error;
 
-        return log_dispatch(level, error, file, line, func, NULL, NULL, NULL, NULL, buf + 8);
+        return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buf + 8);
 }
 
 int log_set_target_from_string(const char *e) {
index 72714e02e5625992241e271537dd9041af0c909a..b3e4060b5d648bcc47e696f5c57234a8e22aeb4d 100644 (file)
@@ -75,6 +75,18 @@ void log_close_console(void);
 
 void log_parse_environment(void);
 
+int log_dispatch_internal(
+                int level,
+                int error,
+                const char *file,
+                int line,
+                const char *func,
+                const char *object_field,
+                const char *object,
+                const char *extra,
+                const char *extra_field,
+                char *buffer);
+
 int log_internal(
                 int level,
                 int error,
@@ -115,7 +127,7 @@ int log_object_internalv(
                 const char *extra_field,
                 const char *extra,
                 const char *format,
-                va_list ap) _printf_(9,0);
+                va_list ap) _printf_(10,0);
 
 int log_struct_internal(
                 int level,
@@ -137,7 +149,7 @@ int log_format_iovec(
                 bool newline_separator,
                 int error,
                 const char *format,
-                va_list ap);
+                va_list ap) _printf_(6, 0);
 
 /* This modifies the buffer passed! */
 int log_dump_internal(
@@ -167,6 +179,9 @@ void log_assert_failed_return(
                 int line,
                 const char *func);
 
+#define log_dispatch(level, error, buffer)                              \
+        log_dispatch_internal(level, error, __FILE__, __LINE__, __func__, NULL, NULL, NULL, NULL, buffer)
+
 /* Logging with level */
 #define log_full_errno(level, error, ...)                               \
         ({                                                              \
diff --git a/src/basic/meson.build b/src/basic/meson.build
new file mode 100644 (file)
index 0000000..065f0ac
--- /dev/null
@@ -0,0 +1,281 @@
+basic_sources_plain = files('''
+        af-list.c
+        af-list.h
+        alloc-util.c
+        alloc-util.h
+        architecture.c
+        architecture.h
+        arphrd-list.c
+        arphrd-list.h
+        async.c
+        async.h
+        audit-util.c
+        audit-util.h
+        barrier.c
+        barrier.h
+        bitmap.c
+        bitmap.h
+        blkid-util.h
+        btrfs-ctree.h
+        btrfs-util.c
+        btrfs-util.h
+        build.h
+        bus-label.c
+        bus-label.h
+        calendarspec.c
+        calendarspec.h
+        capability-util.c
+        capability-util.h
+        cap-list.c
+        cap-list.h
+        cgroup-util.c
+        cgroup-util.h
+        chattr-util.c
+        chattr-util.h
+        clock-util.c
+        clock-util.h
+        conf-files.c
+        conf-files.h
+        copy.c
+        copy.h
+        cpu-set-util.c
+        cpu-set-util.h
+        def.h
+        device-nodes.c
+        device-nodes.h
+        dirent-util.c
+        dirent-util.h
+        env-util.c
+        env-util.h
+        errno-list.c
+        errno-list.h
+        escape.c
+        escape.h
+        ether-addr-util.c
+        ether-addr-util.h
+        exec-util.c
+        exec-util.h
+        exit-status.c
+        exit-status.h
+        extract-word.c
+        extract-word.h
+        fd-util.c
+        fd-util.h
+        fileio.c
+        fileio.h
+        fileio-label.c
+        fileio-label.h
+        format-util.h
+        fs-util.c
+        fs-util.h
+        glob-util.c
+        glob-util.h
+        gunicode.c
+        gunicode.h
+        hash-funcs.c
+        hash-funcs.h
+        hashmap.c
+        hashmap.h
+        hexdecoct.c
+        hexdecoct.h
+        hostname-util.c
+        hostname-util.h
+        in-addr-util.c
+        in-addr-util.h
+        ioprio.h
+        io-util.c
+        io-util.h
+        journal-importer.c
+        journal-importer.h
+        khash.c
+        khash.h
+        label.c
+        label.h
+        list.h
+        locale-util.c
+        locale-util.h
+        lockfile-util.c
+        lockfile-util.h
+        log.c
+        log.h
+        login-util.c
+        login-util.h
+        macro.h
+        memfd-util.c
+        memfd-util.h
+        mempool.c
+        mempool.h
+        missing_syscall.h
+        mkdir.c
+        mkdir.h
+        mkdir-label.c
+        mount-util.c
+        mount-util.h
+        MurmurHash2.c
+        MurmurHash2.h
+        nss-util.h
+        ordered-set.c
+        ordered-set.h
+        parse-util.c
+        parse-util.h
+        path-util.c
+        path-util.h
+        prioq.c
+        prioq.h
+        proc-cmdline.c
+        proc-cmdline.h
+        process-util.c
+        process-util.h
+        random-util.c
+        random-util.h
+        ratelimit.c
+        ratelimit.h
+        raw-clone.h
+        refcnt.h
+        replace-var.c
+        replace-var.h
+        rlimit-util.c
+        rlimit-util.h
+        rm-rf.c
+        rm-rf.h
+        securebits.h
+        selinux-util.c
+        selinux-util.h
+        set.h
+        sigbus.c
+        sigbus.h
+        signal-util.c
+        signal-util.h
+        siphash24.c
+        siphash24.h
+        smack-util.c
+        smack-util.h
+        socket-label.c
+        socket-util.c
+        socket-util.h
+        sparse-endian.h
+        special.h
+        stat-util.c
+        stat-util.h
+        stdio-util.h
+        strbuf.c
+        strbuf.h
+        string-table.c
+        string-table.h
+        string-util.c
+        string-util.h
+        strv.c
+        strv.h
+        strxcpyx.c
+        strxcpyx.h
+        syslog-util.c
+        syslog-util.h
+        terminal-util.c
+        terminal-util.h
+        time-util.c
+        time-util.h
+        umask-util.h
+        unaligned.h
+        unit-name.c
+        unit-name.h
+        user-util.c
+        user-util.h
+        utf8.c
+        utf8.h
+        util.c
+        util.h
+        verbs.c
+        verbs.h
+        virt.c
+        virt.h
+        web-util.c
+        web-util.h
+        xattr-util.c
+        xattr-util.h
+        xml.c
+        xml.h
+'''.split())
+
+missing_h = files('missing.h')
+
+generate_gperfs = find_program('generate-gperfs.py')
+
+generate_af_list = find_program('generate-af-list.sh')
+af_list_txt = custom_target(
+        'af-list.txt',
+        output : 'af-list.txt',
+        command : [generate_af_list, cpp],
+        capture : true)
+
+generate_arphrd_list = find_program('generate-arphrd-list.sh')
+arphrd_list_txt = custom_target(
+        'arphrd-list.txt',
+        output : 'arphrd-list.txt',
+        command : [generate_arphrd_list, cpp],
+        capture : true)
+
+generate_cap_list = find_program('generate-cap-list.sh')
+cap_list_txt = custom_target(
+        'cap-list.txt',
+        output : 'cap-list.txt',
+        command : [generate_cap_list, cpp, config_h, missing_h],
+        capture : true)
+
+generate_errno_list = find_program('generate-errno-list.sh')
+errno_list_txt = custom_target(
+        'errno-list.txt',
+        output : 'errno-list.txt',
+        command : [generate_errno_list, cpp],
+        capture : true)
+
+generated_gperf_headers = []
+foreach item : [['af',     af_list_txt,     'af',         ''],
+                ['arphrd', arphrd_list_txt, 'arphrd',     'ARPHRD_'],
+                ['cap',    cap_list_txt,    'capability', ''],
+                ['errno',  errno_list_txt,  'errno',      '']]
+
+        fname = '@0@-from-name.gperf'.format(item[0])
+        gperf_file = custom_target(
+                fname,
+                input : item[1],
+                output : fname,
+                command : [generate_gperfs, item[2], item[3], '@INPUT@'],
+                capture : true)
+
+        fname = '@0@-from-name.h'.format(item[0])
+        target1 = custom_target(
+                fname,
+                input : gperf_file,
+                output : fname,
+                command : [gperf,
+                           '-L', 'ANSI-C', '-t', '--ignore-case',
+                           '-N', 'lookup_@0@'.format(item[2]),
+                           '-H', 'hash_@0@_name'.format(item[2]),
+                           '-p', '-C',
+                           '@INPUT@'],
+                capture : true)
+
+        fname = '@0@-to-name.h'.format(item[0])
+        awkscript = '@0@-to-name.awk'.format(item[0])
+        target2 = custom_target(
+                fname,
+                input : [awkscript, item[1]],
+                output : fname,
+                command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
+                capture : true)
+
+        generated_gperf_headers += [target1, target2]
+endforeach
+
+basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers
+
+libbasic = static_library(
+        'basic',
+        basic_sources,
+        include_directories : includes,
+        dependencies : [threads,
+                        libcap,
+                        libblkid,
+                        libselinux,
+                       ],
+        install : false)
index 480462357de9e0f04ba7b54ceb1e4c7f12a106eb..55028754cdc0deb75f9bcccf3de183be0b1191a5 100644 (file)
@@ -68,8 +68,6 @@ struct sockaddr_vm {
 };
 #endif /* !HAVE_LINUX_VM_SOCKETS_H */
 
-#include "macro.h"
-
 #ifndef RLIMIT_RTTIME
 #define RLIMIT_RTTIME 15
 #endif
@@ -726,7 +724,7 @@ struct btrfs_ioctl_quota_ctl_args {
 #define IFLA_VLAN_MAX   (__IFLA_VLAN_MAX - 1)
 #endif
 
-#if !HAVE_DECL_IFLA_VXLAN_REMCSUM_NOPARTIAL
+#if !HAVE_DECL_IFLA_VXLAN_GPE
 #define IFLA_VXLAN_UNSPEC 0
 #define IFLA_VXLAN_ID 1
 #define IFLA_VXLAN_GROUP 2
@@ -752,11 +750,34 @@ struct btrfs_ioctl_quota_ctl_args {
 #define IFLA_VXLAN_REMCSUM_RX 22
 #define IFLA_VXLAN_GBP 23
 #define IFLA_VXLAN_REMCSUM_NOPARTIAL 24
-#define __IFLA_VXLAN_MAX 25
+#define IFLA_VXLAN_COLLECT_METADATA 25
+#define IFLA_VXLAN_LABEL 26
+#define IFLA_VXLAN_GPE 27
+
+#define __IFLA_VXLAN_MAX 28
 
 #define IFLA_VXLAN_MAX  (__IFLA_VXLAN_MAX - 1)
 #endif
 
+#if !HAVE_DECL_IFLA_GENEVE_LABEL
+#define IFLA_GENEVE_UNSPEC 0
+#define IFLA_GENEVE_ID 1
+#define IFLA_GENEVE_REMOTE 2
+#define IFLA_GENEVE_TTL 3
+#define IFLA_GENEVE_TOS 4
+#define IFLA_GENEVE_PORT 5
+#define IFLA_GENEVE_COLLECT_METADATA 6
+#define IFLA_GENEVE_REMOTE6 7
+#define IFLA_GENEVE_UDP_CSUM 8
+#define IFLA_GENEVE_UDP_ZERO_CSUM6_TX 9
+#define IFLA_GENEVE_UDP_ZERO_CSUM6_RX 10
+#define IFLA_GENEVE_LABEL 11
+
+#define __IFLA_GENEVE_MAX 12
+
+#define IFLA_GENEVE_MAX  (__IFLA_GENEVE_MAX - 1)
+#endif
+
 #if !HAVE_DECL_IFLA_IPTUN_ENCAP_DPORT
 #define IFLA_IPTUN_UNSPEC 0
 #define IFLA_IPTUN_LINK 1
index 6e58ced6f5291758ae7acab9f9c5d0531aad73ee..d86700736d7e7b8cbbd5e83f700037886106061d 100644 (file)
@@ -23,7 +23,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <xlocale.h>
 
 #include "alloc-util.h"
 #include "extract-word.h"
index ad7b3eedf2c1d5ffb7ca92662bff43e070878872..b216be579d28c0fe2d250b263dfe0f49de2ef5fb 100644 (file)
 #include <stdint.h>
 
 #ifdef HAVE_SYS_AUXV_H
-#include <sys/auxv.h>
+#  include <sys/auxv.h>
+#endif
+
+#ifdef USE_SYS_RANDOM_H
+#  include <sys/random.h>
+#else
+#  include <linux/random.h>
 #endif
 
 #include "fd-util.h"
index 08497af729c13aa600e04c0f3755a4725e38d7b9..ff040e7a5516c24a158597b7e2e01e5e9c051203 100644 (file)
@@ -182,7 +182,7 @@ int rm_rf(const char *path, RemoveFlags flags) {
         /* We refuse to clean the root file system with this
          * call. This is extra paranoia to never cause a really
          * seriously broken system. */
-        if (path_equal(path, "/")) {
+        if (path_equal_or_files_same(path, "/")) {
                 log_error("Attempted to remove entire root file system, and we can't allow that.");
                 return -EPERM;
         }
index 155bf278b2e444072e05d60916070f9d3036e3fd..3358dc32a502d0c58436e024dcb1d6cd616acac6 100644 (file)
@@ -19,7 +19,7 @@
 ***/
 
 #include <assert.h>
-#include <blkid/blkid.h>
+#include <blkid.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
index 681e783f2e2ee423a0dc1d2fd394f7f7d081ea26..f5b39342b7aedf1ce4cd2165a951f7e823b3b241 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 
 /* magic string to find in the binary image */
-static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " VERSION " ####";
+static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " PACKAGE_VERSION " ####";
 
 static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
 
@@ -363,7 +363,7 @@ static VOID print_status(Config *config, CHAR16 *loaded_image_path) {
         uefi_call_wrapper(ST->ConOut->SetAttribute, 2, ST->ConOut, EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK);
         uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut);
 
-        Print(L"systemd-boot version:   " VERSION "\n");
+        Print(L"systemd-boot version:   " PACKAGE_VERSION "\n");
         Print(L"architecture:           " EFI_MACHINE_TYPE_NAME "\n");
         Print(L"loaded image:           %s\n", loaded_image_path);
         Print(L"UEFI specification:     %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff);
@@ -781,7 +781,7 @@ static BOOLEAN menu_run(Config *config, ConfigEntry **chosen_entry, CHAR16 *load
                         break;
 
                 case KEYPRESS(0, 0, 'v'):
-                        status = PoolPrint(L"systemd-boot " VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d",
+                        status = PoolPrint(L"systemd-boot " PACKAGE_VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d",
                                            ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff,
                                            ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
                         break;
@@ -1718,7 +1718,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
         InitializeLib(image, sys_table);
         init_usec = time_usec();
         efivar_set_time_usec(L"LoaderTimeInitUSec", init_usec);
-        efivar_set(L"LoaderInfo", L"systemd-boot " VERSION, FALSE);
+        efivar_set(L"LoaderInfo", L"systemd-boot " PACKAGE_VERSION, FALSE);
         s = PoolPrint(L"%s %d.%02d", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
         efivar_set(L"LoaderFirmwareInfo", s, FALSE);
         FreePool(s);
index 4ac11a9bb05fe7a932b696c7aef40a9d0333825f..b22d37b62d391eda42108e99f7c226d606a660af 100644 (file)
@@ -199,7 +199,7 @@ static EFI_STATUS tpm1_measure_to_pcr_and_event_log(const EFI_TCG *tcg, UINT32 p
 
         event_number = 1;
         status = uefi_call_wrapper(tcg->HashLogExtendEvent, 7,
-                                   tcg, buffer, buffer_size, TCG_ALG_SHA, tcg_event, &event_number, &event_log_last);
+                                   (EFI_TCG *) tcg, buffer, buffer_size, TCG_ALG_SHA, tcg_event, &event_number, &event_log_last);
 
         if (EFI_ERROR(status))
                 return status;
@@ -219,7 +219,7 @@ static EFI_STATUS tpm1_measure_to_pcr_and_event_log(const EFI_TCG *tcg, UINT32 p
  */
 static EFI_STATUS trigger_tcg2_final_events_table(const EFI_TCG2 *tcg)
 {
-        return uefi_call_wrapper(tcg->GetEventLog, 5, tcg,
+        return uefi_call_wrapper(tcg->GetEventLog, 5, (EFI_TCG2 *) tcg,
                                  EFI_TCG2_EVENT_LOG_FORMAT_TCG_2, NULL,
                                  NULL, NULL);
 }
@@ -254,7 +254,7 @@ static EFI_STATUS tpm2_measure_to_pcr_and_event_log(const EFI_TCG2 *tcg, UINT32
 
         CopyMem((VOID *) tcg_event->Event, (VOID *) description, desc_len);
 
-        status = uefi_call_wrapper(tcg->HashLogExtendEvent, 5, tcg, 0, buffer, buffer_size, tcg_event);
+        status = uefi_call_wrapper(tcg->HashLogExtendEvent, 5, (EFI_TCG2 *) tcg, 0, buffer, buffer_size, tcg_event);
 
         uefi_call_wrapper(BS->FreePool, 1, tcg_event);
 
index a2cfe817d0e04f3466052aef66d6f16acbae6f6a..43aa8a0058534bdaadd525c770cf73306451b15b 100644 (file)
@@ -13,9 +13,6 @@
 #ifndef __SDBOOT_MEASURE_H
 #define __SDBOOT_MEASURE_H
 
-#ifndef SD_TPM_PCR
-#define SD_TPM_PCR 8
-#endif
-
 EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description);
+
 #endif
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
new file mode 100644 (file)
index 0000000..6d1b38a
--- /dev/null
@@ -0,0 +1,203 @@
+efi_headers = files('''
+        console.h
+        disk.h
+        graphics.h
+        linux.h
+        measure.h
+        pefile.h
+        splash.h
+        util.h
+'''.split())
+
+common_sources = '''
+        disk.c
+        graphics.c
+        measure.c
+        pefile.c
+        util.c
+'''.split()
+
+systemd_boot_sources = '''
+        boot.c
+        console.c
+'''.split()
+
+stub_sources = '''
+        linux.c
+        splash.c
+        stub.c
+'''.split()
+
+if conf.get('ENABLE_EFI', false) and get_option('gnu-efi') != 'false'
+        efi_cc = get_option('efi-cc')
+        efi_ld = get_option('efi-ld')
+
+        efi_incdir = get_option('efi-includedir')
+        have_header = (gnu_efi_arch != '' and
+                       cc.has_header('@0@/@1@/efibind.h'.format(efi_incdir, gnu_efi_arch)))
+
+        if have_header and EFI_MACHINE_TYPE_NAME == ''
+                error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown')
+        endif
+
+        efi_libdir = get_option('efi-libdir')
+        if efi_libdir == ''
+                cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc)
+                ret = run_command('sh', '-c', cmd)
+                if ret.returncode() == 0
+                        efi_libdir = ret.stdout().strip()
+                endif
+        endif
+
+        have_gnu_efi = have_header and efi_libdir != ''
+else
+        have_gnu_efi = false
+endif
+
+if get_option('gnu-efi') == 'true' and not have_gnu_efi
+        error('gnu-efi support requested, but headers were not found')
+endif
+
+if have_gnu_efi
+        efi_conf = configuration_data()
+        efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+        efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
+        efi_conf.set('SD_BOOT_LOG_TPM', get_option('tpm'))
+        efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
+
+        efi_config_h = configure_file(
+                output : 'efi_config.h',
+                configuration : efi_conf)
+
+        objcopy = find_program('objcopy')
+
+        efi_ldsdir = get_option('efi-ldsdir')
+        arch_lds = 'elf_@0@_efi.lds'.format(gnu_efi_arch)
+        if efi_ldsdir == ''
+                efi_ldsdir = join_paths(efi_libdir, 'gnuefi')
+                cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds))
+                if cmd.returncode() != 0
+                        efi_ldsdir = efi_libdir
+                        cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds))
+                        if cmd.returncode() != 0
+                               error('Cannot find @0@'.format(arch_lds))
+                        endif
+                endif
+        endif
+
+        message('efi-libdir: "@0@"'.format(efi_libdir))
+        message('efi-ldsdir: "@0@"'.format(efi_ldsdir))
+        message('efi-includedir: "@0@"'.format(efi_incdir))
+
+        compile_args = ['-Wall',
+                        '-Wextra',
+                        '-std=gnu90',
+                        '-nostdinc',
+                        '-ggdb', '-O0',
+                        '-fpic',
+                        '-fshort-wchar',
+                        '-ffreestanding',
+                        '-fno-strict-aliasing',
+                        '-fno-stack-protector',
+                        '-Wsign-compare',
+                        '-Wno-missing-field-initializers',
+                        '-isystem', efi_incdir,
+                        '-isystem', join_paths(efi_incdir, gnu_efi_arch),
+                        '-include', efi_config_h]
+        if efi_arch == 'x86_64'
+                compile_args += ['-mno-red-zone',
+                                 '-mno-sse',
+                                 '-mno-mmx',
+                                 '-DEFI_FUNCTION_WRAPPER',
+                                 '-DGNU_EFI_USE_MS_ABI']
+        elif efi_arch == 'ia32'
+                compile_args += ['-mno-sse',
+                                 '-mno-mmx']
+        endif
+
+        efi_ldflags = ['-T',
+                       join_paths(efi_ldsdir, arch_lds),
+                       '-shared',
+                       '-Bsymbolic',
+                       '-nostdlib',
+                       '-znocombreloc',
+                       '-L', efi_libdir,
+                       join_paths(efi_ldsdir, 'crt0-efi-@0@.o'.format(gnu_efi_arch))]
+        if efi_arch == 'aarch64' or efi_arch == 'arm'
+                # Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary'
+                # instead, and add required symbols manually.
+                efi_ldflags += ['--defsym=EFI_SUBSYSTEM=0xa']
+                efi_format = ['-O', 'binary']
+        else
+                efi_format = ['--target=efi-app-@0@'.format(gnu_efi_arch)]
+        endif
+
+        systemd_boot_objects = []
+        stub_objects = []
+        foreach file : common_sources + systemd_boot_sources + stub_sources
+                o_file = custom_target(file + '.o',
+                                       input : file,
+                                       output : file + '.o',
+                                       command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
+                                                 + compile_args,
+                                       depend_files : efi_headers)
+                if (common_sources + systemd_boot_sources).contains(file)
+                        systemd_boot_objects += [o_file]
+                endif
+                if (common_sources + stub_sources).contains(file)
+                        stub_objects += [o_file]
+                endif
+        endforeach
+
+        libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip()
+        systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
+        stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
+        no_undefined_symbols = find_program('no-undefined-symbols.sh')
+
+        foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects],
+                         ['stub.so', stub_efi_name, stub_objects]]
+                so = custom_target(
+                        tuple[0],
+                        input : tuple[2],
+                        output : tuple[0],
+                        command : [efi_ld, '-o', '@OUTPUT@'] +
+                                  efi_ldflags + tuple[2] +
+                                  ['-lefi', '-lgnuefi', libgcc_file_name])
+
+                test('no-undefined-symbols-' + tuple[0],
+                     no_undefined_symbols,
+                     args : [so])
+
+                stub = custom_target(
+                        tuple[1],
+                        input : so,
+                        output : tuple[1],
+                        command : [objcopy,
+                                   '-j', '.text',
+                                   '-j', '.sdata',
+                                   '-j', '.data',
+                                   '-j', '.dynamic',
+                                   '-j', '.dynsym',
+                                   '-j', '.rel',
+                                   '-j', '.rela',
+                                   '-j', '.reloc']
+                                  + efi_format +
+                                  ['@INPUT@', '@OUTPUT@'],
+                        install : true,
+                        install_dir : bootlibdir)
+
+                set_variable(tuple[0].underscorify(), so)
+                set_variable(tuple[0].underscorify() + '_stub', stub)
+        endforeach
+endif
+
+############################################################
+
+if have_gnu_efi
+        test_efi_disk_img = custom_target(
+                'test-efi-disk.img',
+                input : [systemd_boot_so, stub_so_stub],
+                output : 'test-efi-disk.img',
+                command : [test_efi_create_disk_sh, '@OUTPUT@',
+                           '@INPUT0@', '@INPUT1@', splash_bmp])
+endif
diff --git a/src/boot/efi/no-undefined-symbols.sh b/src/boot/efi/no-undefined-symbols.sh
new file mode 100755 (executable)
index 0000000..08b266c
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh -eu
+
+if nm -D -u "$1" | grep ' U '; then
+        echo "Undefined symbols detected!"
+        exit 1
+fi
index b7d5d3cdae369febeb9585bb08f7ef8afa5a89d4..98730a5d3d8417ad337b8adaebf89e4e731f223a 100644 (file)
@@ -23,7 +23,7 @@
 #include "measure.h"
 
 /* magic string to find in the binary image */
-static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " VERSION " ####";
+static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " PACKAGE_VERSION " ####";
 
 static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
 
index a1c0f48c8906c69aee2ae9182816376b027bc8d9..7ebb02fa8ce1694adb409db06867402992afd26d 100644 (file)
@@ -75,6 +75,7 @@ static usec_t arg_delay = 1*USEC_PER_SEC;
 static char* arg_machine = NULL;
 static char* arg_root = NULL;
 static bool arg_recursive = true;
+static bool arg_recursive_unset = false;
 
 static enum {
         COUNT_PIDS,
@@ -118,7 +119,7 @@ static const char *maybe_format_bytes(char *buf, size_t l, bool is_valid, uint64
         if (!is_valid)
                 return "-";
         if (arg_raw) {
-                snprintf(buf, l, "%jd", t);
+                snprintf(buf, l, "%" PRIu64, t);
                 return buf;
         }
         return format_bytes(buf, l, t);
@@ -732,7 +733,6 @@ static int parse_argv(int argc, char *argv[]) {
                 {}
         };
 
-        bool recursive_unset = false;
         int c, r;
 
         assert(argc >= 1);
@@ -852,7 +852,7 @@ static int parse_argv(int argc, char *argv[]) {
                         }
 
                         arg_recursive = r;
-                        recursive_unset = r == 0;
+                        arg_recursive_unset = r == 0;
                         break;
 
                 case 'M':
@@ -873,11 +873,6 @@ static int parse_argv(int argc, char *argv[]) {
                 return -EINVAL;
         }
 
-        if (recursive_unset && arg_count == COUNT_PIDS) {
-                log_error("Non-recursive counting is only supported when counting processes, not tasks. Use -P or -k.");
-                return -EINVAL;
-        }
-
         return 1;
 }
 
@@ -902,6 +897,10 @@ int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
 
+        r = parse_argv(argc, argv);
+        if (r <= 0)
+                goto finish;
+
         r = cg_mask_supported(&mask);
         if (r < 0) {
                 log_error_errno(r, "Failed to determine supported controllers: %m");
@@ -910,9 +909,10 @@ int main(int argc, char *argv[]) {
 
         arg_count = (mask & CGROUP_MASK_PIDS) ? COUNT_PIDS : COUNT_USERSPACE_PROCESSES;
 
-        r = parse_argv(argc, argv);
-        if (r <= 0)
-                goto finish;
+        if (arg_recursive_unset && arg_count == COUNT_PIDS) {
+                log_error("Non-recursive counting is only supported when counting processes, not tasks. Use -P or -k.");
+                return -EINVAL;
+        }
 
         r = show_cgroup_get_path_and_warn(arg_machine, arg_root, &root);
         if (r < 0) {
index 88b758eecbe086fb5ae97b07353224d86aca52f9..955f6f88d86c07b86370a5ad02bfe50eefd6e0fd 100644 (file)
@@ -764,7 +764,7 @@ static int busname_peek_message(BusName *n) {
         struct kdbus_item *d;
         struct kdbus_msg *k;
         size_t start, ps, sz, delta;
-        void *p = NULL;
+        void *p = MAP_FAILED;
         pid_t pid = 0;
         int r;
 
@@ -825,7 +825,7 @@ static int busname_peek_message(BusName *n) {
         r = 0;
 
 finish:
-        if (p)
+        if (p != MAP_FAILED)
                 (void) munmap(p, sz);
 
         cmd_free.offset = cmd_recv.msg.offset;
index 7df4cab3f6f250e0d93f1c7ca5d9ce20d6331d06..0454a28e12b8cb9495f330f95aa305ca3761d053 100644 (file)
@@ -710,7 +710,7 @@ static int property_get_bind_paths(
                                 c->bind_mounts[i].source,
                                 c->bind_mounts[i].destination,
                                 c->bind_mounts[i].ignore_enoent,
-                                c->bind_mounts[i].recursive ? MS_REC : 0);
+                                c->bind_mounts[i].recursive ? (uint64_t) MS_REC : (uint64_t) 0);
                 if (r < 0)
                         return r;
         }
index f15bb2196ccc85e3ea05e877ca39e2813016c6a1..b0645ce294071619932c09e2184edf8cb9cad511 100644 (file)
@@ -748,6 +748,7 @@ const sd_bus_vtable bus_unit_vtable[] = {
         SD_BUS_PROPERTY("IgnoreOnIsolate", "b", bus_property_get_bool, offsetof(Unit, ignore_on_isolate), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("NeedDaemonReload", "b", property_get_need_daemon_reload, 0, SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("JobTimeoutUSec", "t", bus_property_get_usec, offsetof(Unit, job_timeout), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("JobRunningTimeoutUSec", "t", bus_property_get_usec, offsetof(Unit, job_running_timeout), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("JobTimeoutAction", "s", property_get_emergency_action, offsetof(Unit, job_timeout_action), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("JobTimeoutRebootArgument", "s", NULL, offsetof(Unit, job_timeout_reboot_arg), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("ConditionResult", "b", bus_property_get_bool, offsetof(Unit, condition_result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
index 065f2d81d6575d34425ae5e3fd1bdd063ccff187..cfc045d282c72ed5069f2fe4a8c6e3caeef67f43 100644 (file)
@@ -753,13 +753,13 @@ int manager_sync_bus_names(Manager *m, sd_bus *bus) {
                         /* If it is, determine its current owner */
                         r = sd_bus_get_name_creds(bus, name, SD_BUS_CREDS_UNIQUE_NAME, &creds);
                         if (r < 0) {
-                                log_error_errno(r, "Failed to get bus name owner %s: %m", name);
+                                log_full_errno(r == -ENXIO ? LOG_DEBUG : LOG_ERR, r, "Failed to get bus name owner %s: %m", name);
                                 continue;
                         }
 
                         r = sd_bus_creds_get_unique_name(creds, &unique);
                         if (r < 0) {
-                                log_error_errno(r, "Failed to get unique name for %s: %m", name);
+                                log_full_errno(r == -ENXIO ? LOG_DEBUG : LOG_ERR, r, "Failed to get unique name for %s: %m", name);
                                 continue;
                         }
 
index 0e67c96552eac9cb6e29fcf906d2b88a09df0504..da008f604148850e7bf8ae5f767d11a919f272b5 100644 (file)
@@ -112,7 +112,7 @@ static void device_init(Unit *u) {
          * indefinitely for plugged in devices, something which cannot
          * happen for the other units since their operations time out
          * anyway. */
-        u->job_timeout = u->manager->default_timeout_start_usec;
+        u->job_running_timeout = u->manager->default_timeout_start_usec;
 
         u->ignore_on_isolate = true;
 }
index b2e6828239d147c37f558bf2ca17fc8ff508ac5d..e97651105ee2f82067df361b21c49187aac09b58 100644 (file)
@@ -2887,9 +2887,9 @@ static int exec_child(
                 if (line) {
                         log_open();
                         log_struct(LOG_DEBUG,
-                                   LOG_UNIT_ID(unit),
                                    "EXECUTABLE=%s", command->path,
                                    LOG_UNIT_MESSAGE(unit, "Executing: %s", line),
+                                   LOG_UNIT_ID(unit),
                                    NULL);
                         log_close();
                 }
@@ -2927,11 +2927,16 @@ int exec_spawn(Unit *unit,
             context->std_output == EXEC_OUTPUT_SOCKET ||
             context->std_error == EXEC_OUTPUT_SOCKET) {
 
-                if (params->n_fds != 1) {
+                if (params->n_fds > 1) {
                         log_unit_error(unit, "Got more than one socket.");
                         return -EINVAL;
                 }
 
+                if (params->n_fds == 0) {
+                        log_unit_error(unit, "Got no socket.");
+                        return -EINVAL;
+                }
+
                 socket_fd = params->fds[0];
         } else {
                 socket_fd = -1;
@@ -2953,9 +2958,9 @@ int exec_spawn(Unit *unit,
                 return log_oom();
 
         log_struct(LOG_DEBUG,
-                   LOG_UNIT_ID(unit),
                    LOG_UNIT_MESSAGE(unit, "About to execute: %s", line),
                    "EXECUTABLE=%s", command->path,
+                   LOG_UNIT_ID(unit),
                    NULL);
         pid = fork();
         if (pid < 0)
@@ -2989,6 +2994,14 @@ int exec_spawn(Unit *unit,
                                                                   error_message),
                                                  "EXECUTABLE=%s", command->path,
                                                  NULL);
+                        else if (r == -ENOENT && command->ignore)
+                                log_struct_errno(LOG_INFO, r,
+                                                 "MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
+                                                 LOG_UNIT_ID(unit),
+                                                 LOG_UNIT_MESSAGE(unit, "Skipped spawning %s: %m",
+                                                                  command->path),
+                                                 "EXECUTABLE=%s", command->path,
+                                                 NULL);
                         else
                                 log_struct_errno(LOG_ERR, r,
                                                  "MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
@@ -3223,11 +3236,10 @@ int exec_context_load_environment(Unit *unit, const ExecContext *c, char ***l) {
 
         STRV_FOREACH(i, c->environment_files) {
                 char *fn;
-                int k;
+                int k, n;
                 bool ignore = false;
                 char **p;
                 _cleanup_globfree_ glob_t pglob = {};
-                int count, n;
 
                 fn = *i;
 
@@ -3245,23 +3257,19 @@ int exec_context_load_environment(Unit *unit, const ExecContext *c, char ***l) {
                 }
 
                 /* Filename supports globbing, take all matching files */
-                errno = 0;
-                if (glob(fn, 0, NULL, &pglob) != 0) {
+                k = safe_glob(fn, 0, &pglob);
+                if (k < 0) {
                         if (ignore)
                                 continue;
 
                         strv_free(r);
-                        return errno > 0 ? -errno : -EINVAL;
+                        return k;
                 }
-                count = pglob.gl_pathc;
-                if (count == 0) {
-                        if (ignore)
-                                continue;
 
-                        strv_free(r);
-                        return -EINVAL;
-                }
-                for (n = 0; n < count; n++) {
+                /* When we don't match anything, -ENOENT should be returned */
+                assert(pglob.gl_pathc > 0);
+
+                for (n = 0; n < pglob.gl_pathc; n++) {
                         k = load_env_file(NULL, pglob.gl_pathv[n], NULL, &p);
                         if (k < 0) {
                                 if (ignore)
index 94ae429f46d071fa0a205ec5568dbeb4cab5a99a..7b5c98a57c93a2a8d5abf92e5dd0a0cac48e5485 100644 (file)
@@ -49,6 +49,11 @@ int ima_setup(void) {
                 return 0;
         }
 
+        if (access(IMA_POLICY_PATH, F_OK) < 0) {
+                log_debug("No IMA custom policy file "IMA_POLICY_PATH", ignoring.");
+                return 0;
+        }
+
         imafd = open(IMA_SECFS_POLICY, O_WRONLY|O_CLOEXEC);
         if (imafd < 0) {
                 log_error_errno(errno, "Failed to open the IMA kernel interface "IMA_SECFS_POLICY", ignoring: %m");
@@ -62,8 +67,7 @@ int ima_setup(void) {
         /* fall back to copying the policy line-by-line */
         input = fopen(IMA_POLICY_PATH, "re");
         if (!input) {
-                log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, errno,
-                               "Failed to open the IMA custom policy file "IMA_POLICY_PATH", ignoring: %m");
+                log_warning_errno(errno, "Failed to open the IMA custom policy file "IMA_POLICY_PATH", ignoring: %m");
                 return 0;
         }
 
index e2349830a82476829931f1cc5ec42c0aebe51754..5067006d631dcbc89d4a84ab043f3a1b3d44e9a5 100644 (file)
@@ -576,6 +576,7 @@ int job_run_and_invalidate(Job *j) {
         if (!job_is_runnable(j))
                 return -EAGAIN;
 
+        job_start_timer(j, true);
         job_set_state(j, JOB_RUNNING);
         job_add_to_dbus_queue(j);
 
@@ -800,18 +801,18 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) {
 
         default:
                 log_struct(job_result_log_level[result],
-                           LOG_UNIT_ID(u),
                            LOG_MESSAGE("%s", buf),
                            "RESULT=%s", job_result_to_string(result),
+                           LOG_UNIT_ID(u),
                            NULL);
                 return;
         }
 
         log_struct(job_result_log_level[result],
-                   mid,
-                   LOG_UNIT_ID(u),
                    LOG_MESSAGE("%s", buf),
                    "RESULT=%s", job_result_to_string(result),
+                   LOG_UNIT_ID(u),
+                   mid,
                    NULL);
 }
 
@@ -949,22 +950,45 @@ static int job_dispatch_timer(sd_event_source *s, uint64_t monotonic, void *user
         return 0;
 }
 
-int job_start_timer(Job *j) {
+int job_start_timer(Job *j, bool job_running) {
         int r;
+        usec_t run_begin, timeout_time, old_timeout_time;
 
-        if (j->timer_event_source)
-                return 0;
+        if (job_running) {
+                if (j->unit->job_running_timeout == USEC_INFINITY)
+                        return 0;
 
-        j->begin_usec = now(CLOCK_MONOTONIC);
+                run_begin = now(CLOCK_MONOTONIC);
+                timeout_time = usec_add(run_begin, j->unit->job_running_timeout);
 
-        if (j->unit->job_timeout == USEC_INFINITY)
-                return 0;
+                if (j->timer_event_source) {
+                        /* Update only if JobRunningTimeoutSec= results in earlier timeout */
+                        r = sd_event_source_get_time(j->timer_event_source, &old_timeout_time);
+                        if (r < 0)
+                                return r;
+
+                        if (old_timeout_time <= timeout_time)
+                                return 0;
+
+                        return sd_event_source_set_time(j->timer_event_source, timeout_time);
+                }
+        } else {
+                if (j->timer_event_source)
+                        return 0;
+
+                j->begin_usec = now(CLOCK_MONOTONIC);
+
+                if (j->unit->job_timeout == USEC_INFINITY)
+                        return 0;
+
+                timeout_time = usec_add(j->begin_usec, j->unit->job_timeout);
+        }
 
         r = sd_event_add_time(
                         j->manager->event,
                         &j->timer_event_source,
                         CLOCK_MONOTONIC,
-                        usec_add(j->begin_usec, j->unit->job_timeout), 0,
+                        timeout_time, 0,
                         job_dispatch_timer, j);
         if (r < 0)
                 return r;
index bea743f4620c0609c7acb31b2e5a4ce618eecc01..8b3d38fc6013808462d0cd6975257ddb1490aa1b 100644 (file)
@@ -220,7 +220,7 @@ int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u);
 void job_add_to_run_queue(Job *j);
 void job_add_to_dbus_queue(Job *j);
 
-int job_start_timer(Job *j);
+int job_start_timer(Job *j, bool job_running);
 
 int job_run_and_invalidate(Job *j);
 int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool already);
diff --git a/src/core/load-fragment-gperf-nulstr.awk b/src/core/load-fragment-gperf-nulstr.awk
new file mode 100644 (file)
index 0000000..b52438a
--- /dev/null
@@ -0,0 +1,14 @@
+BEGIN{
+        keywords=0 ; FS="," ;
+        print "extern const char load_fragment_gperf_nulstr[];" ;
+        print "const char load_fragment_gperf_nulstr[] ="
+}
+keyword==1 {
+        print "\"" $$1 "\\0\""
+}
+/%%/ {
+        keyword=1
+}
+END {
+        print ";"
+}
index cb9e6fea2788244b99912309afce568571720ba5..97adbdd7bb2edc335851a8b9bc157d3524205b6f 100644 (file)
@@ -194,6 +194,7 @@ Unit.OnFailureIsolate,           config_parse_job_mode_isolate,      0,
 Unit.IgnoreOnIsolate,            config_parse_bool,                  0,                             offsetof(Unit, ignore_on_isolate)
 Unit.IgnoreOnSnapshot,           config_parse_warn_compat,           DISABLED_LEGACY,               0
 Unit.JobTimeoutSec,              config_parse_sec_fix_0,             0,                             offsetof(Unit, job_timeout)
+Unit.JobRunningTimeoutSec,       config_parse_sec,                   0,                             offsetof(Unit, job_running_timeout)
 Unit.JobTimeoutAction,           config_parse_emergency_action,      0,                             offsetof(Unit, job_timeout_action)
 Unit.JobTimeoutRebootArgument,   config_parse_unit_string_printf,    0,                             offsetof(Unit, job_timeout_reboot_arg)
 Unit.StartLimitIntervalSec,      config_parse_sec,                   0,                             offsetof(Unit, start_limit.interval)
index 5b7471c0d0d202b45a28c138ec9f862c8128c6c8..af3c6a46068b3a8f5d8a2ba55088a8a0b4ba7706 100644 (file)
@@ -392,7 +392,9 @@ int config_parse_socket_listen(const char *unit,
 
                 r = socket_address_parse_and_warn(&p->address, k);
                 if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse address value, ignoring: %s", rvalue);
+                        if (r != -EAFNOSUPPORT)
+                                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse address value, ignoring: %s", rvalue);
+
                         return 0;
                 }
 
@@ -3907,6 +3909,7 @@ int config_parse_bind_paths(
                 void *userdata) {
 
         ExecContext *c = data;
+        Unit *u = userdata;
         const char *p;
         int r;
 
@@ -3926,6 +3929,7 @@ int config_parse_bind_paths(
         p = rvalue;
         for (;;) {
                 _cleanup_free_ char *source = NULL, *destination = NULL;
+                _cleanup_free_ char *sresolved = NULL, *dresolved = NULL;
                 char *s = NULL, *d = NULL;
                 bool rbind = true, ignore_enoent = false;
 
@@ -3939,7 +3943,14 @@ int config_parse_bind_paths(
                         return 0;
                 }
 
-                s = source;
+                r = unit_full_printf(u, source, &sresolved);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r,
+                                   "Failed to resolved specifiers in \"%s\", ignoring: %m", source);
+                        return 0;
+                }
+
+                s = sresolved;
                 if (s[0] == '-') {
                         ignore_enoent = true;
                         s++;
@@ -3970,16 +3981,23 @@ int config_parse_bind_paths(
                                 return 0;
                         }
 
-                        if (!utf8_is_valid(destination)) {
-                                log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, destination);
+                        r = unit_full_printf(u, destination, &dresolved);
+                        if (r < 0) {
+                                log_syntax(unit, LOG_ERR, filename, line, r,
+                                           "Failed to resolved specifiers in \"%s\", ignoring: %m", destination);
+                                return 0;
+                        }
+
+                        if (!utf8_is_valid(dresolved)) {
+                                log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, dresolved);
                                 return 0;
                         }
-                        if (!path_is_absolute(destination)) {
-                                log_syntax(unit, LOG_ERR, filename, line, 0, "Not an absolute destination path, ignoring: %s", destination);
+                        if (!path_is_absolute(dresolved)) {
+                                log_syntax(unit, LOG_ERR, filename, line, 0, "Not an absolute destination path, ignoring: %s", dresolved);
                                 return 0;
                         }
 
-                        d = path_kill_slashes(destination);
+                        d = path_kill_slashes(dresolved);
 
                         /* Optionally, there's also a short option string specified */
                         if (p && p[-1] == ':') {
index bcf9ea5f25a07379d1aad01d4be821848b17e126..e6ae0bee3193a5a5e56b549971749ec0c14a734f 100644 (file)
@@ -1162,6 +1162,8 @@ static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool switching
 static int bump_rlimit_nofile(struct rlimit *saved_rlimit) {
         struct rlimit nl;
         int r;
+        int min_max;
+        _cleanup_free_ char *nr_open = NULL;
 
         assert(saved_rlimit);
 
@@ -1182,8 +1184,16 @@ static int bump_rlimit_nofile(struct rlimit *saved_rlimit) {
                 arg_default_rlimit[RLIMIT_NOFILE] = rl;
         }
 
+        /* Get current RLIMIT_NOFILE maximum compiled into the kernel. */
+        r = read_one_line_file("/proc/sys/fs/nr_open", &nr_open);
+        if (r == 0)
+                r = safe_atoi(nr_open, &min_max);
+        /* If we fail, fallback to the hard-coded kernel limit of 1024 * 1024. */
+        if (r < 0)
+                min_max = 1024 * 1024;
+
         /* Bump up the resource limit for ourselves substantially */
-        nl.rlim_cur = nl.rlim_max = 64*1024;
+        nl.rlim_cur = nl.rlim_max = min_max;
         r = setrlimit_closest(RLIMIT_NOFILE, &nl);
         if (r < 0)
                 return log_warning_errno(r, "Setting RLIMIT_NOFILE failed, ignoring: %m");
diff --git a/src/core/meson.build b/src/core/meson.build
new file mode 100644 (file)
index 0000000..fb8f9dc
--- /dev/null
@@ -0,0 +1,235 @@
+libcore_la_sources = '''
+        unit.c
+        unit.h
+        unit-printf.c
+        unit-printf.h
+        job.c
+        job.h
+        manager.c
+        manager.h
+        transaction.c
+        transaction.h
+        load-fragment.c
+        load-fragment.h
+        service.c
+        service.h
+        socket.c
+        socket.h
+        busname.c
+        busname.h
+        bus-policy.c
+        bus-policy.h
+        target.c
+        target.h
+        device.c
+        device.h
+        mount.c
+        mount.h
+        automount.c
+        automount.h
+        swap.c
+        swap.h
+        timer.c
+        timer.h
+        path.c
+        path.h
+        slice.c
+        slice.h
+        scope.c
+        scope.h
+        load-dropin.c
+        load-dropin.h
+        execute.c
+        execute.h
+        dynamic-user.c
+        dynamic-user.h
+        kill.c
+        kill.h
+        dbus.c
+        dbus.h
+        dbus-manager.c
+        dbus-manager.h
+        dbus-unit.c
+        dbus-unit.h
+        dbus-job.c
+        dbus-job.h
+        dbus-service.c
+        dbus-service.h
+        dbus-socket.c
+        dbus-socket.h
+        dbus-busname.c
+        dbus-busname.h
+        dbus-target.c
+        dbus-target.h
+        dbus-device.c
+        dbus-device.h
+        dbus-mount.c
+        dbus-mount.h
+        dbus-automount.c
+        dbus-automount.h
+        dbus-swap.c
+        dbus-swap.h
+        dbus-timer.c
+        dbus-timer.h
+        dbus-path.c
+        dbus-path.h
+        dbus-slice.c
+        dbus-slice.h
+        dbus-scope.c
+        dbus-scope.h
+        dbus-execute.c
+        dbus-execute.h
+        dbus-kill.c
+        dbus-kill.h
+        dbus-cgroup.c
+        dbus-cgroup.h
+        cgroup.c
+        cgroup.h
+        selinux-access.c
+        selinux-access.h
+        selinux-setup.c
+        selinux-setup.h
+        smack-setup.c
+        smack-setup.h
+        ima-setup.c
+        ima-setup.h
+        locale-setup.h
+        locale-setup.c
+        hostname-setup.c
+        hostname-setup.h
+        machine-id-setup.c
+        machine-id-setup.h
+        mount-setup.c
+        mount-setup.h
+        kmod-setup.c
+        kmod-setup.h
+        loopback-setup.h
+        loopback-setup.c
+        namespace.c
+        namespace.h
+        killall.h
+        killall.c
+        audit-fd.c
+        audit-fd.h
+        show-status.c
+        show-status.h
+        emergency-action.c
+        emergency-action.h
+'''.split()
+
+load_fragment_gperf_gperf = custom_target(
+        'load-fragment-gperf.gperf',
+        input : 'load-fragment-gperf.gperf.m4',
+        output: 'load-fragment-gperf.gperf',
+        command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+        capture : true)
+
+load_fragment_gperf_c = custom_target(
+        'load-fragment-gperf.c',
+        input : load_fragment_gperf_gperf,
+        output : 'load-fragment-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+awkscript = 'load-fragment-gperf-nulstr.awk'
+load_fragment_gperf_nulstr_c = custom_target(
+        'load-fragment-gperf-nulstr.c',
+        input : [awkscript, load_fragment_gperf_gperf],
+        output : 'load-fragment-gperf-nulstr.c',
+        command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
+        capture : true)
+
+libcore = static_library(
+        'core',
+        libcore_la_sources,
+        load_fragment_gperf_c,
+        load_fragment_gperf_nulstr_c,
+        include_directories : includes,
+        link_with : [libshared_static],
+        dependencies : [threads,
+                        libseccomp,
+                        libpam,
+                        libaudit,
+                        libkmod,
+                        libapparmor,
+                        libmount])
+
+systemd_sources = files('main.c')
+
+systemd_shutdown_sources = files('''
+        shutdown.c
+        umount.c
+        umount.h
+        mount-setup.c
+        mount-setup.h
+        killall.c
+        killall.h
+'''.split())
+
+in_files = [['macros.systemd',   rpmmacrosdir],
+            ['triggers.systemd', ''],
+            ['systemd.pc',       pkgconfigdatadir]]
+
+foreach item : in_files
+        file = item[0]
+        dir = item[1]
+
+        # If 'no', disable generation completely.
+        # If '', generate, but do not install.
+        if dir != 'no'
+                gen = configure_file(
+                        input : file + '.in',
+                        output : file,
+                        configuration : substs)
+                if dir != ''
+                        install_data(gen,
+                                     install_dir : dir)
+                endif
+        endif
+endforeach
+
+install_data('org.freedesktop.systemd1.conf',
+             install_dir : dbuspolicydir)
+install_data('org.freedesktop.systemd1.service',
+             install_dir : dbussystemservicedir)
+
+policy_in = configure_file(
+        input : 'org.freedesktop.systemd1.policy.in.in',
+        output : 'org.freedesktop.systemd1.policy.in',
+        configuration : substs)
+
+custom_target(
+        'org.freedesktop.systemd1.policy',
+        input : policy_in,
+        output : 'org.freedesktop.systemd1.policy',
+        command : intltool_command,
+        install : install_polkit,
+        install_dir : polkitpolicydir)
+
+# TODO: this might work with meson from git, see
+# https://github.com/mesonbuild/meson/issues/1441#issuecomment-283585493
+#
+# i18n.merge_file(
+#   'org.freedesktop.systemd1.policy',
+#   po_dir : po_dir,
+#   input : policy_in,
+#   output : 'org.freedesktop.systemd1.policy',
+#   install : install_polkit,
+#   install_dir : polkitpolicydir)
+
+install_data('system.conf',
+             'user.conf',
+             install_dir : pkgsysconfdir)
+
+meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
+meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
+meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
+meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
+
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(pkgsysconfdir, 'system/multi-user.target.wants')))
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(pkgsysconfdir, 'system/getty.target.wants')))
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(pkgsysconfdir, 'user')))
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(sysconfdir, 'xdg/systemd')))
index 2b96a9551b335a2db8b5698610545e7e50c46895..0f8a2d68e29e6de27a4559e915a27ea98cb4e06d 100644 (file)
@@ -135,7 +135,12 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
         fmt2 = strjoina("selinux: ", fmt);
 
         va_start(ap, fmt);
-        log_internalv(LOG_AUTH | callback_type_to_priority(type), 0, __FILE__, __LINE__, __FUNCTION__, fmt2, ap);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+        log_internalv(LOG_AUTH | callback_type_to_priority(type),
+                      0, __FILE__, __LINE__, __FUNCTION__,
+                      fmt2, ap);
+#pragma GCC diagnostic pop
         va_end(ap);
 
         return 0;
index 74054887b94bcafe8564fde58d8e3ddbecd8fadf..b45929e5353bd4018d52e82e6d41e0eb34f353fe 100644 (file)
@@ -45,6 +45,7 @@
 #include "service.h"
 #include "signal-util.h"
 #include "special.h"
+#include "stdio-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
@@ -2140,6 +2141,79 @@ _pure_ static bool service_can_reload(Unit *u) {
         return !!s->exec_command[SERVICE_EXEC_RELOAD];
 }
 
+static unsigned service_exec_command_index(Unit *u, ServiceExecCommand id, ExecCommand *current) {
+        Service *s = SERVICE(u);
+        unsigned idx = 0;
+        ExecCommand *first, *c;
+
+        assert(s);
+
+        first = s->exec_command[id];
+
+        /* Figure out where we are in the list by walking back to the beginning */
+        for (c = current; c != first; c = c->command_prev)
+                idx++;
+
+        return idx;
+}
+
+static int service_serialize_exec_command(Unit *u, FILE *f, ExecCommand *command) {
+        Service *s = SERVICE(u);
+        ServiceExecCommand id;
+        unsigned idx;
+        const char *type;
+        char **arg;
+        _cleanup_free_ char *args = NULL, *p = NULL;
+        size_t allocated = 0, length = 0;
+
+        assert(s);
+        assert(f);
+
+        if (!command)
+                return 0;
+
+        if (command == s->control_command) {
+                type = "control";
+                id = s->control_command_id;
+        } else {
+                type = "main";
+                id = SERVICE_EXEC_START;
+        }
+
+        idx = service_exec_command_index(u, id, command);
+
+        STRV_FOREACH(arg, command->argv) {
+                size_t n;
+                _cleanup_free_ char *e = NULL;
+
+                e = xescape(*arg, WHITESPACE);
+                if (!e)
+                        return -ENOMEM;
+
+                n = strlen(e);
+                if (!GREEDY_REALLOC(args, allocated, length + 1 + n + 1))
+                        return -ENOMEM;
+
+                if (length > 0)
+                        args[length++] = ' ';
+
+                memcpy(args + length, e, n);
+                length += n;
+        }
+
+        if (!GREEDY_REALLOC(args, allocated, length + 1))
+                return -ENOMEM;
+        args[length++] = 0;
+
+        p = xescape(command->path, WHITESPACE);
+        if (!p)
+                return -ENOMEM;
+
+        fprintf(f, "%s-command=%s %u %s %s\n", type, service_exec_command_to_string(id), idx, p, args);
+
+        return 0;
+}
+
 static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
         Service *s = SERVICE(u);
         ServiceFDStore *fs;
@@ -2167,11 +2241,8 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
         if (r < 0)
                 return r;
 
-        /* FIXME: There's a minor uncleanliness here: if there are
-         * multiple commands attached here, we will start from the
-         * first one again */
-        if (s->control_command_id >= 0)
-                unit_serialize_item(u, f, "control-command", service_exec_command_to_string(s->control_command_id));
+        service_serialize_exec_command(u, f, s->control_command);
+        service_serialize_exec_command(u, f, s->main_command);
 
         r = unit_serialize_item_fd(u, f, fds, "stdin-fd", s->stdin_fd);
         if (r < 0)
@@ -2227,6 +2298,106 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
         return 0;
 }
 
+static int service_deserialize_exec_command(Unit *u, const char *key, const char *value) {
+        Service *s = SERVICE(u);
+        int r;
+        unsigned idx = 0, i;
+        bool control, found = false;
+        ServiceExecCommand id = _SERVICE_EXEC_COMMAND_INVALID;
+        ExecCommand *command = NULL;
+        _cleanup_free_ char *path = NULL;
+        _cleanup_strv_free_ char **argv = NULL;
+
+        enum ExecCommandState {
+                STATE_EXEC_COMMAND_TYPE,
+                STATE_EXEC_COMMAND_INDEX,
+                STATE_EXEC_COMMAND_PATH,
+                STATE_EXEC_COMMAND_ARGS,
+                _STATE_EXEC_COMMAND_MAX,
+                _STATE_EXEC_COMMAND_INVALID = -1,
+        } state;
+
+        assert(s);
+        assert(key);
+        assert(value);
+
+        control = streq(key, "control-command");
+
+        state = STATE_EXEC_COMMAND_TYPE;
+
+        for (;;) {
+                _cleanup_free_ char *arg = NULL;
+
+                r = extract_first_word(&value, &arg, NULL, EXTRACT_CUNESCAPE);
+                if (r == 0)
+                        break;
+                else if (r < 0)
+                        return r;
+
+                switch (state) {
+                case STATE_EXEC_COMMAND_TYPE:
+                        id = service_exec_command_from_string(arg);
+                        if (id < 0)
+                                return -EINVAL;
+
+                        state = STATE_EXEC_COMMAND_INDEX;
+                        break;
+                case STATE_EXEC_COMMAND_INDEX:
+                        r = safe_atou(arg, &idx);
+                        if (r < 0)
+                                return -EINVAL;
+
+                        state = STATE_EXEC_COMMAND_PATH;
+                        break;
+                case STATE_EXEC_COMMAND_PATH:
+                        path = arg;
+                        arg = NULL;
+                        state = STATE_EXEC_COMMAND_ARGS;
+
+                        if (!path_is_absolute(path))
+                                return -EINVAL;
+                        break;
+                case STATE_EXEC_COMMAND_ARGS:
+                        r = strv_extend(&argv, arg);
+                        if (r < 0)
+                                return -ENOMEM;
+                        break;
+                default:
+                        assert_not_reached("Unknown error at deserialization of exec command");
+                        break;
+                }
+        }
+
+        if (state != STATE_EXEC_COMMAND_ARGS)
+                return -EINVAL;
+
+        /* Let's check whether exec command on given offset matches data that we just deserialized */
+        for (command = s->exec_command[id], i = 0; command; command = command->command_next, i++) {
+                if (i != idx)
+                        continue;
+
+                found = strv_equal(argv, command->argv) && streq(command->path, path);
+                break;
+        }
+
+        if (!found) {
+                /* Command at the index we serialized is different, let's look for command that exactly
+                 * matches but is on different index. If there is no such command we will not resume execution. */
+                for (command = s->exec_command[id]; command; command = command->command_next)
+                        if (strv_equal(command->argv, argv) && streq(command->path, path))
+                                break;
+        }
+
+        if (command && control)
+                s->control_command = command;
+        else if (command)
+                s->main_command = command;
+        else
+                log_unit_warning(u, "Current command vanished from the unit file, execution of the command list won't be resumed.");
+
+        return 0;
+}
+
 static int service_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
         Service *s = SERVICE(u);
         int r;
@@ -2309,16 +2480,6 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
                         s->status_text = t;
                 }
 
-        } else if (streq(key, "control-command")) {
-                ServiceExecCommand id;
-
-                id = service_exec_command_from_string(value);
-                if (id < 0)
-                        log_unit_debug(u, "Failed to parse exec-command value: %s", value);
-                else {
-                        s->control_command_id = id;
-                        s->control_command = s->exec_command[id];
-                }
         } else if (streq(key, "accept-socket")) {
                 Unit *socket;
 
@@ -2437,6 +2598,10 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
                         s->watchdog_override_enable = true;
                         s->watchdog_override_usec = watchdog_override_usec;
                 }
+        } else if (STR_IN_SET(key, "main-command", "control-command")) {
+                r = service_deserialize_exec_command(u, key, value);
+                if (r < 0)
+                        log_unit_debug_errno(u, r, "Failed to parse serialized command \"%s\": %m", value);
         } else
                 log_unit_debug(u, "Unknown serialization key: %s", key);
 
@@ -2693,7 +2858,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
 
                 log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG :
                            (code == CLD_EXITED ? LOG_NOTICE : LOG_WARNING),
-                           LOG_UNIT_ID(u),
                            LOG_UNIT_MESSAGE(u, "Main process exited, code=%s, status=%i/%s",
                                             sigchld_code_to_string(code), status,
                                             strna(code == CLD_EXITED
@@ -2701,6 +2865,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                                                   : signal_to_string(status))),
                            "EXIT_CODE=%s", sigchld_code_to_string(code),
                            "EXIT_STATUS=%i", status,
+                           LOG_UNIT_ID(u),
                            NULL);
 
                 if (s->result == SERVICE_SUCCESS)
index ff0d764fb5b7f5d16fa6b223ae42530db8762b3a..2a58dd394d09861534854b322208a99fd88c197b 100644 (file)
@@ -63,6 +63,9 @@ static int target_add_default_dependencies(Target *t) {
 
         assert(t);
 
+        if (!UNIT(t)->default_dependencies)
+                return 0;
+
         /* Imply ordering for requirement dependencies on target
          * units. Note that when the user created a contradicting
          * ordering manually we won't add anything in here to make
@@ -93,7 +96,7 @@ static int target_load(Unit *u) {
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
-        if (u->load_state == UNIT_LOADED && u->default_dependencies) {
+        if (u->load_state == UNIT_LOADED) {
                 r = target_add_default_dependencies(t);
                 if (r < 0)
                         return r;
index b6d106241452ec59f1a71bf5904dc79c54b8f1a2..a2dfd8ae90024fda5888c1eabd4069cb853a9d93 100644 (file)
@@ -632,7 +632,7 @@ static int transaction_apply(Transaction *tr, Manager *m, JobMode mode) {
 
                 job_add_to_run_queue(j);
                 job_add_to_dbus_queue(j);
-                job_start_timer(j);
+                job_start_timer(j, false);
                 job_shutdown_magic(j);
         }
 
index f76b6c30a83bed4c11b53f0a5a8986c0ff81809d..01fa0d0d46cd1e3230c172908803320f385ae951 100644 (file)
@@ -99,6 +99,7 @@ Unit *unit_new(Manager *m, size_t size) {
         u->on_failure_job_mode = JOB_REPLACE;
         u->cgroup_inotify_wd = -1;
         u->job_timeout = USEC_INFINITY;
+        u->job_running_timeout = USEC_INFINITY;
         u->ref_uid = UID_INVALID;
         u->ref_gid = GID_INVALID;
         u->cpu_usage_last = NSEC_INFINITY;
@@ -1336,6 +1337,9 @@ int unit_load(Unit *u) {
                         goto fail;
                 }
 
+                if (u->job_running_timeout != USEC_INFINITY && u->job_running_timeout > u->job_timeout)
+                        log_unit_warning(u, "JobRunningTimeoutSec= is greater than JobTimeoutSec=, it has no effect.");
+
                 unit_update_cgroup_members_masks(u);
         }
 
@@ -1497,9 +1501,9 @@ static void unit_status_log_starting_stopping_reloading(Unit *u, JobType t) {
          * possible, which means we should avoid the low-level unit
          * name. */
         log_struct(LOG_INFO,
-                   mid,
-                   LOG_UNIT_ID(u),
                    LOG_MESSAGE("%s", buf),
+                   LOG_UNIT_ID(u),
+                   mid,
                    NULL);
 }
 
index 8052c234fdf23ffc412795294bf2ba35c82023d2..cf21b37e22d77d67e61d0c8c844964c317874263 100644 (file)
@@ -114,6 +114,7 @@ struct Unit {
 
         /* Job timeout and action to take */
         usec_t job_timeout;
+        usec_t job_running_timeout;
         EmergencyAction job_timeout_action;
         char *job_timeout_reboot_arg;
 
index 4c4f36aea097612a8a0937e72fd125df66e5ca20..a2c62e55a5f231915549b987000e2c1e5e304798 100644 (file)
@@ -144,10 +144,10 @@ static int parse_config(void) {
         };
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/coredump.conf",
-                                 CONF_PATHS_NULSTR("systemd/coredump.conf.d"),
-                                 "Coredump\0",
-                                 config_item_table_lookup, items,
-                                 false, NULL);
+                                        CONF_PATHS_NULSTR("systemd/coredump.conf.d"),
+                                        "Coredump\0",
+                                        config_item_table_lookup, items,
+                                        false, NULL);
 }
 
 static inline uint64_t storage_size_max(void) {
@@ -800,12 +800,11 @@ log:
         if (journald_crash) {
                 /* We cannot log to the journal, so just print the MESSAGE.
                  * The target was set previously to something safe. */
-                log_struct(LOG_ERR, core_message, NULL);
+                log_dispatch(LOG_ERR, 0, core_message);
                 return 0;
         }
 
-        if (core_message)
-                IOVEC_SET_STRING(iovec[n_iovec++], core_message);
+        IOVEC_SET_STRING(iovec[n_iovec++], core_message);
 
         if (truncated)
                 IOVEC_SET_STRING(iovec[n_iovec++], "COREDUMP_TRUNCATED=1");
@@ -1326,7 +1325,8 @@ static int process_backtrace(int argc, char *argv[]) {
                         log_error_errno(r, "Failed to parse journal entry on stdin: %m");
                         goto finish;
                 }
-                if (r == 1)
+                if (r == 1 ||                        /* complete entry */
+                    journal_importer_eof(&importer)) /* end of data */
                         break;
         }
 
diff --git a/src/coredump/meson.build b/src/coredump/meson.build
new file mode 100644 (file)
index 0000000..8f7d898
--- /dev/null
@@ -0,0 +1,24 @@
+systemd_coredump_sources = files('''
+        coredump.c
+        coredump-vacuum.c
+        coredump-vacuum.h
+'''.split())
+
+if conf.get('HAVE_ELFUTILS', false)
+        systemd_coredump_sources += files(['stacktrace.c',
+                                           'stacktrace.h'])
+endif
+
+coredumpctl_sources = files('coredumpctl.c')
+
+install_data('coredump.conf',
+             install_dir : pkgsysconfdir)
+
+tests += [
+        [['src/coredump/test-coredump-vacuum.c',
+          'src/coredump/coredump-vacuum.c',
+          'src/coredump/coredump-vacuum.h'],
+         [],
+         [],
+         'ENABLE_COREDUMP', 'manual'],
+]
index 2677a3fb3212b78686efaba623303d315d310ca4..b6c1a8781bbbe64e1cd917d7e4fc5e6f23201b0d 100644 (file)
@@ -358,7 +358,7 @@ static int add_mount(
                 "Documentation=man:fstab(5) man:systemd-fstab-generator(8)\n",
                 source);
 
-        if (!noauto && !nofail && !automount)
+        if (!nofail && !automount)
                 fprintf(f, "Before=%s\n", post);
 
         if (!automount && opts) {
@@ -399,6 +399,10 @@ static int add_mount(
         if (r < 0)
                 return r;
 
+        r = generator_write_device_deps(dest, what, where, opts);
+        if (r < 0)
+                return r;
+
         r = write_mount_timeout(f, where, opts);
         if (r < 0)
                 return r;
index 80f676e477b83353aa37aebc06a8778be3237362..3578e2513c728430bdc62ce10d8f6144d5f0295d 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <blkid/blkid.h>
+#include <blkid.h>
 #include <stdlib.h>
 #include <sys/statfs.h>
 #include <unistd.h>
diff --git a/src/hostname/meson.build b/src/hostname/meson.build
new file mode 100644 (file)
index 0000000..d58caa6
--- /dev/null
@@ -0,0 +1,14 @@
+if conf.get('ENABLE_HOSTNAMED', false)
+        install_data('org.freedesktop.hostname1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.hostname1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.hostname1.policy',
+                input : 'org.freedesktop.hostname1.policy.in',
+                output : 'org.freedesktop.hostname1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+endif
index a23b6147911b3df882d31fd65935d0364bb9df3d..a9539c812a5315a069684c1c68fa808a04413aec 100644 (file)
@@ -390,7 +390,7 @@ static int trie_store(struct trie *trie, const char *filename) {
         int64_t size;
         struct trie_header_f h = {
                 .signature = HWDB_SIG,
-                .tool_version = htole64(atoi(VERSION)),
+                .tool_version = htole64(atoi(PACKAGE_VERSION)),
                 .header_size = htole64(sizeof(struct trie_header_f)),
                 .node_size = htole64(sizeof(struct trie_node_f)),
                 .child_entry_size = htole64(sizeof(struct trie_child_entry_f)),
diff --git a/src/import/meson.build b/src/import/meson.build
new file mode 100644 (file)
index 0000000..3fd58cc
--- /dev/null
@@ -0,0 +1,77 @@
+systemd_importd_sources = files('''
+        importd.c
+'''.split())
+
+systemd_pull_sources = files('''
+        pull.c
+        pull-raw.c
+        pull-raw.h
+        pull-tar.c
+        pull-tar.h
+        pull-job.c
+        pull-job.h
+        pull-common.c
+        pull-common.h
+        import-common.c
+        import-common.h
+        import-compress.c
+        import-compress.h
+        curl-util.c
+        curl-util.h
+        qcow2-util.c
+        qcow2-util.h
+'''.split())
+
+systemd_import_sources = files('''
+        import.c
+        import-raw.c
+        import-raw.h
+        import-tar.c
+        import-tar.h
+        import-common.c
+        import-common.h
+        import-compress.c
+        import-compress.h
+        qcow2-util.c
+        qcow2-util.h
+'''.split())
+
+systemd_export_sources = files('''
+        export.c
+        export-tar.c
+        export-tar.h
+        export-raw.c
+        export-raw.h
+        import-common.c
+        import-common.h
+        import-compress.c
+        import-compress.h
+'''.split())
+
+if conf.get('ENABLE_IMPORTD', false)
+        install_data('org.freedesktop.import1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.import1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.import1.policy',
+                input : 'org.freedesktop.import1.policy.in',
+                output : 'org.freedesktop.import1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+
+        install_data('import-pubring.gpg',
+                     install_dir : rootlibexecdir)
+        # TODO: shouldn't this be in pkgdatadir?
+endif
+
+tests += [
+        [['src/import/test-qcow2.c',
+          'src/import/qcow2-util.c',
+          'src/import/qcow2-util.h'],
+         [libshared],
+         [libz],
+         'HAVE_ZLIB', 'manual'],
+]
index 62a9195cc49dad4574340d9756ae8376b3bb3050..78840dd8822835ee851f780562f7f6ad45c6f9aa 100644 (file)
@@ -275,6 +275,7 @@ int pull_make_verification_jobs(
 
         _cleanup_(pull_job_unrefp) PullJob *checksum_job = NULL, *signature_job = NULL;
         int r;
+        const char *chksums = NULL;
 
         assert(ret_checksum_job);
         assert(ret_signature_job);
@@ -284,10 +285,16 @@ int pull_make_verification_jobs(
         assert(glue);
 
         if (verify != IMPORT_VERIFY_NO) {
-                _cleanup_free_ char *checksum_url = NULL;
+                _cleanup_free_ char *checksum_url = NULL, *fn = NULL;
 
-                /* Queue job for the SHA256SUMS file for the image */
-                r = import_url_change_last_component(url, "SHA256SUMS", &checksum_url);
+                /* Queue jobs for the checksum file for the image. */
+                r = import_url_last_component(url, &fn);
+                if (r < 0)
+                        return r;
+
+                chksums = strjoina(fn, ".sha256");
+
+                r = import_url_change_last_component(url, chksums, &checksum_url);
                 if (r < 0)
                         return r;
 
@@ -362,6 +369,15 @@ static int verify_one(PullJob *checksum_job, PullJob *job) {
                    line,
                    strlen(line));
 
+        if (!p) {
+                line = strjoina(job->checksum, "  ", fn, "\n");
+
+                p = memmem(checksum_job->payload,
+                        checksum_job->payload_size,
+                        line,
+                        strlen(line));
+        }
+
         if (!p || (p != (char*) checksum_job->payload && p[-1] != '\n')) {
                 log_error("DOWNLOAD INVALID: Checksum of %s file did not checkout, file has been tampered with.", fn);
                 return -EBADMSG;
@@ -378,7 +394,6 @@ int pull_verify(PullJob *main_job,
                 PullJob *signature_job) {
 
         _cleanup_close_pair_ int gpg_pipe[2] = { -1, -1 };
-        _cleanup_free_ char *fn = NULL;
         _cleanup_close_ int sig_file = -1;
         char sig_file_path[] = "/tmp/sigXXXXXX", gpg_home[] = "/tmp/gpghomeXXXXXX";
         _cleanup_(sigkill_waitp) pid_t pid = 0;
@@ -416,6 +431,9 @@ int pull_verify(PullJob *main_job,
         if (!signature_job)
                 return 0;
 
+        if (checksum_job->style == VERIFICATION_PER_FILE)
+                signature_job = checksum_job;
+
         assert(signature_job->state == PULL_JOB_DONE);
 
         if (!signature_job->payload || signature_job->payload_size <= 0) {
@@ -507,9 +525,11 @@ int pull_verify(PullJob *main_job,
                         cmd[k++] = "--keyring=" VENDOR_KEYRING_PATH;
 
                 cmd[k++] = "--verify";
-                cmd[k++] = sig_file_path;
-                cmd[k++] = "-";
-                cmd[k++] = NULL;
+                if (checksum_job->style == VERIFICATION_PER_DIRECTORY) {
+                        cmd[k++] = sig_file_path;
+                        cmd[k++] = "-";
+                        cmd[k++] = NULL;
+                }
 
                 stdio_unset_cloexec();
 
index 70aaa5c291946f8fd07e0cb1ccd97d77dea823b1..320c21305addd68b27962252521fb551edb40c46 100644 (file)
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "hexdecoct.h"
+#include "import-util.h"
 #include "io-util.h"
 #include "machine-pool.h"
 #include "parse-util.h"
+#include "pull-common.h"
 #include "pull-job.h"
 #include "string-util.h"
 #include "strv.h"
@@ -73,6 +75,31 @@ static void pull_job_finish(PullJob *j, int ret) {
                 j->on_finished(j);
 }
 
+static int pull_job_restart(PullJob *j) {
+        int r;
+        char *chksum_url = NULL;
+
+        r = import_url_change_last_component(j->url, "SHA256SUMS", &chksum_url);
+        if (r < 0)
+                return r;
+
+        free(j->url);
+        j->url = chksum_url;
+        j->state = PULL_JOB_INIT;
+        j->payload = mfree(j->payload);
+        j->payload_size = 0;
+        j->payload_allocated = 0;
+        j->written_compressed = 0;
+        j->written_uncompressed = 0;
+        j->written_since_last_grow = 0;
+
+        r = pull_job_begin(j);
+        if (r < 0)
+                return r;
+
+        return 0;
+}
+
 void pull_job_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result) {
         PullJob *j = NULL;
         CURLcode code;
@@ -102,6 +129,26 @@ void pull_job_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result) {
                 r = 0;
                 goto finish;
         } else if (status >= 300) {
+                if (status == 404 && j->style == VERIFICATION_PER_FILE) {
+
+                        /* retry pull job with SHA256SUMS file */
+                        r = pull_job_restart(j);
+                        if (r < 0)
+                                goto finish;
+
+                        code = curl_easy_getinfo(j->curl, CURLINFO_RESPONSE_CODE, &status);
+                        if (code != CURLE_OK) {
+                                log_error("Failed to retrieve response code: %s", curl_easy_strerror(code));
+                                r = -EIO;
+                                goto finish;
+                        }
+
+                        if (status == 0) {
+                                j->style = VERIFICATION_PER_DIRECTORY;
+                                return;
+                        }
+                }
+
                 log_error("HTTP request to %s failed with code %li.", j->url, status);
                 r = -EIO;
                 goto finish;
@@ -528,6 +575,7 @@ int pull_job_new(PullJob **ret, const char *url, CurlGlue *glue, void *userdata)
         j->content_length = (uint64_t) -1;
         j->start_usec = now(CLOCK_MONOTONIC);
         j->compressed_max = j->uncompressed_max = 64LLU * 1024LLU * 1024LLU * 1024LLU; /* 64GB safety limit */
+        j->style = VERIFICATION_STYLE_UNSET;
 
         j->url = strdup(url);
         if (!j->url)
index 3a152a50e3e88b592ffdabecb326f17b729d33f2..412b66cf22eb41b93d6075587135b739198b5452 100644 (file)
@@ -42,6 +42,12 @@ typedef enum PullJobState {
         _PULL_JOB_STATE_INVALID = -1,
 } PullJobState;
 
+typedef enum VerificationStyle {
+        VERIFICATION_STYLE_UNSET,
+        VERIFICATION_PER_FILE,        /* SuSE-style ".sha256" files with inline signature */
+        VERIFICATION_PER_DIRECTORY,   /* Ubuntu-style SHA256SUM files with detach SHA256SUM.gpg signatures */
+} VerificationStyle;
+
 #define PULL_JOB_IS_COMPLETE(j) (IN_SET((j)->state, PULL_JOB_DONE, PULL_JOB_FAILED))
 
 struct PullJob {
@@ -94,6 +100,8 @@ struct PullJob {
 
         bool grow_machine_directory;
         uint64_t written_since_last_grow;
+
+        VerificationStyle style;
 };
 
 int pull_job_new(PullJob **job, const char *url, CurlGlue *glue, void *userdata);
index 60a769e94438724e31362f95468ab68dd337fe0a..a15eac1f1fe865640981a4d8d0d897e1e94e9fd0 100644 (file)
@@ -478,11 +478,9 @@ static void raw_pull_job_on_finished(PullJob *j) {
         } else if (j == i->settings_job) {
                 if (j->error != 0)
                         log_info_errno(j->error, "Settings file could not be retrieved, proceeding without.");
-        } else if (j->error != 0) {
+        } else if (j->error != 0 && j != i->signature_job) {
                 if (j == i->checksum_job)
                         log_error_errno(j->error, "Failed to retrieve SHA256 checksum, cannot verify. (Try --verify=no?)");
-                else if (j == i->signature_job)
-                        log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)");
                 else
                         log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)");
 
@@ -500,6 +498,13 @@ static void raw_pull_job_on_finished(PullJob *j) {
         if (!raw_pull_is_done(i))
                 return;
 
+        if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) {
+                log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)");
+
+                r = i->signature_job->error;
+                goto finish;
+        }
+
         if (i->roothash_job)
                 i->roothash_job->disk_fd = safe_close(i->roothash_job->disk_fd);
         if (i->settings_job)
@@ -575,7 +580,6 @@ static int raw_pull_job_on_open_disk_generic(
                 const char *extra,
                 char **temp_path) {
 
-        _cleanup_free_ char *p = NULL;
         int r;
 
         assert(i);
@@ -744,6 +748,7 @@ int raw_pull_start(
 
         if (i->checksum_job) {
                 i->checksum_job->on_progress = raw_pull_job_on_progress;
+                i->checksum_job->style = VERIFICATION_PER_FILE;
 
                 r = pull_job_begin(i->checksum_job);
                 if (r < 0)
index 91833d61747e4e1f3c3218bd3a3c99db4a653651..d4b599ba95144b7ff097dd04a07ac0d9c82e8a32 100644 (file)
@@ -298,11 +298,9 @@ static void tar_pull_job_on_finished(PullJob *j) {
         if (j == i->settings_job) {
                 if (j->error != 0)
                         log_info_errno(j->error, "Settings file could not be retrieved, proceeding without.");
-        } else if (j->error != 0) {
+        } else if (j->error != 0 && j != i->signature_job) {
                 if (j == i->checksum_job)
                         log_error_errno(j->error, "Failed to retrieve SHA256 checksum, cannot verify. (Try --verify=no?)");
-                else if (j == i->signature_job)
-                        log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)");
                 else
                         log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)");
 
@@ -317,6 +315,13 @@ static void tar_pull_job_on_finished(PullJob *j) {
         if (!tar_pull_is_done(i))
                 return;
 
+        if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) {
+                log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)");
+
+                r = i->signature_job->error;
+                goto finish;
+        }
+
         i->tar_job->disk_fd = safe_close(i->tar_job->disk_fd);
         if (i->settings_job)
                 i->settings_job->disk_fd = safe_close(i->settings_job->disk_fd);
@@ -547,6 +552,7 @@ int tar_pull_start(
 
         if (i->checksum_job) {
                 i->checksum_job->on_progress = tar_pull_job_on_progress;
+                i->checksum_job->style = VERIFICATION_PER_FILE;
 
                 r = pull_job_begin(i->checksum_job);
                 if (r < 0)
index 202a5a3f97d23ca916a926b95f5362353f85ece9..36c1a32dcd8c2c77350c177575fb40157103525a 100644 (file)
@@ -529,7 +529,7 @@ static int process_http_upload(
                         log_warning("Failed to process data for connection %p", connection);
                         if (r == -E2BIG)
                                 return mhd_respondf(connection,
-                                                    r, MHD_HTTP_REQUEST_ENTITY_TOO_LARGE,
+                                                    r, MHD_HTTP_PAYLOAD_TOO_LARGE,
                                                     "Entry is too large, maximum is " STRINGIFY(DATA_SIZE_MAX) " bytes.");
                         else
                                 return mhd_respondf(connection,
@@ -1200,9 +1200,9 @@ static int parse_config(void) {
                 {}};
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/journal-remote.conf",
-                                 CONF_PATHS_NULSTR("systemd/journal-remote.conf.d"),
-                                 "Remote\0", config_item_table_lookup, items,
-                                 false, NULL);
+                                        CONF_PATHS_NULSTR("systemd/journal-remote.conf.d"),
+                                        "Remote\0", config_item_table_lookup, items,
+                                        false, NULL);
 }
 
 static void help(void) {
index 371b6acc64e74413ab630e1d0ee38cde7e5ab620..e0858dda7bc9a9dd26ccb3fe55eaf25b73dbce9e 100644 (file)
@@ -541,9 +541,9 @@ static int parse_config(void) {
                 {}};
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/journal-upload.conf",
-                                 CONF_PATHS_NULSTR("systemd/journal-upload.conf.d"),
-                                 "Upload\0", config_item_table_lookup, items,
-                                 false, NULL);
+                                        CONF_PATHS_NULSTR("systemd/journal-upload.conf.d"),
+                                        "Upload\0", config_item_table_lookup, items,
+                                        false, NULL);
 }
 
 static void help(void) {
index 7b434b334e65e101048408f2f07c7b45c44bd94c..c2f945bb47382c4eb5b3f901858dd4059c775623 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 import sys
 import argparse
 
diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build
new file mode 100644 (file)
index 0000000..d266b34
--- /dev/null
@@ -0,0 +1,49 @@
+systemd_journal_upload_sources = files('''
+        journal-upload.h
+        journal-upload.c
+        journal-upload-journal.c
+'''.split())
+
+systemd_journal_remote_sources = files('''
+        journal-remote-parse.h
+        journal-remote-parse.c
+        journal-remote-write.h
+        journal-remote-write.c
+        journal-remote.h
+        journal-remote.c
+        microhttpd-util.h
+        microhttpd-util.c
+'''.split())
+
+systemd_journal_gatewayd_sources = files('''
+        journal-gatewayd.c
+        microhttpd-util.h
+        microhttpd-util.c
+'''.split())
+
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
+        journal_upload_conf = configure_file(
+                input : 'journal-upload.conf.in',
+                output : 'journal-upload.conf',
+                configuration : substs)
+        install_data(journal_upload_conf,
+                     install_dir : pkgsysconfdir)
+endif
+
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+        journal_remote_conf = configure_file(
+                input : 'journal-remote.conf.in',
+                output : 'journal-remote.conf',
+                configuration : substs)
+        install_data(journal_remote_conf,
+                     install_dir : pkgsysconfdir)
+
+        install_data('browse.html',
+                     install_dir : join_paths(pkgdatadir, 'gatewayd'))
+
+        meson.add_install_script('sh', '-c',
+                                 mkdir_p.format('/var/log/journal/remote'))
+        meson.add_install_script('sh', '-c',
+                                 'chown 0:0 $DESTDIR/var/log/journal/remote &&
+                                 chmod 755 $DESTDIR/var/log/journal/remote || :')
+endif
index cae10203c67a1a3d6da352be440a7fe6242e96e8..f5d2d7967acf5f1f1c0f1ed393ea022ebda86e26 100644 (file)
@@ -103,7 +103,10 @@ int mhd_respondf(struct MHD_Connection *connection,
         errno = -error;
         fmt = strjoina(format, "\n");
         va_start(ap, format);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
         r = vasprintf(&m, fmt, ap);
+#pragma GCC diagnostic pop
         va_end(ap);
 
         if (r < 0)
index 49def4f630f5ade05b047147ac1c70d69c5d66ee..7f88c2cb7d518dd821d358665235511be426357e 100644 (file)
 #  define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
 #endif
 
+/* Renamed in µhttpd 0.9.51 */
+#ifndef MHD_USE_PIPE_FOR_SHUTDOWN
+#  define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
+#endif
+
 /* Renamed in µhttpd 0.9.52 */
 #ifndef MHD_USE_EPOLL_LINUX_ONLY
 #  define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY
 #endif
 
-/* Renamed in µhttpd 0.9.51 */
-#ifndef MHD_USE_PIPE_FOR_SHUTDOWN
-#  define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
+/* Both the old and new names are defines, check for the new one. */
+
+/* Renamed in µhttpd 0.9.53 */
+#ifndef MHD_HTTP_PAYLOAD_TOO_LARGE
+#  define MHD_HTTP_PAYLOAD_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
 #endif
 
 #if MHD_VERSION < 0x00094203
diff --git a/src/journal/audit_type-to-name.awk b/src/journal/audit_type-to-name.awk
new file mode 100644 (file)
index 0000000..44fc702
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN{
+        print "const char *audit_type_to_string(int type) {\n\tswitch(type) {"
+}
+{
+        printf "        case AUDIT_%s: return \"%s\";\n", $1, $1
+}
+END{
+        print "        default: return NULL;\n\t}\n}\n"
+}
index 612b10f3a9afea1d90614b825680cf6b32052a61..e7c22880be65411a738c904f0e12586bb96f6767 100644 (file)
@@ -40,6 +40,9 @@
 #define RND_GEN_Q 0x02
 #define RND_GEN_X 0x03
 
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+/* TODO: remove void* arithmetic and this work-around */
+
 /******************************************************************************/
 
 static void mpi_export(void *buf, size_t buflen, const gcry_mpi_t x) {
diff --git a/src/journal/generate-audit_type-list.sh b/src/journal/generate-audit_type-list.sh
new file mode 100755 (executable)
index 0000000..18cbe05
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -eu
+
+cpp="$1"
+shift
+
+includes=""
+for i in "$@"; do
+        includes="$includes -include $i"
+done
+
+$cpp -dM $includes - </dev/null | \
+        grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
+        sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
+        sort -k2
index a6ccb679a8413b1096416050d37cba02522b78d5..243d5198d9fa1396ae746b5927f521c8484a082f 100644 (file)
@@ -546,6 +546,8 @@ static bool warn_wrong_flags(const JournalFile *f, bool compatible) {
 }
 
 static int journal_file_verify_header(JournalFile *f) {
+        uint64_t arena_size, header_size;
+
         assert(f);
         assert(f->header);
 
@@ -564,17 +566,21 @@ static int journal_file_verify_header(JournalFile *f) {
         if (f->header->state >= _STATE_MAX)
                 return -EBADMSG;
 
+        header_size = le64toh(f->header->header_size);
+
         /* The first addition was n_data, so check that we are at least this large */
-        if (le64toh(f->header->header_size) < HEADER_SIZE_MIN)
+        if (header_size < HEADER_SIZE_MIN)
                 return -EBADMSG;
 
         if (JOURNAL_HEADER_SEALED(f->header) && !JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays))
                 return -EBADMSG;
 
-        if ((le64toh(f->header->header_size) + le64toh(f->header->arena_size)) > (uint64_t) f->last_stat.st_size)
+        arena_size = le64toh(f->header->arena_size);
+
+        if (UINT64_MAX - header_size < arena_size || header_size + arena_size > (uint64_t) f->last_stat.st_size)
                 return -ENODATA;
 
-        if (le64toh(f->header->tail_object_offset) > (le64toh(f->header->header_size) + le64toh(f->header->arena_size)))
+        if (le64toh(f->header->tail_object_offset) > header_size + arena_size)
                 return -ENODATA;
 
         if (!VALID64(le64toh(f->header->data_hash_table_offset)) ||
@@ -607,6 +613,9 @@ static int journal_file_verify_header(JournalFile *f) {
                         return -EBUSY;
                 }
 
+                if (f->header->field_hash_table_size == 0 || f->header->data_hash_table_size == 0)
+                        return -EBADMSG;
+
                 /* Don't permit appending to files from the future. Because otherwise the realtime timestamps wouldn't
                  * be strictly ordered in the entries in the file anymore, and we can't have that since it breaks
                  * bisection. */
index ad11fb314d366f232e40a416508e1e804d8a1beb..f990ac930355508389bd9c2ee9e76540b5840bb2 100644 (file)
@@ -299,8 +299,9 @@ static void help(void) {
                "     --no-tail             Show all lines, even in follow mode\n"
                "  -r --reverse             Show the newest entries first\n"
                "  -o --output=STRING       Change journal output mode (short, short-precise,\n"
-               "                             short-iso, short-full, short-monotonic, short-unix,\n"
-               "                             verbose, export, json, json-pretty, json-sse, cat)\n"
+               "                             short-iso, short-iso-precise, short-full,\n"
+               "                             short-monotonic, short-unix, verbose, export,\n"
+               "                             json, json-pretty, json-sse, cat)\n"
                "     --utc                 Express time in Coordinated Universal Time (UTC)\n"
                "  -x --catalog             Add message explanations where available\n"
                "     --no-full             Ellipsize fields\n"
index 3c03b83754dbae12931c9621bbbf32142322e75b..c9bf3832c7a73843781af9dbb4f52fa340fb0ad8 100644 (file)
@@ -279,7 +279,7 @@ void server_process_native_message(
 
         if (message) {
                 if (s->forward_to_syslog)
-                        server_forward_syslog(s, priority, identifier, message, ucred, tv);
+                        server_forward_syslog(s, syslog_fixup_facility(priority), identifier, message, ucred, tv);
 
                 if (s->forward_to_kmsg)
                         server_forward_kmsg(s, priority, identifier, message, ucred);
index 6466e46cccfaba2fd98a00ca0c77c9aa3ba90562..667dfa00ff219f20bca593d011ff44a13fc9786e 100644 (file)
@@ -1637,10 +1637,10 @@ static int server_parse_config_file(Server *s) {
         assert(s);
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/journald.conf",
-                                 CONF_PATHS_NULSTR("systemd/journald.conf.d"),
-                                 "Journal\0",
-                                 config_item_perf_lookup, journald_gperf_lookup,
-                                 false, s);
+                                        CONF_PATHS_NULSTR("systemd/journald.conf.d"),
+                                        "Journal\0",
+                                        config_item_perf_lookup, journald_gperf_lookup,
+                                        false, s);
 }
 
 static int server_dispatch_sync(sd_event_source *es, usec_t t, void *userdata) {
diff --git a/src/journal/meson.build b/src/journal/meson.build
new file mode 100644 (file)
index 0000000..582f83a
--- /dev/null
@@ -0,0 +1,122 @@
+journal_internal_sources = files('''
+        audit-type.c
+        audit-type.h
+        catalog.c
+        catalog.h
+        compress.c
+        compress.h
+        journal-def.h
+        journal-file.c
+        journal-file.h
+        journal-send.c
+        journal-vacuum.c
+        journal-vacuum.h
+        journal-verify.c
+        journal-verify.h
+        lookup3.c
+        lookup3.h
+        mmap-cache.c
+        mmap-cache.h
+        sd-journal.c
+'''.split())
+
+if conf.get('HAVE_GCRYPT', false)
+        journal_internal_sources += files('''
+                journal-authenticate.c
+                journal-authenticate.h
+                fsprg.c
+                fsprg.h
+        '''.split())
+
+        journal_internal_sources += gcrypt_util_sources
+endif
+
+############################################################
+
+audit_type_includes = [config_h,
+                       missing_h,
+                       'linux/audit.h']
+if conf.get('HAVE_AUDIT', false)
+        audit_type_includes += 'libaudit.h'
+endif
+
+generate_audit_type_list = find_program('generate-audit_type-list.sh')
+audit_type_list_txt = custom_target(
+        'audit_type-list.txt',
+        output : 'audit_type-list.txt',
+        command : [generate_audit_type_list, cpp] + audit_type_includes,
+        capture : true)
+
+audit_type_to_name = custom_target(
+        'audit_type-to-name.h',
+        input : ['audit_type-to-name.awk', audit_type_list_txt],
+        output : 'audit_type-to-name.h',
+        command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
+        capture : true)
+
+journal_internal_sources += [audit_type_to_name]
+
+############################################################
+
+libjournal_core_sources = files('''
+        journald-kmsg.c
+        journald-kmsg.h
+        journald-syslog.c
+        journald-syslog.h
+        journald-stream.c
+        journald-stream.h
+        journald-server.c
+        journald-server.h
+        journald-console.c
+        journald-console.h
+        journald-wall.c
+        journald-wall.h
+        journald-native.c
+        journald-native.h
+        journald-audit.c
+        journald-audit.h
+        journald-rate-limit.c
+        journald-rate-limit.h
+        journal-internal.h
+'''.split())
+
+systemd_journald_sources = files('''
+        journald.c
+        journald-server.h
+'''.split())
+
+journald_gperf_c = custom_target(
+        'journald-gperf.c',
+        input : 'journald-gperf.gperf',
+        output : 'journald-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+systemd_cat_sources = files('cat.c')
+
+journalctl_sources = files('journalctl.c')
+
+if conf.get('HAVE_QRENCODE', false)
+        journalctl_sources += files('journal-qrcode.c',
+                                    'journal-qrcode.h')
+endif
+
+install_data('journald.conf',
+             install_dir : pkgsysconfdir)
+
+meson.add_install_script(
+        'sh', '-c',
+        mkdir_p.format('/var/log/journal'))
+meson.add_install_script(
+        'sh', '-c',
+        'chown 0:0 $DESTDIR/var/log/journal &&
+         chmod 755 $DESTDIR/var/log/journal || :')
+if get_option('adm-group')
+        meson.add_install_script(
+                'sh', '-c',
+                'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
+endif
+if get_option('wheel-group')
+        meson.add_install_script(
+                'sh', '-c',
+                'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
+endif
index 71967a0f3330573056a50a26eb0ada690435ae7e..86afb4985d8381ebda98a4091391fd65890e1fb3 100644 (file)
@@ -2424,6 +2424,7 @@ _public_ int sd_journal_process(sd_journal *j) {
         assert_return(!journal_pid_changed(j), -ECHILD);
 
         j->last_process_usec = now(CLOCK_MONOTONIC);
+        j->last_invalidate_counter = j->current_invalidate_counter;
 
         for (;;) {
                 union inotify_event_buffer buffer;
index 6f6d71435d21419d51e7a29f1ba8b18ec6a6ff4f..4fb93ded73ef32b1156c2185243b8367434e6a3e 100644 (file)
@@ -30,6 +30,8 @@ typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
 typedef int (decompress_t)(const void *src, uint64_t src_size,
                            void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max);
 
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+
 static usec_t arg_duration = 2 * USEC_PER_SEC;
 static size_t arg_start;
 
@@ -151,8 +153,10 @@ static void test_compress_decompress(const char* label, const char* type,
                  100 - compressed * 100. / total,
                  skipped);
 }
+#endif
 
 int main(int argc, char *argv[]) {
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
         const char *i;
 
         log_set_max_level(LOG_INFO);
@@ -177,4 +181,7 @@ int main(int argc, char *argv[]) {
 #endif
         }
         return 0;
+#else
+        return EXIT_TEST_SKIP;
+#endif
 }
index 44a2cf5217315b6c87e3d3b384e9835bcec82acd..92108a84b3f13af2ed084b934b5b34927c73afe5 100644 (file)
@@ -54,6 +54,7 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
 typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
 typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
 
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
 static void test_compress_decompress(int compression,
                                      compress_blob_t compress,
                                      decompress_blob_t decompress,
@@ -203,6 +204,7 @@ static void test_compress_stream(int compression,
         assert_se(unlink(pattern) == 0);
         assert_se(unlink(pattern2) == 0);
 }
+#endif
 
 #ifdef HAVE_LZ4
 static void test_lz4_decompress_partial(void) {
@@ -247,6 +249,7 @@ static void test_lz4_decompress_partial(void) {
 #endif
 
 int main(int argc, char *argv[]) {
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
         const char text[] =
                 "text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
                 "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
@@ -312,4 +315,7 @@ int main(int argc, char *argv[]) {
 #endif
 
         return 0;
+#else
+        return EXIT_TEST_SKIP;
+#endif
 }
index 68c24bed7a1b56091b84e1127523bdc3693071f8..56925c8a5d8770b69ded67849fd58a3c7c8f9739 100644 (file)
@@ -2,7 +2,15 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
-[[ $1 == "add" ]] || exit 0
 [[ $2 ]] || exit 1
 
-exec depmod -a "$2"
+case "$1" in
+    add)
+        exec depmod -a "$2"
+        ;;
+    remove)
+        exec rm -f /lib/modules/"$2"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
+        ;;
+    *)
+        exit 0
+esac
diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build
new file mode 100644 (file)
index 0000000..ede3323
--- /dev/null
@@ -0,0 +1,11 @@
+install_data('kernel-install',
+             install_mode : 'rwxr-xr-x',
+             install_dir : bindir)
+
+install_data('50-depmod.install',
+             '90-loaderentry.install',
+             install_mode : 'rwxr-xr-x',
+             install_dir : kernelinstalldir)
+
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(sysconfdir, 'kernel/install.d')))
diff --git a/src/libsystemd-network/meson.build b/src/libsystemd-network/meson.build
new file mode 100644 (file)
index 0000000..3285bca
--- /dev/null
@@ -0,0 +1,46 @@
+sources = files('''
+        sd-dhcp-client.c
+        sd-dhcp-server.c
+        dhcp-network.c
+        dhcp-option.c
+        dhcp-packet.c
+        dhcp-internal.h
+        dhcp-server-internal.h
+        dhcp-protocol.h
+        dhcp-lease-internal.h
+        sd-dhcp-lease.c
+        sd-ipv4ll.c
+        sd-ipv4acd.c
+        arp-util.h
+        arp-util.c
+        network-internal.c
+        sd-ndisc.c
+        ndisc-internal.h
+        ndisc-router.h
+        ndisc-router.c
+        icmp6-util.h
+        icmp6-util.c
+        sd-dhcp6-client.c
+        dhcp6-internal.h
+        dhcp6-protocol.h
+        dhcp6-network.c
+        dhcp6-option.c
+        dhcp6-lease-internal.h
+        sd-dhcp6-lease.c
+        dhcp-identifier.h
+        dhcp-identifier.c
+        lldp-internal.h
+        lldp-network.h
+        lldp-network.c
+        lldp-neighbor.h
+        lldp-neighbor.c
+        sd-lldp.c
+'''.split())
+
+network_internal_h = files('network-internal.h')
+
+libsystemd_network = static_library(
+        'systemd-network',
+        sources,
+        network_internal_h,
+        include_directories : includes)
index 092a1eabb07dd5eb79a6bdecc22b0dba4bc95161..337241a815e41323fa42bc05c0da459727700637 100644 (file)
@@ -349,6 +349,45 @@ int config_parse_iaid(const char *unit,
         return 0;
 }
 
+int config_parse_bridge_port_priority(
+                const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        uint16_t i;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = safe_atou16(rvalue, &i);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Failed to parse bridge port priority, ignoring: %s", rvalue);
+                return 0;
+        }
+
+        if (i > LINK_BRIDGE_PORT_PRIORITY_MAX) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Bridge port priority is larger than maximum %u, ignoring: %s", LINK_BRIDGE_PORT_PRIORITY_MAX, rvalue);
+                return 0;
+        }
+
+        *((uint16_t *)data) = i;
+
+        return 0;
+}
+
+
 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) {
         unsigned i;
 
index 5bcd577167d4e9149577ed6209268f09276bce2e..4666f174e9edaee920149dcbc14bf5f2d2d277dc 100644 (file)
@@ -26,6 +26,9 @@
 #include "condition.h"
 #include "udev.h"
 
+#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
+#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
+
 bool net_match_config(const struct ether_addr *match_mac,
                       char * const *match_path,
                       char * const *match_driver,
@@ -62,6 +65,10 @@ int config_parse_iaid(const char *unit, const char *filename, unsigned line,
                       const char *section, unsigned section_line, const char *lvalue,
                       int ltype, const char *rvalue, void *data, void *userdata);
 
+int config_parse_bridge_port_priority(const char *unit, const char *filename, unsigned line,
+                      const char *section, unsigned section_line, const char *lvalue,
+                      int ltype, const char *rvalue, void *data, void *userdata);
+
 int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
 const char *net_get_name(struct udev_device *device);
 
index 13209261f94b2c00672a4dd30ed28455103cfbe1..88a90e593b48ba14f2ec5cae2319be71015d9a9a 100644 (file)
@@ -248,6 +248,12 @@ static int ipv4ll_pick_address(sd_ipv4ll *ll) {
         return sd_ipv4ll_set_address(ll, &(struct in_addr) { addr });
 }
 
+int sd_ipv4ll_restart(sd_ipv4ll *ll) {
+        ll->address = 0;
+
+        return sd_ipv4ll_start(ll);
+}
+
 #define MAC_HASH_KEY SD_ID128_MAKE(df,04,22,98,3f,ad,14,52,f9,87,2e,d1,9c,70,e2,f2)
 
 int sd_ipv4ll_start(sd_ipv4ll *ll) {
index 0702241506b1522d82e26a580bc77464a5c943b4..39ddb2461afb421327d19698a17651dcb0275058 100644 (file)
@@ -19,6 +19,7 @@
 ***/
 
 #include <arpa/inet.h>
+#include <linux/sockios.h>
 
 #include "sd-lldp.h"
 
index 1d3be9b86239ca61227068a8b62e932175142d78..83e57d43f734b390aee1d54863452985916901f6 100644 (file)
@@ -131,6 +131,7 @@ static int ndisc_reset(sd_ndisc *nd) {
         nd->timeout_event_source = sd_event_source_unref(nd->timeout_event_source);
         nd->recv_event_source = sd_event_source_unref(nd->recv_event_source);
         nd->fd = safe_close(nd->fd);
+        nd->nd_sent = 0;
 
         return 0;
 }
index c1135ffa226ec1ff52deda9055819529ebd5463a..92cb790d499fd4ad3444874461cc09498445bc9b 100644 (file)
@@ -517,3 +517,8 @@ global:
         sd_id128_get_machine_app_specific;
         sd_is_socket_sockaddr;
 } LIBSYSTEMD_232;
+
+LIBSYSTEMD_234 {
+global:
+        sd_bus_message_appendv;
+} LIBSYSTEMD_233;
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
new file mode 100644 (file)
index 0000000..ab69afe
--- /dev/null
@@ -0,0 +1,96 @@
+sd_login_c = files('sd-login/sd-login.c')
+
+libsystemd_internal_sources = files('''
+        sd-bus/bus-bloom.c
+        sd-bus/bus-bloom.h
+        sd-bus/bus-common-errors.c
+        sd-bus/bus-common-errors.h
+        sd-bus/bus-container.c
+        sd-bus/bus-container.h
+        sd-bus/bus-control.c
+        sd-bus/bus-control.h
+        sd-bus/bus-convenience.c
+        sd-bus/bus-creds.c
+        sd-bus/bus-creds.h
+        sd-bus/bus-dump.c
+        sd-bus/bus-dump.h
+        sd-bus/bus-error.c
+        sd-bus/bus-error.h
+        sd-bus/bus-gvariant.c
+        sd-bus/bus-gvariant.h
+        sd-bus/bus-internal.c
+        sd-bus/bus-internal.h
+        sd-bus/bus-introspect.c
+        sd-bus/bus-introspect.h
+        sd-bus/bus-kernel.c
+        sd-bus/bus-kernel.h
+        sd-bus/bus-match.c
+        sd-bus/bus-match.h
+        sd-bus/bus-message.c
+        sd-bus/bus-message.h
+        sd-bus/bus-objects.c
+        sd-bus/bus-objects.h
+        sd-bus/bus-protocol.h
+        sd-bus/bus-signature.c
+        sd-bus/bus-signature.h
+        sd-bus/bus-slot.c
+        sd-bus/bus-slot.h
+        sd-bus/bus-socket.c
+        sd-bus/bus-socket.h
+        sd-bus/bus-track.c
+        sd-bus/bus-track.h
+        sd-bus/bus-type.c
+        sd-bus/bus-type.h
+        sd-bus/kdbus.h
+        sd-bus/sd-bus.c
+        sd-daemon/sd-daemon.c
+        sd-device/device-enumerator-private.h
+        sd-device/device-enumerator.c
+        sd-device/device-internal.h
+        sd-device/device-private.c
+        sd-device/device-private.h
+        sd-device/device-util.h
+        sd-device/sd-device.c
+        sd-event/sd-event.c
+        sd-hwdb/hwdb-internal.h
+        sd-hwdb/hwdb-util.h
+        sd-hwdb/sd-hwdb.c
+        sd-id128/id128-util.c
+        sd-id128/id128-util.h
+        sd-id128/sd-id128.c
+        sd-netlink/local-addresses.c
+        sd-netlink/local-addresses.h
+        sd-netlink/netlink-internal.h
+        sd-netlink/netlink-message.c
+        sd-netlink/netlink-socket.c
+        sd-netlink/netlink-types.c
+        sd-netlink/netlink-types.h
+        sd-netlink/netlink-util.c
+        sd-netlink/netlink-util.h
+        sd-netlink/rtnl-message.c
+        sd-netlink/sd-netlink.c
+        sd-network/network-util.c
+        sd-network/network-util.h
+        sd-network/sd-network.c
+        sd-path/sd-path.c
+        sd-resolve/sd-resolve.c
+        sd-utf8/sd-utf8.c
+'''.split()) + sd_login_c
+
+libsystemd_internal = static_library(
+        'systemd',
+        libsystemd_internal_sources,
+        install : false,
+        include_directories : includes,
+        link_with : libbasic,
+        dependencies : [threads,
+                        librt])
+
+libsystemd_sym = 'src/libsystemd/libsystemd.sym'
+
+libsystemd_pc = configure_file(
+        input : 'libsystemd.pc.in',
+        output : 'libsystemd.pc',
+        configuration : substs)
+install_data(libsystemd_pc,
+             install_dir : pkgconfiglibdir)
diff --git a/src/libsystemd/sd-bus/DIFFERENCES b/src/libsystemd/sd-bus/DIFFERENCES
deleted file mode 100644 (file)
index db26967..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Known differences between dbus1 and kdbus:
-
-- NameAcquired/NameLost is gone entirely on kdbus backends if
-  libsystemd is used. It is still added in by systemd-bus-proxyd
-  for old dbus1 clients, and it is available if libsystemd is used
-  against the classic dbus1 daemon. If you want to write compatible
-  code with libsystem-bus you need to explicitly subscribe to
-  NameOwnerChanged signals and just ignore NameAcquired/NameLost
-
-- Applications have to deal with spurious signals they didn't expect,
-  due to the probabilistic bloom filters. They need to handle this
-  anyway, given that any client can send anything to arbitrary clients
-  anyway, even in dbus1, so not much changes.
-
-- clients of the system bus when kdbus is used must roll their own
-  security. Only legacy dbus1 clients get the old XML policy enforced,
-  which is implemented by systemd-bus-proxyd.
-
-- Serial numbers of synthesized messages are always (uint32_t) -1.
-
-- NameOwnerChanged is a synthetic message, generated locally and not
-  by the driver. On dbus1 only the Disconnected message was
-  synthesized like this.
-
-- There's no standard per-session bus anymore. Only a per-user bus.
index 6aeb11364a415f832e14275b8da10bd75f0a2141..3110d579134bca191fa6dde588f6f3922f950bfa 100644 (file)
@@ -73,10 +73,9 @@ the reply_cookie/reply_serial additional header field has been
 increased from 32bit to 64bit, too!
 
 The header field identifiers have been extended from 8bit to
-64bit. This has been done to simplify things (as kdbus otherwise uses
-exclusively 64bit types, unless there is a strong reason not to), and
-has no effect on the serialization size, as due to alignment for each
-8bit header field identifier 56 bits of padding had to be added.
+64bit. This has been done to simplify things, and has no effect
+on the serialization size, as due to alignment for each 8bit
+header field identifier 56 bits of padding had to be added.
 
 Note that the header size changed, due to these changes. However,
 consider that on dbus1 the beginning of the fields array contains the
@@ -94,16 +93,12 @@ array, the size of the header on dbus1 and dbus2 stays identical, at
 
 And that's already it.
 
-Note: to simplify parsing, valid kdbus/dbus2 messages must include the
-entire fixed header and additional header fields in a single non-memfd
-message part. Also, the signature string of the body variant all the
-way to the end of the message must be in a single non-memfd part
-too. The parts for this extended header and footer can be the same
-one, and can also continue any amount of additional body bytes.
-
-Note: on kdbus only native endian messages marshalled in gvariant may
-      be sent. If a client receives a message in non-native endianness
-      or in dbus1 marshalling it shall ignore the message.
+Note: To simplify parsing, valid dbus2 messages must include the entire
+      fixed header and additional header fields in a single non-memfd
+      message part. Also, the signature string of the body variant all the
+      way to the end of the message must be in a single non-memfd part
+      too. The parts for this extended header and footer can be the same
+      one, and can also continue any amount of additional body bytes.
 
 Note: The GVariant "MAYBE" type is not supported, so that messages can
       be fully converted forth and back between dbus1 and gvariant
diff --git a/src/libsystemd/sd-bus/PORTING-DBUS1 b/src/libsystemd/sd-bus/PORTING-DBUS1
deleted file mode 100644 (file)
index 2dedb28..0000000
+++ /dev/null
@@ -1,535 +0,0 @@
-A few hints on supporting kdbus as backend in your favorite D-Bus library.
-
-~~~
-
-Before you read this, have a look at the DIFFERENCES and
-GVARIANT_SERIALIZATION texts you find in the same directory where you
-found this.
-
-We invite you to port your favorite D-Bus protocol implementation
-over to kdbus. However, there are a couple of complexities
-involved. On kdbus we only speak GVariant marshaling, kdbus clients
-ignore traffic in dbus1 marshaling. Thus, you need to add a second,
-GVariant compatible marshaler to your library first.
-
-After you have done that: here's the basic principle how kdbus works:
-
-You connect to a bus by opening its bus node in /sys/fs/kdbus/. All
-buses have a device node there, it starts with a numeric UID of the
-owner of the bus, followed by a dash and a string identifying the
-bus. The system bus is thus called /sys/fs/kdbus/0-system, and for user
-buses the device node is /sys/fs/kdbus/1000-user (if 1000 is your user
-id).
-
-(Before we proceed, please always keep a copy of libsystemd next
-to you, ultimately that's where the details are, this document simply
-is a rough overview to help you grok things.)
-
-CONNECTING
-
-To connect to a bus, simply open() its device node and issue the
-KDBUS_CMD_HELLO call. That's it. Now you are connected. Do not send
-Hello messages or so (as you would on dbus1), that does not exist for
-kdbus.
-
-The structure you pass to the ioctl will contain a couple of
-parameters that you need to know, to operate on the bus.
-
-There are two flags fields, one indicating features of the kdbus
-kernel side ("conn_flags"), the other one ("bus_flags") indicating
-features of the bus owner (i.e. systemd). Both flags fields are 64bit
-in width.
-
-When calling into the ioctl, you need to place your own supported
-feature bits into these fields. This tells the kernel about the
-features you support. When the ioctl returns, it will contain the
-features the kernel supports.
-
-If any of the higher 32bit are set on the two flags fields and your
-client does not know what they mean, it must disconnect. The upper
-32bit are used to indicate "incompatible" feature additions on the bus
-system, the lower 32bit indicate "compatible" feature additions. A
-client that does not support a "compatible" feature addition can go on
-communicating with the bus, however a client that does not support an
-"incompatible" feature must not proceed with the connection. When a
-client encountes such an "incompatible" feature it should immediately
-try the next bus address configured in the bus address string.
-
-The hello structure also contains another flags field "attach_flags"
-which indicates metadata that is optionally attached to all incoming
-messages. You probably want to set KDBUS_ATTACH_NAMES unconditionally
-in it. This has the effect that all well-known names of a sender are
-attached to all incoming messages. You need this information to
-implement matches that match on a message sender name correctly. Of
-course, you should only request the attachment of as little metadata
-fields as you need.
-
-The kernel will return in the "id" field your unique id. This is a
-simple numeric value. For compatibility with classic dbus1 simply
-format this as string and prefix ":1.".
-
-The kernel will also return the bloom filter size and bloom filter
-hash function number used for the signal broadcast bloom filter (see
-below).
-
-The kernel will also return the bus ID of the bus in a 128bit field.
-
-The pool size field specifies the size of the memory mapped buffer.
-After the calling the hello ioctl, you should memory map the kdbus
-fd. In this memory mapped region, the kernel will place all your incoming
-messages.
-
-SENDING MESSAGES
-
-Use the MSG_SEND ioctl to send a message to another peer. The ioctl
-takes a structure that contains a variety of fields:
-
-The flags field corresponds closely to the old dbus1 message header
-flags field, though the DONT_EXPECT_REPLY field got inverted into
-EXPECT_REPLY.
-
-The dst_id/src_id field contains the unique id of the destination and
-the sender. The sender field is overridden by the kernel usually, hence
-you shouldn't fill it in. The destination field can also take the
-special value KDBUS_DST_ID_BROADCAST for broadcast messages. For
-messages intended to a well-known name set the field to
-KDBUS_DST_ID_NAME, and attach the name in a special "items" entry to
-the message (see below).
-
-The payload field indicates the payload. For all dbus traffic it
-should carry the value 0x4442757344427573ULL. (Which encodes
-'DBusDBus').
-
-The cookie field corresponds with the "serial" field of classic
-dbus1. We simply renamed it here (and extended it to 64bit) since we
-didn't want to imply the monotonicity of the assignment the way the
-word "serial" indicates it.
-
-When sending a message that expects a reply, you need to set the
-EXPECT_REPLY flag in the message flag field. In this case you should
-also fill out the "timeout_ns" value which indicates the timeout in
-nsec for this call. If the peer does not respond in this time you will
-get a notification of a timeout. Note that this is also used for
-security purposes: a single reply messages is only allowed through the
-bus as long as the timeout has not ended. With this timeout value you
-hence "open a time window" in which the peer might respond to your
-request and the policy allows the response to go through.
-
-When sending a message that is a reply, you need to fill in the
-cookie_reply field, which is similar to the reply_serial field of
-dbus1. Note that a message cannot have EXPECT_REPLY and a reply_serial
-at the same time!
-
-This pretty much explains the ioctl header. The actual payload of the
-data is now referenced in additional items that are attached to this
-ioctl header structure at the end. When sending a message, you attach
-items of the type PAYLOAD_VEC, PAYLOAD_MEMFD, FDS, BLOOM_FILTER,
-DST_NAME to it:
-
-   KDBUS_ITEM_PAYLOAD_VEC: contains a pointer + length pair for
-   referencing arbitrary user memory. This is how you reference most
-   of your data. It's a lot like the good old iovec structure of glibc.
-
-   KDBUS_ITEM_PAYLOAD_MEMFD: for large data blocks it is preferable
-   to send prepared "memfds" (see below) over. This item contains an
-   fd for a memfd plus a size.
-
-   KDBUS_ITEM_FDS: for sending over fds attach an item of this type with
-   an array of fds.
-
-   KDBUS_ITEM_BLOOM_FILTER: the calculated bloom filter of this message,
-   only for undirected (broadcast) message.
-
-   KDBUS_ITEM_DST_NAME: for messages that are directed to a well-known
-   name (instead of a unique name), this item contains the well-known
-   name field.
-
-A single message may consists of no, one or more payload items of type
-PAYLOAD_VEC or PAYLOAD_MEMFD. D-Bus protocol implementations should
-treat them as a single block that just happens to be split up into
-multiple items. Some restrictions apply however:
-
-   The message header in its entirety must be contained in a single
-   PAYLOAD_VEC item.
-
-   You may only split your message up right in front of each GVariant
-   contained in the payload, as well is immediately before framing of a
-   Gvariant, as well after as any padding bytes if there are any. The
-   padding bytes must be wholly contained in the preceding
-   PAYLOAD_VEC/PAYLOAD_MEMFD item. You may not split up basic types
-   nor arrays of fixed types. The latter is necessary to allow APIs
-   to return direct pointers to linear arrays of numeric
-   values. Examples: The basic types "u", "s", "t" have to be in the
-   same payload item. The array of fixed types "ay", "ai" have to be
-   fully in contained in the same payload item. For an array "as" or
-   "a(si)" the only restriction however is to keep each string
-   individually in an uninterrupted item, to keep the framing of each
-   element and the array in a single uninterrupted item, however the
-   various strings might end up in different items.
-
-Note again, that splitting up messages into separate items is up to the
-implementation. Also note that the kdbus kernel side might merge
-separate items if it deems this to be useful. However, the order in
-which items are contained in the message is left untouched.
-
-PAYLOAD_MEMFD items allow zero-copy data transfer (see below regarding
-the memfd concept). Note however that the overhead of mapping these
-makes them relatively expensive, and only worth the trouble for memory
-blocks > 512K (this value appears to be quite universal across
-architectures, as we tested). Thus we recommend sending PAYLOAD_VEC
-items over for small messages and restore to PAYLOAD_MEMFD items for
-messages > 512K. Since while building up the message you might not
-know yet whether it will grow beyond this boundary a good approach is
-to simply build the message unconditionally in a memfd
-object. However, when the message is sealed to be sent away check for
-the size limit. If the size of the message is < 512K, then simply send
-the data as PAYLOAD_VEC and reuse the memfd. If it is >= 512K, seal
-the memfd and send it as PAYLOAD_MEMFD, and allocate a new memfd for
-the next message.
-
-RECEIVING MESSAGES
-
-Use the MSG_RECV ioctl to read a message from kdbus. This will return
-an offset into the pool memory map, relative to its beginning.
-
-The received message structure more or less follows the structure of
-the message originally sent. However, certain changes have been
-made. In the header the src_id field will be filled in.
-
-The payload items might have gotten merged and PAYLOAD_VEC items are
-not used. Instead, you will only find PAYLOAD_OFF and PAYLOAD_MEMFD
-items. The former contain an offset and size into your memory mapped
-pool where you find the payload.
-
-If during the HELLO ioctl you asked for getting metadata attached to
-your message, you will find additional KDBUS_ITEM_CREDS,
-KDBUS_ITEM_PID_COMM, KDBUS_ITEM_TID_COMM, KDBUS_ITEM_TIMESTAMP,
-KDBUS_ITEM_EXE, KDBUS_ITEM_CMDLINE, KDBUS_ITEM_CGROUP,
-KDBUS_ITEM_CAPS, KDBUS_ITEM_SECLABEL, KDBUS_ITEM_AUDIT items that
-contain this metadata. This metadata will be gathered from the sender
-at the point in time it sends the message. This information is
-uncached, and since it is appended by the kernel, trustable. The
-KDBUS_ITEM_SECLABEL item usually contains the SELinux security label,
-if it is used.
-
-After processing the message you need to call the KDBUS_CMD_FREE
-ioctl, which releases the message from the pool, and allows the kernel
-to store another message there. Note that the memory used by the pool
-is ordinary anonymous, swappable memory that is backed by tmpfs. Hence
-there is no need to copy the message out of it quickly, instead you
-can just leave it there as long as you need it and release it via the
-FREE ioctl only after that's done.
-
-BLOOM FILTERS
-
-The kernel does not understand dbus marshaling, it will not look into
-the message payload. To allow clients to subscribe to specific subsets
-of the broadcast matches we employ bloom filters.
-
-When broadcasting messages, a bloom filter needs to be attached to the
-message in a KDBUS_ITEM_BLOOM item (and only for broadcasting
-messages!). If you don't know what bloom filters are, read up now on
-Wikipedia. In short: they are a very efficient way how to
-probabilistically check whether a certain word is contained in a
-vocabulary. It knows no false negatives, but it does know false
-positives.
-
-The parameters for the bloom filters that need to be included in
-broadcast message is communicated to userspace as part of the hello
-response structure (see above). By default it has the parameters m=512
-(bits in the filter), k=8 (nr of hash functions). Note however, that
-this is subject to change in later versions, and userspace
-implementations must be capable of handling m values between at least
-m=8 and m=2^32, and k values between at least k=1 and k=32. The
-underlying hash function is SipHash-2-4. It is used with a number of
-constant (yet originally randomly generated) 128bit hash keys, more
-specifically:
-
-   b9,66,0b,f0,46,70,47,c1,88,75,c4,9c,54,b9,bd,15,
-   aa,a1,54,a2,e0,71,4b,39,bf,e1,dd,2e,9f,c5,4a,3b,
-   63,fd,ae,be,cd,82,48,12,a1,6e,41,26,cb,fa,a0,c8,
-   23,be,45,29,32,d2,46,2d,82,03,52,28,fe,37,17,f5,
-   56,3b,bf,ee,5a,4f,43,39,af,aa,94,08,df,f0,fc,10,
-   31,80,c8,73,c7,ea,46,d3,aa,25,75,0f,9e,4c,09,29,
-   7d,f7,18,4b,7b,a4,44,d5,85,3c,06,e0,65,53,96,6d,
-   f2,77,e9,6f,93,b5,4e,71,9a,0c,34,88,39,25,bf,35
-
-When calculating the first bit index into the bloom filter, the
-SipHash-2-4 hash value is calculated for the input data and the first
-16 bytes of the array above as hash key. Of the resulting 8 bytes of
-output, as many full bytes are taken for the bit index as necessary,
-starting from the output's first byte. For the second bit index the
-same hash value is used, continuing with the next unused output byte,
-and so on. Each time the bytes returned by the hash function are
-depleted it is recalculated with the next 16 byte hash key from the
-array above and the same input data.
-
-For each message to send across the bus we populate the bloom filter
-with all possible matchable strings. If a client then wants to
-subscribe to messages of this type, it simply tells the kernel to test
-its own calculated bit mask against the bloom filter of each message.
-
-More specifically, the following strings are added to the bloom filter
-of each message that is broadcasted:
-
-  The string "interface:" suffixed by the interface name
-
-  The string "member:" suffixed by the member name
-
-  The string "path:" suffixed by the path name
-
-  The string "path-slash-prefix:" suffixed with the path name, and
-  also all prefixes of the path name (cut off at "/"), also prefixed
-  with "path-slash-prefix".
-
-  The string "message-type:" suffixed with the strings "signal",
-  "method_call", "error" or "method_return" for the respective message
-  type of the message.
-
-  If the first argument of the message is a string, "arg0:" suffixed
-  with the first argument.
-
-  If the first argument of the message is a string, "arg0-dot-prefix"
-  suffixed with the first argument, and also all prefixes of the
-  argument (cut off at "."), also prefixed with "arg0-dot-prefix".
-
-  If the first argument of the message is a string,
-  "arg0-slash-prefix" suffixed with the first argument, and also all
-  prefixes of the argument (cut off at "/"), also prefixed with
-  "arg0-slash-prefix".
-
-  Similar for all further arguments that are strings up to 63, for the
-  arguments and their "dot" and "slash" prefixes. On the first
-  argument that is not a string, addition to the bloom filter should be
-  stopped however.
-
-(Note that the bloom filter does not contain sender nor receiver
-names!)
-
-When a client wants to subscribe to messages matching a certain
-expression, it should calculate the bloom mask following the same
-algorithm. The kernel will then simply test the mask against the
-attached bloom filters.
-
-Note that bloom filters are probabilistic, which means that clients
-might get messages they did not expect. Your bus protocol
-implementation must be capable of dealing with these unexpected
-messages (which it needs to anyway, given that transfers are
-relatively unrestricted on kdbus and people can send you all kinds of
-non-sense).
-
-If a client connects to a bus whose bloom filter metrics (i.e. filter
-size and number of hash functions) are outside of the range the client
-supports it must immediately disconnect and continue connection with
-the next bus address of the bus connection string.
-
-INSTALLING MATCHES
-
-To install matches for broadcast messages, use the KDBUS_CMD_ADD_MATCH
-ioctl. It takes a structure that contains an encoded match expression,
-and that is followed by one or more items, which are combined in an
-AND way. (Meaning: a message is matched exactly when all items
-attached to the original ioctl struct match).
-
-To match against other user messages add a KDBUS_ITEM_BLOOM item in
-the match (see above). Note that the bloom filter does not include
-matches to the sender names. To additionally check against sender
-names, use the KDBUS_ITEM_ID (for unique id matches) and
-KDBUS_ITEM_NAME (for well-known name matches) item types.
-
-To match against kernel generated messages (see below) you should add
-items of the same type as the kernel messages include,
-i.e. KDBUS_ITEM_NAME_ADD, KDBUS_ITEM_NAME_REMOVE,
-KDBUS_ITEM_NAME_CHANGE, KDBUS_ITEM_ID_ADD, KDBUS_ITEM_ID_REMOVE and
-fill them out. Note however, that you have some wildcards in this
-case, for example the .id field of KDBUS_ITEM_ID_ADD/KDBUS_ITEM_ID_REMOVE
-structures may be set to 0 to match against any id addition/removal.
-
-Note that dbus match strings do no map 1:1 to these ioctl() calls. In
-many cases (where the match string is "underspecified") you might need
-to issue up to six different ioctl() calls for the same match. For
-example, the empty match (which matches against all messages), would
-translate into one KDBUS_ITEM_BLOOM ioctl, one KDBUS_ITEM_NAME_ADD,
-one KDBUS_ITEM_NAME_CHANGE, one KDBUS_ITEM_NAME_REMOVE, one
-KDBUS_ITEM_ID_ADD and one KDBUS_ITEM_ID_REMOVE.
-
-When creating a match, you may attach a "cookie" value to them, which
-is used for deleting this match again. The cookie can be selected freely
-by the client. When issuing KDBUS_CMD_REMOVE_MATCH, simply pass the
-same cookie as before and all matches matching the same "cookie" value
-will be removed. This is particularly handy for the case where multiple
-ioctl()s are added for a single match strings.
-
-MEMFDS
-
-memfds may be sent across kdbus via KDBUS_ITEM_PAYLOAD_MEMFD items
-attached to messages. If this is done, the data included in the memfd
-is considered part of the payload stream of a message, and are treated
-the same way as KDBUS_ITEM_PAYLOAD_VEC by the receiving side. It is
-possible to interleave KDBUS_ITEM_PAYLOAD_MEMFD and
-KDBUS_ITEM_PAYLOAD_VEC items freely, by the reader they will be
-considered a single stream of bytes in the order these items appear in
-the message, that just happens to be split up at various places
-(regarding rules how they may be split up, see above). The kernel will
-refuse taking KDBUS_ITEM_PAYLOAD_MEMFD items that refer to memfds that
-are not sealed.
-
-Note that sealed memfds may be unsealed again if they are not mapped
-you have the only fd reference to them.
-
-Alternatively to sending memfds as KDBUS_ITEM_PAYLOAD_MEMFD items
-(where they are just a part of the payload stream of a message) you can
-also simply attach any memfd to a message using
-KDBUS_ITEM_PAYLOAD_FDS. In this case, the memfd contents is not
-considered part of the payload stream of the message, but simply fds
-like any other, that happen to be attached to the message.
-
-MESSAGES FROM THE KERNEL
-
-A couple of messages previously generated by the dbus1 bus driver are
-now generated by the kernel. Since the kernel does not understand the
-payload marshaling, they are generated by the kernel  in a different
-format. This is indicated with the "payload type" field of the
-messages set to 0. Library implementations should take these messages
-and synthesize traditional driver messages for them on reception.
-
-More specifically:
-
-   Instead of the NameOwnerChanged, NameLost, NameAcquired signals
-   there are kernel messages containing KDBUS_ITEM_NAME_ADD,
-   KDBUS_ITEM_NAME_REMOVE, KDBUS_ITEM_NAME_CHANGE, KDBUS_ITEM_ID_ADD,
-   KDBUS_ITEM_ID_REMOVE items are generated (each message will contain
-   exactly one of these items). Note that in libsystemd we have
-   obsoleted NameLost/NameAcquired messages, since they are entirely
-   redundant to NameOwnerChanged. This library will hence only
-   synthesize NameOwnerChanged messages from these kernel messages,
-   and never generate NameLost/NameAcquired. If your library needs to
-   stay compatible to the old dbus1 userspace, you possibly might need
-   to synthesize both a NameOwnerChanged and NameLost/NameAcquired
-   message from the same kernel message.
-
-   When a method call times out, a KDBUS_ITEM_REPLY_TIMEOUT message is
-   generated. This should be synthesized into a method error reply
-   message to the original call.
-
-   When a method call fails because the peer terminated the connection
-   before responding, a KDBUS_ITEM_REPLY_DEAD message is
-   generated. Similarly, it should be synthesized into a method error
-   reply message.
-
-For synthesized messages we recommend setting the cookie field to
-(uint32_t) -1 (and not (uint64_t) -1!), so that the cookie is not 0
-(which the dbus1 spec does not allow), but clearly recognizable as
-synthetic.
-
-Note that the KDBUS_ITEM_NAME_XYZ messages will actually inform you
-about all kinds of names, including activatable ones. Classic dbus1
-NameOwnerChanged messages OTOH are only generated when a name is
-really acquired on the bus and not just simply activatable. This means
-you must explicitly check for the case where an activatable name
-becomes acquired or an acquired name is lost and returns to be
-activatable.
-
-NAME REGISTRY
-
-To acquire names on the bus, use the KDBUS_CMD_NAME_ACQUIRE ioctl(). It
-takes a flags field similar to dbus1's RequestName() bus driver call,
-however the NO_QUEUE flag got inverted into a QUEUE flag instead.
-
-To release a previously acquired name use the KDBUS_CMD_NAME_RELEASE
-ioctl().
-
-To list acquired names use the KDBUS_CMD_CONN_INFO ioctl. It may be
-used to list unique names, well known names as well as activatable
-names and clients currently queuing for ownership of a well-known
-name. The ioctl will return an offset into the memory pool. After
-reading all the data you need, you need to release this via the
-KDBUS_CMD_FREE ioctl(), similar how you release a received message.
-
-CREDENTIALS
-
-kdbus can optionally attach various kinds of metadata about the sender at
-the point of time of sending ("credentials") to messages, on request
-of the receiver. This is both supported on directed and undirected
-(broadcast) messages. The metadata to attach is selected at time of
-the HELLO ioctl of the receiver via a flags field (see above). Note
-that clients must be able to handle that messages contain more
-metadata than they asked for themselves, to simplify implementation of
-broadcasting in the kernel. The receiver should not rely on this data
-to be around though, even though it will be correct if it happens to
-be attached. In order to avoid programming errors in applications, we
-recommend though not passing this data on to clients that did not
-explicitly ask for it.
-
-Credentials may also be queried for a well-known or unique name. Use
-the KDBUS_CMD_CONN_INFO for this. It will return an offset to the pool
-area again, which will contain the same credential items as messages
-have attached. Note that when issuing the ioctl, you can select a
-different set of credentials to gather, than what was originally requested
-for being attached to incoming messages.
-
-Credentials are always specific to the sender's domain that was
-current at the time of sending, and of the process that opened the
-bus connection at the time of opening it. Note that this latter data
-is cached!
-
-POLICY
-
-The kernel enforces only very limited policy on names. It will not do
-access filtering by userspace payload, and thus not by interface or
-method name.
-
-This ultimately means that most fine-grained policy enforcement needs
-to be done by the receiving process. We recommend using PolicyKit for
-any more complex checks. However, libraries should make simple static
-policy decisions regarding privileged/unprivileged method calls
-easy. We recommend doing this by enabling KDBUS_ATTACH_CAPS and
-KDBUS_ATTACH_CREDS for incoming messages, and then discerning client
-access by some capability, or if sender and receiver UIDs match.
-
-BUS ADDRESSES
-
-When connecting to kdbus use the "kernel:" protocol prefix in DBus
-address strings. The device node path is encoded in its "path="
-parameter.
-
-Client libraries should use the following connection string when
-connecting to the system bus:
-
-   kernel:path=/sys/fs/kdbus/0-system/bus;unix:path=/var/run/dbus/system_bus_socket
-
-This will ensure that kdbus is preferred over the legacy AF_UNIX
-socket, but compatibility is kept. For the user bus use:
-
-   kernel:path=/sys/fs/kdbus/$UID-user/bus;unix:path=$XDG_RUNTIME_DIR/bus
-
-With $UID replaced by the callers numer user ID, and $XDG_RUNTIME_DIR
-following the XDG basedir spec.
-
-Of course the $DBUS_SYSTEM_BUS_ADDRESS and $DBUS_SESSION_BUS_ADDRESS
-variables should still take precedence.
-
-DBUS SERVICE FILES
-
-Activatable services for kdbus may not use classic dbus1 service
-activation files. Instead, programs should drop in native systemd
-.service and .busname unit files, so that they are treated uniformly
-with other types of units and activation of the system.
-
-Note that this results in a major difference to classic dbus1:
-activatable bus names can be established at any time in the boot process.
-This is unlike dbus1 where activatable names are unconditionally available
-as long as dbus-daemon is running. Being able to control when
-activatable names are established is essential to allow usage of kdbus
-during early boot and in initrds, without the risk of triggering
-services too early.
-
-DISCLAIMER
-
-This all is so far just the status quo. We are putting this together, because
-we are quite confident that further API changes will be smaller, but
-to make this very clear: this is all subject to change, still!
-
-We invite you to port over your favorite dbus library to this new
-scheme, but please be prepared to make minor changes when we still
-change these interfaces!
index 2d06bf541f7df9a4963d499f09f062c365e9ad72..04158cae4d3ccfc718a00b403f926e5140e0f1db 100644 (file)
@@ -48,7 +48,7 @@ _public_ int sd_bus_emit_signal(
                 va_list ap;
 
                 va_start(ap, types);
-                r = bus_message_append_ap(m, types, ap);
+                r = sd_bus_message_appendv(m, types, ap);
                 va_end(ap);
                 if (r < 0)
                         return r;
@@ -85,7 +85,7 @@ _public_ int sd_bus_call_method_async(
                 va_list ap;
 
                 va_start(ap, types);
-                r = bus_message_append_ap(m, types, ap);
+                r = sd_bus_message_appendv(m, types, ap);
                 va_end(ap);
                 if (r < 0)
                         return r;
@@ -123,7 +123,7 @@ _public_ int sd_bus_call_method(
                 va_list ap;
 
                 va_start(ap, types);
-                r = bus_message_append_ap(m, types, ap);
+                r = sd_bus_message_appendv(m, types, ap);
                 va_end(ap);
                 if (r < 0)
                         goto fail;
@@ -162,7 +162,7 @@ _public_ int sd_bus_reply_method_return(
                 va_list ap;
 
                 va_start(ap, types);
-                r = bus_message_append_ap(m, types, ap);
+                r = sd_bus_message_appendv(m, types, ap);
                 va_end(ap);
                 if (r < 0)
                         return r;
@@ -493,7 +493,7 @@ _public_ int sd_bus_set_property(
                 goto fail;
 
         va_start(ap, type);
-        r = bus_message_append_ap(m, type, ap);
+        r = sd_bus_message_appendv(m, type, ap);
         va_end(ap);
         if (r < 0)
                 goto fail;
index 5cec804e326145773e17af103802e74dedd00b16..da6fd3b89664d647a1c93a143d3efdf6f07df301 100644 (file)
@@ -2341,7 +2341,7 @@ static int type_stack_pop(TypeStack *stack, unsigned max, unsigned *i, const cha
         return 1;
 }
 
-int bus_message_append_ap(
+_public_ int sd_bus_message_appendv(
                 sd_bus_message *m,
                 const char *types,
                 va_list ap) {
@@ -2351,10 +2351,10 @@ int bus_message_append_ap(
         unsigned stack_ptr = 0;
         int r;
 
-        assert(m);
-
-        if (!types)
-                return 0;
+        assert_return(m, -EINVAL);
+        assert_return(types, -EINVAL);
+        assert_return(!m->sealed, -EPERM);
+        assert_return(!m->poisoned, -ESTALE);
 
         n_array = (unsigned) -1;
         n_struct = strlen(types);
@@ -2555,7 +2555,7 @@ _public_ int sd_bus_message_append(sd_bus_message *m, const char *types, ...) {
         assert_return(!m->poisoned, -ESTALE);
 
         va_start(ap, types);
-        r = bus_message_append_ap(m, types, ap);
+        r = sd_bus_message_appendv(m, types, ap);
         va_end(ap);
 
         return r;
index 4710c106b95293e054396aa9df400a4bb0239809..a59aa73833c80a9ea12a4554f6769ce6e07c02be 100644 (file)
@@ -220,8 +220,6 @@ int bus_message_from_malloc(
 int bus_message_get_arg(sd_bus_message *m, unsigned i, const char **str);
 int bus_message_get_arg_strv(sd_bus_message *m, unsigned i, char ***strv);
 
-int bus_message_append_ap(sd_bus_message *m, const char *types, va_list ap);
-
 int bus_message_parse_fields(sd_bus_message *m);
 
 struct bus_body_part *message_append_part(sd_bus_message *m);
index 9bd07ffcabbac14d7b21b7de95959b88e4c65895..b6f5afe1b3bc962db8892a542b5e80c969a2dc3a 100644 (file)
@@ -1057,6 +1057,22 @@ static int object_manager_serialize_path(
                         if (r < 0)
                                 return r;
 
+                        r = sd_bus_message_append(reply, "{sa{sv}}", "org.freedesktop.DBus.Peer", 0);
+                        if (r < 0)
+                                return r;
+
+                        r = sd_bus_message_append(reply, "{sa{sv}}", "org.freedesktop.DBus.Introspectable", 0);
+                        if (r < 0)
+                                return r;
+
+                        r = sd_bus_message_append(reply, "{sa{sv}}", "org.freedesktop.DBus.Properties", 0);
+                        if (r < 0)
+                                return r;
+
+                        r = sd_bus_message_append(reply, "{sa{sv}}", "org.freedesktop.DBus.ObjectManager", 0);
+                        if (r < 0)
+                                return r;
+
                         found_something = true;
                 }
 
index 4beb61f05a8a127bad7c18f7db7bc6e8f9d58594..06c61675113d16dcf5f3a9d302b6d48a59a31475 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sd-bus.h>
+#include "sd-bus.h"
 
 #include "macro.h"
 
index ff0e99558ee0e8103dfa442b09c646e508e8674f..923f7dd10c9b1af413e26c9181afb98bbabba62b 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/veth.h>
 #include <linux/if_bridge.h>
 #include <linux/if_addr.h>
+#include <linux/if_addrlabel.h>
 #include <linux/if.h>
 #include <linux/ip.h>
 #include <linux/if_link.h>
@@ -170,6 +171,9 @@ static const NLType rtnl_link_info_data_vxlan_types[] = {
         [IFLA_VXLAN_REMCSUM_RX]        = { .type = NETLINK_TYPE_U8 },
         [IFLA_VXLAN_GBP]               = { .type = NETLINK_TYPE_FLAG },
         [IFLA_VXLAN_REMCSUM_NOPARTIAL] = { .type = NETLINK_TYPE_FLAG },
+        [IFLA_VXLAN_COLLECT_METADATA]  = { .type = NETLINK_TYPE_U8 },
+        [IFLA_VXLAN_LABEL]             = { .type = NETLINK_TYPE_U32 },
+        [IFLA_VXLAN_GPE]               = { .type = NETLINK_TYPE_FLAG },
 };
 
 static const NLType rtnl_bond_arp_target_types[] = {
@@ -283,6 +287,19 @@ static const NLType rtnl_link_info_data_vrf_types[] = {
         [IFLA_VRF_TABLE]                 = { .type = NETLINK_TYPE_U32 },
 };
 
+static const NLType rtnl_link_info_data_geneve_types[] = {
+        [IFLA_GENEVE_ID]                = { .type = NETLINK_TYPE_U32 },
+        [IFLA_GENEVE_TTL]               = { .type = NETLINK_TYPE_U8 },
+        [IFLA_GENEVE_TOS]               = { .type = NETLINK_TYPE_U8 },
+        [IFLA_GENEVE_PORT]              = { .type = NETLINK_TYPE_U16 },
+        [IFLA_GENEVE_REMOTE]            = { .type = NETLINK_TYPE_IN_ADDR },
+        [IFLA_GENEVE_REMOTE6]           = { .type = NETLINK_TYPE_IN_ADDR },
+        [IFLA_GENEVE_UDP_CSUM]          = { .type = NETLINK_TYPE_U8 },
+        [IFLA_GENEVE_UDP_ZERO_CSUM6_TX] = { .type = NETLINK_TYPE_U8 },
+        [IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = { .type = NETLINK_TYPE_U8 },
+        [IFLA_GENEVE_LABEL]             = { .type = NETLINK_TYPE_U32 },
+};
+
 /* these strings must match the .kind entries in the kernel */
 static const char* const nl_union_link_info_data_table[] = {
         [NL_UNION_LINK_INFO_DATA_BOND] = "bond",
@@ -305,6 +322,7 @@ static const char* const nl_union_link_info_data_table[] = {
         [NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL] = "ip6tnl",
         [NL_UNION_LINK_INFO_DATA_VRF] = "vrf",
         [NL_UNION_LINK_INFO_DATA_VCAN] = "vcan",
+        [NL_UNION_LINK_INFO_DATA_GENEVE] = "geneve",
 };
 
 DEFINE_STRING_TABLE_LOOKUP(nl_union_link_info_data, NLUnionLinkInfoData);
@@ -346,6 +364,8 @@ static const NLTypeSystem rtnl_link_info_data_type_systems[] = {
                                                        .types = rtnl_link_info_data_ip6tnl_types },
         [NL_UNION_LINK_INFO_DATA_VRF] =              { .count = ELEMENTSOF(rtnl_link_info_data_vrf_types),
                                                        .types = rtnl_link_info_data_vrf_types },
+        [NL_UNION_LINK_INFO_DATA_GENEVE] =           { .count = ELEMENTSOF(rtnl_link_info_data_geneve_types),
+                                                       .types = rtnl_link_info_data_geneve_types },
 };
 
 static const NLTypeSystemUnion rtnl_link_info_data_type_system_union = {
@@ -567,22 +587,35 @@ static const NLTypeSystem rtnl_neigh_type_system = {
         .types = rtnl_neigh_types,
 };
 
+static const NLType rtnl_addrlabel_types[] = {
+        [IFAL_ADDRESS]         = { .type = NETLINK_TYPE_IN_ADDR, .size = sizeof(struct in6_addr) },
+        [IFAL_LABEL]           = { .type = NETLINK_TYPE_U32 },
+};
+
+static const NLTypeSystem rtnl_addrlabel_type_system = {
+        .count = ELEMENTSOF(rtnl_addrlabel_types),
+        .types = rtnl_addrlabel_types,
+};
+
 static const NLType rtnl_types[] = {
-        [NLMSG_DONE]   = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = 0 },
-        [NLMSG_ERROR]  = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = sizeof(struct nlmsgerr) },
-        [RTM_NEWLINK]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
-        [RTM_DELLINK]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
-        [RTM_GETLINK]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
-        [RTM_SETLINK]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
-        [RTM_NEWADDR]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
-        [RTM_DELADDR]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
-        [RTM_GETADDR]  = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
-        [RTM_NEWROUTE] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
-        [RTM_DELROUTE] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
-        [RTM_GETROUTE] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
-        [RTM_NEWNEIGH] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
-        [RTM_DELNEIGH] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
-        [RTM_GETNEIGH] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
+        [NLMSG_DONE]       = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = 0 },
+        [NLMSG_ERROR]      = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = sizeof(struct nlmsgerr) },
+        [RTM_NEWLINK]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
+        [RTM_DELLINK]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
+        [RTM_GETLINK]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
+        [RTM_SETLINK]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_link_type_system, .size = sizeof(struct ifinfomsg) },
+        [RTM_NEWADDR]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
+        [RTM_DELADDR]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
+        [RTM_GETADDR]      = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_address_type_system, .size = sizeof(struct ifaddrmsg) },
+        [RTM_NEWROUTE]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
+        [RTM_DELROUTE]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
+        [RTM_GETROUTE]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_route_type_system, .size = sizeof(struct rtmsg) },
+        [RTM_NEWNEIGH]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
+        [RTM_DELNEIGH]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
+        [RTM_GETNEIGH]     = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
+        [RTM_NEWADDRLABEL] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_addrlabel_type_system, .size = sizeof(struct ifaddrlblmsg) },
+        [RTM_DELADDRLABEL] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_addrlabel_type_system, .size = sizeof(struct ifaddrlblmsg) },
+        [RTM_GETADDRLABEL] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_addrlabel_type_system, .size = sizeof(struct ifaddrlblmsg) },
 };
 
 const NLTypeSystem type_system_root = {
index 42e96173de84dd3c8b1082439bba9e71c05852ff..ae65c1d8e4fbe83d6977aac9d028a48a7f30f971 100644 (file)
@@ -88,6 +88,7 @@ typedef enum NLUnionLinkInfoData {
         NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL,
         NL_UNION_LINK_INFO_DATA_VRF,
         NL_UNION_LINK_INFO_DATA_VCAN,
+        NL_UNION_LINK_INFO_DATA_GENEVE,
         _NL_UNION_LINK_INFO_DATA_MAX,
         _NL_UNION_LINK_INFO_DATA_INVALID = -1
 } NLUnionLinkInfoData;
index f49bf4eaa6567f38359bee23743092c0c3061645..49bb226ef309360fd3342ca5dd644c031b8101e0 100644 (file)
@@ -32,6 +32,10 @@ bool rtnl_message_type_is_addr(uint16_t type);
 bool rtnl_message_type_is_route(uint16_t type);
 bool rtnl_message_type_is_neigh(uint16_t type);
 
+static inline bool rtnl_message_type_is_addrlabel(uint16_t type) {
+        return IN_SET(type, RTM_NEWADDRLABEL, RTM_DELADDRLABEL, RTM_GETADDRLABEL);
+}
+
 int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name);
 int rtnl_set_link_properties(sd_netlink **rtnl, int ifindex, const char *alias, const struct ether_addr *mac, unsigned mtu);
 
index b543b5f20cbe09c95290f2ddee5ec1a6a63e57e7..d5f8b7d15eb04a77e0fc2db8e4e261134881201c 100644 (file)
@@ -18,6 +18,7 @@
 ***/
 
 #include <netinet/in.h>
+#include <linux/if_addrlabel.h>
 #include <stdbool.h>
 #include <unistd.h>
 
@@ -700,3 +701,42 @@ int sd_rtnl_message_get_family(sd_netlink_message *m, int *family) {
 
         return -EOPNOTSUPP;
 }
+
+int sd_rtnl_message_new_addrlabel(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int ifindex, int ifal_family) {
+        struct ifaddrlblmsg *addrlabel;
+        int r;
+
+        assert_return(rtnl_message_type_is_addrlabel(nlmsg_type), -EINVAL);
+        assert_return(ret, -EINVAL);
+
+        r = message_new(rtnl, ret, nlmsg_type);
+        if (r < 0)
+                return r;
+
+        if (nlmsg_type == RTM_NEWADDRLABEL)
+                (*ret)->hdr->nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL;
+
+        addrlabel = NLMSG_DATA((*ret)->hdr);
+
+        addrlabel->ifal_family = ifal_family;
+        addrlabel->ifal_index = ifindex;
+
+        return 0;
+}
+
+int sd_rtnl_message_addrlabel_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen) {
+        struct ifaddrlblmsg *addrlabel;
+
+        assert_return(m, -EINVAL);
+        assert_return(m->hdr, -EINVAL);
+        assert_return(rtnl_message_type_is_addrlabel(m->hdr->nlmsg_type), -EINVAL);
+
+        addrlabel = NLMSG_DATA(m->hdr);
+
+        if (prefixlen > 128)
+                return -ERANGE;
+
+        addrlabel->ifal_prefixlen = prefixlen;
+
+        return 0;
+}
index 770c92209ec0ead5e0e615bb2ca5926f81c7f8dc..1becae45fdc65e316663c0e2ec85bccfa2dc4841 100644 (file)
@@ -12,6 +12,6 @@ includedir=@includedir@
 
 Name: libudev
 Description: Library to access udev device information
-Version: @VERSION@
+Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -ludev
 Cflags: -I${includedir}
diff --git a/src/libudev/meson.build b/src/libudev/meson.build
new file mode 100644 (file)
index 0000000..1378f9a
--- /dev/null
@@ -0,0 +1,41 @@
+libudev_sources = files('''
+        libudev-private.h
+        libudev-device-internal.h
+        libudev.c
+        libudev-list.c
+        libudev-util.c
+        libudev-device.c
+        libudev-device-private.c
+        libudev-enumerate.c
+        libudev-monitor.c
+        libudev-queue.c
+        libudev-hwdb.c
+'''.split())
+
+############################################################
+
+libudev_sym = 'libudev.sym'
+libudev_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym)
+libudev = shared_library(
+        'udev',
+        libudev_sources,
+        version : '1.6.6',
+        include_directories : includes,
+        link_args : ['-shared',
+                     '-Wl,--version-script=' + libudev_sym_path],
+        link_with : [libbasic,
+                     libsystemd_internal],
+        dependencies : [threads],
+        link_depends : libudev_sym,
+        install : true,
+        install_dir : rootlibdir)
+
+install_headers('libudev.h')
+libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir())
+
+libudev_pc = configure_file(
+        input : 'libudev.pc.in',
+        output : 'libudev.pc',
+        configuration : substs)
+install_data(libudev_pc,
+             install_dir : pkgconfiglibdir)
index 1cb049e74af4596e9227e3dd48c62662f49905fc..b4798d674c76119b0f2cfe3fa38d7e8dd24ce570 100644 (file)
@@ -436,7 +436,10 @@ static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char
         const char *fmt;
 
         fmt = strjoina("libxkbcommon: ", format);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
         log_internalv(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, fmt, args);
+#pragma GCC diagnostic pop
 }
 
 #define LOAD_SYMBOL(symbol, dl, name)                                   \
diff --git a/src/locale/meson.build b/src/locale/meson.build
new file mode 100644 (file)
index 0000000..d7dd113
--- /dev/null
@@ -0,0 +1,42 @@
+systemd_localed_sources = files('''
+        localed.c
+        keymap-util.c
+        keymap-util.h
+'''.split())
+
+localectl_sources = files('localectl.c')
+
+if conf.get('ENABLE_LOCALED', false)
+        install_data('org.freedesktop.locale1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.locale1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.locale1.policy',
+                input : 'org.freedesktop.locale1.policy.in',
+                output : 'org.freedesktop.locale1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+endif
+
+# If you know a way that allows the same variables to be used
+# in sources list and concatenated to a string for test_env,
+# let me know.
+kbd_model_map = join_paths(meson.current_source_dir(),  'kbd-model-map')
+language_fallback_map = join_paths(meson.current_source_dir(), 'language-fallback-map')
+
+if conf.get('ENABLE_LOCALED', false)
+        install_data('kbd-model-map',
+                     'language-fallback-map',
+                     install_dir : pkgdatadir)
+endif
+
+tests += [
+        [['src/locale/test-keymap-util.c',
+          'src/locale/keymap-util.c',
+          'src/locale/keymap-util.h'],
+         [libshared],
+         [libdl]],
+]
index 7dea5c08597ac549ffb32000e0df151427db92d3..be7acbb54c2ba95a3332c2e02b5383ac20e8826d 100644 (file)
@@ -929,7 +929,7 @@ static int show_session(int argc, char *argv[], void *userdata) {
                 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
                 _cleanup_free_ char *path = NULL;
 
-                r = get_session_path(bus, argv[1], &error, &path);
+                r = get_session_path(bus, argv[i], &error, &path);
                 if (r < 0) {
                         log_error("Failed to get session path: %s", bus_error_message(&error, r));
                         return r;
@@ -1386,8 +1386,10 @@ static int help(int argc, char *argv[], void *userdata) {
                "     --kill-who=WHO        Who to send signal to\n"
                "  -s --signal=SIGNAL       Which signal to send\n"
                "  -n --lines=INTEGER       Number of journal entries to show\n"
-               "  -o --output=STRING       Change journal output mode (short, short-monotonic,\n"
-               "                           verbose, export, json, json-pretty, json-sse, cat)\n\n"
+               "  -o --output=STRING       Change journal output mode (short, short-precise,\n"
+               "                             short-iso, short-iso-precise, short-full,\n"
+               "                             short-monotonic, short-unix, verbose, export,\n"
+               "                             json, json-pretty, json-sse, cat)\n"
                "Session Commands:\n"
                "  list-sessions            List sessions\n"
                "  session-status [ID...]   Show session status\n"
index 5ca42b1ca2ae2c4d14cc4f73f23e25d181b3112e..1e6f3837382fe163fed58bbeda901abdda364d91 100644 (file)
@@ -347,7 +347,7 @@ InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm) {
         assert(m);
 
         HASHMAP_FOREACH(i, m->inhibitors, j)
-                if (i->mode == mm)
+                if (i->mode == mm && i->started)
                         what |= i->what;
 
         return what;
@@ -388,6 +388,9 @@ bool manager_is_inhibited(
         assert(w > 0 && w < _INHIBIT_WHAT_MAX);
 
         HASHMAP_FOREACH(i, m->inhibitors, j) {
+                if (!i->started)
+                        continue;
+
                 if (!(i->what & w))
                         continue;
 
index 19bae294a4a22aee0ff51ae0569cf19c50b3e709..1e2acc838bcdce6e0d11da293de520c9538b8350 100644 (file)
@@ -1004,10 +1004,10 @@ static int manager_parse_config_file(Manager *m) {
         assert(m);
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/logind.conf",
-                                 CONF_PATHS_NULSTR("systemd/logind.conf.d"),
-                                 "Login\0",
-                                 config_item_perf_lookup, logind_gperf_lookup,
-                                 false, m);
+                                        CONF_PATHS_NULSTR("systemd/logind.conf.d"),
+                                        "Login\0",
+                                        config_item_perf_lookup, logind_gperf_lookup,
+                                        false, m);
 }
 
 static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
diff --git a/src/login/meson.build b/src/login/meson.build
new file mode 100644 (file)
index 0000000..26bdbec
--- /dev/null
@@ -0,0 +1,104 @@
+systemd_logind_sources = files('''
+        logind.c
+        logind.h
+'''.split())
+
+logind_gperf_c = custom_target(
+        'logind_gperf.c',
+        input : 'logind-gperf.gperf',
+        output : 'logind-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+systemd_logind_sources += [logind_gperf_c]
+
+
+liblogind_core_sources = files('''
+        logind-core.c
+        logind-device.c
+        logind-device.h
+        logind-button.c
+        logind-button.h
+        logind-action.c
+        logind-action.h
+        logind-seat.c
+        logind-seat.h
+        logind-session.c
+        logind-session.h
+        logind-session-device.c
+        logind-session-device.h
+        logind-user.c
+        logind-user.h
+        logind-inhibit.c
+        logind-inhibit.h
+        logind-dbus.c
+        logind-session-dbus.c
+        logind-seat-dbus.c
+        logind-user-dbus.c
+        logind-utmp.c
+        logind-acl.h
+'''.split())
+
+logind_acl_c = files('logind-acl.c')
+if conf.get('HAVE_ACL', false)
+        liblogind_core_sources += logind_acl_c
+endif
+
+liblogind_core = static_library(
+        'logind-core',
+        liblogind_core_sources,
+        include_directories : includes,
+        dependencies : [libacl])
+
+loginctl_sources = files('''
+        loginctl.c
+        sysfs-show.h
+        sysfs-show.c
+'''.split())
+
+if conf.get('ENABLE_LOGIND', false)
+        logind_conf = configure_file(
+                input : 'logind.conf.in',
+                output : 'logind.conf',
+                configuration : substs)
+        install_data(logind_conf,
+                     install_dir : pkgsysconfdir)
+
+        pam_systemd_sym = 'src/login/pam_systemd.sym'
+        pam_systemd_c = files('pam_systemd.c')
+
+        install_data('org.freedesktop.login1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.login1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.login1.policy',
+                input : 'org.freedesktop.login1.policy.in',
+                output : 'org.freedesktop.login1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+
+        install_data('70-power-switch.rules',
+                     '70-uaccess.rules',
+                     install_dir : udevrulesdir)
+
+        foreach file : ['71-seat.rules',
+                        '73-seat-late.rules']
+                gen = configure_file(
+                        input : file + '.in',
+                        output : file,
+                        configuration : substs)
+                install_data(gen,
+                             install_dir : udevrulesdir)
+        endforeach
+
+        custom_target(
+                'systemd-user',
+                input : 'systemd-user.m4',
+                output: 'systemd-user',
+                command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+                capture : true,
+                install : pamconfdir != 'no',
+                install_dir : pamconfdir)
+endif
index 28384286fb7b2bc69af6800ed1b49d02118cf6c5..a385e6819bcf5f80b9e238bdfc78023c6d1afb45 100644 (file)
@@ -340,6 +340,7 @@ static int list_machines(int argc, char *argv[], void *userdata) {
                         printf("No machines.\n");
         }
 
+        r = 0;
 out:
         clean_machine_info(machines, n_machines);
         return r;
@@ -2693,9 +2694,10 @@ static int help(int argc, char *argv[], void *userdata) {
                "     --mkdir                  Create directory before bind mounting, if missing\n"
                "  -n --lines=INTEGER          Number of journal entries to show\n"
                "     --max-addresses=INTEGER  Number of internet addresses to show at most\n"
-               "  -o --output=STRING          Change journal output mode (short,\n"
-               "                              short-monotonic, verbose, export, json,\n"
-               "                              json-pretty, json-sse, cat)\n"
+               "  -o --output=STRING          Change journal output mode (short, short-precise,\n"
+               "                               short-iso, short-iso-precise, short-full,\n"
+               "                               short-monotonic, short-unix, verbose, export,\n"
+               "                               json, json-pretty, json-sse, cat)\n"
                "     --verify=MODE            Verification mode for downloaded images (no,\n"
                "                              checksum, signature)\n"
                "     --force                  Download image even if already exists\n\n"
diff --git a/src/machine/meson.build b/src/machine/meson.build
new file mode 100644 (file)
index 0000000..1a08133
--- /dev/null
@@ -0,0 +1,45 @@
+systemd_machined_sources = files('''
+        machined.c
+        machined.h
+'''.split())
+
+libmachine_core_sources = files('''
+        machine.c
+        machine.h
+        machined-dbus.c
+        machine-dbus.c
+        machine-dbus.h
+        image-dbus.c
+        image-dbus.h
+        operation.c
+        operation.h
+'''.split())
+
+libmachine_core = static_library(
+        'machine-core',
+        libmachine_core_sources,
+        include_directories : includes,
+        dependencies : [threads])
+
+if conf.get('ENABLE_MACHINED', false)
+        install_data('org.freedesktop.machine1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.machine1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.machine1.policy',
+                input : 'org.freedesktop.machine1.policy.in',
+                output : 'org.freedesktop.machine1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+endif
+
+tests += [
+        [['src/machine/test-machine-tables.c'],
+         [libmachine_core,
+          libshared],
+         [threads],
+         'ENABLE_MACHINED'],
+]
diff --git a/src/network/meson.build b/src/network/meson.build
new file mode 100644 (file)
index 0000000..5f97cc1
--- /dev/null
@@ -0,0 +1,148 @@
+sources = files('''
+        netdev/bond.c
+        netdev/bond.h
+        netdev/bridge.c
+        netdev/bridge.h
+        netdev/dummy.c
+        netdev/dummy.h
+        netdev/ipvlan.c
+        netdev/ipvlan.h
+        netdev/macvlan.c
+        netdev/macvlan.h
+        netdev/netdev.c
+        netdev/netdev.h
+        netdev/tunnel.c
+        netdev/tunnel.h
+        netdev/tuntap.c
+        netdev/tuntap.h
+        netdev/vcan.c
+        netdev/vcan.h
+        netdev/veth.c
+        netdev/veth.h
+        netdev/vlan.c
+        netdev/vlan.h
+        netdev/vrf.c
+        netdev/vrf.h
+        netdev/vxlan.c
+        netdev/vxlan.h
+        netdev/geneve.c
+        netdev/geneve.h
+        networkd-address-label.c
+        networkd-address-label.h
+        networkd-address-pool.c
+        networkd-address-pool.h
+        networkd-address.c
+        networkd-address.h
+        networkd-brvlan.c
+        networkd-brvlan.h
+        networkd-conf.c
+        networkd-conf.h
+        networkd-dhcp4.c
+        networkd-dhcp6.c
+        networkd-fdb.c
+        networkd-fdb.h
+        networkd-ipv4ll.c
+        networkd-ipv6-proxy-ndp.c
+        networkd-ipv6-proxy-ndp.h
+        networkd-link-bus.c
+        networkd-link.c
+        networkd-link.h
+        networkd-lldp-tx.c
+        networkd-lldp-tx.h
+        networkd-manager-bus.c
+        networkd-manager.c
+        networkd-manager.h
+        networkd-ndisc.c
+        networkd-ndisc.h
+        networkd-network-bus.c
+        networkd-network.c
+        networkd-network.h
+        networkd-route.c
+        networkd-route.h
+        networkd-util.c
+        networkd-util.h
+'''.split())
+
+systemd_networkd_sources = files('networkd.c')
+
+systemd_networkd_wait_online_sources = files('''
+        wait-online/link.c
+        wait-online/link.h
+        wait-online/manager.c
+        wait-online/manager.h
+        wait-online/wait-online.c
+'''.split()) + network_internal_h
+
+networkctl_sources = files('networkctl.c')
+
+network_include_dir = include_directories('.')
+
+if conf.get('ENABLE_NETWORKD', false)
+        networkd_gperf_c = custom_target(
+                'networkd-gperf.c',
+                input : 'networkd-gperf.gperf',
+                output : 'networkd-gperf.c',
+                command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+        networkd_network_gperf_c = custom_target(
+                'networkd-network-gperf.c',
+                input : 'networkd-network-gperf.gperf',
+                output : 'networkd-network-gperf.c',
+                command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+        netdev_gperf_c = custom_target(
+                'netdev-gperf.c',
+                input : 'netdev/netdev-gperf.gperf',
+                output : 'netdev-gperf.c',
+                command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+        libnetworkd_core = static_library(
+                'networkd-core',
+                sources,
+                network_internal_h,
+                networkd_gperf_c,
+                networkd_network_gperf_c,
+                netdev_gperf_c,
+                include_directories : includes,
+                link_with : [libshared])
+
+        install_data('org.freedesktop.network1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.network1.service',
+                     install_dir : dbussystemservicedir)
+        if install_polkit
+                install_data('systemd-networkd.rules',
+                             install_dir : polkitrulesdir)
+        endif
+        if install_polkit_pkla
+                install_data('systemd-networkd.pkla',
+                             install_dir : polkitpkladir)
+        endif
+
+        tests += [
+    [['src/network/test-networkd-conf.c'],
+     [libnetworkd_core,
+      libsystemd_network,
+      libudev],
+     []],
+
+    [['src/network/test-network.c'],
+     [libnetworkd_core,
+      libudev_internal,
+      libsystemd_network,
+      libshared],
+     []],
+
+    [['src/network/test-network-tables.c',
+      'src/network/test-network-tables.c',
+      test_tables_h],
+     [libnetworkd_core,
+      libudev_internal,
+      libudev_core,
+      libsystemd_network,
+      libshared],
+     [],
+     '', '', [],
+     [network_include_dir] + libudev_core_includes],
+  ]
+endif
diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c
new file mode 100644 (file)
index 0000000..e71ea58
--- /dev/null
@@ -0,0 +1,315 @@
+/***
+    This file is part of systemd.
+
+    Copyright 2017 Susant Sahani
+
+    systemd is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation; either version 2.1 of the License, or
+    (at your option) any later version.
+
+    systemd is distributed in the hope that it will be useful, but
+    WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <net/if.h>
+
+#include "alloc-util.h"
+#include "conf-parser.h"
+#include "extract-word.h"
+#include "geneve.h"
+#include "parse-util.h"
+#include "sd-netlink.h"
+#include "string-util.h"
+#include "strv.h"
+#include "missing.h"
+#include "networkd-manager.h"
+
+#define GENEVE_FLOW_LABEL_MAX_MASK 0xFFFFFU
+#define DEFAULT_GENEVE_DESTINATION_PORT 6081
+
+/* callback for geneve netdev's created without a backing Link */
+static int geneve_netdev_create_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
+        _cleanup_netdev_unref_ NetDev *netdev = userdata;
+        int r;
+
+        assert(netdev->state != _NETDEV_STATE_INVALID);
+
+        r = sd_netlink_message_get_errno(m);
+        if (r == -EEXIST)
+                log_netdev_info(netdev, "Geneve netdev exists, using existing without changing its parameters");
+        else if (r < 0) {
+                log_netdev_warning_errno(netdev, r, "Geneve netdev could not be created: %m");
+                netdev_drop(netdev);
+
+                return 1;
+        }
+
+        log_netdev_debug(netdev, "Geneve created");
+
+        return 1;
+}
+
+static int netdev_geneve_create(NetDev *netdev) {
+        _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
+        Geneve *v;
+        int r;
+
+        assert(netdev);
+
+        v = GENEVE(netdev);
+
+        r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not allocate RTM_NEWLINK message: %m");
+
+        r = sd_netlink_message_append_string(m, IFLA_IFNAME, netdev->ifname);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_IFNAME, attribute: %m");
+
+        if (netdev->mac) {
+                r = sd_netlink_message_append_ether_addr(m, IFLA_ADDRESS, netdev->mac);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
+        }
+
+        if (netdev->mtu) {
+                r = sd_netlink_message_append_u32(m, IFLA_MTU, netdev->mtu);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_MTU attribute: %m");
+        }
+
+        r = sd_netlink_message_open_container(m, IFLA_LINKINFO);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_LINKINFO attribute: %m");
+
+        r = sd_netlink_message_open_container_union(m, IFLA_INFO_DATA, netdev_kind_to_string(netdev->kind));
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_INFO_DATA attribute: %m");
+
+        if (v->id <= GENEVE_VID_MAX) {
+                r = sd_netlink_message_append_u32(m, IFLA_GENEVE_ID, v->id);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_ID attribute: %m");
+        }
+
+        if (!in_addr_is_null(v->remote_family, &v->remote)) {
+
+                if (v->remote_family == AF_INET)
+                        r = sd_netlink_message_append_in_addr(m, IFLA_GENEVE_REMOTE, &v->remote.in);
+                else
+                        r = sd_netlink_message_append_in6_addr(m, IFLA_GENEVE_REMOTE6, &v->remote.in6);
+
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_GROUP attribute: %m");
+
+        }
+
+        if (v->ttl) {
+                r = sd_netlink_message_append_u8(m, IFLA_GENEVE_TTL, v->ttl);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_TTL attribute: %m");
+        }
+
+        r = sd_netlink_message_append_u8(m, IFLA_GENEVE_TOS, v->tos);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_TOS attribute: %m");
+
+        r = sd_netlink_message_append_u8(m, IFLA_GENEVE_UDP_CSUM, v->udpcsum);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_UDP_CSUM attribute: %m");
+
+        r = sd_netlink_message_append_u8(m, IFLA_GENEVE_UDP_ZERO_CSUM6_TX, v->udp6zerocsumtx);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_UDP_ZERO_CSUM6_TX attribute: %m");
+
+        r = sd_netlink_message_append_u8(m, IFLA_GENEVE_UDP_ZERO_CSUM6_RX, v->udp6zerocsumrx);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_UDP_ZERO_CSUM6_RX attribute: %m");
+
+        if (v->dest_port != DEFAULT_GENEVE_DESTINATION_PORT) {
+                r = sd_netlink_message_append_u16(m, IFLA_GENEVE_PORT, htobe16(v->dest_port));
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_PORT attribute: %m");
+        }
+
+        if (v->flow_label > 0) {
+                r = sd_netlink_message_append_u32(m, IFLA_GENEVE_LABEL, htobe32(v->flow_label));
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_GENEVE_LABEL attribute: %m");
+        }
+
+        r = sd_netlink_message_close_container(m);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_INFO_DATA attribute: %m");
+
+        r = sd_netlink_message_close_container(m);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_LINKINFO attribute: %m");
+
+        r = sd_netlink_call_async(netdev->manager->rtnl, m, geneve_netdev_create_handler, netdev, 0, NULL);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not send rtnetlink message: %m");
+
+        netdev_ref(netdev);
+
+        netdev->state = NETDEV_STATE_CREATING;
+
+        log_netdev_debug(netdev, "Creating");
+
+
+        return r;
+}
+
+int config_parse_geneve_vni(const char *unit,
+                           const char *filename,
+                           unsigned line,
+                           const char *section,
+                           unsigned section_line,
+                           const char *lvalue,
+                           int ltype,
+                           const char *rvalue,
+                           void *data,
+                           void *userdata) {
+        Geneve *v = userdata;
+        uint32_t f;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = safe_atou32(rvalue, &f);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse Geneve VNI '%s'.", rvalue);
+                return 0;
+        }
+
+        if (f > GENEVE_VID_MAX){
+                log_syntax(unit, LOG_ERR, filename, line, r, "Geneve VNI out is of range '%s'.", rvalue);
+                return 0;
+        }
+
+        v->id = f;
+
+        return 0;
+}
+
+int config_parse_geneve_address(const char *unit,
+                                const char *filename,
+                                unsigned line,
+                                const char *section,
+                                unsigned section_line,
+                                const char *lvalue,
+                                int ltype,
+                                const char *rvalue,
+                                void *data,
+                                void *userdata) {
+        Geneve *v = userdata;
+        union in_addr_union *addr = data, buffer;
+        int r, f;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = in_addr_from_string_auto(rvalue, &f, &buffer);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "geneve '%s' address is invalid, ignoring assignment: %s", lvalue, rvalue);
+                return 0;
+        }
+
+        r = in_addr_is_multicast(f, &buffer);
+        if (r > 0) {
+                log_syntax(unit, LOG_ERR, filename, line, 0, "geneve invalid multicast '%s' address, ignoring assignment: %s", lvalue, rvalue);
+                return 0;
+        }
+
+        v->remote_family = f;
+        *addr = buffer;
+
+        return 0;
+}
+
+int config_parse_geneve_flow_label(const char *unit,
+                                   const char *filename,
+                                   unsigned line,
+                                   const char *section,
+                                   unsigned section_line,
+                                   const char *lvalue,
+                                   int ltype,
+                                   const char *rvalue,
+                                   void *data,
+                                   void *userdata) {
+        Geneve *v = userdata;
+        uint32_t f;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = safe_atou32(rvalue, &f);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse Geneve flow label '%s'.", rvalue);
+                return 0;
+        }
+
+        if (f & ~GENEVE_FLOW_LABEL_MAX_MASK) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Geneve flow label '%s' not valid. Flow label range should be [0-1048575].", rvalue);
+                return 0;
+        }
+
+        v->flow_label = f;
+
+        return 0;
+}
+
+static int netdev_geneve_verify(NetDev *netdev, const char *filename) {
+        Geneve *v = GENEVE(netdev);
+
+        assert(netdev);
+        assert(v);
+        assert(filename);
+
+        if (v->ttl == 0) {
+                log_warning("Invalid Geneve TTL value '0' configured in '%s'. Ignoring", filename);
+                return -EINVAL;
+        }
+
+        return 0;
+}
+
+static void geneve_init(NetDev *netdev) {
+        Geneve *v;
+
+        assert(netdev);
+
+        v = GENEVE(netdev);
+
+        assert(v);
+
+        v->id = GENEVE_VID_MAX + 1;
+        v->dest_port = DEFAULT_GENEVE_DESTINATION_PORT;
+        v->udpcsum = false;
+        v->udp6zerocsumtx = false;
+        v->udp6zerocsumrx = false;
+}
+
+const NetDevVTable geneve_vtable = {
+        .object_size = sizeof(Geneve),
+        .init = geneve_init,
+        .sections = "Match\0NetDev\0GENEVE\0",
+        .create = netdev_geneve_create,
+        .create_type = NETDEV_CREATE_INDEPENDENT,
+        .config_verify = netdev_geneve_verify,
+};
diff --git a/src/network/netdev/geneve.h b/src/network/netdev/geneve.h
new file mode 100644 (file)
index 0000000..bde28ba
--- /dev/null
@@ -0,0 +1,85 @@
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2017 Susant Sahani
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+typedef struct Geneve Geneve;
+
+#include "in-addr-util.h"
+#include "netdev.h"
+#include "networkd-link.h"
+#include "networkd-network.h"
+
+#define GENEVE_VID_MAX (1u << 24) - 1
+
+struct Geneve {
+        NetDev meta;
+
+        uint32_t id;
+        uint32_t flow_label;
+
+        int remote_family;
+
+        uint8_t tos;
+        uint8_t ttl;
+
+        uint16_t dest_port;
+
+        bool udpcsum;
+        bool udp6zerocsumtx;
+        bool udp6zerocsumrx;
+
+        union in_addr_union remote;
+};
+
+DEFINE_NETDEV_CAST(GENEVE, Geneve);
+extern const NetDevVTable geneve_vtable;
+
+int config_parse_geneve_vni(const char *unit,
+                            const char *filename,
+                            unsigned line,
+                            const char *section,
+                            unsigned section_line,
+                            const char *lvalue,
+                            int ltype,
+                            const char *rvalue,
+                            void *data,
+                            void *userdata);
+
+int config_parse_geneve_address(const char *unit,
+                               const char *filename,
+                               unsigned line,
+                               const char *section,
+                               unsigned section_line,
+                               const char *lvalue,
+                               int ltype,
+                               const char *rvalue,
+                               void *data,
+                               void *userdata);
+
+int config_parse_geneve_flow_label(const char *unit,
+                                   const char *filename,
+                                   unsigned line,
+                                   const char *section,
+                                   unsigned section_line,
+                                   const char *lvalue,
+                                   int ltype,
+                                   const char *rvalue,
+                                   void *data,
+                                   void *userdata);
index e19fa9817e288fff92481d76fccd8fbbc458c9fa..766e7cf9fa5501932196f8145a00d617cd007a66 100644 (file)
@@ -4,6 +4,7 @@
 #include "network-internal.h"
 #include "netdev/bond.h"
 #include "netdev/bridge.h"
+#include "netdev/geneve.h"
 #include "netdev/ipvlan.h"
 #include "netdev/macvlan.h"
 #include "netdev/tunnel.h"
@@ -36,6 +37,10 @@ NetDev.Kind,                 config_parse_netdev_kind,             0,
 NetDev.MTUBytes,             config_parse_iec_size,                0,                             offsetof(NetDev, mtu)
 NetDev.MACAddress,           config_parse_hwaddr,                  0,                             offsetof(NetDev, mac)
 VLAN.Id,                     config_parse_vlanid,                  0,                             offsetof(VLan, id)
+VLAN.GVRP,                   config_parse_tristate,                0,                             offsetof(VLan, gvrp)
+VLAN.MVRP,                   config_parse_tristate,                0,                             offsetof(VLan, mvrp)
+VLAN.LooseBinding,           config_parse_tristate,                0,                             offsetof(VLan, loose_binding)
+VLAN.ReorderHeader,          config_parse_tristate,                0,                             offsetof(VLan, reorder_hdr)
 MACVLAN.Mode,                config_parse_macvlan_mode,            0,                             offsetof(MacVlan, mode)
 MACVTAP.Mode,                config_parse_macvlan_mode,            0,                             offsetof(MacVlan, mode)
 IPVLAN.Mode,                 config_parse_ipvlan_mode,             0,                             offsetof(IPVlan, mode)
@@ -77,7 +82,17 @@ VXLAN.FDBAgeingSec,          config_parse_sec,                     0,
 VXLAN.GroupPolicyExtension,  config_parse_bool,                    0,                             offsetof(VxLan, group_policy)
 VXLAN.MaximumFDBEntries,     config_parse_unsigned,                0,                             offsetof(VxLan, max_fdb)
 VXLAN.PortRange,             config_parse_port_range,              0,                             0
-VXLAN.DestinationPort,       config_parse_destination_port,        0,                             offsetof(VxLan, dest_port)
+VXLAN.DestinationPort,       config_parse_ip_port,                 0,                             offsetof(VxLan, dest_port)
+VXLAN.FlowLabel,             config_parse_flow_label,              0,                             0
+GENEVE.Id,                   config_parse_geneve_vni,              0,                             offsetof(Geneve, id)
+GENEVE.Remote,               config_parse_geneve_address,          0,                             offsetof(Geneve, remote)
+GENEVE.TOS,                  config_parse_uint8,                   0,                             offsetof(Geneve, tos)
+GENEVE.TTL,                  config_parse_uint8,                   0,                             offsetof(Geneve, ttl)
+GENEVE.UDPChecksum,          config_parse_bool,                    0,                             offsetof(Geneve, udpcsum)
+GENEVE.UDP6ZeroCheckSumRx,   config_parse_bool,                    0,                             offsetof(Geneve, udp6zerocsumrx)
+GENEVE.UDP6ZeroCheckSumTx,   config_parse_bool,                    0,                             offsetof(Geneve, udp6zerocsumtx)
+GENEVE.DestinationPort,      config_parse_ip_port,                 0,                             offsetof(Geneve, dest_port)
+GENEVE.FlowLabel,            config_parse_geneve_flow_label,       0,                             0
 Tun.OneQueue,                config_parse_bool,                    0,                             offsetof(TunTap, one_queue)
 Tun.MultiQueue,              config_parse_bool,                    0,                             offsetof(TunTap, multi_queue)
 Tun.PacketInfo,              config_parse_bool,                    0,                             offsetof(TunTap, packet_info)
index 9b9e83d9db4242751532c1a9e0ba1cb7c8c054ae..43884581caf81ab9ae7099ce4aeb2967bc21b6b1 100644 (file)
@@ -28,6 +28,7 @@
 #include "network-internal.h"
 #include "netdev/netdev.h"
 #include "networkd-manager.h"
+#include "networkd-link.h"
 #include "siphash24.h"
 #include "stat-util.h"
 #include "string-table.h"
@@ -35,6 +36,7 @@
 
 #include "netdev/bridge.h"
 #include "netdev/bond.h"
+#include "netdev/geneve.h"
 #include "netdev/vlan.h"
 #include "netdev/macvlan.h"
 #include "netdev/ipvlan.h"
@@ -69,6 +71,7 @@ const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
         [NETDEV_KIND_IP6TNL] = &ip6tnl_vtable,
         [NETDEV_KIND_VRF] = &vrf_vtable,
         [NETDEV_KIND_VCAN] = &vcan_vtable,
+        [NETDEV_KIND_GENEVE] = &geneve_vtable,
 };
 
 static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = {
@@ -94,6 +97,7 @@ static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = {
         [NETDEV_KIND_IP6TNL] = "ip6tnl",
         [NETDEV_KIND_VRF] = "vrf",
         [NETDEV_KIND_VCAN] = "vcan",
+        [NETDEV_KIND_GENEVE] = "geneve",
 };
 
 DEFINE_STRING_TABLE_LOOKUP(netdev_kind, NetDevKind);
@@ -218,6 +222,13 @@ static int netdev_enslave_ready(NetDev *netdev, Link* link, sd_netlink_message_h
         assert(link);
         assert(callback);
 
+        if (link->flags & IFF_UP) {
+                log_netdev_debug(netdev, "Link '%s' was up when attempting to enslave it. Bringing link down.", link->ifname);
+                r = link_down(link);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not bring link down: %m");
+        }
+
         r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
         if (r < 0)
                 return log_netdev_error_errno(netdev, r, "Could not allocate RTM_SETLINK message: %m");
index 37c74312132bc0948b52c690c16ea9f377bb5533..a961e2ac3b44189c0cabca88f00213798432e662 100644 (file)
@@ -57,6 +57,7 @@ typedef enum NetDevKind {
         NETDEV_KIND_TAP,
         NETDEV_KIND_VRF,
         NETDEV_KIND_VCAN,
+        NETDEV_KIND_GENEVE,
         _NETDEV_KIND_MAX,
         _NETDEV_KIND_INVALID = -1
 } NetDevKind;
index 28c061fa4f90effb7c9858349918a3a0ebeaee02..6f41633eade74da08b9f4c0cbd71010b8a1b4ff5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/if_vlan.h>
 #include <net/if.h>
 
 #include "netdev/vlan.h"
 #include "vlan-util.h"
 
 static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {
+        struct ifla_vlan_flags flags = {};
         VLan *v;
         int r;
 
@@ -38,6 +40,30 @@ static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlin
         if (r < 0)
                 return log_netdev_error_errno(netdev, r, "Could not append IFLA_VLAN_ID attribute: %m");
 
+        if (v->gvrp != -1) {
+                flags.mask |= VLAN_FLAG_GVRP;
+                SET_FLAG(flags.flags, VLAN_FLAG_GVRP, v->gvrp);
+        }
+
+        if (v->mvrp != -1) {
+                flags.mask |= VLAN_FLAG_MVRP;
+                SET_FLAG(flags.flags, VLAN_FLAG_MVRP, v->mvrp);
+        }
+
+        if (v->reorder_hdr != -1) {
+                flags.mask |= VLAN_FLAG_REORDER_HDR;
+                SET_FLAG(flags.flags, VLAN_FLAG_REORDER_HDR, v->reorder_hdr);
+        }
+
+        if (v->loose_binding != -1) {
+                flags.mask |= VLAN_FLAG_LOOSE_BINDING;
+                SET_FLAG(flags.flags, VLAN_FLAG_LOOSE_BINDING, v->loose_binding);
+        }
+
+        r = sd_netlink_message_append_data(req, IFLA_VLAN_FLAGS, &flags, sizeof(struct ifla_vlan_flags));
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_VLAN_FLAGS attribute: %m");
+
         return 0;
 }
 
@@ -66,6 +92,10 @@ static void vlan_init(NetDev *netdev) {
         assert(v);
 
         v->id = VLANID_INVALID;
+        v->gvrp = -1;
+        v->mvrp = -1;
+        v->loose_binding = -1;
+        v->reorder_hdr = -1;
 }
 
 const NetDevVTable vlan_vtable = {
index fade899997d0d190d0cdae78549405b5930b737b..780d61262a2fc858ed64f5777c170797c0e623b2 100644 (file)
@@ -27,6 +27,11 @@ struct VLan {
         NetDev meta;
 
         uint16_t id;
+
+        int gvrp;
+        int mvrp;
+        int loose_binding;
+        int reorder_hdr;
 };
 
 DEFINE_NETDEV_CAST(VLAN, VLan);
index b677b000fd978547893b481fd8ff0cca95484385..b5b7aec2c07af4e3af5cca6bfed51cf3bf0f2a16 100644 (file)
@@ -157,6 +157,10 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli
                         return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_PORT_RANGE attribute: %m");
         }
 
+        r = sd_netlink_message_append_u32(m, IFLA_VXLAN_LABEL, htobe32(v->flow_label));
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_LABEL attribute: %m");
+
         if (v->group_policy) {
                 r = sd_netlink_message_append_flag(m, IFLA_VXLAN_GBP);
                 if (r < 0)
@@ -267,18 +271,18 @@ int config_parse_port_range(const char *unit,
         return 0;
 }
 
-int config_parse_destination_port(const char *unit,
-                                  const char *filename,
-                                  unsigned line,
-                                  const char *section,
-                                  unsigned section_line,
-                                  const char *lvalue,
-                                  int ltype,
-                                  const char *rvalue,
-                                  void *data,
-                                  void *userdata) {
+int config_parse_flow_label(const char *unit,
+                            const char *filename,
+                            unsigned line,
+                            const char *section,
+                            unsigned section_line,
+                            const char *lvalue,
+                            int ltype,
+                            const char *rvalue,
+                            void *data,
+                            void *userdata) {
         VxLan *v = userdata;
-        uint16_t port;
+        unsigned f;
         int r;
 
         assert(filename);
@@ -286,13 +290,19 @@ int config_parse_destination_port(const char *unit,
         assert(rvalue);
         assert(data);
 
-        r = parse_ip_port(rvalue, &port);
+        r = safe_atou(rvalue, &f);
         if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse VXLAN destination port '%s'.", rvalue);
+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse VXLAN flow label '%s'.", rvalue);
+                return 0;
+        }
+
+        if (f & ~VXLAN_FLOW_LABEL_MAX_MASK) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "VXLAN flow label '%s' not valid. Flow label range should be [0-1048575].", rvalue);
                 return 0;
         }
 
-        v->dest_port = port;
+        v->flow_label = f;
 
         return 0;
 }
index dca58e7fe69321499deea6ccf9c005ab6c17bd68..1eeda022a2043882bbd133a46f2a991cfca8b817 100644 (file)
@@ -25,6 +25,7 @@ typedef struct VxLan VxLan;
 #include "netdev/netdev.h"
 
 #define VXLAN_VID_MAX (1u << 24) - 1
+#define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU
 
 struct VxLan {
         NetDev meta;
@@ -40,6 +41,7 @@ struct VxLan {
         unsigned tos;
         unsigned ttl;
         unsigned max_fdb;
+        unsigned flow_label;
 
         uint16_t dest_port;
 
@@ -84,13 +86,13 @@ int config_parse_port_range(const char *unit,
                             void *data,
                             void *userdata);
 
-int config_parse_destination_port(const char *unit,
-                                  const char *filename,
-                                  unsigned line,
-                                  const char *section,
-                                  unsigned section_line,
-                                  const char *lvalue,
-                                  int ltype,
-                                  const char *rvalue,
-                                  void *data,
-                                  void *userdata);
+int config_parse_flow_label(const char *unit,
+                            const char *filename,
+                            unsigned line,
+                            const char *section,
+                            unsigned section_line,
+                            const char *lvalue,
+                            int ltype,
+                            const char *rvalue,
+                            void *data,
+                            void *userdata);
diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c
new file mode 100644 (file)
index 0000000..b89995e
--- /dev/null
@@ -0,0 +1,223 @@
+/***
+  This file is part of systemd.
+
+  Copyright 2017 Susant Sahani
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <net/if.h>
+#include <linux/if_addrlabel.h>
+
+#include "alloc-util.h"
+#include "conf-parser.h"
+#include "networkd-address-label.h"
+#include "netlink-util.h"
+#include "networkd-manager.h"
+#include "parse-util.h"
+#include "socket-util.h"
+
+int address_label_new(AddressLabel **ret) {
+        _cleanup_address_label_free_ AddressLabel *addrlabel = NULL;
+
+        addrlabel = new0(AddressLabel, 1);
+        if (!addrlabel)
+                return -ENOMEM;
+
+        *ret = addrlabel;
+        addrlabel = NULL;
+
+        return 0;
+}
+
+void address_label_free(AddressLabel *label) {
+        if (!label)
+                return;
+
+        if (label->network) {
+                LIST_REMOVE(labels, label->network->address_labels, label);
+                assert(label->network->n_address_labels > 0);
+                label->network->n_address_labels--;
+
+                if (label->section) {
+                        hashmap_remove(label->network->address_labels_by_section, label->section);
+                        network_config_section_free(label->section);
+                }
+        }
+
+        free(label);
+}
+
+static int address_label_new_static(Network *network, const char *filename, unsigned section_line, AddressLabel **ret) {
+        _cleanup_network_config_section_free_ NetworkConfigSection *n = NULL;
+        _cleanup_address_label_free_ AddressLabel *label = NULL;
+        int r;
+
+        assert(network);
+        assert(ret);
+        assert(!!filename == (section_line > 0));
+
+        r = network_config_section_new(filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        label = hashmap_get(network->address_labels_by_section, n);
+        if (label) {
+                *ret = label;
+                label = NULL;
+
+                return 0;
+        }
+
+        r = address_label_new(&label);
+        if (r < 0)
+                return r;
+
+        label->section = n;
+        n = NULL;
+
+        r = hashmap_put(network->address_labels_by_section, label->section, label);
+        if (r < 0)
+                return r;
+
+        label->network = network;
+        LIST_APPEND(labels, network->address_labels, label);
+        network->n_address_labels++;
+
+        *ret = label;
+        label = NULL;
+
+        return 0;
+}
+
+int address_label_configure(
+                AddressLabel *label,
+                Link *link,
+                sd_netlink_message_handler_t callback,
+                bool update) {
+
+        _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
+        int r;
+
+        assert(label);
+        assert(link);
+        assert(link->ifindex > 0);
+        assert(link->manager);
+        assert(link->manager->rtnl);
+
+        r = sd_rtnl_message_new_addrlabel(link->manager->rtnl, &req, RTM_NEWADDRLABEL,
+                                          link->ifindex, AF_INET6);
+        if (r < 0)
+                return log_error_errno(r, "Could not allocate RTM_NEWADDR message: %m");
+
+        r = sd_rtnl_message_addrlabel_set_prefixlen(req, label->prefixlen);
+        if (r < 0)
+                return log_error_errno(r, "Could not set prefixlen: %m");
+
+        r = sd_netlink_message_append_u32(req, IFAL_LABEL, label->label);
+        if (r < 0)
+                return log_error_errno(r, "Could not append IFAL_LABEL attribute: %m");
+
+        r = sd_netlink_message_append_in6_addr(req, IFA_ADDRESS, &label->in_addr.in6);
+        if (r < 0)
+                return log_error_errno(r, "Could not append IFA_ADDRESS attribute: %m");
+
+        r = sd_netlink_call_async(link->manager->rtnl, req, callback, link, 0, NULL);
+        if (r < 0)
+                return log_error_errno(r, "Could not send rtnetlink message: %m");
+
+        link_ref(link);
+
+        return 0;
+}
+
+int config_parse_address_label_prefix(const char *unit,
+                                      const char *filename,
+                                      unsigned line,
+                                      const char *section,
+                                      unsigned section_line,
+                                      const char *lvalue,
+                                      int ltype,
+                                      const char *rvalue,
+                                      void *data,
+                                      void *userdata) {
+
+        _cleanup_address_label_free_ AddressLabel *n = NULL;
+        Network *network = userdata;
+        int r;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = address_label_new_static(network, filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        r = in_addr_prefix_from_string(rvalue, AF_INET6, &n->in_addr, &n->prefixlen);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Address label is invalid, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        n = NULL;
+
+        return 0;
+}
+
+int config_parse_address_label(
+                const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        _cleanup_address_label_free_ AddressLabel *n = NULL;
+        Network *network = userdata;
+        uint32_t k;
+        int r;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = address_label_new_static(network, filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        r = safe_atou32(rvalue, &k);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse address label, ignoring: %s", rvalue);
+                return 0;
+        }
+
+        if (k == 0xffffffffUL) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Adress label is invalid, ignoring: %s", rvalue);
+                return 0;
+        }
+
+        n->label = k;
+        n = NULL;
+
+        return 0;
+}
diff --git a/src/network/networkd-address-label.h b/src/network/networkd-address-label.h
new file mode 100644 (file)
index 0000000..8724ea8
--- /dev/null
@@ -0,0 +1,58 @@
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2017 Susant Sahani
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <inttypes.h>
+#include <stdbool.h>
+
+#include "in-addr-util.h"
+
+typedef struct AddressLabel AddressLabel;
+
+#include "networkd-link.h"
+#include "networkd-network.h"
+
+typedef struct Network Network;
+typedef struct Link Link;
+typedef struct NetworkConfigSection NetworkConfigSection;
+
+struct AddressLabel {
+        Network *network;
+        Link *link;
+        NetworkConfigSection *section;
+
+        unsigned char prefixlen;
+        uint32_t label;
+
+        union in_addr_union in_addr;
+
+        LIST_FIELDS(AddressLabel, labels);
+};
+
+int address_label_new(AddressLabel **ret);
+void address_label_free(AddressLabel *label);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(AddressLabel*, address_label_free);
+#define _cleanup_address_label_free_ _cleanup_(address_label_freep)
+
+int address_label_configure(AddressLabel *address, Link *link, sd_netlink_message_handler_t callback, bool update);
+
+int config_parse_address_label(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_address_label_prefix(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
index aaa27f311d39ce24e5ed0df326b1cef3574fdb0a..e28e018116044e1cadc7feb79ad5ca03d85f9a65 100644 (file)
@@ -32,10 +32,10 @@ int manager_parse_config_file(Manager *m) {
         assert(m);
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/networkd.conf",
-                                 CONF_PATHS_NULSTR("systemd/networkd.conf.d"),
-                                 "DHCP\0",
-                                 config_item_perf_lookup, networkd_gperf_lookup,
-                                 false, m);
+                                        CONF_PATHS_NULSTR("systemd/networkd.conf.d"),
+                                        "DHCP\0",
+                                        config_item_perf_lookup, networkd_gperf_lookup,
+                                        false, m);
 }
 
 static const char* const duid_type_table[_DUID_TYPE_MAX] = {
index 7ba05dbec30d51467e14c0d625bc4d231a51cc85..e2578a298b99042756ef9923c693e9bcb4ba5e1c 100644 (file)
@@ -179,12 +179,22 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
 
         switch(event) {
                 case SD_IPV4LL_EVENT_STOP:
+                        r = ipv4ll_address_lost(link);
+                        if (r < 0) {
+                                link_enter_failed(link);
+                                return;
+                        }
+                        break;
                 case SD_IPV4LL_EVENT_CONFLICT:
                         r = ipv4ll_address_lost(link);
                         if (r < 0) {
                                 link_enter_failed(link);
                                 return;
                         }
+
+                        r = sd_ipv4ll_restart(ll);
+                        if (r < 0)
+                                log_link_warning(link, "Could not acquire IPv4 link-local address");
                         break;
                 case SD_IPV4LL_EVENT_BIND:
                         r = ipv4ll_address_claimed(ll, link);
index 11c1cd92686cd80c6db0da7a9c74d42d7a28f674..00790c0c135b68fa035b9ee9f352b0282c2b1f76 100644 (file)
@@ -38,6 +38,9 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
         if (!link->network)
                 return false;
 
+        if (link->network->ipv6_proxy_ndp != -1)
+                return link->network->ipv6_proxy_ndp;
+
         if (link->network->n_ipv6_proxy_ndp_addresses == 0)
                 return false;
 
index 0c1229336b87c8d4b8db7e106ef504e2d68f0af1..6ed838094246fcfb94d3b33c82ebedc6e2f2bf1e 100644 (file)
@@ -853,6 +853,35 @@ static int address_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userda
         return 1;
 }
 
+static int address_label_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
+        _cleanup_link_unref_ Link *link = userdata;
+        int r;
+
+        assert(rtnl);
+        assert(m);
+        assert(link);
+        assert(link->ifname);
+        assert(link->link_messages > 0);
+
+        link->link_messages--;
+
+        if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
+                return 1;
+
+        r = sd_netlink_message_get_errno(m);
+        if (r < 0 && r != -EEXIST)
+                log_link_warning_errno(link, r, "could not set address label: %m");
+        else if (r >= 0)
+                manager_rtnl_process_address(rtnl, m, link->manager);
+
+        if (link->link_messages == 0) {
+                log_link_debug(link, "Addresses label set");
+                link_enter_set_routes(link);
+        }
+
+        return 1;
+}
+
 static int link_push_uplink_dns_to_dhcp_server(Link *link, sd_dhcp_server *s) {
         _cleanup_free_ struct in_addr *addresses = NULL;
         size_t n_addresses = 0, n_allocated = 0;
@@ -965,6 +994,7 @@ static int link_set_bridge_fdb(Link *link) {
 }
 
 static int link_enter_set_addresses(Link *link) {
+        AddressLabel *label;
         Address *ad;
         int r;
 
@@ -989,6 +1019,17 @@ static int link_enter_set_addresses(Link *link) {
                 link->link_messages++;
         }
 
+        LIST_FOREACH(labels, label, link->network->address_labels) {
+                r = address_label_configure(label, link, address_label_handler, false);
+                if (r < 0) {
+                        log_link_warning_errno(link, r, "Could not set address label: %m");
+                        link_enter_failed(link);
+                        return r;
+                }
+
+                link->link_messages++;
+        }
+
         /* now that we can figure out a default address for the dhcp server,
            start it */
         if (link_dhcp4_server_enabled(link)) {
@@ -1325,6 +1366,11 @@ static int link_set_bridge(Link *link) {
                 if (r < 0)
                         return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_COST attribute: %m");
         }
+        if (link->network->priority != LINK_BRIDGE_PORT_PRIORITY_INVALID) {
+                r = sd_netlink_message_append_u16(req, IFLA_BRPORT_PRIORITY, link->network->priority);
+                if (r < 0)
+                        return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PRIORITY attribute: %m");
+        }
 
         r = sd_netlink_message_close_container(req);
         if (r < 0)
@@ -1598,7 +1644,7 @@ static int link_up_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userda
         return 1;
 }
 
-static int link_up(Link *link) {
+int link_up(Link *link) {
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
         uint8_t ipv6ll_mode;
         int r;
@@ -1719,7 +1765,7 @@ static int link_down_handler(sd_netlink *rtnl, sd_netlink_message *m, void *user
         return 1;
 }
 
-static int link_down(Link *link) {
+int link_down(Link *link) {
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
         int r;
 
index e6190fbe576409ff5b59018889ae38d7ad5e60e0..be5c4f328425a240f86cdede2f9d177247d86763 100644 (file)
@@ -138,6 +138,9 @@ int link_get(Manager *m, int ifindex, Link **ret);
 int link_add(Manager *manager, sd_netlink_message *message, Link **ret);
 void link_drop(Link *link);
 
+int link_up(Link *link);
+int link_down(Link *link);
+
 int link_address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata);
 int link_route_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata);
 
index 4fd5d8ae70312fcaa49d578a3e85ed653ebe66fa..d52b511bb55c5996cf058cae04ec7b00a9845597 100644 (file)
@@ -27,6 +27,7 @@
 
 #define NDISC_DNSSL_MAX 64U
 #define NDISC_RDNSS_MAX 64U
+#define NDISC_PREFIX_LFT_MIN 7200U
 
 static int ndisc_netlink_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
         _cleanup_link_unref_ Link *link = userdata;
@@ -152,13 +153,21 @@ static void ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
 
 static void ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *rt) {
         _cleanup_address_free_ Address *address = NULL;
-        uint32_t lifetime_valid, lifetime_preferred;
+        Address *existing_address;
+        uint32_t lifetime_valid, lifetime_preferred, lifetime_remaining;
+        usec_t time_now;
         unsigned prefixlen;
         int r;
 
         assert(link);
         assert(rt);
 
+        r = sd_ndisc_router_get_timestamp(rt, clock_boottime_or_monotonic(), &time_now);
+        if (r < 0) {
+                log_link_warning_errno(link, r, "Failed to get RA timestamp: %m");
+                return;
+        }
+
         r = sd_ndisc_router_prefix_get_prefixlen(rt, &prefixlen);
         if (r < 0) {
                 log_link_error_errno(link, r, "Failed to get prefix length: %m");
@@ -207,7 +216,24 @@ static void ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *
         address->prefixlen = prefixlen;
         address->flags = IFA_F_NOPREFIXROUTE|IFA_F_MANAGETEMPADDR;
         address->cinfo.ifa_prefered = lifetime_preferred;
-        address->cinfo.ifa_valid = lifetime_valid;
+
+        /* see RFC4862 section 5.5.3.e */
+        r = address_get(link, address->family, &address->in_addr, address->prefixlen, &existing_address);
+        if (r > 0) {
+                lifetime_remaining = existing_address->cinfo.tstamp / 100 + existing_address->cinfo.ifa_valid - time_now / USEC_PER_SEC;
+                if (lifetime_valid > NDISC_PREFIX_LFT_MIN || lifetime_valid > lifetime_remaining)
+                        address->cinfo.ifa_valid = lifetime_valid;
+                else if (lifetime_remaining <= NDISC_PREFIX_LFT_MIN)
+                        address->cinfo.ifa_valid = lifetime_remaining;
+                else
+                        address->cinfo.ifa_valid = NDISC_PREFIX_LFT_MIN;
+        } else if (lifetime_valid > 0)
+                address->cinfo.ifa_valid = lifetime_valid;
+        else
+                return; /* see RFC4862 section 5.5.3.d */
+
+        if (address->cinfo.ifa_valid == 0)
+                return;
 
         r = address_configure(address, link, ndisc_netlink_handler, true);
         if (r < 0) {
index 68052ba54439840b2bac6dc3a8b20db51d160653..b2c585f8664d9f5cce9d109cc99425f949a72943 100644 (file)
@@ -63,6 +63,7 @@ Network.IPv6AcceptRA,                   config_parse_tristate,
 Network.IPv6AcceptRouterAdvertisements, config_parse_tristate,                          0,                             offsetof(Network, ipv6_accept_ra)
 Network.IPv6DuplicateAddressDetection,  config_parse_int,                               0,                             offsetof(Network, ipv6_dad_transmits)
 Network.IPv6HopLimit,                   config_parse_int,                               0,                             offsetof(Network, ipv6_hop_limit)
+Network.IPv6ProxyNDP,                   config_parse_tristate,                          0,                             offsetof(Network, ipv6_proxy_ndp)
 Network.ActiveSlave,                    config_parse_bool,                              0,                             offsetof(Network, active_slave)
 Network.PrimarySlave,                   config_parse_bool,                              0,                             offsetof(Network, primary_slave)
 Network.IPv4ProxyARP,                   config_parse_tristate,                          0,                             offsetof(Network, proxy_arp)
@@ -79,6 +80,8 @@ Address.DuplicateAddressDetection,      config_parse_address_flags,
 Address.ManageTemporaryAddress,         config_parse_address_flags,                     0,                             0
 Address.PrefixRoute,                    config_parse_address_flags,                     0,                             0
 Address.AutoJoin,                       config_parse_address_flags,                     0,                             0
+IPv6AddressLabel.Prefix,                config_parse_address_label_prefix,              0,                             0
+IPv6AddressLabel.Label,                 config_parse_address_label,                     0,                             0
 Route.Gateway,                          config_parse_gateway,                           0,                             0
 Route.Destination,                      config_parse_destination,                       0,                             0
 Route.Source,                           config_parse_destination,                       0,                             0
@@ -86,6 +89,9 @@ Route.Metric,                           config_parse_route_priority,
 Route.Scope,                            config_parse_route_scope,                       0,                             0
 Route.PreferredSource,                  config_parse_preferred_src,                     0,                             0
 Route.Table,                            config_parse_route_table,                       0,                             0
+Route.GatewayOnlink,                    config_parse_gateway_onlink,                    0,                             0
+Route.IPv6Preference,                   config_parse_ipv6_route_preference,             0,                             0
+Route.Protocol,                         config_parse_route_protocol,                    0,                             0
 DHCP.ClientIdentifier,                  config_parse_dhcp_client_identifier,            0,                             offsetof(Network, dhcp_client_identifier)
 DHCP.UseDNS,                            config_parse_bool,                              0,                             offsetof(Network, dhcp_use_dns)
 DHCP.UseNTP,                            config_parse_bool,                              0,                             offsetof(Network, dhcp_use_ntp)
@@ -119,12 +125,13 @@ DHCPServer.EmitTimezone,                config_parse_bool,
 DHCPServer.Timezone,                    config_parse_timezone,                          0,                             offsetof(Network, dhcp_server_timezone)
 DHCPServer.PoolOffset,                  config_parse_uint32,                            0,                             offsetof(Network, dhcp_server_pool_offset)
 DHCPServer.PoolSize,                    config_parse_uint32,                            0,                             offsetof(Network, dhcp_server_pool_size)
-Bridge.Cost,                            config_parse_unsigned,                          0,                             offsetof(Network, cost)
+Bridge.Cost,                            config_parse_uint32,                            0,                             offsetof(Network, cost)
 Bridge.UseBPDU,                         config_parse_bool,                              0,                             offsetof(Network, use_bpdu)
 Bridge.HairPin,                         config_parse_bool,                              0,                             offsetof(Network, hairpin)
 Bridge.FastLeave,                       config_parse_bool,                              0,                             offsetof(Network, fast_leave)
 Bridge.AllowPortToBeRoot,               config_parse_bool,                              0,                             offsetof(Network, allow_port_to_be_root)
 Bridge.UnicastFlood,                    config_parse_bool,                              0,                             offsetof(Network, unicast_flood)
+Bridge.Priority,                        config_parse_bridge_port_priority,              0,                             offsetof(Network, priority)
 BridgeFDB.MACAddress,                   config_parse_fdb_hwaddr,                        0,                             0
 BridgeFDB.VLANId,                       config_parse_fdb_vlan_id,                       0,                             0
 BridgeVLAN.PVID,                        config_parse_brvlan_pvid,                       0,                             0
index ab372568de819e1d711fbc97712a54e3966e0173..3c26c8609e81994c6e3b7cab1eafbc95a02b7e1b 100644 (file)
@@ -114,6 +114,7 @@ static int network_load_one(Manager *manager, const char *filename) {
         LIST_HEAD_INIT(network->static_routes);
         LIST_HEAD_INIT(network->static_fdb_entries);
         LIST_HEAD_INIT(network->ipv6_proxy_ndp_addresses);
+        LIST_HEAD_INIT(network->address_labels);
 
         network->stacked_netdevs = hashmap_new(&string_hash_ops);
         if (!network->stacked_netdevs)
@@ -131,6 +132,10 @@ static int network_load_one(Manager *manager, const char *filename) {
         if (!network->fdb_entries_by_section)
                 return log_oom();
 
+        network->address_labels_by_section = hashmap_new(&network_config_hash_ops);
+        if (!network->address_labels_by_section)
+                return log_oom();
+
         network->filename = strdup(filename);
         if (!network->filename)
                 return log_oom();
@@ -165,6 +170,7 @@ static int network_load_one(Manager *manager, const char *filename) {
         network->use_bpdu = true;
         network->allow_port_to_be_root = true;
         network->unicast_flood = true;
+        network->priority = LINK_BRIDGE_PORT_PRIORITY_INVALID;
 
         network->lldp_mode = LLDP_MODE_ROUTERS_ONLY;
 
@@ -178,6 +184,7 @@ static int network_load_one(Manager *manager, const char *filename) {
         network->ipv6_accept_ra = -1;
         network->ipv6_dad_transmits = -1;
         network->ipv6_hop_limit = -1;
+        network->ipv6_proxy_ndp = -1;
         network->duid.type = _DUID_TYPE_INVALID;
         network->proxy_arp = -1;
         network->arp = -1;
@@ -191,6 +198,7 @@ static int network_load_one(Manager *manager, const char *filename) {
                               "Link\0"
                               "Network\0"
                               "Address\0"
+                              "IPv6AddressLabel\0"
                               "Route\0"
                               "DHCP\0"
                               "DHCPv4\0" /* compat */
@@ -270,6 +278,7 @@ void network_free(Network *network) {
         Address *address;
         FdbEntry *fdb_entry;
         IPv6ProxyNDPAddress *ipv6_proxy_ndp_address;
+        AddressLabel *label;
         Iterator i;
 
         if (!network)
@@ -317,9 +326,13 @@ void network_free(Network *network) {
         while ((ipv6_proxy_ndp_address = network->ipv6_proxy_ndp_addresses))
                 ipv6_proxy_ndp_address_free(ipv6_proxy_ndp_address);
 
+        while ((label = network->address_labels))
+                address_label_free(label);
+
         hashmap_free(network->addresses_by_section);
         hashmap_free(network->routes_by_section);
         hashmap_free(network->fdb_entries_by_section);
+        hashmap_free(network->address_labels_by_section);
 
         if (network->manager) {
                 if (network->manager->networks)
@@ -428,7 +441,7 @@ int network_apply(Network *network, Link *link) {
         if (network->ipv4ll_route) {
                 Route *route;
 
-                r = route_new_static(network, "Network", 0, &route);
+                r = route_new_static(network, NULL, 0, &route);
                 if (r < 0)
                         return r;
 
index 4ce066a76463b16091eba7786b27cec7884bb5fa..c9326c7f1e522c861e9494e9277db02e7b80c138 100644 (file)
@@ -28,6 +28,7 @@
 #include "resolve-util.h"
 
 #include "networkd-address.h"
+#include "networkd-address-label.h"
 #include "networkd-brvlan.h"
 #include "networkd-fdb.h"
 #include "networkd-lldp-tx.h"
@@ -163,7 +164,8 @@ struct Network {
         bool fast_leave;
         bool allow_port_to_be_root;
         bool unicast_flood;
-        unsigned cost;
+        uint32_t cost;
+        uint16_t priority;
 
         bool use_br_vlan;
         uint16_t pvid;
@@ -176,6 +178,7 @@ struct Network {
         int ipv6_accept_ra;
         int ipv6_dad_transmits;
         int ipv6_hop_limit;
+        int ipv6_proxy_ndp;
         int proxy_arp;
 
         bool ipv6_accept_ra_use_dns;
@@ -201,15 +204,18 @@ struct Network {
         LIST_HEAD(Route, static_routes);
         LIST_HEAD(FdbEntry, static_fdb_entries);
         LIST_HEAD(IPv6ProxyNDPAddress, ipv6_proxy_ndp_addresses);
+        LIST_HEAD(AddressLabel, address_labels);
 
         unsigned n_static_addresses;
         unsigned n_static_routes;
         unsigned n_static_fdb_entries;
         unsigned n_ipv6_proxy_ndp_addresses;
+        unsigned n_address_labels;
 
         Hashmap *addresses_by_section;
         Hashmap *routes_by_section;
         Hashmap *fdb_entries_by_section;
+        Hashmap *address_labels_by_section;
 
         struct in_addr_data *dns;
         unsigned n_dns;
index 570083f1803b626a017ef900c2bdaf709eab21f5..c5ee08a77a23cb36de3fc21bc5f503b0711311f4 100644 (file)
@@ -17,6 +17,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/icmpv6.h>
+
 #include "alloc-util.h"
 #include "conf-parser.h"
 #include "in-addr-util.h"
@@ -939,3 +941,111 @@ int config_parse_route_table(const char *unit,
 
         return 0;
 }
+
+int config_parse_gateway_onlink(const char *unit,
+                                const char *filename,
+                                unsigned line,
+                                const char *section,
+                                unsigned section_line,
+                                const char *lvalue,
+                                int ltype,
+                                const char *rvalue,
+                                void *data,
+                                void *userdata) {
+        Network *network = userdata;
+        _cleanup_route_free_ Route *n = NULL;
+        int r;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = route_new_static(network, filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        r = parse_boolean(rvalue);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Could not parse gateway onlink \"%s\", ignoring assignment: %m", rvalue);
+                return 0;
+        }
+
+        SET_FLAG(n->flags, RTNH_F_ONLINK, r);
+        n = NULL;
+
+        return 0;
+}
+
+int config_parse_ipv6_route_preference(const char *unit,
+                                       const char *filename,
+                                       unsigned line,
+                                       const char *section,
+                                       unsigned section_line,
+                                       const char *lvalue,
+                                       int ltype,
+                                       const char *rvalue,
+                                       void *data,
+                                       void *userdata) {
+        Network *network = userdata;
+        _cleanup_route_free_ Route *n = NULL;
+        int r;
+
+        r = route_new_static(network, filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        if (streq(rvalue, "low"))
+                n->pref = ICMPV6_ROUTER_PREF_LOW;
+        else if (streq(rvalue, "medium"))
+                n->pref = ICMPV6_ROUTER_PREF_MEDIUM;
+        else if (streq(rvalue, "high"))
+                n->pref = ICMPV6_ROUTER_PREF_HIGH;
+        else {
+                log_syntax(unit, LOG_ERR, filename, line, 0, "Unknown route preference: %s", rvalue);
+                return 0;
+        }
+
+        n = NULL;
+
+        return 0;
+}
+
+int config_parse_route_protocol(const char *unit,
+                                const char *filename,
+                                unsigned line,
+                                const char *section,
+                                unsigned section_line,
+                                const char *lvalue,
+                                int ltype,
+                                const char *rvalue,
+                                void *data,
+                                void *userdata) {
+        Network *network = userdata;
+        _cleanup_route_free_ Route *n = NULL;
+        int r;
+
+        r = route_new_static(network, filename, section_line, &n);
+        if (r < 0)
+                return r;
+
+        if (streq(rvalue, "kernel"))
+                n->protocol = RTPROT_KERNEL;
+        else if (streq(rvalue, "boot"))
+                n->protocol = RTPROT_BOOT;
+        else if (streq(rvalue, "static"))
+                n->protocol = RTPROT_STATIC;
+        else {
+                r = safe_atou8(rvalue , &n->protocol);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r, "Could not parse route protocol \"%s\", ignoring assignment: %m", rvalue);
+                        return 0;
+                }
+        }
+
+        n = NULL;
+
+        return 0;
+}
index 4ebfa0f0bdcf77586031b40e53e8c3abeee7fe18..efd1e53d2af89f0c2c7c7ff6b41190e983a000a4 100644 (file)
@@ -75,3 +75,6 @@ int config_parse_destination(const char *unit, const char *filename, unsigned li
 int config_parse_route_priority(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_route_scope(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_route_table(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_gateway_onlink(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_ipv6_route_preference(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_route_protocol(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
diff --git a/src/nspawn/meson.build b/src/nspawn/meson.build
new file mode 100644 (file)
index 0000000..b6ac600
--- /dev/null
@@ -0,0 +1,40 @@
+systemd_nspawn_sources = files('''
+        nspawn.c
+        nspawn-settings.c
+        nspawn-settings.h
+        nspawn-mount.c
+        nspawn-mount.h
+        nspawn-network.c
+        nspawn-network.h
+        nspawn-expose-ports.c
+        nspawn-expose-ports.h
+        nspawn-cgroup.c
+        nspawn-cgroup.h
+        nspawn-seccomp.c
+        nspawn-seccomp.h
+        nspawn-register.c
+        nspawn-register.h
+        nspawn-setuid.c
+        nspawn-setuid.h
+        nspawn-stub-pid1.c
+        nspawn-stub-pid1.h
+        nspawn-patch-uid.c
+        nspawn-patch-uid.h
+'''.split())
+
+nspawn_gperf_c = custom_target(
+        'nspawn-gperf.c',
+        input : 'nspawn-gperf.gperf',
+        output : 'nspawn-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+systemd_nspawn_sources += [nspawn_gperf_c]
+
+tests += [
+        [['src/nspawn/test-patch-uid.c',
+          'src/nspawn/nspawn-patch-uid.c',
+          'src/nspawn/nspawn-patch-uid.h'],
+         [libshared],
+         [libacl],
+         '', 'manual'],
+]
index 1fc0501c2e70eb590cc8f67ee4d0596486b08813..a21fc1ba996fdba8842bc0a8e710e17eb6799296 100644 (file)
@@ -18,7 +18,7 @@
 ***/
 
 #ifdef HAVE_BLKID
-#include <blkid/blkid.h>
+#include <blkid.h>
 #endif
 #include <errno.h>
 #include <getopt.h>
@@ -389,12 +389,10 @@ static void parse_mount_settings_env(void) {
         if (r < 0) {
                 log_warning_errno(r, "Failed to parse SYSTEMD_NSPAWN_API_VFS_WRITABLE from environment, ignoring.");
                 return;
-        } else if (r > 0)
-                arg_mount_settings &= ~MOUNT_APPLY_APIVFS_RO;
-        else
-                arg_mount_settings |= MOUNT_APPLY_APIVFS_RO;
+        }
 
-        arg_mount_settings &= ~MOUNT_APPLY_APIVFS_NETNS;
+        SET_FLAG(arg_mount_settings, MOUNT_APPLY_APIVFS_RO, r == 0);
+        SET_FLAG(arg_mount_settings, MOUNT_APPLY_APIVFS_NETNS, false);
 }
 
 static int parse_argv(int argc, char *argv[]) {
@@ -1158,6 +1156,10 @@ static int parse_argv(int argc, char *argv[]) {
 
         arg_caps_retain = (arg_caps_retain | plus | (arg_private_network ? 1ULL << CAP_NET_ADMIN : 0)) & ~minus;
 
+        r = cg_unified_flush();
+        if (r < 0)
+                return log_error_errno(r, "Failed to determine whether the unified cgroups hierarchy is used: %m");
+
         e = getenv("SYSTEMD_NSPAWN_CONTAINER_SERVICE");
         if (e)
                 arg_container_service_name = e;
@@ -1321,17 +1323,32 @@ static int setup_timezone(const char *dest) {
         return 0;
 }
 
-static int resolved_running(void) {
+static int resolved_listening(void) {
         _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
+        _cleanup_free_ char *dns_stub_listener_mode = NULL;
         int r;
 
-        /* Check if resolved is running */
+        /* Check if resolved is listening */
 
         r = sd_bus_open_system(&bus);
         if (r < 0)
                 return r;
 
-        return bus_name_has_owner(bus, "org.freedesktop.resolve1", NULL);
+        r = bus_name_has_owner(bus, "org.freedesktop.resolve1", NULL);
+        if (r <= 0)
+                return r;
+
+        r = sd_bus_get_property_string(bus,
+                                       "org.freedesktop.resolve1",
+                                       "/org/freedesktop/resolve1",
+                                       "org.freedesktop.resolve1.Manager",
+                                       "DNSStubListener",
+                                       NULL,
+                                       &dns_stub_listener_mode);
+        if (r < 0)
+                return r;
+
+        return STR_IN_SET(dns_stub_listener_mode, "udp", "yes");
 }
 
 static int setup_resolv_conf(const char *dest) {
@@ -1358,7 +1375,7 @@ static int setup_resolv_conf(const char *dest) {
         }
 
         if (access("/usr/lib/systemd/resolv.conf", F_OK) >= 0 &&
-            resolved_running() > 0) {
+            resolved_listening() > 0) {
 
                 /* resolved is enabled on the host. In this, case bind mount its static resolv.conf file into the
                  * container, so that the container can use the host's resolver. Given that network namespacing is
@@ -3530,10 +3547,6 @@ int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
 
-        r = cg_unified_flush();
-        if (r < 0)
-                return log_error_errno(r, "Failed to determine whether the unified cgroups hierarchy is used: %m");
-
         /* Make sure rename_process() in the stub init process can work */
         saved_argv = argv;
         saved_argc = argc;
index b704ca3b4b6bfd0e5841a75d0d581aec82d8e9cd..db3bf5bd21e5ab18f503bbdc6c92024ce084c21b 100644 (file)
 #include "string-util.h"
 #include "util.h"
 
-#ifndef RC_LOCAL_SCRIPT_PATH_START
-#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
-#endif
-
-#ifndef RC_LOCAL_SCRIPT_PATH_STOP
-#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local"
-#endif
-
 static const char *arg_dest = "/tmp";
 
 static int add_symlink(const char *service, const char *where) {
diff --git a/src/resolve/dns_type-to-name.awk b/src/resolve/dns_type-to-name.awk
new file mode 100644 (file)
index 0000000..badb182
--- /dev/null
@@ -0,0 +1,11 @@
+BEGIN{
+        print "const char *dns_type_to_string(int type) {\n\tswitch(type) {"
+}
+{
+        printf "        case DNS_TYPE_%s: return ", $1;
+        sub(/_/, "-");
+        printf "\"%s\";\n", $1
+}
+END{
+        print "        default: return NULL;\n\t}\n}\n"
+}
diff --git a/src/resolve/generate-dns_type-gperf.py b/src/resolve/generate-dns_type-gperf.py
new file mode 100755 (executable)
index 0000000..8a0b43c
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+"""Generate %-from-name.gperf from %-list.txt
+"""
+
+import sys
+
+name, prefix, input = sys.argv[1:]
+
+print("""\
+struct {}_name {{ const char* name; int id; }};
+%null-strings
+%%""".format(name))
+
+for line in open(input):
+    line = line.rstrip()
+    s = line.replace('_', '-')
+    print("{}, {}{}".format(s, prefix, line))
diff --git a/src/resolve/generate-dns_type-list.sed b/src/resolve/generate-dns_type-list.sed
new file mode 100644 (file)
index 0000000..b7bc30f
--- /dev/null
@@ -0,0 +1 @@
+s/.* DNS_TYPE_(\w+).*/\1/p
diff --git a/src/resolve/meson.build b/src/resolve/meson.build
new file mode 100644 (file)
index 0000000..f3c411f
--- /dev/null
@@ -0,0 +1,178 @@
+basic_dns_sources = files('''
+        resolved-dns-dnssec.c
+        resolved-dns-dnssec.h
+        resolved-dns-packet.c
+        resolved-dns-packet.h
+        resolved-dns-rr.c
+        resolved-dns-rr.h
+        resolved-dns-answer.c
+        resolved-dns-answer.h
+        resolved-dns-question.c
+        resolved-dns-question.h
+        dns-type.c
+'''.split())
+
+dns_type_h = files('dns-type.h')[0]
+
+systemd_resolved_only_sources = files('''
+        resolved.c
+        resolved-manager.c
+        resolved-manager.h
+        resolved-conf.c
+        resolved-conf.h
+        resolved-resolv-conf.c
+        resolved-resolv-conf.h
+        resolved-bus.c
+        resolved-bus.h
+        resolved-link.h
+        resolved-link.c
+        resolved-link-bus.c
+        resolved-link-bus.h
+        resolved-llmnr.h
+        resolved-llmnr.c
+        resolved-mdns.h
+        resolved-mdns.c
+        resolved-def.h
+        resolved-dns-query.h
+        resolved-dns-query.c
+        resolved-dns-synthesize.h
+        resolved-dns-synthesize.c
+        resolved-dns-transaction.h
+        resolved-dns-transaction.c
+        resolved-dns-scope.h
+        resolved-dns-scope.c
+        resolved-dns-server.h
+        resolved-dns-server.c
+        resolved-dns-search-domain.h
+        resolved-dns-search-domain.c
+        resolved-dns-cache.h
+        resolved-dns-cache.c
+        resolved-dns-zone.h
+        resolved-dns-zone.c
+        resolved-dns-stream.h
+        resolved-dns-stream.c
+        resolved-dns-trust-anchor.h
+        resolved-dns-trust-anchor.c
+        resolved-dns-stub.h
+        resolved-dns-stub.c
+        resolved-etc-hosts.h
+        resolved-etc-hosts.c
+'''.split())
+
+systemd_resolve_only_sources = files('resolve-tool.c')
+
+############################################################
+
+dns_type_list_txt = custom_target(
+        'dns_type-list.txt',
+        input : ['generate-dns_type-list.sed', dns_type_h],
+        output : 'dns_type-list.txt',
+        command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'],
+        capture : true)
+
+generate_dns_type_gperf = find_program('generate-dns_type-gperf.py')
+
+dns_type_headers = [dns_type_h]
+foreach item : [['dns_type', dns_type_list_txt, 'dns_type', 'DNS_TYPE_']]
+
+        fname = '@0@-from-name.gperf'.format(item[0])
+        gperf_file = custom_target(
+                fname,
+                input : item[1],
+                output : fname,
+                command : [generate_dns_type_gperf, item[2], item[3], '@INPUT@'],
+                capture : true)
+
+        fname = '@0@-from-name.h'.format(item[0])
+        target1 = custom_target(
+                fname,
+                input : gperf_file,
+                output : fname,
+                command : [gperf,
+                           '-L', 'ANSI-C', '-t', '--ignore-case',
+                           '-N', 'lookup_@0@'.format(item[2]),
+                           '-H', 'hash_@0@_name'.format(item[2]),
+                           '-p', '-C',
+                           '@INPUT@'],
+                capture : true)
+
+        fname = '@0@-to-name.h'.format(item[0])
+        awkscript = '@0@-to-name.awk'.format(item[0])
+        target2 = custom_target(
+                fname,
+                input : [awkscript, item[1]],
+                output : fname,
+                command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
+                capture : true)
+
+        dns_type_headers += [target1, target2]
+endforeach
+
+resolved_gperf_c = custom_target(
+        'resolved_gperf.c',
+        input : 'resolved-gperf.gperf',
+        output : 'resolved-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+systemd_resolved_sources = (basic_dns_sources +
+                            [resolved_gperf_c] +
+                            systemd_resolved_only_sources +
+                            dns_type_headers)
+
+systemd_resolve_sources = (basic_dns_sources +
+                           systemd_resolve_only_sources +
+                           dns_type_headers)
+
+if conf.get('ENABLE_RESOLVED', false)
+        install_data('org.freedesktop.resolve1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.resolve1.service',
+                     install_dir : dbussystemservicedir)
+
+        resolved_conf = configure_file(
+                input : 'resolved.conf.in',
+                output : 'resolved.conf',
+                configuration : substs)
+        install_data(resolved_conf,
+                     install_dir : pkgsysconfdir)
+
+        install_data('resolv.conf',
+                     install_dir : rootlibexecdir)
+endif
+
+tests += [
+        [['src/resolve/test-resolve-tables.c',
+          basic_dns_sources,
+          dns_type_headers,
+          'src/shared/test-tables.h'],
+         [],
+         [libgcrypt,
+          libgpg_error,
+          libm],
+         'ENABLE_RESOLVED'],
+
+        [['src/resolve/test-dns-packet.c',
+          basic_dns_sources,
+          dns_type_headers],
+         [],
+         [libgcrypt,
+          libgpg_error,
+          libm],
+         'ENABLE_RESOLVED'],
+
+        [['src/resolve/test-dnssec.c',
+          basic_dns_sources,
+          dns_type_headers],
+         [],
+         [libgcrypt,
+          libgpg_error,
+          libm],
+         'ENABLE_RESOLVED'],
+
+        [['src/resolve/test-dnssec-complex.c',
+          'src/resolve/dns-type.c',
+          dns_type_headers],
+         [],
+         [],
+         'ENABLE_RESOLVED', 'manual'],
+]
index 32537ce6e8acb6db5f24fb7de931ee5bb44148df..c62058917fca9231de45c32fb807a8175c6f0f9c 100644 (file)
@@ -114,8 +114,8 @@ static void print_source(uint64_t flags, usec_t rtt) {
                        flags & SD_RESOLVED_DNS ? " DNS" :"",
                        flags & SD_RESOLVED_LLMNR_IPV4 ? " LLMNR/IPv4" : "",
                        flags & SD_RESOLVED_LLMNR_IPV6 ? " LLMNR/IPv6" : "",
-                       flags & SD_RESOLVED_MDNS_IPV4 ? "mDNS/IPv4" : "",
-                       flags & SD_RESOLVED_MDNS_IPV6 ? "mDNS/IPv6" : "");
+                       flags & SD_RESOLVED_MDNS_IPV4 ? " mDNS/IPv4" : "",
+                       flags & SD_RESOLVED_MDNS_IPV6 ? " mDNS/IPv6" : "");
 
         assert_se(format_timespan(rtt_str, sizeof(rtt_str), rtt, 100));
 
index 2c501093882635e605af5e2857fcc3bcc34dcabc..efa16ad93d68559eb746d93f0d71538c5bd334b8 100644 (file)
@@ -1450,6 +1450,8 @@ static int bus_property_get_ntas(
         return sd_bus_message_close_container(reply);
 }
 
+static BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_dns_stub_listener_mode, dns_stub_listener_mode, DnsStubListenerMode);
+
 static int bus_method_reset_statistics(sd_bus_message *message, void *userdata, sd_bus_error *error) {
         Manager *m = userdata;
         DnsScope *s;
@@ -1577,6 +1579,7 @@ static const sd_bus_vtable resolve_vtable[] = {
         SD_BUS_PROPERTY("DNSSECStatistics", "(tttt)", bus_property_get_dnssec_statistics, 0, 0),
         SD_BUS_PROPERTY("DNSSECSupported", "b", bus_property_get_dnssec_supported, 0, 0),
         SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", bus_property_get_ntas, 0, 0),
+        SD_BUS_PROPERTY("DNSStubListener", "s", bus_property_get_dns_stub_listener_mode, offsetof(Manager, dns_stub_listener_mode), 0),
 
         SD_BUS_METHOD("ResolveHostname", "isit", "a(iiay)st", bus_method_resolve_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
         SD_BUS_METHOD("ResolveAddress", "iiayt", "a(is)t", bus_method_resolve_address, SD_BUS_VTABLE_UNPRIVILEGED),
index abf3263178b8e7868b6f97ff78057d9ee4c6970b..97334a0af7a9facfd2309fc6117e4ab590c1b8a5 100644 (file)
@@ -233,10 +233,10 @@ int manager_parse_config_file(Manager *m) {
         assert(m);
 
         r = config_parse_many_nulstr(PKGSYSCONFDIR "/resolved.conf",
-                              CONF_PATHS_NULSTR("systemd/resolved.conf.d"),
-                              "Resolve\0",
-                              config_item_perf_lookup, resolved_gperf_lookup,
-                              false, m);
+                                     CONF_PATHS_NULSTR("systemd/resolved.conf.d"),
+                                     "Resolve\0",
+                                     config_item_perf_lookup, resolved_gperf_lookup,
+                                     false, m);
         if (r < 0)
                 return r;
 
index 5498f7b9cbdcd0f985f626a9652a64b16383b857..63cb6a5bda6a6e39826366a700bd22d062622009 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sd-messages.h>
+#include "sd-messages.h"
 
 #include "alloc-util.h"
 #include "resolved-dns-server.h"
index ff2ad9c1de4fc54b9cd92ad28be839d0d70fb9c1..3075f62b5e26fe09009cb23bbfefaaa2a09bd25e 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sd-messages.h>
+#include "sd-messages.h"
 
 #include "af-list.h"
 #include "alloc-util.h"
index 7e9f9e5a2075d5dd22edb1533771e29b2f3bc8ee..dda98750632c496733d1349170f30027f3f9828e 100644 (file)
@@ -17,7 +17,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sd-messages.h>
+#include "sd-messages.h"
 
 #include "alloc-util.h"
 #include "conf-files.h"
index 446f85cdf41afb2aa650e6ac3811e6e685626450..5153563b9993bff3ebf09732d776456370f46f7f 100644 (file)
@@ -18,6 +18,7 @@ Resolve.DNS,             config_parse_dns_servers,            DNS_SERVER_SYSTEM,
 Resolve.FallbackDNS,     config_parse_dns_servers,            DNS_SERVER_FALLBACK, 0
 Resolve.Domains,         config_parse_search_domains,         0,                   0
 Resolve.LLMNR,           config_parse_resolve_support,        0,                   offsetof(Manager, llmnr_support)
+Resolve.MulticastDNS,    config_parse_resolve_support,        0,                   offsetof(Manager, mdns_support)
 Resolve.DNSSEC,          config_parse_dnssec_mode,            0,                   offsetof(Manager, dnssec_mode)
 Resolve.Cache,           config_parse_bool,                   0,                   offsetof(Manager, enable_cache)
 Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0,                   offsetof(Manager, dns_stub_listener_mode)
index 3f7f9035cfdcd55af8613cb37bd6b587e628bad2..d06096f3f238027d334f4a2e692f89ab43408dac 100644 (file)
@@ -28,6 +28,8 @@
 #include "mkdir.h"
 #include "parse-util.h"
 #include "resolved-link.h"
+#include "resolved-llmnr.h"
+#include "resolved-mdns.h"
 #include "string-util.h"
 #include "strv.h"
 
@@ -523,10 +525,25 @@ static void link_read_settings(Link *l) {
 }
 
 int link_update(Link *l) {
+        int r;
+
         assert(l);
 
         link_read_settings(l);
         link_load_user(l);
+
+        if (l->llmnr_support != RESOLVE_SUPPORT_NO) {
+                r = manager_llmnr_start(l->manager);
+                if (r < 0)
+                        return r;
+        }
+
+        if (l->mdns_support != RESOLVE_SUPPORT_NO) {
+                r = manager_mdns_start(l->manager);
+                if (r < 0)
+                        return r;
+        }
+
         link_allocate_scopes(l);
         link_add_rrs(l, false);
 
index 3516af58ee6d1e3d02cd51e854d25d9dfb0b32f6..29396e997356149728a3c30552a24f5ed7f8fa9b 100644 (file)
@@ -77,7 +77,7 @@ int manager_llmnr_start(Manager *m) {
         return 0;
 
 eaddrinuse:
-        log_warning("There appears to be another LLMNR responder running. Turning off LLMNR support.");
+        log_warning("Another LLMNR responder prohibits binding the socket to the same port. Turning off LLMNR support.");
         m->llmnr_support = RESOLVE_SUPPORT_NO;
         manager_llmnr_stop(m);
 
@@ -136,56 +136,75 @@ int manager_llmnr_ipv4_udp_fd(Manager *m) {
 
         m->llmnr_ipv4_udp_fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->llmnr_ipv4_udp_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to create socket: %m");
 
         /* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_TTL: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MULTICAST_TTL: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MULTICAST_LOOP: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_PKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_RECVTTL: %m");
                 goto fail;
         }
 
         /* Disable Don't-Fragment bit in the IP header */
         r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MTU_DISCOVER: %m");
                 goto fail;
         }
 
+        /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
         r = bind(m->llmnr_ipv4_udp_fd, &sa.sa, sizeof(sa.in));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("LLMNR-IPv4(UDP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->llmnr_ipv4_udp_fd, &sa.sa, sizeof(sa.in));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+                r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = sd_event_add_io(m->event, &m->llmnr_ipv4_udp_event_source, m->llmnr_ipv4_udp_fd, EPOLLIN, on_llmnr_packet, m);
@@ -216,55 +235,74 @@ int manager_llmnr_ipv6_udp_fd(Manager *m) {
 
         m->llmnr_ipv6_udp_fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->llmnr_ipv6_udp_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to create socket: %m");
 
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_UNICAST_HOPS: %m");
                 goto fail;
         }
 
         /* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_MULTICAST_HOPS: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_MULTICAST_LOOP: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_V6ONLY: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_RECVPKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_RECVHOPLIMIT: %m");
                 goto fail;
         }
 
+        /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
         r = bind(m->llmnr_ipv6_udp_fd, &sa.sa, sizeof(sa.in6));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("LLMNR-IPv6(UDP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->llmnr_ipv6_udp_fd, &sa.sa, sizeof(sa.in6));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+                r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = sd_event_add_io(m->event, &m->llmnr_ipv6_udp_event_source, m->llmnr_ipv6_udp_fd, EPOLLIN, on_llmnr_packet, m);
@@ -338,49 +376,68 @@ int manager_llmnr_ipv4_tcp_fd(Manager *m) {
 
         m->llmnr_ipv4_tcp_fd = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->llmnr_ipv4_tcp_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to create socket: %m");
 
         /* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
         r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_TTL, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_TTL: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_PKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_RECVTTL: %m");
                 goto fail;
         }
 
         /* Disable Don't-Fragment bit in the IP header */
         r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_MTU_DISCOVER: %m");
                 goto fail;
         }
 
+        /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
         r = bind(m->llmnr_ipv4_tcp_fd, &sa.sa, sizeof(sa.in));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("LLMNR-IPv4(TCP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->llmnr_ipv4_tcp_fd, &sa.sa, sizeof(sa.in));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+                r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = listen(m->llmnr_ipv4_tcp_fd, SOMAXCONN);
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to listen the stream: %m");
                 goto fail;
         }
 
@@ -412,48 +469,67 @@ int manager_llmnr_ipv6_tcp_fd(Manager *m) {
 
         m->llmnr_ipv6_tcp_fd = socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->llmnr_ipv6_tcp_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to create socket: %m");
 
         /* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
         r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_UNICAST_HOPS: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_V6ONLY: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_RECVPKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_RECVHOPLIMIT: %m");
                 goto fail;
         }
 
+        /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
         r = bind(m->llmnr_ipv6_tcp_fd, &sa.sa, sizeof(sa.in6));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("LLMNR-IPv6(TCP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->llmnr_ipv6_tcp_fd, &sa.sa, sizeof(sa.in6));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+                r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = listen(m->llmnr_ipv6_tcp_fd, SOMAXCONN);
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to listen the stream: %m");
                 goto fail;
         }
 
index c4e4409fe38e5e43a76369ad626fc9ef36e7d7f1..9db8b8f61613bd5f2ac366ed30d6dbf0763c913f 100644 (file)
@@ -612,14 +612,6 @@ int manager_start(Manager *m) {
         if (r < 0)
                 return r;
 
-        r = manager_llmnr_start(m);
-        if (r < 0)
-                return r;
-
-        r = manager_mdns_start(m);
-        if (r < 0)
-                return r;
-
         return 0;
 }
 
index c40e8f75f0e30bcc2c9327509e8aec9bf8b5c22d..415dc1a5328f900fd66d01665da8488fc45fabe6 100644 (file)
@@ -60,7 +60,7 @@ int manager_mdns_start(Manager *m) {
         return 0;
 
 eaddrinuse:
-        log_warning("There appears to be another mDNS responder running. Turning off mDNS support.");
+        log_warning("Another mDNS responder prohibits binding the socket to the same port. Turning off mDNS support.");
         m->mdns_support = RESOLVE_SUPPORT_NO;
         manager_mdns_stop(m);
 
@@ -217,55 +217,75 @@ int manager_mdns_ipv4_fd(Manager *m) {
 
         m->mdns_ipv4_fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->mdns_ipv4_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "mDNS-IPv4: Failed to create socket: %m");
 
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_TTL: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MULTICAST_TTL: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MULTICAST_LOOP: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_PKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_RECVTTL: %m");
                 goto fail;
         }
 
         /* Disable Don't-Fragment bit in the IP header */
         r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MTU_DISCOVER: %m");
                 goto fail;
         }
 
+        /* See the section 15.1 of RFC6762 */
+        /* first try to bind without SO_REUSEADDR to detect another mDNS responder */
         r = bind(m->mdns_ipv4_fd, &sa.sa, sizeof(sa.in));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "mDNS-IPv4: Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("mDNS-IPv4: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv4: Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->mdns_ipv4_fd, &sa.sa, sizeof(sa.in));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv4: Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple mDNS responders */
+                r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv4: Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = sd_event_add_io(m->event, &m->mdns_ipv4_event_source, m->mdns_ipv4_fd, EPOLLIN, on_mdns_packet, m);
@@ -294,55 +314,75 @@ int manager_mdns_ipv6_fd(Manager *m) {
 
         m->mdns_ipv6_fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
         if (m->mdns_ipv6_fd < 0)
-                return -errno;
+                return log_error_errno(errno, "mDNS-IPv6: Failed to create socket: %m");
 
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_UNICAST_HOPS: %m");
                 goto fail;
         }
 
         /* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof(ttl));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_MULTICAST_HOPS: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_MULTICAST_LOOP: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
-                goto fail;
-        }
-
-        r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-        if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_V6ONLY: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_RECVPKTINFO: %m");
                 goto fail;
         }
 
         r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
         if (r < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_RECVHOPLIMIT: %m");
                 goto fail;
         }
 
+        /* See the section 15.1 of RFC6762 */
+        /* first try to bind without SO_REUSEADDR to detect another mDNS responder */
         r = bind(m->mdns_ipv6_fd, &sa.sa, sizeof(sa.in6));
         if (r < 0) {
-                r = -errno;
-                goto fail;
+                if (errno != EADDRINUSE) {
+                        r = log_error_errno(errno, "mDNS-IPv6: Failed to bind socket: %m");
+                        goto fail;
+                }
+
+                log_warning("mDNS-IPv6: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+                /* try again with SO_REUSEADDR */
+                r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv6: Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
+
+                r = bind(m->mdns_ipv6_fd, &sa.sa, sizeof(sa.in6));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv6: Failed to bind socket: %m");
+                        goto fail;
+                }
+        } else {
+                /* enable SO_REUSEADDR for the case that the user really wants multiple mDNS responders */
+                r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+                if (r < 0) {
+                        r = log_error_errno(errno, "mDNS-IPv6: Failed to set SO_REUSEADDR: %m");
+                        goto fail;
+                }
         }
 
         r = sd_event_add_io(m->event, &m->mdns_ipv6_event_source, m->mdns_ipv6_fd, EPOLLIN, on_mdns_packet, m);
index 60afa151e3121c180d3c944364da783f29c6001b..e6b20620e2c631125aab95bbffd45d71000f407b 100644 (file)
@@ -16,6 +16,7 @@
 #FallbackDNS=@DNS_SERVERS@
 #Domains=
 #LLMNR=yes
+#MulticastDNS=yes
 #DNSSEC=@DEFAULT_DNSSEC_MODE@
 #Cache=yes
 #DNSStubListener=udp
index 5cbb2ec3dd1f806f19aac35981d8da9af91ba065..903a1878611a3064bd7f5f7b2d276031f6d56fe6 100644 (file)
@@ -120,6 +120,8 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
 
                         if (!table[i].ignore_failure)
                                 return -errno;
+
+                        continue;
                 }
 
                 if (uid != UID_INVALID || gid != UID_INVALID) {
index 8765cf2f49d4997e06b4ab044c1c355eefbe7580..436130edea665e4f1159b782ecc7558387fd1e59 100644 (file)
@@ -24,8 +24,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <systemd/sd-bus.h>
-
 #include "alloc-util.h"
 #include "bus-error.h"
 #include "bus-util.h"
index 736f0f34c88ff528a730c7566a07110e2b6b7b42..1764f76744578f25c75572208d4feace1a08eca6 100644 (file)
@@ -22,7 +22,7 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
 
 #include "logs-show.h"
 #include "output-mode.h"
index 265ac83dc0b88170f86762ff931ff88eb547390b..dae521ef9fed50df3b753e1a20d83128e91cdc8e 100644 (file)
@@ -506,6 +506,7 @@ int config_parse_many(
 
 DEFINE_PARSER(int, int, safe_atoi);
 DEFINE_PARSER(long, long, safe_atoli);
+DEFINE_PARSER(uint8, uint8_t, safe_atou8);
 DEFINE_PARSER(uint16, uint16_t, safe_atou16);
 DEFINE_PARSER(uint32, uint32_t, safe_atou32);
 DEFINE_PARSER(uint64, uint64_t, safe_atou64);
@@ -959,3 +960,40 @@ int config_parse_ifname(
 
         return 0;
 }
+
+int config_parse_ip_port(
+                const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        uint16_t *s = data;
+        uint16_t port;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        if (isempty(rvalue)) {
+                *s = 0;
+                return 0;
+        }
+
+        r = parse_ip_port(rvalue, &port);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse port '%s'.", rvalue);
+                return 0;
+        }
+
+        *s = port;
+
+        return 0;
+}
index 26ff3df16f26cc0f43495809d9e9d1bc69f8fd1c..ce1113485d5915797bacdcad8f25e1e5da4d2cd2 100644 (file)
@@ -119,6 +119,7 @@ int config_parse_many(
 int config_parse_int(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unsigned(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_long(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_uint8(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_uint16(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_uint32(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_uint64(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
@@ -139,6 +140,7 @@ int config_parse_log_level(const char *unit, const char *filename, unsigned line
 int config_parse_signal(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_personality(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_ifname(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_ip_port(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 
 #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg)                \
         int function(const char *unit,                                  \
index 1c9d21566fdbe3455e4600e201bcad026840e5bf..163995c1e5f5a760c20d92e2a0d023fa9335c01d 100644 (file)
@@ -42,7 +42,7 @@
 #include "udev-util.h"
 #include "xattr-util.h"
 
-static int probe_filesystem(const char *node, char **ret_fstype) {
+_unused_ static int probe_filesystem(const char *node, char **ret_fstype) {
 #ifdef HAVE_BLKID
         _cleanup_blkid_free_probe_ blkid_probe b = NULL;
         const char *fstype;
@@ -951,7 +951,7 @@ int dissected_image_decrypt(
          *
          *      = 0           → There was nothing to decrypt
          *      > 0           → Decrypted successfully
-         *      -ENOKEY       → There's some to decrypt but no key was supplied
+         *      -ENOKEY       → There's something to decrypt but no key was supplied
          *      -EKEYREJECTED → Passed key was not correct
          */
 
index 8631a5a5d9fa4a0eff51a6ac81d25a6b84b93f8f..8229e6b1834402b4cbfe6026eb30cda4640935c1 100644 (file)
@@ -269,6 +269,7 @@ int efi_set_variable(
         _cleanup_close_ int fd = -1;
 
         assert(name);
+        assert(value);
 
         if (asprintf(&p,
                      "/sys/firmware/efi/efivars/%s-%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
index 9a069b2f97e1c00ba16964423b831331ea5cbb7d..19ec133772d91247c7f42e11c0922d728588210e 100644 (file)
@@ -188,10 +188,49 @@ int generator_write_timeouts(
 
         return write_drop_in_format(dir, unit, 50, "device-timeout",
                                     "# Automatically generated by %s\n\n"
-                                    "[Unit]\nJobTimeoutSec=%s",
+                                    "[Unit]\nJobRunningTimeoutSec=%s",
                                     program_invocation_short_name, timeout);
 }
 
+int generator_write_device_deps(
+                const char *dir,
+                const char *what,
+                const char *where,
+                const char *opts) {
+
+        /* fstab records that specify _netdev option should apply the network
+         * ordering on the actual device depending on network connection. If we
+         * are not mounting real device (NFS, CIFS), we rely on _netdev effect
+         * on the mount unit itself. */
+
+        _cleanup_free_ char *node = NULL, *unit = NULL;
+        int r;
+
+        if (!fstab_test_option(opts, "_netdev\0"))
+                return 0;
+
+        node = fstab_node_to_udev_node(what);
+        if (!node)
+                return log_oom();
+
+        /* Nothing to apply dependencies to. */
+        if (!is_device_path(node))
+                return 0;
+
+        r = unit_name_from_path(node, ".device", &unit);
+        if (r < 0)
+                return log_error_errno(r, "Failed to make unit name from path: %m");
+
+        /* See mount_add_default_dependencies for explanation why we create such
+         * dependencies. */
+        return write_drop_in_format(dir, unit, 50, "netdev-dependencies",
+                                    "# Automatically generated by %s\n\n"
+                                    "[Unit]\n"
+                                    "After=" SPECIAL_NETWORK_ONLINE_TARGET " " SPECIAL_NETWORK_TARGET "\n"
+                                    "Wants=" SPECIAL_NETWORK_ONLINE_TARGET "\n",
+                                    program_invocation_short_name);
+}
+
 int generator_write_initrd_root_device_deps(const char *dir, const char *what) {
         _cleanup_free_ char *unit = NULL;
         int r;
index a6017c1b76a1970d78903a79d4ce5190eb9d8786..825d934c8e9977651b977b464407cfb312fa96d2 100644 (file)
@@ -35,6 +35,12 @@ int generator_write_timeouts(
         const char *opts,
         char **filtered);
 
+int generator_write_device_deps(
+                const char *dir,
+                const char *what,
+                const char *where,
+                const char *opts);
+
 int generator_write_initrd_root_device_deps(
         const char *dir,
         const char *what);
index 72c43e80cb197f45e8bcde8e2b23de74f8481210..a8c15d93b6611780ade1195832d72d406d571bb2 100644 (file)
@@ -264,6 +264,8 @@ static int output_timestamp_realtime(FILE *f, sd_journal *j, OutputMode mode, Ou
                 }
 
         } else {
+                char usec[7];
+
                 gettime_r = (flags & OUTPUT_UTC) ? gmtime_r : localtime_r;
                 t = (time_t) (x / USEC_PER_SEC);
 
@@ -275,9 +277,19 @@ static int output_timestamp_realtime(FILE *f, sd_journal *j, OutputMode mode, Ou
 
                 case OUTPUT_SHORT_ISO:
                         if (strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%z", gettime_r(&t, &tm)) <= 0) {
-                                log_error("Failed for format ISO time");
+                                log_error("Failed to format ISO time");
+                                return -EINVAL;
+                        }
+                        break;
+
+                case OUTPUT_SHORT_ISO_PRECISE:
+                        /* No usec in strftime, so we leave space and copy over */
+                        if (strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S.xxxxxx%z", gettime_r(&t, &tm)) <= 0) {
+                                log_error("Failed to format ISO-precise time");
                                 return -EINVAL;
                         }
+                        xsprintf(usec, "%06"PRI_USEC, x % USEC_PER_SEC);
+                        memcpy(buf + 20, usec, 6);
                         break;
 
                 case OUTPUT_SHORT:
@@ -949,6 +961,7 @@ static int (*output_funcs[_OUTPUT_MODE_MAX])(
 
         [OUTPUT_SHORT] = output_short,
         [OUTPUT_SHORT_ISO] = output_short,
+        [OUTPUT_SHORT_ISO_PRECISE] = output_short,
         [OUTPUT_SHORT_PRECISE] = output_short,
         [OUTPUT_SHORT_MONOTONIC] = output_short,
         [OUTPUT_SHORT_UNIX] = output_short,
diff --git a/src/shared/meson.build b/src/shared/meson.build
new file mode 100644 (file)
index 0000000..b684e5b
--- /dev/null
@@ -0,0 +1,165 @@
+shared_sources = '''
+        acl-util.h
+        acpi-fpdt.c
+        acpi-fpdt.h
+        apparmor-util.c
+        apparmor-util.h
+        ask-password-api.c
+        ask-password-api.h
+        base-filesystem.c
+        base-filesystem.h
+        boot-timestamps.c
+        boot-timestamps.h
+        bus-unit-util.c
+        bus-unit-util.h
+        bus-util.c
+        bus-util.h
+        cgroup-show.c
+        cgroup-show.h
+        clean-ipc.c
+        clean-ipc.h
+        condition.c
+        condition.h
+        conf-parser.c
+        conf-parser.h
+        dev-setup.c
+        dev-setup.h
+        dissect-image.c
+        dissect-image.h
+        dns-domain.c
+        dns-domain.h
+        dropin.c
+        dropin.h
+        efivars.c
+        efivars.h
+        fdset.c
+        fdset.h
+        firewall-util.h
+        fstab-util.c
+        fstab-util.h
+        gcrypt-util.c
+        gcrypt-util.h
+        generator.c
+        generator.h
+        gpt.h
+        ima-util.c
+        ima-util.h
+        import-util.c
+        import-util.h
+        initreq.h
+        install.c
+        install.h
+        install-printf.c
+        install-printf.h
+        journal-util.c
+        journal-util.h
+        logs-show.c
+        logs-show.h
+        loop-util.c
+        loop-util.h
+        machine-image.c
+        machine-image.h
+        machine-pool.c
+        machine-pool.h
+        nsflags.c
+        nsflags.h
+        output-mode.c
+        output-mode.h
+        pager.c
+        pager.h
+        path-lookup.c
+        path-lookup.h
+        ptyfwd.c
+        ptyfwd.h
+        resolve-util.c
+        resolve-util.h
+        seccomp-util.h
+        sleep-config.c
+        sleep-config.h
+        spawn-ask-password-agent.c
+        spawn-ask-password-agent.h
+        spawn-polkit-agent.c
+        spawn-polkit-agent.h
+        specifier.c
+        specifier.h
+        switch-root.c
+        switch-root.h
+        sysctl-util.c
+        sysctl-util.h
+        tests.c
+        tests.h
+        udev-util.h
+        uid-range.c
+        uid-range.h
+        utmp-wtmp.h
+        vlan-util.c
+        vlan-util.h
+        volatile-util.c
+        volatile-util.h
+        watchdog.c
+        watchdog.h
+'''.split()
+
+test_tables_h = files('test-tables.h')
+shared_sources += [test_tables_h]
+
+if conf.get('HAVE_ACL', false)
+        shared_sources += ['acl-util.c']
+endif
+
+if conf.get('HAVE_UTMP', false)
+        shared_sources += ['utmp-wtmp.c']
+endif
+
+if conf.get('HAVE_SECCOMP', false)
+        shared_sources += ['seccomp-util.c']
+endif
+
+if conf.get('HAVE_LIBIPTC', false)
+        shared_sources += ['firewall-util.c']
+endif
+
+libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
+
+libshared = shared_library(
+        libshared_name,
+        shared_sources,
+        basic_sources,
+        journal_internal_sources,
+        libsystemd_internal_sources,
+        libudev_sources,
+        include_directories : includes,
+        link_args : ['-shared'],
+        c_args : ['-fvisibility=default'],
+        dependencies : [threads,
+                        librt,
+                        libcap,
+                        libacl,
+                        libcryptsetup,
+                        libgcrypt,
+                        libiptc,
+                        libseccomp,
+                        libselinux,
+                        libidn,
+                        libxz,
+                        liblz4,
+                        libblkid],
+        install : true,
+        install_dir : rootlibexecdir)
+
+libshared_static = static_library(
+        libshared_name,
+        shared_sources,
+        basic_sources,
+        include_directories : includes,
+        dependencies : [threads,
+                        librt,
+                        libcap,
+                        libacl,
+                        libcryptsetup,
+                        libseccomp,
+                        libselinux,
+                        libidn,
+                        libxz,
+                        liblz4,
+                        libblkid])
index 67d8208ad2d88bc762d4f0c754e61b70cfa15bcc..29dcba9f6b82cd6a6d52d539ccaaf059826ec53c 100644 (file)
@@ -24,6 +24,7 @@ static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
         [OUTPUT_SHORT] = "short",
         [OUTPUT_SHORT_FULL] = "short-full",
         [OUTPUT_SHORT_ISO] = "short-iso",
+        [OUTPUT_SHORT_ISO_PRECISE] = "short-iso-precise",
         [OUTPUT_SHORT_PRECISE] = "short-precise",
         [OUTPUT_SHORT_MONOTONIC] = "short-monotonic",
         [OUTPUT_SHORT_UNIX] = "short-unix",
index ff29dafcb57970eecb5ecd95db25348170d54312..2a1bfd98d087c60b62be33ec4015a291b59fde4a 100644 (file)
@@ -25,6 +25,7 @@ typedef enum OutputMode {
         OUTPUT_SHORT,
         OUTPUT_SHORT_FULL,
         OUTPUT_SHORT_ISO,
+        OUTPUT_SHORT_ISO_PRECISE,
         OUTPUT_SHORT_PRECISE,
         OUTPUT_SHORT_MONOTONIC,
         OUTPUT_SHORT_UNIX,
index f00ba9e1e79f133c4446052bdad1f127ed4f9a1e..4d7b02c63c4ae08b9001472a3bcbd54c838d7bab 100644 (file)
@@ -53,6 +53,11 @@ noreturn static void pager_fallback(void) {
         _exit(EXIT_SUCCESS);
 }
 
+static int stored_stdout = -1;
+static int stored_stderr = -1;
+static bool stdout_redirected = false;
+static bool stderr_redirected = false;
+
 int pager_open(bool no_pager, bool jump_to_end) {
         _cleanup_close_pair_ int fd[2] = { -1, -1 };
         const char *pager;
@@ -147,10 +152,19 @@ int pager_open(bool no_pager, bool jump_to_end) {
         }
 
         /* Return in the parent */
-        if (dup2(fd[1], STDOUT_FILENO) < 0)
+        stored_stdout = fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 3);
+        if (dup2(fd[1], STDOUT_FILENO) < 0) {
+                stored_stdout = safe_close(stored_stdout);
                 return log_error_errno(errno, "Failed to duplicate pager pipe: %m");
-        if (dup2(fd[1], STDERR_FILENO) < 0)
+        }
+        stdout_redirected = true;
+
+        stored_stderr = fcntl(STDERR_FILENO, F_DUPFD_CLOEXEC, 3);
+        if (dup2(fd[1], STDERR_FILENO) < 0) {
+                stored_stderr = safe_close(stored_stderr);
                 return log_error_errno(errno, "Failed to duplicate pager pipe: %m");
+        }
+        stderr_redirected = true;
 
         return 1;
 }
@@ -161,8 +175,17 @@ void pager_close(void) {
                 return;
 
         /* Inform pager that we are done */
-        stdout = safe_fclose(stdout);
-        stderr = safe_fclose(stderr);
+        (void) fflush(stdout);
+        if (stdout_redirected)
+                if (stored_stdout < 0 || dup2(stored_stdout, STDOUT_FILENO) < 0)
+                        (void) close(STDOUT_FILENO);
+        stored_stdout = safe_close(stored_stdout);
+        (void) fflush(stderr);
+        if (stderr_redirected)
+                if (stored_stderr < 0 || dup2(stored_stderr, STDERR_FILENO) < 0)
+                        (void) close(STDERR_FILENO);
+        stored_stderr = safe_close(stored_stderr);
+        stdout_redirected = stderr_redirected = false;
 
         (void) kill(pager_pid, SIGCONT);
         (void) wait_for_terminate(pager_pid, NULL);
index 2631856563c5daebfb415e2c241221eb1d84aed1..bc8eaabab269c313441e4afa95f81e3b9bd9c093 100644 (file)
@@ -804,6 +804,12 @@ int seccomp_restrict_namespaces(unsigned long retain) {
                 case SCMP_ARCH_X32:
                 case SCMP_ARCH_PPC64:
                 case SCMP_ARCH_PPC64LE:
+                case SCMP_ARCH_MIPS:
+                case SCMP_ARCH_MIPSEL:
+                case SCMP_ARCH_MIPS64:
+                case SCMP_ARCH_MIPSEL64:
+                case SCMP_ARCH_MIPS64N32:
+                case SCMP_ARCH_MIPSEL64N32:
                         clone_reversed_order = 0;
                         break;
 
index b56ac3f7630d329297d5c834184af3af34b488ac..468be19f05fc433bb2f2eec63896aa1ee994ef61 100644 (file)
@@ -92,7 +92,7 @@ int seccomp_memory_deny_write_execute(void);
 #endif
 
 /* we don't know the right order of the clone() parameters except for these archs, for now */
-#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) || defined(__s390__) || defined(__powerpc64__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) || defined(__s390__) || defined(__powerpc64__) || defined(__mips__)
 #define SECCOMP_RESTRICT_NAMESPACES_BROKEN 0
 #else
 #define SECCOMP_RESTRICT_NAMESPACES_BROKEN 1
index ed31a80c8d036cb178dcca49f756c7ec450181ed..8c1624ff46733d65e8d6af7ada8f86823496405c 100644 (file)
@@ -59,9 +59,9 @@ int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {
         };
 
         config_parse_many_nulstr(PKGSYSCONFDIR "/sleep.conf",
-                          CONF_PATHS_NULSTR("systemd/sleep.conf.d"),
-                          "Sleep\0", config_item_table_lookup, items,
-                          false, NULL);
+                                 CONF_PATHS_NULSTR("systemd/sleep.conf.d"),
+                                 "Sleep\0", config_item_table_lookup, items,
+                                 false, NULL);
 
         if (streq(verb, "suspend")) {
                 /* empty by default */
diff --git a/src/sulogin-shell/.gitignore b/src/sulogin-shell/.gitignore
new file mode 100644 (file)
index 0000000..01a3155
--- /dev/null
@@ -0,0 +1 @@
+systemd-sulogin-shell
diff --git a/src/sulogin-shell/meson.build b/src/sulogin-shell/meson.build
new file mode 100644 (file)
index 0000000..4ec0d3d
--- /dev/null
@@ -0,0 +1,7 @@
+gen = configure_file(
+        input : 'systemd-sulogin-shell.in',
+        output : 'systemd-sulogin-shell',
+        configuration : substs)
+
+install_data(gen,
+             install_dir : rootlibexecdir)
diff --git a/src/sulogin-shell/systemd-sulogin-shell.in b/src/sulogin-shell/systemd-sulogin-shell.in
new file mode 100755 (executable)
index 0000000..d4f32af
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ -x /bin/plymouth ]; then
+    /bin/plymouth --wait quit
+fi
+
+cat <<EOF
+You are in $1 mode. After logging in, type "journalctl -xb" to view
+system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to
+boot into default mode.
+EOF
+
+@SULOGIN@
+@SYSTEMCTL@ --job-mode=fail --no-block default
index d78e56d777e1e9abb9cd37207a33354a109df39b..8b42a93ba318e87c2334cab4d086cdf5afa126d6 100644 (file)
@@ -1780,6 +1780,7 @@ static int list_dependencies_one(
         STRV_FOREACH(c, deps) {
                 if (strv_contains(*units, *c)) {
                         if (!arg_plain) {
+                                printf("  ");
                                 r = list_dependencies_print("...", level + 1, (branches << 1) | (c[1] == NULL ? 0 : 1), 1);
                                 if (r < 0)
                                         return r;
@@ -3190,8 +3191,8 @@ static int start_unit(int argc, char *argv[], void *userdata) {
         return r;
 }
 
+#ifdef ENABLE_LOGIND
 static int logind_set_wall_message(void) {
-#ifdef HAVE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
         _cleanup_free_ char *m = NULL;
@@ -3219,15 +3220,14 @@ static int logind_set_wall_message(void) {
 
         if (r < 0)
                 return log_warning_errno(r, "Failed to set wall message, ignoring: %s", bus_error_message(&error, r));
-
-#endif
         return 0;
 }
+#endif
 
 /* Ask systemd-logind, which might grant access to unprivileged users
  * through PolicyKit */
 static int logind_reboot(enum action a) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *method, *description;
         sd_bus *bus;
@@ -3290,7 +3290,7 @@ static int logind_reboot(enum action a) {
 }
 
 static int logind_check_inhibitors(enum action a) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
         _cleanup_strv_free_ char **sessions = NULL;
         const char *what, *who, *why, *mode;
@@ -3409,7 +3409,7 @@ static int logind_check_inhibitors(enum action a) {
 }
 
 static int logind_prepare_firmware_setup(void) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
         int r;
@@ -7001,7 +7001,8 @@ static void systemctl_help(void) {
                "     --root=PATH      Enable unit files in the specified root directory\n"
                "  -n --lines=INTEGER  Number of journal entries to show\n"
                "  -o --output=STRING  Change journal output mode (short, short-precise,\n"
-               "                             short-iso, short-full, short-monotonic, short-unix,\n"
+               "                             short-iso, short-iso-precise, short-full,\n"
+               "                             short-monotonic, short-unix,\n"
                "                             verbose, export, json, json-pretty, json-sse, cat)\n"
                "     --firmware-setup Tell the firmware to show the setup menu on next boot\n"
                "     --plain          Print unit dependencies as a list instead of a tree\n\n"
@@ -8280,7 +8281,7 @@ static int halt_now(enum action a) {
 
 static int logind_schedule_shutdown(void) {
 
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         char date[FORMAT_TIMESTAMP_MAX];
         const char *action;
@@ -8408,7 +8409,7 @@ static int runlevel_main(void) {
 }
 
 static int logind_cancel_shutdown(void) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         sd_bus *bus;
         int r;
index 3bb886be75959100f12c32e62f067927bbe070c0..97c3943861c9d195cf01f17330f0221a1f069e1e 100644 (file)
@@ -22,8 +22,8 @@
 
 /* This is a private header; never even think of including this directly! */
 
-#if __INCLUDE_LEVEL__ <= 1
-#error "Do not include _sd-common.h directly; it is a private header."
+#if defined(__INCLUDE_LEVEL__) && __INCLUDE_LEVEL__ <= 1
+#  error "Do not include _sd-common.h directly; it is a private header."
 #endif
 
 #ifndef _sd_printf_
diff --git a/src/systemd/meson.build b/src/systemd/meson.build
new file mode 100644 (file)
index 0000000..43fd013
--- /dev/null
@@ -0,0 +1,54 @@
+_systemd_headers = '''
+        sd-bus.h
+        sd-bus-protocol.h
+        sd-bus-vtable.h
+        sd-daemon.h
+        sd-event.h
+        sd-id128.h
+        sd-journal.h
+        sd-login.h
+        sd-messages.h
+'''.split()
+
+# https://github.com/mesonbuild/meson/issues/1633
+systemd_headers = files(_systemd_headers)
+
+#  sd-device.h
+#  sd-hwdb.h
+#  sd-dhcp6-client.h
+#  sd-dhcp6-lease.h
+#  sd-dhcp-client.h
+#  sd-dhcp-lease.h
+#  sd-dhcp-server.h
+#  sd-ipv4acd.h
+#  sd-ipv4ll.h
+#  sd-lldp.h
+#  sd-ndisc.h
+#  sd-netlink.h
+#  sd-network.h
+#  sd-path.h
+#  sd-resolve.h
+#  sd-utf8.h
+
+install_headers(
+        systemd_headers,
+        '_sd-common.h',
+        subdir : 'systemd')
+
+
+############################################################
+
+opts = [[],
+        ['-ansi'],
+        ['-std=iso9899:1990']]
+
+foreach header : _systemd_headers
+        foreach opt : opts
+                name = ''.join([header] + opt)
+                test('cc-' + name,
+                     check_compilation_sh,
+                     args : cc.cmd_array() + ['-x', 'c', '-c'] + opt +
+                            ['-Werror', '-include',
+                             join_paths(meson.current_source_dir(), header)])
+        endforeach
+endforeach
index c47459c9adbb1fff848623f0caccf9eee63ef53a..2b6aeb79896e6fb7b8f6e6315e537cb362a1216c 100644 (file)
@@ -266,6 +266,7 @@ int sd_bus_message_set_destination(sd_bus_message *m, const char *destination);
 int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority);
 
 int sd_bus_message_append(sd_bus_message *m, const char *types, ...);
+int sd_bus_message_appendv(sd_bus_message *m, const char *types, va_list ap);
 int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p);
 int sd_bus_message_append_array(sd_bus_message *m, char type, const void *ptr, size_t size);
 int sd_bus_message_append_array_space(sd_bus_message *m, char type, size_t size, void **ptr);
index cc26b7df553b2499b33bb5530e52477d33025b24..f8cb895660516b839dd8bd39c6ab25a640429321 100644 (file)
@@ -69,7 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
 typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
 typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
 typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
+#if defined _GNU_SOURCE || _POSIX_C_SOURCE >= 199309L
 typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
 #else
 typedef void* sd_event_child_handler_t;
index 1109ec52e0472f32f0e8e19bcdfa44427ba1510a..5ba92083f4851944c9ab9f98196f36b4dc64ee28 100644 (file)
@@ -47,6 +47,7 @@ int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
 int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
 int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
 int sd_ipv4ll_is_running(sd_ipv4ll *ll);
+int sd_ipv4ll_restart(sd_ipv4ll *ll);
 int sd_ipv4ll_start(sd_ipv4ll *ll);
 int sd_ipv4ll_stop(sd_ipv4ll *ll);
 sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
index 7efa8ebe5ab0384005982d7ed87f98782aa99386..aa39e0a0db8e1f7cf63ed55e729bd3f1ed1645aa 100644 (file)
@@ -155,6 +155,9 @@ int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *family);
 int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state);
 int sd_rtnl_message_neigh_get_flags(sd_netlink_message *m, uint8_t *flags);
 
+int sd_rtnl_message_new_addrlabel(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int ifindex, int ifal_family);
+int sd_rtnl_message_addrlabel_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
+
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink, sd_netlink_unref);
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink_message, sd_netlink_message_unref);
 
index 9fde9b18842dc78a57191f16cb82a89d1e149314..98280784439610596454119a2cd4c4d58967b258 100644 (file)
@@ -389,6 +389,9 @@ static int handle_provides(SysvStub *s, unsigned line, const char *full_text, co
                                 r = strv_extend(&s->before, SPECIAL_NETWORK_TARGET);
                                 if (r < 0)
                                         return log_oom();
+                                r = strv_extend(&s->wants, SPECIAL_NETWORK_TARGET);
+                                if (r < 0)
+                                        return log_oom();
                         }
 
                         break;
diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py
new file mode 100755 (executable)
index 0000000..357cce8
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+import sys, re
+
+print('#include <stdio.h>')
+for header in sys.argv[2:]:
+    print('#include "{}"'.format(header.split('/')[-1]))
+
+print('''
+void* functions[] = {''')
+
+for line in open(sys.argv[1]):
+    match = re.search('^ +([a-zA-Z0-9_]+);', line)
+    if match:
+        print('    {},'.format(match.group(1)))
+
+print('''};
+
+int main(void) {
+    unsigned i;
+    for (i = 0; i < sizeof(functions)/sizeof(void*); i++)
+         printf("%p\\n", functions[i]);
+    return 0;
+}''')
diff --git a/src/test/meson.build b/src/test/meson.build
new file mode 100644 (file)
index 0000000..4ae1210
--- /dev/null
@@ -0,0 +1,878 @@
+awkscript = 'test-hashmap-ordered.awk'
+test_hashmap_ordered_c = custom_target(
+        'test-hashmap-ordered.c',
+        input : [awkscript, 'test-hashmap-plain.c'],
+        output : 'test-hashmap-ordered.c',
+        command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
+        capture : true)
+
+test_include_dir = include_directories('.')
+
+path = run_command('sh', ['-c', 'echo "$PATH"']).stdout()
+test_env = environment()
+test_env.set('SYSTEMD_KBD_MODEL_MAP', kbd_model_map)
+test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
+test_env.set('PATH', path)
+test_env.prepend('PATH', meson.build_root())
+
+############################################################
+
+generate_sym_test_py = find_program('generate-sym-test.py')
+
+test_libsystemd_sym_c = custom_target(
+        'test-libsystemd-sym.c',
+        input : [libsystemd_sym_path] + systemd_headers,
+        output : 'test-libsystemd-sym.c',
+        command : [generate_sym_test_py, libsystemd_sym_path] + systemd_headers,
+        capture : true)
+
+test_libudev_sym_c = custom_target(
+        'test-libudev-sym.c',
+        input : [libudev_sym_path, libudev_h_path],
+        output : 'test-libudev-sym.c',
+        command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'],
+        capture : true)
+
+test_dlopen_c = files('test-dlopen.c')
+
+############################################################
+
+tests += [
+        [['src/test/test-device-nodes.c'],
+         [],
+         []],
+
+        [['src/test/test-engine.c'],
+         [libcore,
+          libudev,
+          libsystemd_internal],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-job-type.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-ns.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid],
+         '', 'manual'],
+
+        [['src/test/test-loopback.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-hostname.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid],
+         '', 'unsafe'],
+
+        [['src/test/test-dns-domain.c'],
+         [libcore,
+          libsystemd_network],
+         []],
+
+        [['src/test/test-boot-timestamps.c'],
+         [],
+         [],
+         'ENABLE_EFI'],
+
+        [['src/test/test-unit-name.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-unit-file.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-utf8.c'],
+         [],
+         []],
+
+        [['src/test/test-capability.c'],
+         [],
+         [libcap]],
+
+        [['src/test/test-async.c'],
+         [],
+         []],
+
+        [['src/test/test-locale-util.c'],
+         [],
+         []],
+
+        [['src/test/test-copy.c'],
+         [libshared_static],
+         []],
+
+        [['src/test/test-sigbus.c'],
+         [],
+         []],
+
+        [['src/test/test-condition.c'],
+         [],
+         []],
+
+        [['src/test/test-fdset.c'],
+         [],
+         []],
+
+        [['src/test/test-fstab-util.c'],
+         [],
+         []],
+
+        [['src/test/test-ratelimit.c'],
+         [],
+         []],
+
+        [['src/test/test-util.c'],
+         [],
+         []],
+
+        [['src/test/test-mount-util.c'],
+         [],
+         []],
+
+        [['src/test/test-exec-util.c'],
+         [],
+         []],
+
+        [['src/test/test-hexdecoct.c'],
+         [],
+         []],
+
+        [['src/test/test-alloc-util.c'],
+         [],
+         []],
+
+        [['src/test/test-xattr-util.c'],
+         [],
+         []],
+
+        [['src/test/test-io-util.c'],
+         [],
+         []],
+
+        [['src/test/test-glob-util.c'],
+         [],
+         []],
+
+        [['src/test/test-fs-util.c'],
+         [],
+         []],
+
+        [['src/test/test-proc-cmdline.c'],
+         [],
+         []],
+
+        [['src/test/test-fd-util.c'],
+         [],
+         []],
+
+        [['src/test/test-web-util.c'],
+         [],
+         []],
+
+        [['src/test/test-cpu-set-util.c'],
+         [],
+         []],
+
+        [['src/test/test-stat-util.c'],
+         [],
+         []],
+
+        [['src/test/test-escape.c'],
+         [],
+         []],
+
+        [['src/test/test-string-util.c'],
+         [],
+         []],
+
+        [['src/test/test-extract-word.c'],
+         [],
+         []],
+
+        [['src/test/test-parse-util.c'],
+         [],
+         []],
+
+        [['src/test/test-user-util.c'],
+         [],
+         []],
+
+        [['src/test/test-hostname-util.c'],
+         [],
+         []],
+
+        [['src/test/test-process-util.c'],
+         [],
+         []],
+
+        [['src/test/test-terminal-util.c'],
+         [],
+         []],
+
+        [['src/test/test-path-lookup.c'],
+         [],
+         []],
+
+        [['src/test/test-uid-range.c'],
+         [],
+         []],
+
+        [['src/test/test-cap-list.c',
+          generated_gperf_headers],
+         [],
+         [libcap]],
+
+        [['src/test/test-socket-util.c'],
+         [],
+         []],
+
+        [['src/test/test-barrier.c'],
+         [],
+         []],
+
+        [['src/test/test-tmpfiles.c'],
+         [],
+         []],
+
+        [['src/test/test-namespace.c'],
+         [libcore,
+          libshared],
+         [threads,
+          libblkid]],
+
+        [['src/test/test-verbs.c'],
+         [],
+         []],
+
+        [['src/test/test-install-root.c'],
+         [],
+         []],
+
+        [['src/test/test-acl-util.c'],
+         [],
+         [],
+         'HAVE_ACL'],
+
+        [['src/test/test-seccomp.c'],
+         [],
+         [libseccomp],
+         'HAVE_SECCOMP'],
+
+        [['src/test/test-rlimit-util.c'],
+         [],
+         []],
+
+        [['src/test/test-ask-password-api.c'],
+         [],
+         [],
+         '', 'manual'],
+
+        [['src/test/test-dissect-image.c'],
+         [],
+         [libblkid],
+         '', 'manual'],
+
+        [['src/test/test-signal-util.c'],
+         [],
+         []],
+
+        [['src/test/test-selinux.c'],
+         [],
+         []],
+
+        [['src/test/test-sizeof.c'],
+         [libbasic],
+         []],
+
+        [['src/test/test-hashmap.c',
+          'src/test/test-hashmap-plain.c',
+          test_hashmap_ordered_c],
+         [],
+         [],
+         '', 'timeout=90'],
+
+        [['src/test/test-set.c'],
+         [],
+         []],
+
+        [['src/test/test-bitmap.c'],
+         [],
+         []],
+
+        [['src/test/test-xml.c'],
+         [],
+         []],
+
+        [['src/test/test-list.c'],
+         [],
+         []],
+
+        [['src/test/test-unaligned.c'],
+         [],
+         []],
+
+        [['src/test/test-tables.c',
+          'src/shared/test-tables.h',
+          'src/journal/journald-server.c',
+          'src/journal/journald-server.h'],
+         [libcore,
+          libjournal_core,
+          libudev_core,
+          libudev_internal,
+          libsystemd_network,
+          libshared],
+         [threads,
+          libseccomp,
+          libmount,
+          libxz,
+          liblz4,
+          libblkid],
+         '', '', [], libudev_core_includes],
+
+        [['src/test/test-prioq.c'],
+         [],
+         []],
+
+        [['src/test/test-fileio.c'],
+         [],
+         []],
+
+        [['src/test/test-time.c'],
+         [],
+         []],
+
+        [['src/test/test-clock.c'],
+         [],
+         []],
+
+        [['src/test/test-architecture.c'],
+         [],
+         []],
+
+        [['src/test/test-log.c'],
+         [],
+         []],
+
+        [['src/test/test-ipcrm.c'],
+         [],
+         [],
+         '', 'unsafe'],
+
+        [['src/test/test-btrfs.c'],
+         [],
+         [],
+         '', 'manual'],
+
+
+        [['src/test/test-firewall-util.c'],
+         [libshared],
+         [],
+         'HAVE_LIBIPTC'],
+
+        [['src/test/test-netlink-manual.c'],
+         [],
+         [libkmod],
+         'HAVE_KMOD', 'manual'],
+
+        [['src/test/test-ellipsize.c'],
+         [],
+         []],
+
+        [['src/test/test-date.c'],
+         [],
+         []],
+
+        [['src/test/test-sleep.c'],
+         [],
+         []],
+
+        [['src/test/test-replace-var.c'],
+         [],
+         []],
+
+        [['src/test/test-calendarspec.c'],
+         [],
+         []],
+
+        [['src/test/test-strip-tab-ansi.c'],
+         [],
+         []],
+
+        [['src/test/test-daemon.c'],
+         [],
+         []],
+
+        [['src/test/test-cgroup.c'],
+         [],
+         [],
+         '', 'manual'],
+
+
+        [['src/test/test-cgroup-mask.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-cgroup-util.c'],
+         [],
+         []],
+
+        [['src/test/test-env-util.c'],
+         [],
+         []],
+
+        [['src/test/test-strbuf.c'],
+         [],
+         []],
+
+        [['src/test/test-strv.c'],
+         [],
+         []],
+
+        [['src/test/test-path-util.c'],
+         [],
+         []],
+
+        [['src/test/test-path.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-execute.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-siphash24.c'],
+         [],
+         []],
+
+        [['src/test/test-strxcpyx.c'],
+         [],
+         []],
+
+        [['src/test/test-install.c'],
+         [libcore,
+          libshared],
+         [],
+         '', 'manual'],
+
+        [['src/test/test-watchdog.c'],
+         [],
+         []],
+
+        [['src/test/test-sched-prio.c'],
+         [libcore,
+          libshared],
+         [threads,
+          librt,
+          libseccomp,
+          libselinux,
+          libmount,
+          libblkid]],
+
+        [['src/test/test-conf-files.c'],
+         [],
+         []],
+
+        [['src/test/test-conf-parser.c'],
+         [],
+         []],
+
+        [['src/test/test-af-list.c',
+          generated_gperf_headers],
+         [],
+         []],
+
+        [['src/test/test-arphrd-list.c',
+          generated_gperf_headers],
+         [],
+         []],
+
+        [['src/test/test-journal-importer.c'],
+         [],
+         []],
+
+        [['src/test/test-libudev.c'],
+         [libshared],
+         []],
+
+        [['src/test/test-udev.c'],
+         [libudev_core,
+          libudev_internal,
+          libsystemd_network,
+          libshared],
+         [threads,
+          librt,
+          libblkid,
+          libkmod,
+          libacl],
+         '', 'manual'],
+
+        [['src/test/test-id128.c'],
+         [],
+         []],
+
+        [['src/test/test-hash.c'],
+         [],
+         []],
+
+        [['src/test/test-nss.c'],
+         [],
+         [libdl],
+         '', 'manual'],
+]
+
+############################################################
+
+# define some tests here, because the link_with deps were not defined earlier
+
+tests += [
+        [['src/journal/test-journal.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-send.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-syslog.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4,
+          libselinux]],
+
+        [['src/journal/test-journal-match.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-enum.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-stream.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-flush.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-init.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-verify.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-journal-interleaving.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-mmap-cache.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4]],
+
+        [['src/journal/test-catalog.c'],
+         [libjournal_core,
+          libshared],
+         [threads,
+          libxz,
+          liblz4],
+         '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)],
+
+        [['src/journal/test-compress.c'],
+         [libjournal_core,
+          libshared],
+         [liblz4,
+          libxz]],
+
+        [['src/journal/test-compress-benchmark.c'],
+         [libjournal_core,
+          libshared],
+         [liblz4,
+          libxz],
+         '', 'timeout=90'],
+
+        [['src/journal/test-audit-type.c'],
+         [libjournal_core,
+          libshared],
+         [liblz4,
+          libxz]],
+]
+
+############################################################
+
+tests += [
+        [['src/libsystemd/sd-bus/test-bus-marshal.c'],
+         [],
+         [threads,
+          libglib,
+          libgobject,
+          libgio,
+          libdbus]],
+
+        [['src/libsystemd/sd-bus/test-bus-signature.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-bus/test-bus-chat.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-bus/test-bus-cleanup.c'],
+         [],
+         [threads,
+          libseccomp]],
+
+        [['src/libsystemd/sd-bus/test-bus-error.c'],
+         [libshared_static,
+          libsystemd_internal],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-track.c'],
+         [],
+         [libseccomp]],
+
+        [['src/libsystemd/sd-bus/test-bus-server.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-bus/test-bus-objects.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-bus/test-bus-gvariant.c'],
+         [],
+         [libglib,
+          libgobject,
+          libgio]],
+
+        [['src/libsystemd/sd-bus/test-bus-creds.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-match.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-kernel.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-benchmark.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-bus/test-bus-zero-copy.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-bus/test-bus-introspect.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-event/test-event.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-netlink/test-netlink.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-netlink/test-local-addresses.c'],
+         [],
+         []],
+
+        [['src/libsystemd/sd-resolve/test-resolve.c'],
+         [],
+         [threads]],
+
+        [['src/libsystemd/sd-login/test-login.c'],
+         [],
+         [],
+         '', 'manual'],
+]
+
+############################################################
+
+tests += [
+        [['src/libsystemd-network/test-dhcp-option.c',
+          'src/libsystemd-network/dhcp-protocol.h',
+          'src/libsystemd-network/dhcp-internal.h'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-dhcp-client.c',
+          'src/libsystemd-network/dhcp-protocol.h',
+          'src/libsystemd-network/dhcp-internal.h',
+          'src/systemd/sd-dhcp-client.h'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-dhcp-server.c'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-ipv4ll.c',
+          'src/libsystemd-network/arp-util.h',
+          'src/systemd/sd-ipv4ll.h'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-ipv4ll-manual.c',
+          'src/systemd/sd-ipv4ll.h'],
+         [libshared,
+          libsystemd_network],
+         [],
+         '', 'manual'],
+
+        [['src/libsystemd-network/test-acd.c',
+          'src/systemd/sd-ipv4acd.h'],
+         [libshared,
+          libsystemd_network],
+         [],
+         '', 'manual'],
+
+        [['src/libsystemd-network/test-ndisc-rs.c',
+          'src/libsystemd-network/dhcp-identifier.h',
+          'src/libsystemd-network/dhcp-identifier.c',
+          'src/libsystemd-network/icmp6-util.h',
+          'src/systemd/sd-dhcp6-client.h',
+          'src/systemd/sd-ndisc.h'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-dhcp6-client.c',
+          'src/libsystemd-network/dhcp-identifier.h',
+          'src/libsystemd-network/dhcp-identifier.c',
+          'src/libsystemd-network/dhcp6-internal.h',
+          'src/systemd/sd-dhcp6-client.h'],
+         [libshared,
+          libsystemd_network],
+         []],
+
+        [['src/libsystemd-network/test-lldp.c'],
+         [libshared,
+          libsystemd_network],
+         []],
+]
+
+############################################################
+
+tests += [
+        [['src/login/test-login-shared.c'],
+         [],
+         []],
+
+        [['src/login/test-inhibit.c'],
+         [],
+         [],
+         '', 'manual'],
+
+        [['src/login/test-login-tables.c'],
+         [liblogind_core,
+          libshared],
+         [threads]],
+]
diff --git a/src/test/test-dlopen.c b/src/test/test-dlopen.c
new file mode 100644 (file)
index 0000000..9f5343a
--- /dev/null
@@ -0,0 +1,32 @@
+/***
+  This file is part of systemd.
+
+  Copyright 2016 Zbigniew Jędrzejewski-Szmek
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <dlfcn.h>
+#include <stdlib.h>
+
+#include "macro.h"
+
+int main(int argc, char **argv) {
+        void *handle;
+
+        assert_se((handle = dlopen(argv[1], RTLD_NOW)));
+        assert_se(dlclose(handle) == 0);
+
+        return EXIT_SUCCESS;
+}
index 482b0751b938519509b92e1136d289946b5f0e56..30c92019d910a52d908c5e17e96a5e5179cd8128 100644 (file)
@@ -223,7 +223,7 @@ static int gather_stdout_three(int fd, void *arg) {
         return 0;
 }
 
-const gather_stdout_callback_t const gather_stdout[] = {
+const gather_stdout_callback_t gather_stdout[] = {
         gather_stdout_one,
         gather_stdout_two,
         gather_stdout_three,
index 9eea3eb608bf36925ccb176dc5dd9cf39088a207..af866e004b9bad6c34e4ff9da9d0fa268a78f119 100644 (file)
 ***/
 
 #include <fcntl.h>
+#include <glob.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
+#include "dirent-util.h"
 #include "fileio.h"
+#include "fs-util.h"
 #include "glob-util.h"
 #include "macro.h"
+#include "rm-rf.h"
 
 static void test_glob_exists(void) {
         char name[] = "/tmp/test-glob_exists.XXXXXX";
@@ -43,8 +48,69 @@ static void test_glob_exists(void) {
         assert_se(r == 0);
 }
 
+static void test_glob_no_dot(void) {
+        char template[] = "/tmp/test-glob-util.XXXXXXX";
+        const char *fn;
+
+        _cleanup_globfree_ glob_t g = {
+                .gl_closedir = (void (*)(void *)) closedir,
+                .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
+                .gl_opendir = (void *(*)(const char *)) opendir,
+                .gl_lstat = lstat,
+                .gl_stat = stat,
+        };
+
+        int r;
+
+        assert_se(mkdtemp(template));
+
+        fn = strjoina(template, "/*");
+        r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
+        assert_se(r == GLOB_NOMATCH);
+
+        fn = strjoina(template, "/.*");
+        r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
+        assert_se(r == GLOB_NOMATCH);
+
+        (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
+}
+
+static void test_safe_glob(void) {
+        char template[] = "/tmp/test-glob-util.XXXXXXX";
+        const char *fn, *fn2, *fname;
+
+        _cleanup_globfree_ glob_t g = {};
+        int r;
+
+        assert_se(mkdtemp(template));
+
+        fn = strjoina(template, "/*");
+        r = safe_glob(fn, 0, &g);
+        assert_se(r == -ENOENT);
+
+        fn2 = strjoina(template, "/.*");
+        r = safe_glob(fn2, GLOB_NOSORT|GLOB_BRACE, &g);
+        assert_se(r == -ENOENT);
+
+        fname = strjoina(template, "/.foobar");
+        assert_se(touch(fname) == 0);
+
+        r = safe_glob(fn, 0, &g);
+        assert_se(r == -ENOENT);
+
+        r = safe_glob(fn2, GLOB_NOSORT|GLOB_BRACE, &g);
+        assert_se(r == 0);
+        assert_se(g.gl_pathc == 1);
+        assert_se(streq(g.gl_pathv[0], fname));
+        assert_se(g.gl_pathv[1] == NULL);
+
+        (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
+}
+
 int main(void) {
         test_glob_exists();
+        test_glob_no_dot();
+        test_safe_glob();
 
         return 0;
 }
diff --git a/src/test/test-hashmap-ordered.awk b/src/test/test-hashmap-ordered.awk
new file mode 100644 (file)
index 0000000..10f4386
--- /dev/null
@@ -0,0 +1,11 @@
+BEGIN {
+        print "/* GENERATED FILE */";
+        print "#define ORDERED"
+}
+{
+        if (!match($0, "^#include"))
+                gsub(/hashmap/, "ordered_hashmap");
+        gsub(/HASHMAP/, "ORDERED_HASHMAP");
+        gsub(/Hashmap/, "OrderedHashmap");
+        print
+}
index e28de9b37b44164a6cd54fdc5bdf2c243d363250..0f71c18b650f12bd12774bd38c80c173326fbeed 100644 (file)
@@ -392,7 +392,7 @@ int main(int argc, char *argv[]) {
                         return EXIT_SUCCESS;
 
                 case 'V':
-                        printf("%s\n", VERSION);
+                        printf("%s\n", PACKAGE_VERSION);
                         return EXIT_SUCCESS;
 
                 case 'm':
index b59cb7aa694478c4d3f6e0b34046b193ea68cb3c..b4cb3f0d376bef2b76cf95a7940e5d948b8fc5e9 100644 (file)
@@ -71,9 +71,11 @@ static void* open_handle(const char* dir, const char* module, int flags) {
         const char *path;
         void *handle;
 
-        if (dir)
-                path = strjoina(dir, "/.libs/libnss_", module, ".so.2");
-        else
+        if (dir) {
+                path = strjoina(dir, "/libnss_", module, ".so.2");
+                if (access(path, F_OK) < 0)
+                        path = strjoina(dir, "/.libs/libnss_", module, ".so.2");
+        } else
                 path = strjoina("libnss_", module, ".so.2");
 
         handle = dlopen(path, flags);
index 22df20a1eb9ceaa6dc82be0a0100676501e355e2..ab62d0dad2f043da6674b1973bb1e364554616f2 100644 (file)
@@ -27,6 +27,7 @@
 #include "mount-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
@@ -104,6 +105,38 @@ static void test_path(void) {
         assert_se(!path_equal_ptr(NULL, "/a"));
 }
 
+static void test_path_equal_root(void) {
+        /* Nail down the details of how path_equal("/", ...) works. */
+
+        assert_se(path_equal("/", "/"));
+        assert_se(path_equal("/", "//"));
+
+        assert_se(!path_equal("/", "/./"));
+        assert_se(!path_equal("/", "/../"));
+
+        assert_se(!path_equal("/", "/.../"));
+
+        /* Make sure that files_same works as expected. */
+
+        assert_se(files_same("/", "/") > 0);
+        assert_se(files_same("/", "//") > 0);
+
+        assert_se(files_same("/", "/./") > 0);
+        assert_se(files_same("/", "/../") > 0);
+
+        assert_se(files_same("/", "/.../") == -ENOENT);
+
+        /* The same for path_equal_or_files_same. */
+
+        assert_se(path_equal_or_files_same("/", "/"));
+        assert_se(path_equal_or_files_same("/", "//"));
+
+        assert_se(path_equal_or_files_same("/", "/./"));
+        assert_se(path_equal_or_files_same("/", "/../"));
+
+        assert_se(!path_equal_or_files_same("/", "/.../"));
+}
+
 static void test_find_binary(const char *self) {
         char *p;
 
@@ -551,6 +584,7 @@ int main(int argc, char **argv) {
         log_open();
 
         test_path();
+        test_path_equal_root();
         test_find_binary(argv[0]);
         test_prefixes();
         test_path_join();
index 8f99a13772701ca6e3855c98542caf06aee36ade..269adfd18fe8bac5b6f8b44b415d41465166d1d3 100644 (file)
@@ -17,7 +17,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "log.h"
+#include <stdio.h>
+
 #include "time-util.h"
 
 /* Print information about various types. Useful when diagnosing
 #pragma GCC diagnostic ignored "-Wtype-limits"
 
 #define info(t)                                                 \
-        log_info("%s → %zu bits%s", STRINGIFY(t),               \
-                 sizeof(t)*CHAR_BIT,                            \
-                 strstr(STRINGIFY(t), "signed") ? "" :          \
-                 ((t)-1 < (t)0 ? ", signed" : ", unsigned"));
+        printf("%s → %zu bits%s\n", STRINGIFY(t),               \
+               sizeof(t)*CHAR_BIT,                              \
+               strstr(STRINGIFY(t), "signed") ? "" :            \
+               ((t)-1 < (t)0 ? ", signed" : ", unsigned"));
+
+enum Enum {
+        enum_value,
+};
+
+enum BigEnum {
+        big_enum_value = UINT64_C(-1),
+};
 
 int main(void) {
         info(char);
@@ -39,6 +48,8 @@ int main(void) {
         info(unsigned);
         info(long unsigned);
         info(long long unsigned);
+        info(__syscall_ulong_t);
+        info(__syscall_slong_t);
 
         info(float);
         info(double);
@@ -48,6 +59,10 @@ int main(void) {
         info(ssize_t);
         info(time_t);
         info(usec_t);
+        info(__time_t);
+
+        info(enum Enum);
+        info(enum BigEnum);
 
         return 0;
 }
index e965b4494a34c3fcd4aca40edc52535198d04535..c84bd8991e68a1a3d67cd2e2fef02dab7594b21f 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
         if (udev == NULL)
                 return EXIT_FAILURE;
 
-        log_debug("version %s", VERSION);
+        log_debug("version %s", PACKAGE_VERSION);
         mac_selinux_init();
 
         action = argv[1];
diff --git a/src/timedate/meson.build b/src/timedate/meson.build
new file mode 100644 (file)
index 0000000..63124d6
--- /dev/null
@@ -0,0 +1,14 @@
+if conf.get('ENABLE_TIMEDATED', false)
+        install_data('org.freedesktop.timedate1.conf',
+                     install_dir : dbuspolicydir)
+        install_data('org.freedesktop.timedate1.service',
+                     install_dir : dbussystemservicedir)
+
+        custom_target(
+                'org.freedesktop.timedate1.policy',
+                input : 'org.freedesktop.timedate1.policy.in',
+                output : 'org.freedesktop.timedate1.policy',
+                command : intltool_command,
+                install : install_polkit,
+                install_dir : polkitpolicydir)
+endif
diff --git a/src/timesync/meson.build b/src/timesync/meson.build
new file mode 100644 (file)
index 0000000..ee54c3e
--- /dev/null
@@ -0,0 +1,26 @@
+systemd_timesyncd_sources = files('''
+        timesyncd.c
+        timesyncd-manager.c
+        timesyncd-manager.h
+        timesyncd-conf.c
+        timesyncd-conf.h
+        timesyncd-server.c
+        timesyncd-server.h
+'''.split())
+
+timesyncd_gperf_c = custom_target(
+        'timesyncd-gperf.c',
+        input : 'timesyncd-gperf.gperf',
+        output : 'timesyncd-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+systemd_timesyncd_sources += [timesyncd_gperf_c]
+
+if conf.get('ENABLE_TIMESYNCD', false)
+        timesyncd_conf = configure_file(
+                input : 'timesyncd.conf.in',
+                output : 'timesyncd.conf',
+                configuration : substs)
+        install_data(timesyncd_conf,
+                     install_dir : pkgsysconfdir)
+endif
index bf25b112e16f894a065bc758494f1ba28405890a..99bdb55e986f403b5c4b9d80a609431f392a647b 100644 (file)
@@ -99,8 +99,8 @@ int manager_parse_config_file(Manager *m) {
         assert(m);
 
         return config_parse_many_nulstr(PKGSYSCONFDIR "/timesyncd.conf",
-                                 CONF_PATHS_NULSTR("systemd/timesyncd.conf.d"),
-                                 "Time\0",
-                                 config_item_perf_lookup, timesyncd_gperf_lookup,
-                                 false, m);
+                                        CONF_PATHS_NULSTR("systemd/timesyncd.conf.d"),
+                                        "Time\0",
+                                        config_item_perf_lookup, timesyncd_gperf_lookup,
+                                        false, m);
 }
index 7326597b8c35eba060a19fc2bab6f07bcfebd8de..36488c9a5c2a6b08daf0b1bf5b2c6d184e6923b0 100644 (file)
@@ -973,7 +973,7 @@ static int path_set_attribute(Item *item, const char *path) {
 
         r = chattr_fd(fd, f, item->attribute_mask);
         if (r < 0)
-                log_full_errno(r == -ENOTTY ? LOG_DEBUG : LOG_WARNING,
+                log_full_errno(r == -ENOTTY || r == -EOPNOTSUPP ? LOG_DEBUG : LOG_WARNING,
                                r,
                                "Cannot set file attribute for '%s', value=0x%08x, mask=0x%08x: %m",
                                path, item->attribute_value, item->attribute_mask);
@@ -1093,19 +1093,14 @@ static int item_do_children(Item *i, const char *path, action_t action) {
 
 static int glob_item(Item *i, action_t action, bool recursive) {
         _cleanup_globfree_ glob_t g = {
-                .gl_closedir = (void (*)(void *)) closedir,
-                .gl_readdir = (struct dirent *(*)(void *)) readdir,
                 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
-                .gl_lstat = lstat,
-                .gl_stat = stat,
         };
         int r = 0, k;
         char **fn;
 
-        errno = 0;
-        k = glob(i->path, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
-        if (k != 0 && k != GLOB_NOMATCH)
-                return log_error_errno(errno ?: EIO, "glob(%s) failed: %m", i->path);
+        k = safe_glob(i->path, GLOB_NOSORT|GLOB_BRACE, &g);
+        if (k < 0 && k != -ENOENT)
+                return log_error_errno(k, "glob(%s) failed: %m", i->path);
 
         STRV_FOREACH(fn, g.gl_pathv) {
                 k = action(i, *fn);
diff --git a/src/udev/generate-keyboard-keys-list.sh b/src/udev/generate-keyboard-keys-list.sh
new file mode 100755 (executable)
index 0000000..479e493
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh -eu
+
+$1 -dM -include linux/input.h - </dev/null | \
+        awk '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($2 != "KEY_MAX") { print $2 } }'
diff --git a/src/udev/meson.build b/src/udev/meson.build
new file mode 100644 (file)
index 0000000..6576ad6
--- /dev/null
@@ -0,0 +1,150 @@
+udevadm_sources = files('''
+        udevadm.c
+        udevadm-info.c
+        udevadm-control.c
+        udevadm-monitor.c
+        udevadm-hwdb.c
+        udevadm-settle.c
+        udevadm-trigger.c
+        udevadm-test.c
+        udevadm-test-builtin.c
+        udevadm-util.c
+        udevadm-util.h
+'''.split())
+
+systemd_udevd_sources = files('udevd.c')
+
+libudev_core_sources = '''
+        udev.h
+        udev-event.c
+        udev-watch.c
+        udev-node.c
+        udev-rules.c
+        udev-ctrl.c
+        udev-builtin.c
+        udev-builtin-btrfs.c
+        udev-builtin-hwdb.c
+        udev-builtin-input_id.c
+        udev-builtin-keyboard.c
+        udev-builtin-net_id.c
+        udev-builtin-net_setup_link.c
+        udev-builtin-path_id.c
+        udev-builtin-usb_id.c
+        net/link-config.c
+        net/link-config.h
+        net/ethtool-util.c
+        net/ethtool-util.h
+'''.split()
+
+if conf.get('HAVE_KMOD', false)
+        libudev_core_sources += ['udev-builtin-kmod.c']
+endif
+
+if conf.get('HAVE_BLKID', false)
+        libudev_core_sources += ['udev-builtin-blkid.c']
+endif
+
+if conf.get('HAVE_ACL', false)
+        libudev_core_sources += ['udev-builtin-uaccess.c',
+                                logind_acl_c,
+                                 sd_login_c]
+endif
+
+############################################################
+
+generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh')
+keyboard_keys_list_txt = custom_target(
+        'keyboard-keys-list.txt',
+        output : 'keyboard-keys-list.txt',
+        command : [generate_keyboard_keys_list, cpp],
+        capture : true)
+
+fname = 'keyboard-keys-from-name.gperf'
+gperf_file = custom_target(
+        fname,
+        input : keyboard_keys_list_txt,
+        output : fname,
+        command : [generate_gperfs, 'key', '', '@INPUT@'],
+        capture : true)
+
+fname = 'keyboard-keys-from-name.h'
+keyboard_keys_from_name_h = custom_target(
+        fname,
+        input : gperf_file,
+        output : fname,
+        command : [gperf,
+                   '-L', 'ANSI-C', '-t', '--ignore-case',
+                   '-N', 'keyboard_lookup_key',
+                   '-H', 'hash_key_name',
+                   '-p', '-C',
+                   '@INPUT@'],
+        capture : true)
+
+############################################################
+
+link_config_gperf_c = custom_target(
+        'link-config-gperf.c',
+        input : 'net/link-config-gperf.gperf',
+        output : 'link-config-gperf.c',
+        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
+
+############################################################
+
+if get_option('link-udev-shared')
+        udev_link_with = [libshared]
+        udev_rpath = rootlibexecdir
+else
+        udev_link_with = [libshared_static,
+                          libsystemd_internal]
+        udev_rpath = ''
+endif
+
+libudev_internal = static_library(
+        'udev',
+        libudev_sources,
+        include_directories : includes,
+        link_with : udev_link_with)
+
+libudev_core_includes = [includes, include_directories('net')]
+libudev_core = static_library(
+        'udev-core',
+        libudev_core_sources,
+        link_config_gperf_c,
+        keyboard_keys_from_name_h,
+        include_directories : libudev_core_includes,
+        link_with : udev_link_with,
+        dependencies : [libblkid, libkmod])
+
+foreach prog : [['ata_id/ata_id.c'],
+                ['cdrom_id/cdrom_id.c'],
+                ['collect/collect.c'],
+                ['scsi_id/scsi_id.c',
+                 'scsi_id/scsi_id.h',
+                 'scsi_id/scsi_serial.c',
+                 'scsi_id/scsi.h'],
+                ['v4l_id/v4l_id.c'],
+                ['mtd_probe/mtd_probe.c',
+                 'mtd_probe/mtd_probe.h',
+                 'mtd_probe/probe_smartmedia.c']]
+
+        executable(prog[0].split('/')[0],
+                   prog,
+                   include_directories : includes,
+                   link_with : [libudev_internal],
+                   install_rpath : udev_rpath,
+                   install : true,
+                   install_dir : udevlibexecdir)
+endforeach
+
+install_data('udev.conf',
+             install_dir : join_paths(sysconfdir, 'udev'))
+
+udev_pc = configure_file(
+        input : 'udev.pc.in',
+        output : 'udev.pc',
+        configuration : substs)
+install_data(udev_pc,
+             install_dir : pkgconfigdatadir)
+
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d')))
index 46556916429b6352424b34e7e880332003e0ae56..eba382a82dc6ff1fa7d490d3f14b7d1ca0f98689 100644 (file)
@@ -391,7 +391,7 @@ static int set_options(struct udev *udev,
                         break;
 
                 case 'V':
-                        printf("%s\n", VERSION);
+                        printf("%s\n", PACKAGE_VERSION);
                         exit(0);
 
                 case 'x':
index 9037aa1304d68a3b31c626babf73b961715ee59d..63194036206497d2ac8529fc296052df6f837ba5 100644 (file)
@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <blkid/blkid.h>
+#include <blkid.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
index 51f364bf94fd027f0ed8c32ec636f1811522e786..4303b2593d3bf85f84196812c6940d143f897666 100644 (file)
 #define LONG(x) ((x)/BITS_PER_LONG)
 #define test_bit(bit, array)    ((array[LONG(bit)] >> OFF(bit)) & 1)
 
+/* available as of kernel 3.11 */
+#ifndef BTN_DPAD_UP
+#define BTN_DPAD_UP 0x220
+#endif /* BTN_DPAD_UP */
+
+/* available as of kernel 3.13 */
+#ifndef KEY_ALS_TOGGLE
+#define KEY_ALS_TOGGLE 0x230
+#endif /* KEY_ALS_TOGGLE */
+
+struct range {
+        unsigned start;
+        unsigned end;
+};
+
+/* key code ranges above BTN_MISC (start is inclusive, stop is exclusive)*/
+static const struct range high_key_blocks[] = {
+        { KEY_OK, BTN_DPAD_UP },
+        { KEY_ALS_TOGGLE, BTN_TRIGGER_HAPPY }
+};
+
 static inline int abs_size_mm(const struct input_absinfo *absinfo) {
         /* Resolution is defined to be in units/mm for ABS_X/Y */
         return (absinfo->maximum - absinfo->minimum) / absinfo->resolution;
@@ -260,13 +281,16 @@ static bool test_key(struct udev_device *dev,
                 found |= bitmask_key[i];
                 log_debug("test_key: checking bit block %lu for any keys; found=%i", (unsigned long)i*BITS_PER_LONG, found > 0);
         }
-        /* If there are no keys in the lower block, check the higher block */
+        /* If there are no keys in the lower block, check the higher blocks */
         if (!found) {
-                for (i = KEY_OK; i < BTN_TRIGGER_HAPPY; ++i) {
-                        if (test_bit(i, bitmask_key)) {
-                                log_debug("test_key: Found key %x in high block", i);
-                                found = 1;
-                                break;
+                unsigned block;
+                for (block = 0; block < (sizeof(high_key_blocks) / sizeof(struct range)); ++block) {
+                        for (i = high_key_blocks[block].start; i < high_key_blocks[block].end; ++i) {
+                                if (test_bit(i, bitmask_key)) {
+                                        log_debug("test_key: Found key %x in high block", i);
+                                        found = 1;
+                                        break;
+                                }
                         }
                 }
         }
index 09024116f2bf4fcabc349be91904f42ba43012e0..07a2f94197f765a54730d4ac0e2cae00755e2158 100644 (file)
@@ -29,7 +29,7 @@
 #include "string-util.h"
 #include "udev.h"
 
-static const struct key *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len);
+static const struct key_name *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len);
 #include "keyboard-keys-from-name.h"
 
 static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) {
@@ -76,7 +76,7 @@ static void map_keycode(int fd, const char *devnode, int scancode, const char *k
                 unsigned key;
         } map;
         char *endptr;
-        const struct key *k;
+        const struct key_name *k;
         unsigned keycode_num;
 
         /* translate identifier to key code */
index bd7b789cad921fabab9a5280d2f2b26270952e22..dcbfba359fa3e91e2297775d8b6d89948b114d28 100644 (file)
@@ -45,6 +45,7 @@
  *                                         — PCI geographical location
  *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
  *                                         — USB port number chain
+ *   v<slot>                               - VIO slot number (IBM PowerVM)
  *
  * All multi-function PCI devices will carry the [f<function>] number in the
  * device name, including the function 0 device.
@@ -122,6 +123,7 @@ enum netname_type{
         NET_BCMA,
         NET_VIRTIO,
         NET_CCW,
+        NET_VIO,
 };
 
 struct netnames {
@@ -139,6 +141,7 @@ struct netnames {
         char usb_ports[IFNAMSIZ];
         char bcma_core[IFNAMSIZ];
         char ccw_busid[IFNAMSIZ];
+        char vio_slot[IFNAMSIZ];
 };
 
 /* skip intermediate virtio devices */
@@ -319,6 +322,33 @@ out:
         return err;
 }
 
+static int names_vio(struct udev_device *dev, struct netnames *names) {
+        struct udev_device *parent;
+        unsigned busid, slotid, ethid;
+        const char *syspath;
+
+        /* check if our direct parent is a VIO device with no other bus in-between */
+        parent = udev_device_get_parent(dev);
+        if (!parent)
+                return -ENOENT;
+
+        if (!streq_ptr("vio", udev_device_get_subsystem(parent)))
+                 return -ENOENT;
+
+        /* The devices' $DEVPATH number is tied to (virtual) hardware (slot id
+         * selected in the HMC), thus this provides a reliable naming (e.g.
+         * "/devices/vio/30000002/net/eth1"); we ignore the bus number, as
+         * there should only ever be one bus, and then remove leading zeros. */
+        syspath = udev_device_get_syspath(dev);
+
+        if (sscanf(syspath, "/sys/devices/vio/%4x%4x/net/eth%u", &busid, &slotid, &ethid) != 3)
+                return -EINVAL;
+
+        xsprintf(names->vio_slot, "v%u", slotid);
+        names->type = NET_VIO;
+        return 0;
+}
+
 static int names_pci(struct udev_device *dev, struct netnames *names) {
         struct udev_device *parent;
 
@@ -591,6 +621,16 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
                 goto out;
         }
 
+        /* get ibmveth/ibmvnic slot-based names. */
+        err = names_vio(dev, &names);
+        if (err >= 0 && names.type == NET_VIO) {
+                char str[IFNAMSIZ];
+
+                if (snprintf(str, sizeof(str), "%s%s", prefix, names.vio_slot) < (int)sizeof(str))
+                        udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
+                goto out;
+        }
+
         /* get PCI based path names, we compose only PCI based paths */
         err = names_pci(dev, &names);
         if (err < 0)
index dbefbbe175da06ba52ab93a9e0c43b43a892687a..92e4f8d9c05d740653868299aff9f6f843ef3e44 100644 (file)
@@ -239,7 +239,7 @@ static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int
         int err = 0;
 
         memzero(&ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire));
-        strcpy(ctrl_msg_wire.version, "udev-" VERSION);
+        strcpy(ctrl_msg_wire.version, "udev-" PACKAGE_VERSION);
         ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
         ctrl_msg_wire.type = type;
 
index a0c2e82d471e39a8986cec54d99febbde9c73531..e384a6f7c9ca10e7168df9f9d1a4b1a0f751b6c7 100644 (file)
@@ -1,5 +1,5 @@
 Name: udev
 Description: udev
-Version: @VERSION@
+Version: @PACKAGE_VERSION@
 
 udevdir=@udevlibexecdir@
index 70a5fa4d7a2b5ec54549bd783d534f240544332d..69b0b9025c1dc0ea18d70ae6bd03548492fc9260 100644 (file)
@@ -352,7 +352,7 @@ static int trie_store(struct trie *trie, const char *filename) {
         int64_t size;
         struct trie_header_f h = {
                 .signature = HWDB_SIG,
-                .tool_version = htole64(atoi(VERSION)),
+                .tool_version = htole64(atoi(PACKAGE_VERSION)),
                 .header_size = htole64(sizeof(struct trie_header_f)),
                 .node_size = htole64(sizeof(struct trie_node_f)),
                 .child_entry_size = htole64(sizeof(struct trie_child_entry_f)),
index 90cdfa16c7630a58a9ac84e66237e61e707b904a..16b2aab0a19ed5a81af65a2582ecaf05c18c2422 100644 (file)
@@ -376,7 +376,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) {
                         export_prefix = optarg;
                         break;
                 case 'V':
-                        printf("%s\n", VERSION);
+                        printf("%s\n", PACKAGE_VERSION);
                         return 0;
                 case 'h':
                         help();
index 07b667f131965c17ca319c84be61fffa3e6f515e..e8ffe2f309d9161d226cda2298e6ec7ba8590f55 100644 (file)
@@ -59,7 +59,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
                 {}
         };
 
-        log_debug("version %s", VERSION);
+        log_debug("version %s", PACKAGE_VERSION);
 
         while ((c = getopt_long(argc, argv, "a:N:h", options, NULL)) >= 0)
                 switch (c) {
index a6a873e5de7627ef13b0695aa1010f01b5458ed1..492b2f4c256496cd30b28872a102410d291bf65f 100644 (file)
@@ -25,7 +25,7 @@
 #include "udev.h"
 
 static int adm_version(struct udev *udev, int argc, char *argv[]) {
-        printf("%s\n", VERSION);
+        printf("%s\n", PACKAGE_VERSION);
         return 0;
 }
 
index ce2ff89b8548bafab4c561876651f5c8cb0309b8..56b8c1ec55435bf9dd9b22ffdef4c80e8ef56249 100644 (file)
@@ -1492,7 +1492,7 @@ static int parse_argv(int argc, char *argv[]) {
                         help();
                         return 0;
                 case 'V':
-                        printf("%s\n", VERSION);
+                        printf("%s\n", PACKAGE_VERSION);
                         return 0;
                 case '?':
                         return -EINVAL;
@@ -1740,7 +1740,7 @@ int main(int argc, char *argv[]) {
         if (arg_daemonize) {
                 pid_t pid;
 
-                log_info("starting version " VERSION);
+                log_info("starting version " PACKAGE_VERSION);
 
                 /* connect /dev/null to stdin, stdout, stderr */
                 if (log_get_max_level() < LOG_DEBUG) {
index d466e1b759a7c44aeb6b2d5742697a5ea5cff299..06e2d7b71b36e8f73687e84053a8c2a52f661c66 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "alloc-util.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "fs-util.h"
 #include "io-util.h"
 #include "selinux-util.h"
 #include "util.h"
@@ -36,6 +38,7 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
         _cleanup_fclose_ FILE *f = NULL;
         int fd = -1;
         int r;
+        _cleanup_(unlink_and_freep) char *tmp = NULL;
 
         assert(path);
         assert(ts);
@@ -50,20 +53,20 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
         if (r < 0)
                 return log_error_errno(r, "Failed to set SELinux context for %s: %m", path);
 
-        fd = open(path, O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644);
+        fd = open_tmpfile_linkable(path, O_WRONLY|O_CLOEXEC, &tmp);
         mac_selinux_create_file_clear();
 
         if (fd < 0) {
                 if (errno == EROFS)
-                        return log_debug("Can't create timestamp file %s, file system is read-only.", path);
+                        return log_debug("Can't create temporary timestamp file %s, file system is read-only.", tmp);
 
-                return log_error_errno(errno, "Failed to create/open timestamp file %s: %m", path);
+                return log_error_errno(errno, "Failed to create/open temporary timestamp file %s: %m", tmp);
         }
 
         f = fdopen(fd, "we");
         if (!f) {
                 safe_close(fd);
-                return log_error_errno(errno, "Failed to fdopen() timestamp file %s: %m", path);
+                return log_error_errno(errno, "Failed to fdopen() timestamp file %s: %m", tmp);
         }
 
         (void) fprintf(f,
@@ -76,7 +79,15 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
                 return log_error_errno(r, "Failed to write timestamp file: %m");
 
         if (futimens(fd, twice) < 0)
-                return log_error_errno(errno, "Failed to update timestamp on %s: %m", path);
+                return log_error_errno(errno, "Failed to update timestamp on %s: %m", tmp);
+
+        /* fix permissions */
+        (void) fchmod(fd, 0644);
+        r = link_tmpfile(fd, tmp, path);
+        if (r < 0)
+                return log_error_errno(r, "Failed to move \"%s\" to \"%s\": %m", tmp, path);
+
+        tmp = mfree(tmp);
 
         return 0;
 }
diff --git a/src/vconsole/meson.build b/src/vconsole/meson.build
new file mode 100644 (file)
index 0000000..1260b53
--- /dev/null
@@ -0,0 +1,8 @@
+if conf.get('ENABLE_VCONSOLE', false)
+        vconsole_rules = configure_file(
+                input : '90-vconsole.rules.in',
+                output : '90-vconsole.rules',
+                configuration : substs)
+        install_data(vconsole_rules,
+                     install_dir : udevrulesdir)
+endif
index a0ab5990fca7ad838872d47e5de14ab55c43b058..36d04d49c10656107d39d2662ef280b00c470d36 100644 (file)
@@ -99,10 +99,7 @@ static int toggle_utf8(const char *name, int fd, bool utf8) {
 
         r = tcgetattr(fd, &tc);
         if (r >= 0) {
-                if (utf8)
-                        tc.c_iflag |= IUTF8;
-                else
-                        tc.c_iflag &= ~IUTF8;
+                SET_FLAG(tc.c_iflag, IUTF8, utf8);
                 r = tcsetattr(fd, TCSANOW, &tc);
         }
         if (r < 0)
diff --git a/sysctl.d/meson.build b/sysctl.d/meson.build
new file mode 100644 (file)
index 0000000..1b6707d
--- /dev/null
@@ -0,0 +1,21 @@
+install_data(
+        '50-default.conf',
+        install_dir : sysctldir)
+
+in_files = []
+
+if conf.get('ENABLE_COREDUMP', false)
+        in_files += ['50-coredump.conf']
+endif
+
+foreach file : in_files
+        gen = configure_file(
+                input : file + '.in',
+                output : file,
+                configuration : substs)
+        install_data(gen,
+                     install_dir : sysctldir)
+endforeach
+
+meson.add_install_script('sh', '-c',
+                         mkdir_p.format(join_paths(sysconfdir, 'sysctl.d')))
index 6b5349dc8df8e463266aa446695fe83bb18c09c3..3ba4bb760df9a73b143e30407e1429666110a2bb 100644 (file)
@@ -15,7 +15,6 @@ enable getty@.service
 enable systemd-timesyncd.service
 enable systemd-networkd.service
 enable systemd-resolved.service
-enable systemd-networkd-wait-online.service
 
 disable console-getty.service
 disable debug-shell.service
index b2dc5ebd4ffd43304792fcd0943a3aa7b1df7c53..7d6021e855a6e26f15e0b179cb9979c67e0ac059 100644 (file)
@@ -29,6 +29,7 @@ g dialout -     -            -
 g disk    -     -            -
 g input   -     -            -
 g lp      -     -            -
+g kvm     -     -            -
 g tape    -     -            -
 g video   -     -            -
 
diff --git a/sysusers.d/meson.build b/sysusers.d/meson.build
new file mode 100644 (file)
index 0000000..f4662c0
--- /dev/null
@@ -0,0 +1,31 @@
+in_files = ['basic.conf']
+
+enable_sysusers = conf.get('ENABLE_SYSUSERS', false)
+
+foreach file : in_files
+        gen = configure_file(
+                input : file + '.in',
+                output : file,
+                configuration : substs)
+        if enable_sysusers
+                install_data(gen,
+                             install_dir : sysusersdir)
+        endif
+endforeach
+
+m4_files = ['systemd.conf']
+
+if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
+        m4_files += ['systemd-remote.conf']
+endif
+
+foreach file : m4_files
+        custom_target(
+                'sysusers.d/' + file,
+                input : file + '.m4',
+                output: file,
+                command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+                capture : true,
+                install : enable_sysusers,
+                install_dir : sysusersdir)
+endforeach
index fa7e73ce3ad17343c638bef03a5a891b97e028e3..58f67f50fd51b992b1cf32156efe1144ed5fcea2 100644 (file)
@@ -3,7 +3,7 @@ subdirectories named "test/TEST-??-*", which are run one by one.
 
 To run the extended testsuite do the following:
 
-$ make all
+$ make all  # Avoid the "sudo make" below building anything as root
 $ cd test
 $ sudo make clean check
 ...
index e20f47014396257f4e99cebb8f9a2488f8267a7c..c252bdfbad014529e43c038456d82eabf2206db0 100755 (executable)
@@ -67,23 +67,23 @@ EOL
 systemctl start test.socket
 systemctl is-active test.socket
 [[ "$(stat --format='%G' /run/test.socket)" == adm ]]
-echo A | nc -U /run/test.socket
+echo A | nc -w1 -U /run/test.socket
 
 mv $U ${U}.disabled
 systemctl daemon-reload
 systemctl is-active test.socket
 [[ "$(stat --format='%G' /run/test.socket)" == adm ]]
-echo B | nc -U /run/test.socket && exit 1
+echo B | nc -w1 -U /run/test.socket && exit 1
 
 mv ${U}.disabled $U
 systemctl daemon-reload
 systemctl is-active test.socket
-echo C | nc -U /run/test.socket && exit 1
+echo C | nc -w1 -U /run/test.socket && exit 1
 [[ "$(stat --format='%G' /run/test.socket)" == adm ]]
 
 systemctl restart test.socket
 systemctl is-active test.socket
-echo D | nc -U /run/test.socket
+echo D | nc -w1 -U /run/test.socket
 [[ "$(stat --format='%G' /run/test.socket)" == adm ]]
 
 
index 4b7abd24aebf2047742adf3f21853cf888d7734a..402b4f83abd3010901c4ef0b1ced2bf110471eda 100755 (executable)
@@ -1,6 +1,6 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 
-OUTFILE_HEADER = """#!/usr/bin/python3
+OUTFILE_HEADER = """#!/usr/bin/env python3
 #
 # create-sys-script.py
 #
diff --git a/test/meson.build b/test/meson.build
new file mode 100644 (file)
index 0000000..b7fb507
--- /dev/null
@@ -0,0 +1,166 @@
+test_data_files = '''
+        a.service
+        basic.target
+        b.service
+        c.service
+        daughter.service
+        d.service
+        end.service
+        e.service
+        f.service
+        grandchild.service
+        g.service
+        hello-after-sleep.target
+        hello.service
+        h.service
+        parent-deep.slice
+        parent.slice
+        sched_idle_bad.service
+        sched_idle_ok.service
+        sched_rr_bad.service
+        sched_rr_change.service
+        sched_rr_ok.service
+        shutdown.target
+        sleep.service
+        sockets.target
+        son.service
+        sysinit.target
+        testsuite.target
+        timers.target
+        unstoppable.service
+        test-path/paths.target
+        test-path/basic.target
+        test-path/sysinit.target
+        test-path/path-changed.service
+        test-path/path-directorynotempty.service
+        test-path/path-existsglob.service
+        test-path/path-exists.service
+        test-path/path-makedirectory.service
+        test-path/path-modified.service
+        test-path/path-mycustomunit.service
+        test-path/path-service.service
+        test-path/path-changed.path
+        test-path/path-directorynotempty.path
+        test-path/path-existsglob.path
+        test-path/path-exists.path
+        test-path/path-makedirectory.path
+        test-path/path-modified.path
+        test-path/path-unit.path
+        test-execute/exec-environment-empty.service
+        test-execute/exec-environment-multiple.service
+        test-execute/exec-environment.service
+        test-execute/exec-passenvironment-absent.service
+        test-execute/exec-passenvironment-empty.service
+        test-execute/exec-passenvironment-repeated.service
+        test-execute/exec-passenvironment.service
+        test-execute/exec-group.service
+        test-execute/exec-group-nfsnobody.service
+        test-execute/exec-supplementarygroups.service
+        test-execute/exec-supplementarygroups-single-group.service
+        test-execute/exec-supplementarygroups-single-group-user.service
+        test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
+        test-execute/exec-supplementarygroups-multiple-groups-withgid.service
+        test-execute/exec-supplementarygroups-multiple-groups-withuid.service
+        test-execute/exec-dynamicuser-fixeduser.service
+        test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service
+        test-execute/exec-dynamicuser-supplementarygroups.service
+        test-execute/exec-ignoresigpipe-no.service
+        test-execute/exec-ignoresigpipe-yes.service
+        test-execute/exec-personality-x86-64.service
+        test-execute/exec-personality-x86.service
+        test-execute/exec-personality-s390.service
+        test-execute/exec-personality-ppc64.service
+        test-execute/exec-personality-ppc64le.service
+        test-execute/exec-personality-aarch64.service
+        test-execute/exec-privatedevices-no.service
+        test-execute/exec-privatedevices-yes.service
+        test-execute/exec-privatedevices-no-capability-mknod.service
+        test-execute/exec-privatedevices-yes-capability-mknod.service
+        test-execute/exec-protectkernelmodules-no-capabilities.service
+        test-execute/exec-protectkernelmodules-yes-capabilities.service
+        test-execute/exec-protectkernelmodules-yes-mount-propagation.service
+        test-execute/exec-privatetmp-no.service
+        test-execute/exec-privatetmp-yes.service
+        test-execute/exec-readonlypaths.service
+        test-execute/exec-readonlypaths-mount-propagation.service
+        test-execute/exec-readwritepaths-mount-propagation.service
+        test-execute/exec-inaccessiblepaths-mount-propagation.service
+        test-execute/exec-spec-interpolation.service
+        test-execute/exec-systemcallerrornumber.service
+        test-execute/exec-systemcallfilter-failing2.service
+        test-execute/exec-systemcallfilter-failing.service
+        test-execute/exec-systemcallfilter-not-failing2.service
+        test-execute/exec-systemcallfilter-not-failing.service
+        test-execute/exec-systemcallfilter-system-user.service
+        test-execute/exec-systemcallfilter-system-user-nfsnobody.service
+        test-execute/exec-user.service
+        test-execute/exec-user-nfsnobody.service
+        test-execute/exec-workingdirectory.service
+        test-execute/exec-umask-0177.service
+        test-execute/exec-umask-default.service
+        test-execute/exec-privatenetwork-yes.service
+        test-execute/exec-environmentfile.service
+        test-execute/exec-oomscoreadjust-positive.service
+        test-execute/exec-oomscoreadjust-negative.service
+        test-execute/exec-ioschedulingclass-best-effort.service
+        test-execute/exec-ioschedulingclass-idle.service
+        test-execute/exec-ioschedulingclass-none.service
+        test-execute/exec-ioschedulingclass-realtime.service
+        test-execute/exec-capabilityboundingset-invert.service
+        test-execute/exec-capabilityboundingset-merge.service
+        test-execute/exec-capabilityboundingset-reset.service
+        test-execute/exec-capabilityboundingset-simple.service
+        test-execute/exec-capabilityambientset.service
+        test-execute/exec-capabilityambientset-nfsnobody.service
+        test-execute/exec-capabilityambientset-merge.service
+        test-execute/exec-capabilityambientset-merge-nfsnobody.service
+        test-execute/exec-runtimedirectory.service
+        test-execute/exec-runtimedirectory-mode.service
+        test-execute/exec-runtimedirectory-owner.service
+        test-execute/exec-runtimedirectory-owner-nfsnobody.service
+        test-execute/exec-restrict-namespaces-no.service
+        test-execute/exec-restrict-namespaces-yes.service
+        test-execute/exec-restrict-namespaces-mnt.service
+        test-execute/exec-restrict-namespaces-mnt-blacklist.service
+        test-execute/exec-read-only-path-succeed.service
+        test-execute/exec-privatedevices-yes-capability-sys-rawio.service
+        test-execute/exec-privatedevices-no-capability-sys-rawio.service
+        bus-policy/hello.conf
+        bus-policy/methods.conf
+        bus-policy/ownerships.conf
+        bus-policy/signals.conf
+        bus-policy/check-own-rules.conf
+        bus-policy/many-rules.conf
+        bus-policy/test.conf
+        hwdb/10-bad.hwdb
+        journal-data/journal-1.txt
+        journal-data/journal-2.txt
+'''.split()
+
+if conf.get('ENABLE_RESOLVED', false)
+        test_data_files += '''
+                test-resolve/_openpgpkey.fedoraproject.org.pkts
+                test-resolve/fedoraproject.org.pkts
+                test-resolve/gandi.net.pkts
+                test-resolve/google.com.pkts
+                test-resolve/root.pkts
+                test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts
+                test-resolve/teamits.com.pkts
+                test-resolve/zbyszek@fedoraproject.org.pkts
+                test-resolve/_443._tcp.fedoraproject.org.pkts
+                test-resolve/kyhwana.org.pkts
+                test-resolve/fake-caa.pkts
+        '''.split()
+endif
+
+if install_tests
+        foreach file : test_data_files
+                subdir = file.split('/')[0]
+                if subdir == file
+                        subdir = ''
+                endif
+
+                install_data(file,
+                             install_dir : testsdir + '/testdata/' + subdir)
+        endforeach
+endif
index e0dddeb05389bc8cc734b3a9309c595bb3f81384..eee8b65ec01050a8cebcac618228e54398033d41 100755 (executable)
@@ -96,10 +96,20 @@ class NetworkdTestingUtilities:
         dropin_path = os.path.join(dropin_dir, "%s.conf" % dropin_name)
 
         os.makedirs(dropin_dir, exist_ok=True)
+        self.addCleanup(os.rmdir, dropin_dir)
         with open(dropin_path, 'w') as dropin:
             dropin.write(contents)
         self.addCleanup(os.remove, dropin_path)
 
+    def read_attr(self, link, attribute):
+        """Read a link attributed from the sysfs."""
+        # Note we we don't want to check if interface `link' is managed, we
+        # want to evaluate link variable and pass the value of the link to
+        # assert_link_states e.g. eth0=managed.
+        self.assert_link_states(**{link:'managed'})
+        with open(os.path.join('/sys/class/net', link, attribute)) as f:
+            return f.readline().strip()
+
     def assert_link_states(self, **kwargs):
         """Match networkctl link states to the given ones.
 
@@ -140,6 +150,74 @@ class NetworkdTestingUtilities:
             self.fail("Missing links in status output: %s" % interfaces)
 
 
+class BridgeTest(NetworkdTestingUtilities, unittest.TestCase):
+    """Provide common methods for testing networkd against servers."""
+
+    def setUp(self):
+        self.write_network('port1.netdev', '''\
+[NetDev]
+Name=port1
+Kind=dummy
+MACAddress=12:34:56:78:9a:bc''')
+        self.write_network('port2.netdev', '''\
+[NetDev]
+Name=port2
+Kind=dummy
+MACAddress=12:34:56:78:9a:bd''')
+        self.write_network('mybridge.netdev', '''\
+[NetDev]
+Name=mybridge
+Kind=bridge''')
+        self.write_network('port1.network', '''\
+[Match]
+Name=port1
+[Network]
+Bridge=mybridge''')
+        self.write_network('port2.network', '''\
+[Match]
+Name=port2
+[Network]
+Bridge=mybridge''')
+        self.write_network('mybridge.network', '''\
+[Match]
+Name=mybridge
+[Network]
+DNS=192.168.250.1
+Address=192.168.250.33/24
+Gateway=192.168.250.1''')
+        subprocess.check_call(['systemctl', 'start', 'systemd-networkd'])
+
+    def tearDown(self):
+        subprocess.check_call(['systemctl', 'stop', 'systemd-networkd'])
+        subprocess.check_call(['ip', 'link', 'del', 'mybridge'])
+        subprocess.check_call(['ip', 'link', 'del', 'port1'])
+        subprocess.check_call(['ip', 'link', 'del', 'port2'])
+
+    def test_bridge_init(self):
+        self.assert_link_states(
+            port1='managed',
+            port2='managed',
+            mybridge='managed')
+
+    def test_bridge_port_priority(self):
+        self.assertEqual(self.read_attr('port1', 'brport/priority'), '32')
+        self.write_network_dropin('port1.network', 'priority', '''\
+[Bridge]
+Priority=28
+''')
+        subprocess.check_call(['systemctl', 'restart', 'systemd-networkd'])
+        self.assertEqual(self.read_attr('port1', 'brport/priority'), '28')
+
+    def test_bridge_port_priority_set_zero(self):
+        """It should be possible to set the bridge port priority to 0"""
+        self.assertEqual(self.read_attr('port2', 'brport/priority'), '32')
+        self.write_network_dropin('port2.network', 'priority', '''\
+[Bridge]
+Priority=0
+''')
+        subprocess.check_call(['systemctl', 'restart', 'systemd-networkd'])
+        self.assertEqual(self.read_attr('port2', 'brport/priority'), '0')
+
 class ClientTestBase(NetworkdTestingUtilities):
     """Provide common methods for testing networkd against servers."""
 
index dab01f1d8aca4afb52bbc385f122859ac1336e1a..14739df49321cba8a3194b004bdb9434260fb79e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # Simple udev rules syntax checker
 #
 # (C) 2010 Canonical Ltd.
index a9c0046667c8e354a62fc28fb351a4a7375731ec..6c9ee5ff834c24261bce654a5539ff92f091a75e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #
 # sys-script.py
 #
index 16ea65690a2b9f87832228c8d0776dbc0acd273f..d116fffe38fdb2ec16c6e4df08460475ecac2ad6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #
 # systemd-sysv-generator integration test
 #
index cd4699dc187eb4d1c5705d4655ca9f36f221be57..0216c83c12d844d794e68cd7a34f6f234a095181 100755 (executable)
@@ -1,30 +1,38 @@
 #!/bin/bash -e
 
+out="$1"
+systemd_efi="$2"
+boot_stub="$3"
+splash_bmp="$4"
+if [ -z "$out" -o -z "$systemd_efi" -o -z "$boot_stub" -o -z "$splash_bmp" ]; then
+        exit 1
+fi
+
 # create GPT table with EFI System Partition
-rm -f test-efi-disk.img
-dd if=/dev/null of=test-efi-disk.img bs=1M seek=512 count=1
-parted --script test-efi-disk.img "mklabel gpt" "mkpart ESP fat32 1MiB 511MiB" "set 1 boot on"
+rm -f "$out"
+dd if=/dev/null of="$out" bs=1M seek=512 count=1 status=none
+parted --script "$out" "mklabel gpt" "mkpart ESP fat32 1MiB 511MiB" "set 1 boot on"
 
 # create FAT32 file system
-LOOP=$(losetup --show -f -P test-efi-disk.img)
+LOOP=$(losetup --show -f -P "$out")
 mkfs.vfat -F32 ${LOOP}p1
 mkdir -p mnt
 mount ${LOOP}p1 mnt
 
 mkdir -p mnt/EFI/{BOOT,systemd}
-cp systemd-bootx64.efi mnt/EFI/BOOT/BOOTX64.efi
+cp "$systemd_efi" mnt/EFI/BOOT/BOOTX64.efi
 
 [ -e /boot/shellx64.efi ] && cp /boot/shellx64.efi mnt/
 
 mkdir mnt/EFI/Linux
-echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" > mnt/cmdline.txt
+echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt
 objcopy \
-  --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
-  --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
-  --add-section .splash=test/splash.bmp --change-section-vma .splash=0x40000 \
-  --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \
-  --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \
-  linuxx64.efi.stub mnt/EFI/Linux/linux-test.efi
+        --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
+        --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
+        --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \
+        --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \
+        --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \
+        "$boot_stub" mnt/EFI/Linux/linux-test.efi
 
 # install entries
 mkdir -p mnt/loader/entries
diff --git a/test/test-exec-deserialization.py b/test/test-exec-deserialization.py
new file mode 100755 (executable)
index 0000000..39a9e62
--- /dev/null
@@ -0,0 +1,192 @@
+#!/usr/bin/env python3
+
+#
+#  Copyright 2017 Michal Sekletar <msekleta@redhat.com>
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+#
+#  systemd is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public License
+#  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+# ATTENTION: This uses the *installed* systemd, not the one from the built
+# source tree.
+
+import unittest
+import time
+import os
+import tempfile
+import subprocess
+
+from enum import Enum
+
+class UnitFileChange(Enum):
+    NO_CHANGE = 0
+    LINES_SWAPPED = 1
+    COMMAND_ADDED_BEFORE = 2
+    COMMAND_ADDED_AFTER = 3
+    COMMAND_INTERLEAVED = 4
+    REMOVAL = 5
+
+class ExecutionResumeTest(unittest.TestCase):
+    def setUp(self):
+        self.unit = 'test-issue-518.service'
+        self.unitfile_path = '/run/systemd/system/{0}'.format(self.unit)
+        self.output_file = tempfile.mktemp()
+        self.unit_files = {}
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/sleep 2
+        ExecStart=/bin/bash -c "echo foo >> {0}"
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.NO_CHANGE] = unit_file_content
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/bash -c "echo foo >> {0}"
+        ExecStart=/bin/sleep 2
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.LINES_SWAPPED] = unit_file_content
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/bash -c "echo bar >> {0}"
+        ExecStart=/bin/sleep 2
+        ExecStart=/bin/bash -c "echo foo >> {0}"
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.COMMAND_ADDED_BEFORE] = unit_file_content
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/sleep 2
+        ExecStart=/bin/bash -c "echo foo >> {0}"
+        ExecStart=/bin/bash -c "echo bar >> {0}"
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.COMMAND_ADDED_AFTER] = unit_file_content
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/bash -c "echo baz >> {0}"
+        ExecStart=/bin/sleep 2
+        ExecStart=/bin/bash -c "echo foo >> {0}"
+        ExecStart=/bin/bash -c "echo bar >> {0}"
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.COMMAND_INTERLEAVED] = unit_file_content
+
+        unit_file_content = '''
+        [Service]
+        Type=oneshot
+        ExecStart=/bin/bash -c "echo bar >> {0}"
+        ExecStart=/bin/bash -c "echo baz >> {0}"
+        '''.format(self.output_file)
+        self.unit_files[UnitFileChange.REMOVAL] = unit_file_content
+
+    def reload(self):
+        subprocess.check_call(['systemctl', 'daemon-reload'])
+
+    def write_unit_file(self, unit_file_change):
+        if not isinstance(unit_file_change, UnitFileChange):
+            raise ValueError('Unknown unit file change')
+
+        content = self.unit_files[unit_file_change]
+
+        with open(self.unitfile_path, 'w') as f:
+            f.write(content)
+
+        self.reload()
+
+    def check_output(self, expected_output):
+        try:
+            with open(self.output_file, 'r') as log:
+                output = log.read()
+        except IOError:
+            self.fail()
+
+        self.assertEqual(output, expected_output)
+
+    def setup_unit(self):
+        self.write_unit_file(UnitFileChange.NO_CHANGE)
+        subprocess.check_call(['systemctl', '--job-mode=replace', '--no-block', 'start', self.unit])
+
+    def test_no_change(self):
+        expected_output = 'foo\n'
+
+        self.setup_unit()
+        self.reload()
+        time.sleep(4)
+
+        self.check_output(expected_output)
+
+    def test_swapped(self):
+        expected_output = ''
+
+        self.setup_unit()
+        self.write_unit_file(UnitFileChange.LINES_SWAPPED)
+        self.reload()
+        time.sleep(4)
+
+        self.assertTrue(not os.path.exists(self.output_file))
+
+    def test_added_before(self):
+        expected_output = 'foo\n'
+
+        self.setup_unit()
+        self.write_unit_file(UnitFileChange.COMMAND_ADDED_BEFORE)
+        self.reload()
+        time.sleep(4)
+
+        self.check_output(expected_output)
+
+    def test_added_after(self):
+        expected_output = 'foo\nbar\n'
+
+        self.setup_unit()
+        self.write_unit_file(UnitFileChange.COMMAND_ADDED_AFTER)
+        self.reload()
+        time.sleep(4)
+
+        self.check_output(expected_output)
+
+    def test_interleaved(self):
+        expected_output = 'foo\nbar\n'
+
+        self.setup_unit()
+        self.write_unit_file(UnitFileChange.COMMAND_INTERLEAVED)
+        self.reload()
+        time.sleep(4)
+
+        self.check_output(expected_output)
+
+    def test_removal(self):
+        self.setup_unit()
+        self.write_unit_file(UnitFileChange.REMOVAL)
+        self.reload()
+        time.sleep(4)
+
+        self.assertTrue(not os.path.exists(self.output_file))
+
+    def tearDown(self):
+        for f in [self.output_file, self.unitfile_path]:
+            try:
+                os.remove(f)
+            except OSError:
+                # ignore error if log file doesn't exist
+                pass
+
+        self.reload()
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/tmpfiles.d/meson.build b/tmpfiles.d/meson.build
new file mode 100644 (file)
index 0000000..d68d17e
--- /dev/null
@@ -0,0 +1,43 @@
+enable_tmpfiles = conf.get('ENABLE_TMPFILES', false)
+
+tmpfiles = [['home.conf',            ''],
+            ['journal-nocow.conf',   ''],
+            ['systemd-nologin.conf', ''],
+            ['systemd-nspawn.conf',  ''],
+            ['systemd-remote.conf',  'ENABLE_REMOTE'],
+            ['tmp.conf',             ''],
+            ['var.conf',             ''],
+            ['x11.conf',             ''],
+            ['legacy.conf',          'HAVE_SYSV_COMPAT'],
+           ]
+
+foreach pair : tmpfiles
+        if not enable_tmpfiles
+                # do nothing
+        elif pair[1] == '' or conf.get(pair[1], false)
+                install_data(pair[0], install_dir : tmpfilesdir)
+        else
+                message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
+                        .format(pair[0], pair[1], conf.get(pair[1], 0)))
+        endif
+endforeach
+
+m4_files = ['etc.conf',
+            'systemd.conf']
+
+foreach file : m4_files
+        custom_target(
+                'tmpfiles.d/' + file,
+                input : file + '.m4',
+                output: file,
+                command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+                capture : true,
+                install : enable_tmpfiles,
+                install_dir : tmpfilesdir)
+endforeach
+
+if enable_tmpfiles
+        meson.add_install_script(
+                'sh', '-c',
+                mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
+endif
old mode 100644 (file)
new mode 100755 (executable)
index b220060..357e498
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 # This file is part of systemd. It is distrubuted under the MIT license, see
index d20016e0058b37993844a8c0ef7d57ca74164fa5..62ce8006f53ab4eef89a87775625f1ee34fcc573 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #  -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 #  This file is part of systemd.
index 8ce09ca2fa078a988ceb68eb87552fc86dfa56b7..1b287997fa7e6839e665b2498506020309a07b76 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #  -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 #  This file is part of systemd.
index 50ad9532cdc57e3dd885107b6e6e04da86b51c0d..abc33e7394d9a8251c94cc278d920a8afe75d79a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #  -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 #  This file is part of systemd.
old mode 100644 (file)
new mode 100755 (executable)
index 18aa513..e9e39f1
@@ -1,9 +1,9 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #  -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 #  This file is part of systemd.
 #
-#  Copyright 2013 Zbigniew Jędrzejewski-Szmek
+#  Copyright 2013, 2017 Zbigniew Jędrzejewski-Szmek
 #
 #  systemd is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU Lesser General Public License as published by
@@ -22,6 +22,7 @@ from __future__ import print_function
 import collections
 import sys
 import os.path
+import pprint
 from xml_helper import *
 
 SECTION = '''\
@@ -66,11 +67,13 @@ EXTRA_DIST += \\
        {dist_files}
 '''
 
+meson = False
+
 def man(page, number):
-    return 'man/{}.{}'.format(page, number)
+    return ('man/' if not meson else '') + '{}.{}'.format(page, number)
 
 def xml(file):
-    return 'man/{}'.format(os.path.basename(file))
+    return ('man/' if not meson else '') + os.path.basename(file)
 
 def add_rules(rules, name):
     xml = xml_parse(name)
@@ -122,9 +125,40 @@ def make_makefile(rules, dist_files):
         for conditional,rulegroup in sorted(rules.items())
         ) + FOOTER.format(dist_files=mjoin(sorted(dist_files)))
 
+MESON_HEADER = '''\
+# Do not edit. Generated by make-man-rules.py.
+manpages = ['''
+
+MESON_FOOTER = '''\
+]
+# Really, do not edit.'''
+
+def make_mesonfile(rules, dist_files):
+    # reformat rules as
+    # grouped = [ [name, section, [alias...], condition], ...]
+    #
+    # but first create a dictionary like
+    # lists = { (name, condition) => [alias...]
+    grouped = collections.defaultdict(list)
+    for condition, items in rules.items():
+        for alias, name in items.items():
+            group = grouped[(name, condition)]
+            if name != alias:
+                group.append(alias)
+
+    lines = [ [p[0][:-2], p[0][-1], sorted(a[:-2] for a in aliases), p[1]]
+              for p, aliases in sorted(grouped.items()) ]
+    return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
+
 if __name__ == '__main__':
-    rules = create_rules(sys.argv[1:])
-    dist_files = (xml(file) for file in sys.argv[1:]
+    meson = sys.argv[1] == '--meson'
+    pages = sys.argv[1+meson:]
+
+    rules = create_rules(pages)
+    dist_files = (xml(file) for file in pages
                   if not file.endswith(".directives.xml") and
                      not file.endswith(".index.xml"))
-    print(make_makefile(rules, dist_files), end='')
+    if meson:
+        print(make_mesonfile(rules, dist_files))
+    else:
+        print(make_makefile(rules, dist_files), end='')
diff --git a/tools/meson-check-compilation.sh b/tools/meson-check-compilation.sh
new file mode 100755 (executable)
index 0000000..d3b2a31
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh -eu
+
+"$@" '-' -o/dev/null </dev/null
diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh
new file mode 100755 (executable)
index 0000000..47a5099
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh -eu
+
+# output width
+if "$1"  --help | grep -v 'default:' | grep -E -q '.{80}.'; then
+        echo "$(basename "$1") --help output is too wide:"
+        "$1"  --help | awk 'length > 80' | grep -E --color=yes '.{80}'
+        exit 1
+fi
+
+# no --help output to stdout
+if "$1" --help 2>&1 1>/dev/null | grep .; then
+        echo "$(basename "$1") --help prints to stderr"
+        exit 2
+fi
+
+# error output to stderr
+if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
+        echo "$(basename "$1") with an unknown parameter does not print to stderr"
+        exit 3
+fi
diff --git a/tools/meson-git-contrib.sh b/tools/meson-git-contrib.sh
new file mode 100755 (executable)
index 0000000..1c614ef
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -eu
+
+git shortlog -s `git describe --abbrev=0`.. | \
+        cut -c8- | \
+        sed 's/ / /g' | \
+        awk '{ print $$0 "," }' | \
+        sort -u
diff --git a/tools/meson-hwdb-update.sh b/tools/meson-hwdb-update.sh
new file mode 100755 (executable)
index 0000000..4c91907
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh -eu
+
+cd "$1"
+
+curl -L -o usb.ids 'http://www.linux-usb.org/usb.ids'
+curl -L -o pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids'
+curl -L -o ma-large.txt 'http://standards-oui.ieee.org/oui/oui.txt'
+curl -L -o ma-medium.txt 'http://standards-oui.ieee.org/oui28/mam.txt'
+curl -L -o ma-small.txt 'http://standards-oui.ieee.org/oui36/oui36.txt'
+curl -L -o pnp_id_registry.html 'http://www.uefi.org/uefi-pnp-export'
+curl -L -o acpi_id_registry.html 'http://www.uefi.org/uefi-acpi-export'
+./ids-update.pl
+./acpi-update.py > 20-acpi-vendor.hwdb.base
+patch -p0 -o- 20-acpi-vendor.hwdb.base <20-acpi-vendor.hwdb.patch >20-acpi-vendor.hwdb
+diff -u 20-acpi-vendor.hwdb.base 20-acpi-vendor.hwdb >20-acpi-vendor.hwdb.patch
diff --git a/tools/meson-link-test.c b/tools/meson-link-test.c
new file mode 100644 (file)
index 0000000..825bbff
--- /dev/null
@@ -0,0 +1 @@
+int main(void) {return 0;}
diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
new file mode 100755 (executable)
index 0000000..47a5e70
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh -eu
+
+# this is needed mostly because $DESTDIR is provided as a variable,
+# and we need to create the target directory...
+
+mkdir -vp "$(dirname "${DESTDIR:-}$2")"
+if [ "$(dirname $1)" = . ]; then
+        ln -vfs -T "$1" "${DESTDIR:-}$2"
+else
+        ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+fi
old mode 100644 (file)
new mode 100755 (executable)
index b2c0369..0088be5
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #  -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
 #
 #  This file is part of systemd.
index da68eb8faa0284f7e1bfd52d0c8a883364d07355..e9eb238b98f047ae90cd5a7fb6021be1df430f7b 100644 (file)
@@ -17,9 +17,7 @@ Before=shutdown.target
 [Service]
 Environment=HOME=/root
 WorkingDirectory=-/root
-ExecStartPre=-/bin/plymouth --wait quit
-ExecStartPre=-/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+ExecStart=-@rootlibexecdir@/systemd-sulogin-shell emergency
 Type=idle
 StandardInput=tty-force
 StandardOutput=inherit
diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
new file mode 100755 (executable)
index 0000000..dfd287e
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh -eu
+
+unitdir="$1"
+target="$2"
+unit="$3"
+
+case "$target" in
+        */?*) # a path, but not just a slash at the end
+                dir="${DESTDIR:-}${target}"
+                ;;
+        *)
+                dir="${DESTDIR:-}${unitdir}/${target}"
+                ;;
+esac
+
+unitpath="${DESTDIR:-}${unitdir}/${unit}"
+
+case "$target" in
+        */)
+                mkdir -p -m 0755 "$dir"
+                ;;
+        *)
+                mkdir -p -m 0755 "$(basename "$dir")"
+                ;;
+esac
+
+ln -vfs --relative "$unitpath" "$dir"
diff --git a/units/meson.build b/units/meson.build
new file mode 100644 (file)
index 0000000..6fb1fa2
--- /dev/null
@@ -0,0 +1,329 @@
+units = [
+        ['basic.target',                        ''],
+        ['bluetooth.target',                    ''],
+        ['cryptsetup-pre.target',               'HAVE_LIBCRYPTSETUP'],
+        ['cryptsetup.target',                   'HAVE_LIBCRYPTSETUP',
+         'sysinit.target.wants/'],
+        ['dev-hugepages.mount',                 '',
+         'sysinit.target.wants/'],
+        ['dev-mqueue.mount',                    '',
+         'sysinit.target.wants/'],
+        ['emergency.target',                    ''],
+        ['exit.target',                         ''],
+        ['final.target',                        ''],
+        ['getty.target',                        '',
+         'multi-user.target.wants/'],
+        ['graphical.target',                    '',
+         'runlevel5.target default.target'],
+        ['halt.target',                         ''],
+        ['hibernate.target',                    'ENABLE_HIBERNATE'],
+        ['hybrid-sleep.target',                 'ENABLE_HIBERNATE'],
+        ['initrd-fs.target',                    ''],
+        ['initrd-root-device.target',           ''],
+        ['initrd-root-fs.target',               ''],
+        ['initrd-switch-root.target',           ''],
+        ['initrd.target',                       ''],
+        ['kexec.target',                        ''],
+        ['ldconfig.service',                    'ENABLE_LDCONFIG',
+         'sysinit.target.wants/'],
+        ['local-fs-pre.target',                 ''],
+        ['local-fs.target',                     ''],
+        ['machine.slice',                       'ENABLE_MACHINED'],
+        ['machines.target',                     'ENABLE_MACHINED',
+         join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
+        ['multi-user.target',                   '',
+         'runlevel2.target runlevel3.target runlevel4.target'],
+        ['network-online.target',               ''],
+        ['network-pre.target',                  ''],
+        ['network.target',                      ''],
+        ['nss-lookup.target',                   ''],
+        ['nss-user-lookup.target',              ''],
+        ['paths.target',                        ''],
+        ['poweroff.target',                     '',
+         'runlevel0.target'],
+        ['printer.target',                      ''],
+        ['proc-sys-fs-binfmt_misc.automount',   'ENABLE_BINFMT',
+         'sysinit.target.wants/'],
+        ['proc-sys-fs-binfmt_misc.mount',       'ENABLE_BINFMT'],
+        ['reboot.target',                       '',
+         'runlevel6.target ctrl-alt-del.target'],
+        ['remote-fs-pre.target',                ''],
+        ['remote-fs.target',                    '',
+         join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
+        ['rescue.target',                       '',
+         'runlevel1.target'],
+        ['rpcbind.target',                      ''],
+        ['shutdown.target',                     ''],
+        ['sigpwr.target',                       ''],
+        ['sleep.target',                        ''],
+        ['slices.target',                       ''],
+        ['smartcard.target',                    ''],
+        ['sockets.target',                      ''],
+        ['sound.target',                        ''],
+        ['suspend.target',                      ''],
+        ['swap.target',                         ''],
+        ['sys-fs-fuse-connections.mount',       '',
+         'sysinit.target.wants/'],
+        ['sys-kernel-config.mount',             '',
+         'sysinit.target.wants/'],
+        ['sys-kernel-debug.mount',              '',
+         'sysinit.target.wants/'],
+        ['sysinit.target',                      ''],
+        ['syslog.socket',                       ''],
+        ['system-update.target',                ''],
+        ['system.slice',                        ''],
+        ['systemd-ask-password-console.path',   '',
+         'sysinit.target.wants/'],
+        ['systemd-ask-password-wall.path',      '',
+         'multi-user.target.wants/'],
+        ['systemd-coredump.socket',             'ENABLE_COREDUMP',
+         'sockets.target.wants/'],
+        ['systemd-initctl.socket',              '',
+         'sockets.target.wants/'],
+        ['systemd-journal-gatewayd.socket',     'ENABLE_REMOTE HAVE_MICROHTTPD'],
+        ['systemd-journal-remote.socket',       'ENABLE_REMOTE HAVE_MICROHTTPD'],
+        ['systemd-journald-audit.socket',       '',
+         'sockets.target.wants/'],
+        ['systemd-journald-dev-log.socket',     '',
+         'sockets.target.wants/'],
+        ['systemd-journald.socket',             '',
+         'sockets.target.wants/'],
+        ['systemd-networkd.socket',             '',
+         join_paths(pkgsysconfdir, 'system/sockets.target.wants/')],
+        ['systemd-rfkill.socket',               'ENABLE_RFKILL'],
+        ['systemd-tmpfiles-clean.timer',        '',
+         'timers.target.wants/'],
+        ['systemd-udevd-control.socket',        '',
+         'sockets.target.wants/'],
+        ['systemd-udevd-kernel.socket',         '',
+         'sockets.target.wants/'],
+        ['time-sync.target',                    ''],
+        ['timers.target',                       ''],
+        ['umount.target',                       ''],
+        ['user.slice',                          ''],
+        ['var-lib-machines.mount',              '',
+         'local-fs.target.wants/'],
+]
+
+in_units = [
+        ['debug-shell.service',                  ''],
+        ['emergency.service',                    ''],
+        ['halt-local.service',                   'HAVE_SYSV_COMPAT'],
+        ['initrd-cleanup.service',               ''],
+        ['initrd-parse-etc.service',             ''],
+        ['initrd-switch-root.service',           ''],
+        ['initrd-udevadm-cleanup-db.service',    ''],
+        ['kmod-static-nodes.service',            'HAVE_KMOD ENABLE_TMPFILES',
+         'sysinit.target.wants/'],
+        ['quotaon.service',                      'ENABLE_QUOTACHECK'],
+        ['rc-local.service',                     'HAVE_SYSV_COMPAT'],
+        ['rescue.service',                       ''],
+        ['system-update-cleanup.service',        ''],
+        ['systemd-ask-password-console.service', ''],
+        ['systemd-ask-password-wall.service',    ''],
+        ['systemd-backlight@.service',           'ENABLE_BACKLIGHT'],
+        ['systemd-binfmt.service',               'ENABLE_BINFMT',
+         'sysinit.target.wants/'],
+        ['systemd-coredump@.service',            'ENABLE_COREDUMP'],
+        ['systemd-exit.service',                 ''],
+        ['systemd-firstboot.service',            'ENABLE_FIRSTBOOT',
+         'sysinit.target.wants/'],
+        ['systemd-fsck-root.service',            ''],
+        ['systemd-fsck@.service',                ''],
+        ['systemd-halt.service',                 ''],
+        ['systemd-hibernate-resume@.service',    'ENABLE_HIBERNATE'],
+        ['systemd-hibernate.service',            'ENABLE_HIBERNATE'],
+        ['systemd-hybrid-sleep.service',         'ENABLE_HIBERNATE'],
+        ['systemd-hostnamed.service',            'ENABLE_HOSTNAMED',
+         'dbus-org.freedesktop.hostname1.service'],
+        ['systemd-hwdb-update.service',          'ENABLE_HWDB',
+         'sysinit.target.wants/'],
+        ['systemd-importd.service',              'ENABLE_IMPORTD',
+         'dbus-org.freedesktop.import1.service'],
+        ['systemd-initctl.service',               ''],
+        ['systemd-journal-catalog-update.service', '',
+         'sysinit.target.wants/'],
+        ['systemd-journal-flush.service',         '',
+         'sysinit.target.wants/'],
+        ['systemd-journal-gatewayd.service',     'ENABLE_REMOTE HAVE_MICROHTTPD'],
+        ['systemd-journal-remote.service',       'ENABLE_REMOTE HAVE_MICROHTTPD'],
+        ['systemd-journal-upload.service',       'ENABLE_REMOTE HAVE_LIBCURL'],
+        ['systemd-journald.service',             '',
+         'sysinit.target.wants/'],
+        ['systemd-kexec.service',                ''],
+        ['systemd-localed.service',              'ENABLE_LOCALED',
+         'dbus-org.freedesktop.locale1.service'],
+        ['systemd-logind.service',               'ENABLE_LOGIND',
+         'multi-user.target.wants/ dbus-org.freedesktop.login1.service'],
+        ['systemd-machine-id-commit.service',    '',
+         'sysinit.target.wants/'],
+        ['systemd-machined.service',             'ENABLE_MACHINED',
+         'dbus-org.freedesktop.machine1.service'],
+        ['systemd-modules-load.service',         'HAVE_KMOD',
+         'sysinit.target.wants/'],
+        ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD',
+         join_paths(pkgsysconfdir, 'system/network-online.target.wants/')],
+        ['systemd-nspawn@.service',              ''],
+        ['systemd-poweroff.service',             ''],
+        ['systemd-quotacheck.service',           'ENABLE_QUOTACHECK'],
+        ['systemd-random-seed.service',          'ENABLE_RANDOMSEED',
+         'sysinit.target.wants/'],
+        ['systemd-reboot.service',               ''],
+        ['systemd-remount-fs.service',           '',
+         'local-fs.target.wants/'],
+        ['systemd-rfkill.service',               'ENABLE_RFKILL'],
+        ['systemd-suspend.service',              ''],
+        ['systemd-sysctl.service',               '',
+         'sysinit.target.wants/'],
+        ['systemd-sysusers.service',             'ENABLE_SYSUSERS',
+         'sysinit.target.wants/'],
+        ['systemd-timedated.service',            'ENABLE_TIMEDATED',
+         'dbus-org.freedesktop.timedate1.service'],
+        ['systemd-timesyncd.service',            'ENABLE_TIMESYNCD',
+         join_paths(pkgsysconfdir, 'system/sysinit.target.wants/')],
+        ['systemd-tmpfiles-clean.service',       'ENABLE_TMPFILES'],
+        ['systemd-tmpfiles-setup-dev.service',   'ENABLE_TMPFILES',
+         'sysinit.target.wants/'],
+        ['systemd-tmpfiles-setup.service',       'ENABLE_TMPFILES',
+         'sysinit.target.wants/'],
+        ['systemd-udev-settle.service',          ''],
+        ['systemd-udev-trigger.service',         '',
+         'sysinit.target.wants/'],
+        ['systemd-udevd.service',                '',
+         'sysinit.target.wants/'],
+        ['systemd-update-done.service',          '',
+         'sysinit.target.wants/'],
+        ['systemd-update-utmp-runlevel.service', 'HAVE_UTMP HAVE_SYSV_COMPAT',
+         'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'],
+        ['systemd-update-utmp.service',          'HAVE_UTMP',
+         'sysinit.target.wants/'],
+        ['systemd-user-sessions.service',        '',
+         'multi-user.target.wants/'],
+        ['systemd-vconsole-setup.service',       'ENABLE_VCONSOLE'],
+        ['systemd-volatile-root.service',        ''],
+]
+
+m4_units = [
+        ['getty@.service',                     '',
+         'autovt@.service ' +
+         join_paths(pkgsysconfdir, 'system/getty.target.wants/getty@tty1.service')],
+        ['serial-getty@.service',              ''],
+        ['tmp.mount',                          '',
+         'local-fs.target.wants/'],
+]
+
+m4_in_units = [
+        ['console-getty.service',              ''],
+        ['container-getty@.service',           ''],
+        ['systemd-networkd.service',           'ENABLE_NETWORKD',
+         join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.network1.service') + ' ' +
+         join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
+        ['systemd-resolved.service',           'ENABLE_RESOLVED',
+         join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.resolve1.service') + ' ' +
+         join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
+        ['user@.service',                      ''],
+]
+
+foreach tuple : m4_in_units
+        file = tuple[0]
+
+        gen = configure_file(
+                input : file + '.m4.in',
+                output : file + '.m4',
+                configuration : substs)
+
+        m4_units += [[file, tuple.get(1, ''), tuple.get(2, ''), gen]]
+endforeach
+
+foreach tuple : in_units
+        file = tuple[0]
+
+        # we do this here because install_data does not accept custom_target output
+        conds = tuple[1].split(' ')
+        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
+                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+
+        gen1 = configure_file(
+                input : file + '.in',
+                output : file + '.tmp',
+                configuration : substs)
+        gen2 = custom_target(
+                file,
+                input : gen1,
+                output : file,
+                command : [sed, '/^## /d', '@INPUT@'],
+                capture : true,
+                install : install,
+                install_dir : systemunitdir)
+
+        if install and tuple.length() > 2
+                foreach target : tuple[2].split()
+                        meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
+                endforeach
+        endif
+endforeach
+
+foreach tuple : m4_units
+        file = tuple[0]
+        input = tuple.get(3, file + '.m4')
+
+        # we do this here because install_data does not accept custom_target output
+        conds = tuple[1].split(' ')
+        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
+                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+
+        custom_target(
+                file,
+                input : input,
+                output: file,
+                command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+                capture : true,
+                install : install,
+                install_dir : systemunitdir)
+
+        if tuple.length() > 2 and install
+                foreach target : tuple[2].split()
+                        meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
+                endforeach
+        endif
+endforeach
+
+foreach tuple : units
+        file = tuple[0]
+        input = tuple.get(3, file)
+
+        conds = tuple[1].split(' ')
+        install = ((conds.get(0, '') == '' or conf.get(conds[0], false)) and
+                   (conds.get(1, '') == '' or conf.get(conds[1], false)))
+
+        if install
+                install_data(input,
+                             install_dir : systemunitdir)
+
+                if tuple.length() > 2
+                        foreach target : tuple[2].split()
+                                meson.add_install_script(
+                                        'meson-add-wants.sh', systemunitdir, target, file)
+                        endforeach
+                endif
+        endif
+endforeach
+
+############################################################
+
+meson.add_install_script(meson_make_symlink,
+                         join_paths(pkgsysconfdir, 'user'),
+                         join_paths(sysconfdir, 'xdg/systemd/user'))
+meson.add_install_script(meson_make_symlink,
+                         join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'),
+                         join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service'))
+if conf.get('HAVE_SYSV_COMPAT', false)
+        foreach i : [1, 2, 3, 4, 5]
+                meson.add_install_script(
+                        'sh', '-c',
+                        mkdir_p
+                        .format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i))))
+        endforeach
+endif
+
+subdir('user')
index 7d59a4019547f6f7eff6ce06c113b638b675d880..f3e1e270c984cdbf52dd33411dab986c7dd9d54a 100644 (file)
@@ -10,7 +10,7 @@ Description=Enable File System Quotas
 Documentation=man:quotaon(8)
 DefaultDependencies=no
 After=systemd-quotacheck.service
-Before=local-fs.target shutdown.target
+Before=remote-fs.target shutdown.target
 ConditionPathExists=@QUOTAON@
 
 [Service]
index 5feff69c89a9335668469c6b049bd654dc61f8e8..4ab66f48560a55d8caa1eb03102481a34b64ed46 100644 (file)
@@ -16,9 +16,7 @@ Before=shutdown.target
 [Service]
 Environment=HOME=/root
 WorkingDirectory=-/root
-ExecStartPre=-/bin/plymouth --wait quit
-ExecStartPre=-/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+ExecStart=-@rootlibexecdir@/systemd-sulogin-shell rescue
 Type=idle
 StandardInput=tty-force
 StandardOutput=inherit
index 4522d0d2be30d499194f5e3006be92d134141f87..609c5b62ee2bfc14d2a2d1b9c341bf9250493f4e 100644 (file)
@@ -21,6 +21,12 @@ After=rc-local.service
 Before=getty.target
 IgnoreOnIsolate=yes
 
+# IgnoreOnIsolate causes issues with sulogin, if someone isolates
+# rescue.target or starts rescue.service from multi-user.target or
+# graphical.target.
+Conflicts=rescue.service
+Before=rescue.service
+
 [Service]
 ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
 Type=idle
index b9eab2154280b57c2b3b746fa1a95fd59f15e644..d00b9292117376d19f46c9c6e813d40ead4f4d74 100644 (file)
@@ -28,6 +28,7 @@ RestrictRealtime=yes
 RestrictNamespaces=yes
 RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
 SystemCallArchitectures=native
+ReadWritePaths=/var/lib/systemd/journal-upload
 
 # If there are many split up journal files we need a lot of fds to
 # access them all and combine
index 64253f59d4c9df4650d8cab0c53741dc1018db94..66b7c6a48e1e691b46989433776677aef251d9dc 100644 (file)
@@ -19,7 +19,6 @@ Sockets=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald
 ExecStart=@rootlibexecdir@/systemd-journald
 Restart=always
 RestartSec=0
-NotifyAccess=all
 StandardOutput=null
 WatchdogSec=3min
 FileDescriptorStoreMax=1024
index c3f153046a88c0575f5f68df4cdd58ddb1298d0a..15e6ad99d8a7e6bf191789e6f433b4b0e4742280 100644 (file)
@@ -42,3 +42,10 @@ ReadWritePaths=/run/systemd
 [Install]
 WantedBy=multi-user.target
 Also=systemd-networkd.socket
+Alias=dbus-org.freedesktop.network1.service
+
+# We want to enable systemd-networkd-wait-online.service whenever this service
+# is enabled. systemd-networkd-wait-online.service has
+# WantedBy=network-online.target, so enabling it only has an effect if
+# network-online.target itself is enabled or pulled in by some other unit.
+Also=systemd-networkd-wait-online.service
index 5cb9bc3bc98d26c9019f11812aa63270b520fb41..6b1999aa516a8206f8c4321afa9638fd92fbed01 100644 (file)
@@ -10,7 +10,7 @@ Description=File System Quota Check
 Documentation=man:systemd-quotacheck.service(8)
 DefaultDependencies=no
 After=systemd-remount-fs.service
-Before=local-fs.target shutdown.target
+Before=remote-fs.target shutdown.target
 ConditionPathExists=@QUOTACHECK@
 
 [Service]
index 70491e0751f254e6fc4f142359119b299a7c196f..6c22893ed7db0109031f7d3127ff94597b710cb1 100644 (file)
@@ -12,6 +12,8 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/resolved
 Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
 Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 After=systemd-networkd.service network.target
+Before=network-online.target nss-lookup.target
+Wants=nss-lookup.target
 
 # On kdbus systems we pull in the busname explicitly, because it
 # carries policy that allows the daemon to acquire its name.
diff --git a/units/user/meson.build b/units/user/meson.build
new file mode 100644 (file)
index 0000000..b507144
--- /dev/null
@@ -0,0 +1,33 @@
+units = [
+        'basic.target',
+        'bluetooth.target',
+        'default.target',
+        'exit.target',
+        'graphical-session-pre.target',
+        'graphical-session.target',
+        'paths.target',
+        'printer.target',
+        'shutdown.target',
+        'smartcard.target',
+        'sockets.target',
+        'sound.target',
+        'timers.target',
+]
+
+foreach file : units
+        install_data(file,
+                     install_dir : userunitdir)
+endforeach
+
+in_units = [
+        'systemd-exit.service',
+]
+
+foreach file : in_units
+        gen = configure_file(
+                input : file + '.in',
+                output : file,
+                configuration : substs)
+        install_data(gen,
+                     install_dir : userunitdir)
+endforeach