summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile42
-rw-r--r--src/busctl/busctl-introspect.h1
-rw-r--r--src/grp-boot/Makefile2
-rw-r--r--src/grp-boot/bootctl/Makefile1
-rw-r--r--src/grp-boot/systemd-boot/Makefile86
-rw-r--r--src/grp-boot/systemd-boot/console.h2
-rw-r--r--src/grp-boot/systemd-boot/disk.h2
-rw-r--r--src/grp-boot/systemd-boot/graphics.h2
-rw-r--r--src/grp-boot/systemd-boot/linux.h2
-rw-r--r--src/grp-boot/systemd-boot/measure.h2
-rw-r--r--src/grp-boot/systemd-boot/pefile.h2
-rw-r--r--src/grp-boot/systemd-boot/splash.h2
-rw-r--r--src/grp-boot/systemd-boot/util.h2
-rw-r--r--src/grp-coredump/Makefile2
-rw-r--r--src/grp-coredump/systemd-coredump/.gitignore1
-rw-r--r--src/grp-coredump/systemd-coredump/Makefile5
-rw-r--r--src/grp-coredump/systemd-coredump/coredump.c60
-rw-r--r--src/grp-coredump/systemd-coredump/systemd-coredump.tmpfiles10
-rw-r--r--src/grp-hostname/Makefile53
-rw-r--r--src/grp-hostname/hostnamectl/Makefile45
-rw-r--r--src/grp-hostname/systemd-hostnamed/Makefile65
-rw-r--r--src/grp-initprogs/Makefile44
-rw-r--r--src/grp-initprogs/grp-sleep/Makefile30
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/Makefile40
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile21
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-sleep/Makefile25
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml4
-rw-r--r--src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.bash0
-rw-r--r--src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.zsh0
-rw-r--r--src/grp-initprogs/systemd-quotacheck/Makefile3
-rw-r--r--src/grp-initprogs/systemd-random-seed/Makefile3
-rw-r--r--src/grp-initprogs/systemd-sysusers/.gitignore3
-rw-r--r--src/grp-initprogs/systemd-sysusers/Makefile10
-rw-r--r--src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.bash0
-rw-r--r--src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.zsh0
-rw-r--r--src/grp-initprogs/systemd-tmpfiles/Makefile8
-rw-r--r--src/grp-initprogs/systemd-tmpfiles/tmpfiles.c2
-rw-r--r--src/grp-initprogs/systemd-update-utmp/update-utmp.c24
-rw-r--r--src/grp-journal/.gitignore4
-rw-r--r--src/grp-journal/Makefile21
-rw-r--r--src/grp-journal/grp-remote/Makefile71
-rw-r--r--src/grp-journal/grp-remote/microhttpd-util.c12
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile5
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c28
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-gatewayd/systemd-journal-gatewayd.sysusers1
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/Makefile14
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c34
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/Makefile8
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h1
-rw-r--r--src/grp-journal/journalctl/Makefile17
-rw-r--r--src/grp-journal/libjournal-core/.gitignore4
-rw-r--r--src/grp-journal/libjournal-core/Makefile2
-rw-r--r--src/grp-journal/libjournal-core/journald-gperf.c175
-rw-r--r--src/grp-journal/libjournal-core/journald-gperf.gperf2
-rw-r--r--src/grp-journal/libjournal-core/journald-server.c75
-rw-r--r--src/grp-journal/libjournal-core/journald-stream.c32
-rw-r--r--src/grp-journal/libjournal-core/test-compress.c12
-rw-r--r--src/grp-journal/systemd-cat/Makefile36
-rw-r--r--src/grp-journal/systemd-journald/Makefile28
-rw-r--r--src/grp-journal/systemd-journald/systemd-journald.tmpfiles.m418
-rw-r--r--src/grp-locale/Makefile64
-rw-r--r--src/grp-locale/localectl/Makefile45
-rw-r--r--src/grp-locale/systemd-localed/.gitignore2
-rw-r--r--src/grp-locale/systemd-localed/Makefile79
-rw-r--r--src/grp-locale/systemd-localed/localed.c36
-rw-r--r--src/grp-login/Makefile55
-rw-r--r--src/grp-login/systemd-logind/Makefile87
-rw-r--r--src/grp-login/systemd-logind/logind-action.h3
-rw-r--r--src/grp-login/systemd-logind/logind-core.c3
-rw-r--r--src/grp-login/systemd-logind/logind-dbus.c3
-rw-r--r--src/grp-login/systemd-logind/logind-gperf.c144
-rw-r--r--src/grp-login/systemd-logind/logind-gperf.gperf2
-rw-r--r--src/grp-login/systemd-logind/logind-seat-dbus.c2
-rw-r--r--src/grp-login/systemd-logind/logind-session-dbus.c2
-rw-r--r--src/grp-login/systemd-logind/logind-session.h6
-rw-r--r--src/grp-login/systemd-logind/logind-user-dbus.c2
-rw-r--r--src/grp-login/systemd-logind/logind-utmp.c3
-rw-r--r--src/grp-machine/Makefile5
-rw-r--r--src/grp-machine/grp-import/Makefile48
-rw-r--r--src/grp-machine/grp-import/libimport/Makefile51
-rw-r--r--src/grp-machine/grp-import/libimport/import-common.h2
-rw-r--r--src/grp-machine/grp-import/systemd-export/Makefile7
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-raw.c18
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-raw.h1
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-tar.h1
-rw-r--r--src/grp-machine/grp-import/systemd-import/Makefile9
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-raw.c4
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-raw.h1
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-tar.c4
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-tar.h1
-rw-r--r--src/grp-machine/grp-import/systemd-importd/Makefile30
-rw-r--r--src/grp-machine/grp-import/systemd-pull/Makefile9
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-job.h4
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-raw.c2
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-raw.h1
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-tar.c2
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-tar.h1
-rw-r--r--src/grp-machine/systemd-machined/Makefile41
-rw-r--r--src/grp-machine/systemd-machined/machine-dbus.c41
-rw-r--r--src/grp-machine/systemd-machined/machine.h6
-rw-r--r--src/grp-network/Makefile41
-rw-r--r--src/grp-network/libnetworkd-core/Makefile4
-rw-r--r--src/grp-network/libnetworkd-core/networkd-gperf.gperf2
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-gperf.gperf4
-rw-r--r--src/grp-network/libnetworkd-core/networkd-network-gperf.gperf4
-rw-r--r--src/grp-network/systemd-networkd-wait-online/Makefile9
-rw-r--r--src/grp-network/systemd-networkd/Makefile30
-rw-r--r--src/grp-network/systemd-networkd/systemd-networkd.tmpfiles12
-rw-r--r--src/grp-resolve/90-resolved.preset3
-rw-r--r--src/grp-resolve/Makefile6
-rw-r--r--src/grp-resolve/libbasic-dns/Makefile115
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-dnssec.c10
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h4
-rw-r--r--src/grp-resolve/systemd-resolve/Makefile52
l---------src/grp-resolve/systemd-resolve/gcrypt-util.c1
l---------src/grp-resolve/systemd-resolve/gcrypt-util.h1
-rw-r--r--src/grp-resolve/systemd-resolve/resolve-tool.c5
-rw-r--r--src/grp-resolve/systemd-resolved/Makefile114
l---------src/grp-resolve/systemd-resolved/gcrypt-util.c1
l---------src/grp-resolve/systemd-resolved/gcrypt-util.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-bus.c2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-cache.c4
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.c2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.h4
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.h6
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.h20
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.h3
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-transaction.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h5
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-zone.c2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-etc-hosts.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-gperf.gperf2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.h3
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.c1
-rw-r--r--src/grp-system/Makefile7
-rw-r--r--src/grp-system/grp-utils/Makefile32
-rw-r--r--src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c3
l---------src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c1
l---------src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h1
-rw-r--r--src/grp-system/grp-utils/systemd-sysv-generator/Makefile6
-rw-r--r--src/grp-system/libcore/Makefile9
-rw-r--r--src/grp-system/libcore/audit-fd.c6
-rw-r--r--src/grp-system/libcore/busname.h1
-rw-r--r--src/grp-system/libcore/cgroup.h1
-rw-r--r--src/grp-system/libcore/dbus-automount.h1
-rw-r--r--src/grp-system/libcore/dbus-busname.h1
-rw-r--r--src/grp-system/libcore/dbus-execute.c34
-rw-r--r--src/grp-system/libcore/dbus-path.h2
-rw-r--r--src/grp-system/libcore/device.h2
-rw-r--r--src/grp-system/libcore/execute.c82
-rw-r--r--src/grp-system/libcore/execute.h2
-rw-r--r--src/grp-system/libcore/killall.h2
-rw-r--r--src/grp-system/libcore/kmod-setup.c6
-rw-r--r--src/grp-system/libcore/load-fragment-gperf.gperf.m44
-rw-r--r--src/grp-system/libcore/load-fragment.c60
-rw-r--r--src/grp-system/libcore/loopback-setup.c1
-rw-r--r--src/grp-system/libcore/machine-id-setup.h2
-rw-r--r--src/grp-system/libcore/manager.c82
-rw-r--r--src/grp-system/libcore/manager.h4
-rw-r--r--src/grp-system/libcore/scope.h1
-rw-r--r--src/grp-system/libcore/selinux-access.c18
-rw-r--r--src/grp-system/libcore/selinux-setup.c10
-rw-r--r--src/grp-system/libcore/service.h3
-rw-r--r--src/grp-system/libcore/slice.h2
-rw-r--r--src/grp-system/libcore/smack-setup.h2
-rw-r--r--src/grp-system/libcore/socket.h1
-rw-r--r--src/grp-system/libcore/swap.h2
-rw-r--r--src/grp-system/libcore/target.c1
-rw-r--r--src/grp-system/libcore/target.h2
-rw-r--r--src/grp-system/libcore/timer.h2
-rw-r--r--src/grp-system/libcore/unit.h2
-rw-r--r--src/grp-system/systemctl/.gitignore4
-rw-r--r--src/grp-system/systemctl/Makefile8
-rw-r--r--src/grp-system/systemd-shutdown/Makefile3
l---------src/grp-system/systemd-shutdown/killall.c1
l---------src/grp-system/systemd-shutdown/killall.h1
l---------src/grp-system/systemd-shutdown/mount-setup.c1
l---------src/grp-system/systemd-shutdown/mount-setup.h1
-rw-r--r--src/grp-system/systemd-shutdown/shutdown.c2
-rw-r--r--src/grp-system/systemd-shutdown/systemd-shutdown.xml6
-rw-r--r--src/grp-system/systemd-shutdown/umount.c2
-rw-r--r--src/grp-system/systemd-shutdown/umount.h2
-rw-r--r--src/grp-system/systemd/Makefile10
-rw-r--r--src/grp-system/systemd/main.c76
-rw-r--r--src/grp-system/systemd/systemd-tmpfs.tmpfiles2
-rw-r--r--src/grp-system/systemd/systemd.tmpfiles20
-rw-r--r--src/grp-timedate/Makefile2
-rw-r--r--src/grp-timedate/timedatectl/Makefile1
-rw-r--r--src/grp-udev/.vimrc4
-rw-r--r--src/grp-udev/Makefile8
-rw-r--r--src/grp-udev/hwdb/Makefile2
-rw-r--r--src/grp-udev/libudev-core/Makefile13
l---------src/grp-udev/libudev-core/logind-acl.c1
l---------src/grp-udev/libudev-core/logind-acl.h1
-rw-r--r--src/grp-udev/libudev-core/net/Makefile30
-rw-r--r--src/grp-udev/libudev-core/net/link-config-gperf.gperf4
l---------src/grp-udev/libudev-core/sd-login.c1
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-btrfs.c6
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-input_id.c2
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-net_setup_link.c3
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-uaccess.c3
-rw-r--r--src/grp-udev/mtd_probe/Makefile2
-rw-r--r--src/grp-udev/scsi_id/scsi.h1
-rw-r--r--src/grp-udev/scsi_id/scsi_id.h2
-rw-r--r--src/grp-udev/systemd-hwdb/Makefile4
-rw-r--r--src/grp-udev/systemd-udevd/udevd.c1
-rw-r--r--src/grp-udev/udevadm/Makefile2
-rw-r--r--src/grp-utils/Makefile32
-rw-r--r--src/grp-utils/systemd-escape/systemd-escape.completion.bash0
-rw-r--r--src/grp-utils/systemd-escape/systemd-escape.completion.zsh0
-rw-r--r--src/grp-utils/systemd-path/Makefile6
l---------src/grp-utils/systemd-path/_sd-common.h1
-rw-r--r--src/grp-utils/systemd-path/sd-path.h2
-rw-r--r--src/grp-utils/systemd-path/systemd-path.completion.zsh18
-rw-r--r--src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.bash0
-rw-r--r--src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.zsh0
-rw-r--r--src/libbasic/Makefile2
-rw-r--r--src/libbasic/include/Makefile2
-rw-r--r--src/libbasic/include/basic/Makefile8
-rw-r--r--src/libbasic/include/basic/btrfs-ctree.h1
-rw-r--r--src/libbasic/include/basic/missing_syscall.h4
-rw-r--r--src/libbasic/include/basic/rm-rf.h3
-rw-r--r--src/libbasic/include/basic/socket-util.h2
-rw-r--r--src/libbasic/include/basic/time-util.h2
-rw-r--r--src/libbasic/src/Makefile7
-rw-r--r--src/libbasic/src/af-list.c4
-rw-r--r--src/libbasic/src/arphrd-list.c4
-rw-r--r--src/libbasic/src/btrfs-util.c34
-rw-r--r--src/libbasic/src/cap-list.c4
-rw-r--r--src/libbasic/src/errno-list.c4
-rw-r--r--src/libbasic/src/hashmap.c2
-rw-r--r--src/libbasic/src/memfd-util.c14
-rw-r--r--src/libbasic/src/path-util.c22
-rw-r--r--src/libbasic/src/process-util.c34
-rw-r--r--src/libbasic/src/random-util.c10
-rw-r--r--src/libbasic/src/selinux-util.c14
-rw-r--r--src/libfirewall/Makefile2
-rw-r--r--src/libfirewall/firewall-util.c8
-rw-r--r--src/libshared/Makefile2
-rw-r--r--src/libshared/include/shared/install.h10
-rw-r--r--src/libshared/include/shared/test-tables.h2
-rw-r--r--src/libshared/src/Makefile19
-rw-r--r--src/libshared/src/dns-domain.c20
-rw-r--r--src/libshared/src/gcrypt-util.c3
-rw-r--r--src/libsystemd-network/Makefile2
l---------src/libsystemd-network/include/systemd-network/_sd-common.h1
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp-client.h2
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h2
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp-server.h3
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h2
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h2
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-ipv4acd.h3
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-ipv4ll.h3
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-lldp.h3
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-ndisc.h4
-rw-r--r--src/libsystemd-network/src/Makefile4
-rw-r--r--src/libsystemd-network/src/network-internal.c2
-rw-r--r--src/libsystemd/Makefile47
-rw-r--r--src/libsystemd/include/systemd/sd-utf8.h32
-rw-r--r--src/libsystemd/sd_event_get_fd.xml2
-rw-r--r--src/libsystemd/src/Makefile168
l---------src/libsystemd/src/sd-bus/Makefile1
-rw-r--r--src/libsystemd/src/sd-bus/bus-control.c16
-rw-r--r--src/libsystemd/src/sd-bus/bus-kernel.c28
-rw-r--r--src/libsystemd/src/sd-bus/bus-signature.h1
-rw-r--r--src/libsystemd/src/sd-bus/bus-socket.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-track.h2
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-gvariant.c10
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-marshal.c16
l---------src/libsystemd/src/sd-daemon/Makefile1
l---------src/libsystemd/src/sd-device/Makefile1
-rw-r--r--src/libsystemd/src/sd-device/device-internal.h2
l---------src/libsystemd/src/sd-event/Makefile1
l---------src/libsystemd/src/sd-hwdb/Makefile1
l---------src/libsystemd/src/sd-id128/Makefile1
-rw-r--r--src/libsystemd/src/sd-journal/Makefile11
-rw-r--r--src/libsystemd/src/sd-journal/audit-type.c4
-rw-r--r--src/libsystemd/src/sd-journal/compress.c16
-rw-r--r--src/libsystemd/src/sd-journal/fsprg.c3
l---------src/libsystemd/src/sd-journal/gcrypt-util.c1
l---------src/libsystemd/src/sd-journal/gcrypt-util.h1
-rw-r--r--src/libsystemd/src/sd-journal/journal-authenticate.c2
-rw-r--r--src/libsystemd/src/sd-journal/journal-file.h10
-rw-r--r--src/libsystemd/src/sd-journal/journal-send.c22
-rw-r--r--src/libsystemd/src/sd-journal/mmap-cache.h2
l---------src/libsystemd/src/sd-login/Makefile1
l---------src/libsystemd/src/sd-netlink/Makefile1
-rw-r--r--src/libsystemd/src/sd-netlink/local-addresses.c1
-rw-r--r--src/libsystemd/src/sd-netlink/sd-netlink.h2
l---------src/libsystemd/src/sd-network/Makefile1
-rw-r--r--src/libsystemd/src/sd-network/network-util.h2
l---------src/libsystemd/src/sd-resolve/Makefile1
-rw-r--r--src/libsystemd/src/sd-utf8/sd-utf8.c35
-rw-r--r--src/libsystemd/src/subdir.mk9
-rw-r--r--src/libsystemd/src/test.mk152
-rw-r--r--src/libudev/Makefile36
-rw-r--r--src/libudev/src/Makefile41
-rw-r--r--src/systemd-cryptsetup/Makefile2
-rw-r--r--src/systemd-dbus1-generator/Makefile6
-rw-r--r--src/systemd-debug-generator/Makefile2
-rw-r--r--src/systemd-getty-generator/Makefile2
-rw-r--r--src/systemd-gpt-auto-generator/Makefile2
-rw-r--r--src/systemd-machine-id-setup/machine-id-setup-main.c1
l---------src/systemd-machine-id-setup/machine-id-setup.c1
l---------src/systemd-machine-id-setup/machine-id-setup.h1
-rw-r--r--src/systemd-nspawn/Makefile5
l---------src/systemd-nspawn/loopback-setup.c1
l---------src/systemd-nspawn/loopback-setup.h1
l---------src/systemd-nspawn/machine-id-setup.c1
l---------src/systemd-nspawn/machine-id-setup.h1
l---------src/systemd-nspawn/mount-setup.c1
l---------src/systemd-nspawn/mount-setup.h1
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.c1
-rw-r--r--src/systemd-nspawn/nspawn-gperf.gperf2
-rw-r--r--src/systemd-nspawn/nspawn-mount.h1
-rw-r--r--src/systemd-nspawn/nspawn-network.c1
-rw-r--r--src/systemd-nspawn/nspawn-patch-uid.c18
-rw-r--r--src/systemd-nspawn/nspawn-register.c2
-rw-r--r--src/systemd-nspawn/nspawn.c93
-rw-r--r--src/systemd-remount-fs/Makefile3
l---------src/systemd-remount-fs/mount-setup.c1
l---------src/systemd-remount-fs/mount-setup.h1
-rw-r--r--src/systemd-remount-fs/remount-fs.c1
-rw-r--r--src/systemd-stdio-bridge/systemd-stdio-bridge.completion.bash0
-rw-r--r--src/systemd-stdio-bridge/systemd-stdio-bridge.completion.zsh0
-rw-r--r--src/systemd-system-update-generator/Makefile2
-rw-r--r--src/systemd-timesyncd/Makefile5
-rw-r--r--src/systemd-timesyncd/timesyncd-gperf.gperf2
-rw-r--r--src/test/test-af-list.c2
-rw-r--r--src/test/test-arphrd-list.c2
-rw-r--r--src/test/test-netlink-manual.c2
333 files changed, 2724 insertions, 1606 deletions
diff --git a/src/Makefile b/src/Makefile
index b84e6076a0..905d11d803 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -23,5 +23,47 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+nested.subdirs += busctl
+nested.subdirs += grp-boot
+nested.subdirs += grp-coredump
+nested.subdirs += grp-hostname
+nested.subdirs += grp-initprogs
+nested.subdirs += grp-journal
+nested.subdirs += grp-locale
+nested.subdirs += grp-login
+nested.subdirs += grp-machine
+nested.subdirs += grp-network
+nested.subdirs += grp-resolve
+nested.subdirs += grp-system
+nested.subdirs += grp-timedate
+nested.subdirs += grp-udev
+nested.subdirs += grp-utils
+nested.subdirs += libbasic
+nested.subdirs += libfirewall
+nested.subdirs += libshared
+nested.subdirs += libsystemd
+nested.subdirs += libsystemd-network
+nested.subdirs += libudev
+nested.subdirs += nss-myhostname
+nested.subdirs += systemd-ask-password
+nested.subdirs += systemd-cgls
+nested.subdirs += systemd-cgroups-agent
+nested.subdirs += systemd-cgtop
+nested.subdirs += systemd-cryptsetup
+nested.subdirs += systemd-dbus1-generator
+nested.subdirs += systemd-debug-generator
+nested.subdirs += systemd-getty-generator
+nested.subdirs += systemd-gpt-auto-generator
+nested.subdirs += systemd-initctl
+nested.subdirs += systemd-machine-id-setup
+nested.subdirs += systemd-nspawn
+nested.subdirs += systemd-rc-local-generator
+nested.subdirs += systemd-remount-fs
+nested.subdirs += systemd-reply-password
+nested.subdirs += systemd-socket-proxyd
+nested.subdirs += systemd-stdio-bridge
+nested.subdirs += systemd-system-update-generator
+nested.subdirs += systemd-timesyncd
+nested.subdirs += systemd-tty-ask-password-agent
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/busctl/busctl-introspect.h b/src/busctl/busctl-introspect.h
index d922e352db..3dd1df4e47 100644
--- a/src/busctl/busctl-introspect.h
+++ b/src/busctl/busctl-introspect.h
@@ -20,6 +20,7 @@
***/
#include <stdbool.h>
+#include <stdint.h>
typedef struct XMLIntrospectOps {
int (*on_path)(const char *path, void *userdata);
diff --git a/src/grp-boot/Makefile b/src/grp-boot/Makefile
index 922d8a32d3..6f46e5e035 100644
--- a/src/grp-boot/Makefile
+++ b/src/grp-boot/Makefile
@@ -23,6 +23,6 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += bootctl systemd-boot
+nested.subdirs += bootctl systemd-boot kernel-install
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/bootctl/Makefile b/src/grp-boot/bootctl/Makefile
index 84253d2387..a983e32a9f 100644
--- a/src/grp-boot/bootctl/Makefile
+++ b/src/grp-boot/bootctl/Makefile
@@ -51,4 +51,5 @@ dist_zshcompletion_data += \
shell-completion/zsh/_bootctl
endif # HAVE_BLKID
endif # ENABLE_EFI
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile
index 5b53fdc7e4..9766e1bb82 100644
--- a/src/grp-boot/systemd-boot/Makefile
+++ b/src/grp-boot/systemd-boot/Makefile
@@ -25,6 +25,7 @@ include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_EFI),)
ifneq ($(HAVE_GNUEFI),)
+# ------------------------------------------------------------------------------
efi_cppflags = \
$(EFI_CPPFLAGS) \
-I$(top_builddir) -include config.h \
@@ -81,9 +82,18 @@ EFI_FORMAT = -O binary
else
EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
endif # ARCH_AARCH64
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
+$(outdir)/%.o: $(srcdir)/%.c
+ $(AM_V_EFI_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+
+$(outdir)/%.so:
+ @if test $(words $^) = 0; then echo 'Cannot link EFI library with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_EFI_CCLD)$(LD) $(efi_ldflags) $^ -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
+ $(AM_V_at)! { nm -D -u $@ | grep ' U '; }
+
+# These next 2 are the same rule
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi : $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi.stub: $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
# ------------------------------------------------------------------------------
systemd_boot_headers = \
src/boot/efi/util.h \
@@ -102,33 +112,9 @@ systemd_boot_sources = \
src/boot/efi/measure.c \
src/boot/efi/boot.c
-EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
-
-systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o))
-systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
-bootlib_DATA = $(systemd_boot)
-
-$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(systemd_boot_solib): $(systemd_boot_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(systemd_boot): $(systemd_boot_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
-
+bootlib_DATA += $(systemd_boot)
+$(outdir)/systemd-boot.so: $(addprefix $(outdir)/,$(notdir $(systemd_boot_sources:.c=.o)))
# ------------------------------------------------------------------------------
stub_headers = \
src/boot/efi/util.h \
@@ -149,46 +135,18 @@ stub_sources = \
src/boot/efi/measure.c \
src/boot/efi/stub.c
-EXTRA_DIST += \
- $(stub_sources) \
- $(stub_headers) \
- test/splash.bmp
-
-stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
-stub_solib = $(top_builddir)/src/boot/efi/stub.so
stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
bootlib_DATA += $(stub)
-
-$(outdir)/%.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); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(stub): $(stub_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
-
-
+$(outdir)/linux.so: $(addprefix $(outdir)/,$(notdir $(stub_sources:.c=.o)))
# ------------------------------------------------------------------------------
-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
+$(outdir)/test-efi-disk.img: $(outdir)/$(systemd_boot) $(outdir)/$(stub) $(srcdir)/test-efi-create-disk.sh
+ $(AM_V_GEN)$(@D)/test-efi-create-disk.sh
-test-efi: test-efi-disk.img
+test-efi: $(outdir)/test-efi-disk.img
$(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
-EXTRA_DIST += test/test-efi-create-disk.sh
-
+files.out.int += test-efi-disk.img
+# ------------------------------------------------------------------------------
+endif # HAVE_GNUEFI
+endif # ENABLE_EFI
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/console.h b/src/grp-boot/systemd-boot/console.h
index 3fe0ce5ec4..887995a9cc 100644
--- a/src/grp-boot/systemd-boot/console.h
+++ b/src/grp-boot/systemd-boot/console.h
@@ -16,6 +16,8 @@
#ifndef __SDBOOT_CONSOLE_H
#define __SDBOOT_CONSOLE_H
+#include <efi.h>
+
#define EFI_SHIFT_STATE_VALID 0x80000000
#define EFI_RIGHT_CONTROL_PRESSED 0x00000004
#define EFI_LEFT_CONTROL_PRESSED 0x00000008
diff --git a/src/grp-boot/systemd-boot/disk.h b/src/grp-boot/systemd-boot/disk.h
index af91a9c674..5804b8881a 100644
--- a/src/grp-boot/systemd-boot/disk.h
+++ b/src/grp-boot/systemd-boot/disk.h
@@ -15,5 +15,7 @@
#ifndef __SDBOOT_DISK_H
#define __SDBOOT_DISK_H
+#include <efi.h>
+
EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[37]);
#endif
diff --git a/src/grp-boot/systemd-boot/graphics.h b/src/grp-boot/systemd-boot/graphics.h
index cf48e647e7..d8e5adfcd8 100644
--- a/src/grp-boot/systemd-boot/graphics.h
+++ b/src/grp-boot/systemd-boot/graphics.h
@@ -18,5 +18,7 @@
#ifndef __SDBOOT_GRAPHICS_H
#define __SDBOOT_GRAPHICS_H
+#include <efi.h>
+
EFI_STATUS graphics_mode(BOOLEAN on);
#endif
diff --git a/src/grp-boot/systemd-boot/linux.h b/src/grp-boot/systemd-boot/linux.h
index d9e6ed7955..b87a7f0d38 100644
--- a/src/grp-boot/systemd-boot/linux.h
+++ b/src/grp-boot/systemd-boot/linux.h
@@ -15,6 +15,8 @@
#ifndef __SDBOOT_kernel_H
#define __SDBOOT_kernel_H
+#include <efi.h>
+
EFI_STATUS linux_exec(EFI_HANDLE *image,
CHAR8 *cmdline, UINTN cmdline_size,
UINTN linux_addr,
diff --git a/src/grp-boot/systemd-boot/measure.h b/src/grp-boot/systemd-boot/measure.h
index a2cfe817d0..ddd686a8fd 100644
--- a/src/grp-boot/systemd-boot/measure.h
+++ b/src/grp-boot/systemd-boot/measure.h
@@ -13,6 +13,8 @@
#ifndef __SDBOOT_MEASURE_H
#define __SDBOOT_MEASURE_H
+#include <efi.h>
+
#ifndef SD_TPM_PCR
#define SD_TPM_PCR 8
#endif
diff --git a/src/grp-boot/systemd-boot/pefile.h b/src/grp-boot/systemd-boot/pefile.h
index 2e445ede17..bc2d73fea9 100644
--- a/src/grp-boot/systemd-boot/pefile.h
+++ b/src/grp-boot/systemd-boot/pefile.h
@@ -15,6 +15,8 @@
#ifndef __SDBOOT_PEFILE_H
#define __SDBOOT_PEFILE_H
+#include <efi.h>
+
EFI_STATUS pefile_locate_sections(EFI_FILE *dir, CHAR16 *path,
CHAR8 **sections, UINTN *addrs, UINTN *offsets, UINTN *sizes);
#endif
diff --git a/src/grp-boot/systemd-boot/splash.h b/src/grp-boot/systemd-boot/splash.h
index 09b543fb47..362ff22643 100644
--- a/src/grp-boot/systemd-boot/splash.h
+++ b/src/grp-boot/systemd-boot/splash.h
@@ -16,5 +16,7 @@
#ifndef __SDBOOT_SPLASH_H
#define __SDBOOT_SPLASH_H
+#include <efi.h>
+
EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background);
#endif
diff --git a/src/grp-boot/systemd-boot/util.h b/src/grp-boot/systemd-boot/util.h
index e673cdf9a0..e2da8b3fee 100644
--- a/src/grp-boot/systemd-boot/util.h
+++ b/src/grp-boot/systemd-boot/util.h
@@ -22,7 +22,7 @@
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
static inline const CHAR16 *yes_no(BOOLEAN b) {
- return b ? L"yes" : L"no";
+ return b ? (CHAR16*)L"yes" : (CHAR16*)L"no";
}
EFI_STATUS parse_boolean(CHAR8 *v, BOOLEAN *b);
diff --git a/src/grp-coredump/Makefile b/src/grp-coredump/Makefile
index 2e604d7b86..811efb5af5 100644
--- a/src/grp-coredump/Makefile
+++ b/src/grp-coredump/Makefile
@@ -23,6 +23,6 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += coredumpctl systemd-coredump
+nested.subdirs += coredumpctl systemd-coredump
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/systemd-coredump/.gitignore b/src/grp-coredump/systemd-coredump/.gitignore
new file mode 100644
index 0000000000..768e3d4d9f
--- /dev/null
+++ b/src/grp-coredump/systemd-coredump/.gitignore
@@ -0,0 +1 @@
+/50-coredump.sysctl
diff --git a/src/grp-coredump/systemd-coredump/Makefile b/src/grp-coredump/systemd-coredump/Makefile
index bc71db120e..108186488c 100644
--- a/src/grp-coredump/systemd-coredump/Makefile
+++ b/src/grp-coredump/systemd-coredump/Makefile
@@ -75,7 +75,10 @@ CLEANFILES += \
endif # ENABLE_COREDUMP
EXTRA_DIST += \
- sysctl.d/50-coredump.conf.in \
+ sysctl.d/50-coredump.sysctl.in \
units/systemd-coredump@.service.in
+sd.CPPFLAGS += -I$(topsrcdir)/src/grp-journal/libjournal-core
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/systemd-coredump/coredump.c b/src/grp-coredump/systemd-coredump/coredump.c
index 999de63900..8f291e6bd8 100644
--- a/src/grp-coredump/systemd-coredump/coredump.c
+++ b/src/grp-coredump/systemd-coredump/coredump.c
@@ -28,39 +28,39 @@
#include <elfutils/libdwfl.h>
#endif
-#include "sd-journal.h"
-#include "sd-login.h"
-#include "sd-daemon.h"
-
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "capability-util.h"
-#include "cgroup-util.h"
-#include "compress.h"
-#include "conf-parser.h"
-#include "copy.h"
+#include <systemd/sd-journal.h>
+#include <systemd/sd-login.h>
+#include <systemd/sd-daemon.h>
+
+#include "shared/acl-util.h"
+#include "basic/alloc-util.h"
+#include "basic/capability-util.h"
+#include "basic/cgroup-util.h"
+#include "sd-journal/compress.h"
+#include "shared/conf-parser.h"
+#include "basic/copy.h"
#include "coredump-vacuum.h"
-#include "dirent-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "io-util.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/io-util.h"
#include "journald-native.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "socket-util.h"
-#include "special.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/socket-util.h"
+#include "basic/special.h"
#include "stacktrace.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
/* The maximum size up to which we process coredumps */
#define PROCESS_SIZE_MAX ((uint64_t) (2LLU*1024LLU*1024LLU*1024LLU))
diff --git a/src/grp-coredump/systemd-coredump/systemd-coredump.tmpfiles b/src/grp-coredump/systemd-coredump/systemd-coredump.tmpfiles
new file mode 100644
index 0000000000..02b052583d
--- /dev/null
+++ b/src/grp-coredump/systemd-coredump/systemd-coredump.tmpfiles
@@ -0,0 +1,10 @@
+# This file is part of systemd.
+#
+# 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.
+
+# See tmpfiles.d(5) for details
+
+d /var/lib/systemd/coredump 0755 root root 3d
diff --git a/src/grp-hostname/Makefile b/src/grp-hostname/Makefile
index 911188454c..319c1d2c8e 100644
--- a/src/grp-hostname/Makefile
+++ b/src/grp-hostname/Makefile
@@ -23,57 +23,6 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-ifneq ($(ENABLE_HOSTNAMED),)
-systemd_hostnamed_SOURCES = \
- src/hostname/hostnamed.c
-
-systemd_hostnamed_LDADD = \
- libshared.la
-
-rootlibexec_PROGRAMS += \
- systemd-hostnamed
-
-nodist_systemunit_DATA += \
- units/systemd-hostnamed.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.hostname1.busname
-
-dist_dbuspolicy_DATA += \
- src/hostname/org.freedesktop.hostname1.conf
-
-dist_dbussystemservice_DATA += \
- src/hostname/org.freedesktop.hostname1.service
-
-polkitpolicy_files += \
- src/hostname/org.freedesktop.hostname1.policy
-
-SYSTEM_UNIT_ALIASES += \
- systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.hostname1.busname
-
-hostnamectl_SOURCES = \
- src/hostname/hostnamectl.c
-
-hostnamectl_LDADD = \
- libshared.la
-
-bin_PROGRAMS += \
- hostnamectl
-
-dist_bashcompletion_data += \
- shell-completion/bash/hostnamectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_hostnamectl
-endif # ENABLE_HOSTNAMED
-
-polkitpolicy_in_files += \
- src/hostname/org.freedesktop.hostname1.policy.in
-
-EXTRA_DIST += \
- units/systemd-hostnamed.service.in
+nested.subdirs += systemd-hostnamed hostnamectl
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-hostname/hostnamectl/Makefile b/src/grp-hostname/hostnamectl/Makefile
new file mode 100644
index 0000000000..f684bde523
--- /dev/null
+++ b/src/grp-hostname/hostnamectl/Makefile
@@ -0,0 +1,45 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_HOSTNAMED),)
+
+hostnamectl_SOURCES = \
+ src/hostname/hostnamectl.c
+
+hostnamectl_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ hostnamectl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/hostnamectl
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_hostnamectl
+
+endif
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-hostname/systemd-hostnamed/Makefile b/src/grp-hostname/systemd-hostnamed/Makefile
new file mode 100644
index 0000000000..171bce55a4
--- /dev/null
+++ b/src/grp-hostname/systemd-hostnamed/Makefile
@@ -0,0 +1,65 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_HOSTNAMED),)
+systemd_hostnamed_SOURCES = \
+ src/hostname/hostnamed.c
+
+systemd_hostnamed_LDADD = \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-hostnamed
+
+nodist_systemunit_DATA += \
+ units/systemd-hostnamed.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.hostname1.busname
+
+dist_dbuspolicy_DATA += \
+ src/hostname/org.freedesktop.hostname1.conf
+
+dist_dbussystemservice_DATA += \
+ src/hostname/org.freedesktop.hostname1.service
+
+polkitpolicy_files += \
+ src/hostname/org.freedesktop.hostname1.policy
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.hostname1.busname
+
+endif # ENABLE_HOSTNAMED
+
+polkitpolicy_in_files += \
+ src/hostname/org.freedesktop.hostname1.policy.in
+
+EXTRA_DIST += \
+ units/systemd-hostnamed.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/Makefile b/src/grp-initprogs/Makefile
new file mode 100644
index 0000000000..2cf2214e2a
--- /dev/null
+++ b/src/grp-initprogs/Makefile
@@ -0,0 +1,44 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+nested.subdirs += grp-sleep
+nested.subdirs += systemd-backlight
+nested.subdirs += systemd-binfmt
+nested.subdirs += systemd-detect-virt
+nested.subdirs += systemd-firstboot
+nested.subdirs += systemd-fsck
+nested.subdirs += systemd-modules-load
+nested.subdirs += systemd-quotacheck
+nested.subdirs += systemd-random-seed
+nested.subdirs += systemd-rfkill
+nested.subdirs += systemd-sysctl
+nested.subdirs += systemd-sysusers
+nested.subdirs += systemd-tmpfiles
+nested.subdirs += systemd-update-done
+nested.subdirs += systemd-update-utmp
+nested.subdirs += systemd-user-sessions
+nested.subdirs += systemd-vconsole-setup
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/Makefile b/src/grp-initprogs/grp-sleep/Makefile
new file mode 100644
index 0000000000..5a3a87d2bf
--- /dev/null
+++ b/src/grp-initprogs/grp-sleep/Makefile
@@ -0,0 +1,30 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+nested.subdirs += systemd-hibernate-resume
+nested.subdirs += systemd-hibernate-resume-generator
+nested.subdirs += systemd-sleep
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/Makefile b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/Makefile
new file mode 100644
index 0000000000..8c0eba2b1a
--- /dev/null
+++ b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/Makefile
@@ -0,0 +1,40 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_HIBERNATE),)
+systemgenerator_PROGRAMS += \
+ systemd-hibernate-resume-generator
+
+systemd_hibernate_resume_generator_SOURCES = \
+ src/hibernate-resume/hibernate-resume-generator.c
+
+systemd_hibernate_resume_generator_LDADD = \
+ libshared.la
+
+endif # ENABLE_HIBERNATE
+
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile
index 4a5590dbf5..3b41b82e4b 100644
--- a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile
+++ b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile
@@ -24,8 +24,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_HIBERNATE),)
-systemgenerator_PROGRAMS += \
- systemd-hibernate-resume-generator
rootlibexec_PROGRAMS += \
systemd-hibernate-resume
@@ -36,25 +34,12 @@ systemd_hibernate_resume_SOURCES = \
systemd_hibernate_resume_LDADD = \
libshared.la
-systemd_hibernate_resume_generator_SOURCES = \
- src/hibernate-resume/hibernate-resume-generator.c
-
-systemd_hibernate_resume_generator_LDADD = \
- libshared.la
-
-dist_systemunit_DATA += \
- units/hibernate.target \
- units/hybrid-sleep.target
-
nodist_systemunit_DATA += \
- units/systemd-hibernate.service \
- units/systemd-hibernate-resume@.service \
- units/systemd-hybrid-sleep.service
+ units/systemd-hibernate-resume@.service
+
endif # ENABLE_HIBERNATE
EXTRA_DIST += \
- units/systemd-hibernate.service.in \
- units/systemd-hibernate-resume@.service.in \
- units/systemd-hybrid-sleep.service.in
+ units/systemd-hibernate-resume@.service.in
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile b/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile
index db103f05c9..ca484794a0 100644
--- a/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile
+++ b/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile
@@ -30,4 +30,29 @@ systemd_sleep_SOURCES = \
systemd_sleep_LDADD = \
libshared.la
+ifneq ($(ENABLE_HIBERNATE),)
+
+dist_systemunit_DATA += \
+ units/hibernate.target \
+ units/hybrid-sleep.target
+
+nodist_systemunit_DATA += \
+ units/systemd-hibernate.service \
+ units/systemd-hybrid-sleep.service
+
+endif # ENABLE_HIBERNATE
+
+dist_systemunit_DATA += \
+ units/suspend.target \
+
+nodist_systemunit_DATA += \
+ units/systemd-suspend.service \
+
+EXTRA_DIST += \
+ units/systemd-suspend.service.in \
+ units/systemd-hibernate.service.in \
+ units/systemd-hybrid-sleep.service.in
+
+sd.CPPFLAGS += -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml b/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
index a8beb86f4d..efd97eb671 100644
--- a/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
+++ b/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
@@ -26,7 +26,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
- <title>systemd-suspend.service</title>
+ <title>systemd-sleep</title>
<productname>systemd</productname>
<authorgroup>
@@ -40,7 +40,7 @@
</refentryinfo>
<refmeta>
- <refentrytitle>systemd-suspend.service</refentrytitle>
+ <refentrytitle>systemd-sleep</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>
diff --git a/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.bash b/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.bash
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.bash
diff --git a/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.zsh b/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.zsh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-initprogs/systemd-firstboot/systemd-firstboot.completion.zsh
diff --git a/src/grp-initprogs/systemd-quotacheck/Makefile b/src/grp-initprogs/systemd-quotacheck/Makefile
index 4220946f39..076d33a587 100644
--- a/src/grp-initprogs/systemd-quotacheck/Makefile
+++ b/src/grp-initprogs/systemd-quotacheck/Makefile
@@ -38,9 +38,12 @@ systemd_quotacheck_LDADD = \
endif # ENABLE_QUOTACHECK
EXTRA_DIST += \
+ units/quotaon.service.in \
units/systemd-quotacheck.service.in
nodist_systemunit_DATA += \
units/quotaon.service
+sd.CPPFLAGS += -DQUOTACHECK=\"$(QUOTACHECK)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-random-seed/Makefile b/src/grp-initprogs/systemd-random-seed/Makefile
index 56d1af7431..489a8ab007 100644
--- a/src/grp-initprogs/systemd-random-seed/Makefile
+++ b/src/grp-initprogs/systemd-random-seed/Makefile
@@ -44,4 +44,7 @@ endif # ENABLE_RANDOMSEED
EXTRA_DIST += \
units/systemd-random-seed.service.in
+sd.CPPFLAGS += -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\"
+sd.CPPFLAGS += -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-sysusers/.gitignore b/src/grp-initprogs/systemd-sysusers/.gitignore
deleted file mode 100644
index c065034d29..0000000000
--- a/src/grp-initprogs/systemd-sysusers/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/basic.conf
-/systemd.conf
-/systemd-remote.conf
diff --git a/src/grp-initprogs/systemd-sysusers/Makefile b/src/grp-initprogs/systemd-sysusers/Makefile
index 4753ca75d0..9339b9fd8b 100644
--- a/src/grp-initprogs/systemd-sysusers/Makefile
+++ b/src/grp-initprogs/systemd-sysusers/Makefile
@@ -40,22 +40,14 @@ SYSINIT_TARGET_WANTS += \
systemd-sysusers.service
nodist_sysusers_DATA = \
- sysusers.d/systemd.conf \
sysusers.d/basic.conf
-ifneq ($(HAVE_REMOTE),)
-nodist_sysusers_DATA += \
- sysusers.d/systemd-remote.conf
-endif # HAVE_REMOTE
-
INSTALL_DIRS += \
$(sysusersdir)
endif # ENABLE_SYSUSERS
EXTRA_DIST += \
units/systemd-sysusers.service.in \
- sysusers.d/systemd.conf.m4 \
- sysusers.d/systemd-remote.conf.m4 \
- sysusers.d/basic.conf.in
+ sysusers.d/basic.sysusers.in
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.bash b/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.bash
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.bash
diff --git a/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.zsh b/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.zsh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-initprogs/systemd-sysusers/systemd-sysusers.completion.zsh
diff --git a/src/grp-initprogs/systemd-tmpfiles/Makefile b/src/grp-initprogs/systemd-tmpfiles/Makefile
index d12c910883..de085fa334 100644
--- a/src/grp-initprogs/systemd-tmpfiles/Makefile
+++ b/src/grp-initprogs/systemd-tmpfiles/Makefile
@@ -42,7 +42,6 @@ nodist_systemunit_DATA += \
units/systemd-tmpfiles-clean.service
nodist_tmpfiles_DATA = \
- tmpfiles.d/systemd.conf \
tmpfiles.d/etc.conf
dist_tmpfiles_DATA = \
@@ -50,9 +49,7 @@ dist_tmpfiles_DATA = \
tmpfiles.d/tmp.conf \
tmpfiles.d/x11.conf \
tmpfiles.d/var.conf \
- tmpfiles.d/home.conf \
- tmpfiles.d/systemd-nspawn.conf \
- tmpfiles.d/journal-nocow.conf
+ tmpfiles.d/home.conf
ifneq ($(HAVE_SYSV_COMPAT),)
dist_tmpfiles_DATA += \
@@ -75,8 +72,7 @@ INSTALL_DIRS += \
endif # ENABLE_TMPFILES
EXTRA_DIST += \
- tmpfiles.d/systemd.conf.m4 \
- tmpfiles.d/etc.conf.m4 \
+ tmpfiles.d/etc.tmpfiles.m4 \
units/systemd-tmpfiles-setup-dev.service.in \
units/systemd-tmpfiles-setup.service.in \
units/systemd-tmpfiles-clean.service.in
diff --git a/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c b/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
index c674bf1226..f865b9cc3e 100644
--- a/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
+++ b/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
@@ -2179,7 +2179,7 @@ static int read_config_file(const char *fn, bool ignore_enoent) {
Iterator iterator;
unsigned v = 0;
Item *i;
- int r;
+ int r = 0;
assert(fn);
diff --git a/src/grp-initprogs/systemd-update-utmp/update-utmp.c b/src/grp-initprogs/systemd-update-utmp/update-utmp.c
index 8ae4a8a833..69264c3a26 100644
--- a/src/grp-initprogs/systemd-update-utmp/update-utmp.c
+++ b/src/grp-initprogs/systemd-update-utmp/update-utmp.c
@@ -25,18 +25,18 @@
#include <libaudit.h>
#endif
-#include "sd-bus.h"
-
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "formats-util.h"
-#include "log.h"
-#include "macro.h"
-#include "special.h"
-#include "unit-name.h"
-#include "util.h"
-#include "utmp-wtmp.h"
+#include <systemd/sd-bus.h>
+
+#include "basic/alloc-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/special.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "shared/utmp-wtmp.h"
typedef struct Context {
sd_bus *bus;
diff --git a/src/grp-journal/.gitignore b/src/grp-journal/.gitignore
index c3fea7424f..c9bd45a7be 100644
--- a/src/grp-journal/.gitignore
+++ b/src/grp-journal/.gitignore
@@ -1 +1,5 @@
+/journald-gperf.c
+/libsystemd-journal.pc
+/audit_type-list.txt
+/audit_type-*-name.*
/README
diff --git a/src/grp-journal/Makefile b/src/grp-journal/Makefile
index fcefb81581..f42ecedcc8 100644
--- a/src/grp-journal/Makefile
+++ b/src/grp-journal/Makefile
@@ -167,4 +167,25 @@ tests += \
test-compress-benchmark
endif # HAVE_COMPRESSION
+dist_tmpfiles_DATA = \
+ tmpfiles.d/journal-nocow.conf
+
+nested.subdirs += journalctl systemd-journald libjournal-core
+nested.subdirs += systemd-cat
+#nested.subdirs += grp-remote
+
+ifneq ($(HAVE_SYSV_COMPAT),)
+varlog_DATA = \
+ docs/var-log/README
+
+CLEANFILES += \
+ docs/var-log/README
+endif # HAVE_SYSV_COMPAT
+
+EXTRA_DIST += \
+ docs/var-log/README.in
+
+dist_systempreset_DATA = \
+ 90-journald.preset
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/Makefile b/src/grp-journal/grp-remote/Makefile
index 4a18cd13bb..b1415ad6d3 100644
--- a/src/grp-journal/grp-remote/Makefile
+++ b/src/grp-journal/grp-remote/Makefile
@@ -20,74 +20,11 @@
#
# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-ifneq ($(ENABLE_IMPORTD),)
-
-ifneq ($(HAVE_LIBCURL),)
-ifneq ($(HAVE_XZ),)
-ifneq ($(HAVE_ZLIB),)
-ifneq ($(HAVE_BZIP2),)
-ifneq ($(HAVE_GCRYPT),)
-
-dist_rootlibexec_DATA = \
- src/import/import-pubring.gpg
-
-nodist_systemunit_DATA += \
- units/systemd-importd.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.import1.busname
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.import1.busname
-
-SYSTEM_UNIT_ALIASES += \
- systemd-importd.service dbus-org.freedesktop.import1.service
-
-dist_dbussystemservice_DATA += \
- src/import/org.freedesktop.import1.service
-
-dist_dbuspolicy_DATA += \
- src/import/org.freedesktop.import1.conf
-
-polkitpolicy_files += \
- src/import/org.freedesktop.import1.policy
-
-manual_tests += \
- test-qcow2
-
-test_qcow2_SOURCES = \
- src/import/test-qcow2.c \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
-
-test_qcow2_CFLAGS = \
- $(AM_CFLAGS) \
- $(ZLIB_CFLAGS)
-
-test_qcow2_LDADD = \
- libshared.la \
- $(ZLIB_LIBS)
-
-endif # HAVE_GCRYPT
-endif # HAVE_BZIP2
-endif # HAVE_ZLIB
-endif # HAVE_XZ
-endif # HAVE_LIBCURL
-
-endif # ENABLE_IMPORTD
-
-polkitpolicy_in_files += \
- src/import/org.freedesktop.import1.policy.in
-
-EXTRA_DIST += \
- units/systemd-importd.service.in
-
-
-at.subdirs += systemd-journa-gatewayd
-at.subdirs += systemd-journa-remote
-at.subdirs += systemd-journa-upload
+nested.subdirs += systemd-journal-gatewayd
+nested.subdirs += systemd-journal-remote
+nested.subdirs += systemd-journal-upload
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/microhttpd-util.c b/src/grp-journal/grp-remote/microhttpd-util.c
index c65c43186f..99d6f32a2a 100644
--- a/src/grp-journal/grp-remote/microhttpd-util.c
+++ b/src/grp-journal/grp-remote/microhttpd-util.c
@@ -27,13 +27,13 @@
#include <gnutls/x509.h>
#endif
-#include "alloc-util.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
#include "microhttpd-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
void microhttpd_logger(void *arg, const char *fmt, va_list ap) {
char *f;
diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile
index 2003240fbe..b3c2e450e5 100644
--- a/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile
+++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile
@@ -20,7 +20,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/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(HAVE_MICROHTTPD),)
@@ -60,6 +60,9 @@ nodist_systemunit_DATA += \
dist_gatewayddocumentroot_DATA = \
src/journal-remote/browse.html
+dist_sysusers_DATA += \
+ sysusers.d/systemd-journal-gatewayd.conf
+
endif # HAVE_MICROHTTPD
EXTRA_DIST += \
diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c b/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c
index e265027a04..2e21f9ecb7 100644
--- a/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c
+++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c
@@ -27,21 +27,21 @@
#include <string.h>
#include <unistd.h>
-#include "sd-bus.h"
-#include "sd-daemon.h"
-#include "sd-journal.h"
-
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
-#include "log.h"
-#include "logs-show.h"
+#include <systemd/sd-bus.h>
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-journal.h>
+
+#include "basic/alloc-util.h"
+#include "shared/bus-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
+#include "shared/logs-show.h"
#include "microhttpd-util.h"
-#include "parse-util.h"
-#include "sigbus.h"
-#include "util.h"
+#include "basic/parse-util.h"
+#include "basic/sigbus.h"
+#include "basic/util.h"
#define JOURNAL_WAIT_TIMEOUT (10*USEC_PER_SEC)
diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/systemd-journal-gatewayd.sysusers b/src/grp-journal/grp-remote/systemd-journal-gatewayd/systemd-journal-gatewayd.sysusers
index 379be0852e..a60fcf4d42 100644
--- a/src/grp-journal/grp-remote/systemd-journal-gatewayd/systemd-journal-gatewayd.sysusers
+++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/systemd-journal-gatewayd.sysusers
@@ -5,4 +5,5 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
+m4_ifdef(`HAVE_MICROHTTPD',
u systemd-journal-gateway - "systemd Journal Gateway"
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/Makefile b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile
index b387eae386..7a9d9b19df 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/Makefile
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile
@@ -20,7 +20,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/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(HAVE_MICROHTTPD),)
@@ -63,15 +63,15 @@ endif # HAVE_GNUTLS
dist_systemunit_DATA += \
units/systemd-journal-remote.socket
+dist_sysusers_DATA += \
+ sysusers.d/systemd-journal-remote.conf
+
nodist_systemunit_DATA += \
units/systemd-journal-remote.service
-journal-remote-install-hook: journal-install-hook
- -$(MKDIR_P) $(DESTDIR)/var/log/journal/remote
- -chown 0:0 $(DESTDIR)/var/log/journal/remote
- -chmod 755 $(DESTDIR)/var/log/journal/remote
-
-INSTALL_EXEC_HOOKS += journal-remote-install-hook
+files.sys.all += /var/log/journal/remote
+$(DESTDIR)/var/log/journal/remote:
+ $(MKDIR_P) $@
nodist_pkgsysconf_DATA += \
src/journal-remote/journal-remote.conf
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c
index 35a1e55f9e..6ea7adabb0 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c
@@ -31,27 +31,27 @@
#include <gnutls/gnutls.h>
#endif
-#include "sd-daemon.h"
-
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
+#include <systemd/sd-daemon.h>
+
+#include "basic/alloc-util.h"
+#include "shared/conf-parser.h"
+#include "basic/def.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
#include "journal-file.h"
#include "journal-remote-write.h"
#include "journal-remote.h"
#include "journald-native.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
#define REMOTE_JOURNAL_PATH "/var/log/journal/remote"
diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/Makefile b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile
index 4a92997441..845a3a566d 100644
--- a/src/grp-journal/grp-remote/systemd-journal-upload/Makefile
+++ b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile
@@ -20,7 +20,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/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(HAVE_LIBCURL),)
@@ -45,7 +45,11 @@ nodist_systemunit_DATA += \
nodist_pkgsysconf_DATA += \
src/journal-remote/journal-upload.conf
-endif
+
+dist_sysusers_DATA += \
+ sysusers.d/systemd-journal-upload.conf
+
+endif # HAVE_LIBCURL
EXTRA_DIST += \
units/systemd-journal-upload.service.in \
diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h
index 2decc7b22e..9eeb8d2123 100644
--- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h
+++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h
@@ -1,5 +1,6 @@
#pragma once
+#include <curl/curl.h>
#include <inttypes.h>
#include <systemd/sd-event.h>
diff --git a/src/grp-journal/journalctl/Makefile b/src/grp-journal/journalctl/Makefile
index c3cdb6b27a..a7aa51403e 100644
--- a/src/grp-journal/journalctl/Makefile
+++ b/src/grp-journal/journalctl/Makefile
@@ -23,6 +23,9 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+rootbin_PROGRAMS += \
+ journalctl
+
# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
journalctl_CFLAGS = \
$(AM_CFLAGS)
@@ -46,4 +49,18 @@ journalctl_LDADD += \
$(QRENCODE_LIBS)
endif # HAVE_QRENCODE
+nodist_systemunit_DATA += \
+ units/systemd-journal-flush.service \
+ units/systemd-journal-catalog-update.service
+
+SYSINIT_TARGET_WANTS += \
+ systemd-journal-flush.service \
+ systemd-journal-catalog-update.service
+
+EXTRA_DIST += \
+ units/systemd-journal-flush.service.in \
+ units/systemd-journal-catalog-update.service.in
+
+sd.CPPFLAGS += -DCATALOG_DATABASE=\"$(catalogstatedir)/database\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/libjournal-core/.gitignore b/src/grp-journal/libjournal-core/.gitignore
deleted file mode 100644
index 04d5852547..0000000000
--- a/src/grp-journal/libjournal-core/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/journald-gperf.c
-/libsystemd-journal.pc
-/audit_type-list.txt
-/audit_type-*-name.*
diff --git a/src/grp-journal/libjournal-core/Makefile b/src/grp-journal/libjournal-core/Makefile
index d55aebfb49..997fcf0468 100644
--- a/src/grp-journal/libjournal-core/Makefile
+++ b/src/grp-journal/libjournal-core/Makefile
@@ -53,4 +53,6 @@ libjournal_core_la_LIBADD = \
noinst_LTLIBRARIES += \
libjournal-core.la
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/libjournal-core/journald-gperf.c b/src/grp-journal/libjournal-core/journald-gperf.c
new file mode 100644
index 0000000000..3da66da54f
--- /dev/null
+++ b/src/grp-journal/libjournal-core/journald-gperf.c
@@ -0,0 +1,175 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf */
+/* Computed positions: -k'9,18' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+
+#include <stddef.h>
+#include <string.h>
+#include <sys/socket.h>
+
+#include "shared/conf-parser.h"
+
+#include "journald-server.h"
+
+#define TOTAL_KEYWORDS 28
+#define MIN_WORD_LENGTH 12
+#define MAX_WORD_LENGTH 28
+#define MIN_HASH_VALUE 12
+#define MAX_HASH_VALUE 53
+/* maximum key range = 42, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+journald_gperf_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 10, 0, 54, 54,
+ 0, 54, 54, 0, 54, 20, 54, 0, 54, 54,
+ 54, 54, 5, 0, 30, 20, 54, 15, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 15, 54, 0,
+ 54, 25, 54, 54, 54, 25, 54, 54, 54, 54,
+ 54, 20, 10, 54, 54, 54, 0, 54, 15, 54,
+ 0, 5, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54
+ };
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[17]];
+ /*FALLTHROUGH*/
+ case 17:
+ case 16:
+ case 15:
+ case 14:
+ case 13:
+ case 12:
+ case 11:
+ case 10:
+ case 9:
+ hval += asso_values[(unsigned char)str[8]];
+ break;
+ }
+ return hval;
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct ConfigPerfItem *
+journald_gperf_lookup (register const char *str, register unsigned int len)
+{
+ static const struct ConfigPerfItem wordlist[] =
+ {
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {"Journal.Seal", config_parse_bool, 0, offsetof(Server, seal)},
+ {(char*)0}, {(char*)0},
+ {"Journal.Storage", config_parse_storage, 0, offsetof(Server, storage)},
+ {"Journal.Compress", config_parse_bool, 0, offsetof(Server, compress)},
+ {"Journal.SplitMode", config_parse_split_mode, 0, offsetof(Server, split_mode)},
+ {"Journal.MaxFileSec", config_parse_sec, 0, offsetof(Server, max_file_usec)},
+ {(char*)0},
+ {"Journal.MaxLevelKMsg", config_parse_log_level, 0, offsetof(Server, max_level_kmsg)},
+ {"Journal.MaxLevelStore", config_parse_log_level, 0, offsetof(Server, max_level_store)},
+ {"Journal.SystemMaxFiles", config_parse_uint64, 0, offsetof(Server, system_metrics.n_max_files)},
+ {"Journal.ForwardToSyslog", config_parse_bool, 0, offsetof(Server, forward_to_syslog)},
+ {"Journal.ForwardToConsole", config_parse_bool, 0, offsetof(Server, forward_to_console)},
+ {"Journal.SystemMaxFileSize", config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_size)},
+ {"Journal.RuntimeMaxUse", config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_use)},
+ {"Journal.MaxLevelSyslog", config_parse_log_level, 0, offsetof(Server, max_level_syslog)},
+ {"Journal.RuntimeMaxFiles", config_parse_uint64, 0, offsetof(Server, runtime_metrics.n_max_files)},
+ {(char*)0},
+ {"Journal.RateLimitInterval", config_parse_sec, 0, offsetof(Server, rate_limit_interval)},
+ {"Journal.RuntimeMaxFileSize", config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_size)},
+ {"Journal.SystemKeepFree", config_parse_iec_uint64, 0, offsetof(Server, system_metrics.keep_free)},
+ {"Journal.RateLimitIntervalSec",config_parse_sec, 0, offsetof(Server, rate_limit_interval)},
+ {(char*)0},
+ {"Journal.MaxLevelWall", config_parse_log_level, 0, offsetof(Server, max_level_wall)},
+ {"Journal.ForwardToWall", config_parse_bool, 0, offsetof(Server, forward_to_wall)},
+ {"Journal.RateLimitBurst", config_parse_unsigned, 0, offsetof(Server, rate_limit_burst)},
+ {"Journal.SyncIntervalSec", config_parse_sec, 0, offsetof(Server, sync_interval_usec)},
+ {(char*)0},
+ {"Journal.SystemMaxUse", config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_use)},
+ {"Journal.ForwardToKMsg", config_parse_bool, 0, offsetof(Server, forward_to_kmsg)},
+ {(char*)0},
+ {"Journal.MaxLevelConsole", config_parse_log_level, 0, offsetof(Server, max_level_console)},
+ {(char*)0},
+ {"Journal.TTYPath", config_parse_path, 0, offsetof(Server, tty_path)},
+ {(char*)0}, {(char*)0},
+ {"Journal.MaxRetentionSec", config_parse_sec, 0, offsetof(Server, max_retention_usec)},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {"Journal.RuntimeKeepFree", config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.keep_free)}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = journald_gperf_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register const char *s = wordlist[key].section_and_lvalue;
+
+ if (s && *str == *s && !strcmp (str + 1, s + 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
diff --git a/src/grp-journal/libjournal-core/journald-gperf.gperf b/src/grp-journal/libjournal-core/journald-gperf.gperf
index 7fecd7a964..f64cd871fe 100644
--- a/src/grp-journal/libjournal-core/journald-gperf.gperf
+++ b/src/grp-journal/libjournal-core/journald-gperf.gperf
@@ -1,7 +1,7 @@
%{
#include <stddef.h>
#include <sys/socket.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "journald-server.h"
%}
struct ConfigPerfItem;
diff --git a/src/grp-journal/libjournal-core/journald-server.c b/src/grp-journal/libjournal-core/journald-server.c
index 8f82d2a838..4dca4b02b3 100644
--- a/src/grp-journal/libjournal-core/journald-server.c
+++ b/src/grp-journal/libjournal-core/journald-server.c
@@ -26,29 +26,44 @@
#include <sys/statvfs.h>
#include <linux/sockios.h>
-#include "libudev.h"
-#include "sd-daemon.h"
-#include "sd-journal.h"
-#include "sd-messages.h"
-
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "cgroup-util.h"
-#include "conf-parser.h"
-#include "dirent-util.h"
-#include "extract-word.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "journal-authenticate.h"
-#include "journal-file.h"
-#include "journal-internal.h"
-#include "journal-vacuum.h"
+#include <libudev.h>
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-journal.h>
+#include <systemd/sd-messages.h>
+
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/dirent-util.h"
+#include "basic/extract-word.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/rm-rf.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "sd-journal/journal-authenticate.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-internal.h"
+#include "sd-journal/journal-vacuum.h"
+#include "shared/acl-util.h"
+#include "shared/conf-parser.h"
+
#include "journald-audit.h"
#include "journald-kmsg.h"
#include "journald-native.h"
@@ -56,20 +71,6 @@
#include "journald-server.h"
#include "journald-stream.h"
#include "journald-syslog.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "rm-rf.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "log.h"
#define USER_JOURNALS_MAX 1024
diff --git a/src/grp-journal/libjournal-core/journald-stream.c b/src/grp-journal/libjournal-core/journald-stream.c
index 4ad16ee41c..4b0062bc9a 100644
--- a/src/grp-journal/libjournal-core/journald-stream.c
+++ b/src/grp-journal/libjournal-core/journald-stream.c
@@ -24,28 +24,28 @@
#include <selinux/selinux.h>
#endif
-#include "sd-daemon.h"
-#include "sd-event.h"
-
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-event.h>
+
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
#include "journald-console.h"
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-stream.h"
#include "journald-syslog.h"
#include "journald-wall.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "selinux-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "syslog-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/selinux-util.h"
+#include "basic/socket-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/syslog-util.h"
#define STDOUT_STREAMS_MAX 4096
diff --git a/src/grp-journal/libjournal-core/test-compress.c b/src/grp-journal/libjournal-core/test-compress.c
index 68c9a4d76c..8cd098cabc 100644
--- a/src/grp-journal/libjournal-core/test-compress.c
+++ b/src/grp-journal/libjournal-core/test-compress.c
@@ -21,13 +21,13 @@
#include <lz4.h>
#endif
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "compress.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
-#include "random-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/random-util.h"
+#include "basic/util.h"
#ifdef HAVE_XZ
# define XZ_OK 0
diff --git a/src/grp-journal/systemd-cat/Makefile b/src/grp-journal/systemd-cat/Makefile
new file mode 100644
index 0000000000..a6d7eee6ea
--- /dev/null
+++ b/src/grp-journal/systemd-cat/Makefile
@@ -0,0 +1,36 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+systemd_cat_SOURCES = \
+ src/journal/cat.c
+
+systemd_cat_LDADD = \
+ libjournal-core.la
+
+
+bin_PROGRAMS += \
+ systemd-cat
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/systemd-journald/Makefile b/src/grp-journal/systemd-journald/Makefile
index 755e2d2c36..62f19aa1b8 100644
--- a/src/grp-journal/systemd-journald/Makefile
+++ b/src/grp-journal/systemd-journald/Makefile
@@ -31,36 +31,22 @@ systemd_journald_LDADD = \
libjournal-core.la \
libshared.la
-systemd_cat_SOURCES = \
- src/journal/cat.c
-
-systemd_cat_LDADD = \
- libjournal-core.la
-
-
rootlibexec_PROGRAMS += \
systemd-journald
-rootbin_PROGRAMS += \
- journalctl
-
-bin_PROGRAMS += \
- systemd-cat
-
dist_systemunit_DATA += \
units/systemd-journald.socket \
units/systemd-journald-dev-log.socket \
units/systemd-journald-audit.socket
nodist_systemunit_DATA += \
- units/systemd-journald.service \
- units/systemd-journal-flush.service \
- units/systemd-journal-catalog-update.service
+ units/systemd-journald.service
dist_pkgsysconf_DATA += \
src/journal/journald.conf
-dist_catalog_DATA = \
+# TODO
+_dist_catalog_DATA = \
catalog/systemd.bg.catalog \
catalog/systemd.be.catalog \
catalog/systemd.be@latin.catalog \
@@ -79,14 +65,10 @@ SOCKETS_TARGET_WANTS += \
systemd-journald-audit.socket
SYSINIT_TARGET_WANTS += \
- systemd-journald.service \
- systemd-journal-flush.service \
- systemd-journal-catalog-update.service
+ systemd-journald.service
EXTRA_DIST += \
- units/systemd-journald.service.in \
- units/systemd-journal-flush.service.in \
- units/systemd-journal-catalog-update.service.in
+ units/systemd-journald.service.in
gperf_gperf_sources += \
src/journal/journald-gperf.gperf
diff --git a/src/grp-journal/systemd-journald/systemd-journald.tmpfiles.m4 b/src/grp-journal/systemd-journald/systemd-journald.tmpfiles.m4
index 2cd58e9121..2e8bd8cbef 100644
--- a/src/grp-journal/systemd-journald/systemd-journald.tmpfiles.m4
+++ b/src/grp-journal/systemd-journald/systemd-journald.tmpfiles.m4
@@ -7,21 +7,6 @@
# See tmpfiles.d(5) for details
-d /run/user 0755 root root -
-F! /run/utmp 0664 root utmp -
-
-d /run/systemd/ask-password 0755 root root -
-d /run/systemd/seats 0755 root root -
-d /run/systemd/sessions 0755 root root -
-d /run/systemd/users 0755 root root -
-d /run/systemd/machines 0755 root root -
-d /run/systemd/shutdown 0755 root root -
-m4_ifdef(`ENABLE_NETWORKD',
-d /run/systemd/netif 0755 systemd-network systemd-network -
-d /run/systemd/netif/links 0755 systemd-network systemd-network -
-d /run/systemd/netif/leases 0755 systemd-network systemd-network -
-)m4_dnl
-
d /run/log 0755 root root -
z /run/log/journal 2755 root systemd-journal - -
@@ -68,6 +53,3 @@ a+ /var/log/journal/%m - - - - d:group:wheel:r-x
a+ /var/log/journal/%m - - - - group:wheel:r-x
a+ /var/log/journal/%m/system.journal - - - - group:wheel:r--
'')')')m4_dnl
-
-d /var/lib/systemd 0755 root root -
-d /var/lib/systemd/coredump 0755 root root 3d
diff --git a/src/grp-locale/Makefile b/src/grp-locale/Makefile
index b34c066ec2..6dc11dc2d8 100644
--- a/src/grp-locale/Makefile
+++ b/src/grp-locale/Makefile
@@ -23,68 +23,6 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-ifneq ($(ENABLE_LOCALED),)
-systemd_localed_SOURCES = \
- src/locale/localed.c
-
-systemd_localed_LDADD = \
- libshared.la \
- -ldl
-
-systemd_localed_CFLAGS = \
- $(AM_CFLAGS) \
- $(XKBCOMMON_CFLAGS)
-
-nodist_systemunit_DATA += \
- units/systemd-localed.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.locale1.busname
-
-rootlibexec_PROGRAMS += \
- systemd-localed
-
-dist_dbuspolicy_DATA += \
- src/locale/org.freedesktop.locale1.conf
-
-dist_dbussystemservice_DATA += \
- src/locale/org.freedesktop.locale1.service
-
-polkitpolicy_files += \
- src/locale/org.freedesktop.locale1.policy
-
-SYSTEM_UNIT_ALIASES += \
- systemd-localed.service dbus-org.freedesktop.locale1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.locale1.busname
-
-dist_pkgdata_DATA = \
- src/locale/kbd-model-map \
- src/locale/language-fallback-map
-
-localectl_SOURCES = \
- src/locale/localectl.c
-
-localectl_LDADD = \
- libshared.la
-
-bin_PROGRAMS += \
- localectl
-
-dist_bashcompletion_data += \
- shell-completion/bash/localectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_localectl
-endif # ENABLE_LOCALED
-
-.PHONY: update-kbd-model-map
-
-polkitpolicy_in_files += \
- src/locale/org.freedesktop.locale1.policy.in
-
-EXTRA_DIST += \
- units/systemd-localed.service.in
+nested.subdirs += systemd-localed localectl
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-locale/localectl/Makefile b/src/grp-locale/localectl/Makefile
new file mode 100644
index 0000000000..d0023df124
--- /dev/null
+++ b/src/grp-locale/localectl/Makefile
@@ -0,0 +1,45 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_LOCALED),)
+
+localectl_SOURCES = \
+ src/locale/localectl.c
+
+localectl_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ localectl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/localectl
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_localectl
+
+endif # ENABLE_LOCALED
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-locale/systemd-localed/.gitignore b/src/grp-locale/systemd-localed/.gitignore
index b1e0ba755e..6d9d6089c0 100644
--- a/src/grp-locale/systemd-localed/.gitignore
+++ b/src/grp-locale/systemd-localed/.gitignore
@@ -1 +1 @@
-org.freedesktop.locale1.policy
+/org.freedesktop.locale1.policy
diff --git a/src/grp-locale/systemd-localed/Makefile b/src/grp-locale/systemd-localed/Makefile
new file mode 100644
index 0000000000..de38bb8576
--- /dev/null
+++ b/src/grp-locale/systemd-localed/Makefile
@@ -0,0 +1,79 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_LOCALED),)
+systemd_localed_SOURCES = \
+ src/locale/localed.c
+
+systemd_localed_LDADD = \
+ libshared.la \
+ -ldl
+
+systemd_localed_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(XKBCOMMON_CFLAGS)
+
+nodist_systemunit_DATA += \
+ units/systemd-localed.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.locale1.busname
+
+rootlibexec_PROGRAMS += \
+ systemd-localed
+
+dist_dbuspolicy_DATA += \
+ src/locale/org.freedesktop.locale1.conf
+
+dist_dbussystemservice_DATA += \
+ src/locale/org.freedesktop.locale1.service
+
+polkitpolicy_files += \
+ src/locale/org.freedesktop.locale1.policy
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-localed.service dbus-org.freedesktop.locale1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.locale1.busname
+
+dist_pkgdata_DATA = \
+ src/locale/kbd-model-map \
+ src/locale/language-fallback-map
+
+endif # ENABLE_LOCALED
+
+.PHONY: update-kbd-model-map
+
+polkitpolicy_in_files += \
+ src/locale/org.freedesktop.locale1.policy.in
+
+EXTRA_DIST += \
+ units/systemd-localed.service.in
+
+sd.CPPFLAGS += -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\"
+sd.CPPFLAGS += -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\"
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-locale/systemd-localed/localed.c b/src/grp-locale/systemd-localed/localed.c
index 3b22a582ac..7bb7f1cf34 100644
--- a/src/grp-locale/systemd-localed/localed.c
+++ b/src/grp-locale/systemd-localed/localed.c
@@ -27,24 +27,24 @@
#include <dlfcn.h>
#endif
-#include "sd-bus.h"
-
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-message.h"
-#include "bus-util.h"
-#include "def.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "fileio.h"
-#include "locale-util.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include <systemd/sd-bus.h>
+
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/fileio.h"
+#include "basic/locale-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-message.h"
+#include "shared/bus-util.h"
enum {
/* We don't list LC_ALL here on purpose. People should be
diff --git a/src/grp-login/Makefile b/src/grp-login/Makefile
index 381d653166..be6adc4880 100644
--- a/src/grp-login/Makefile
+++ b/src/grp-login/Makefile
@@ -56,60 +56,9 @@ tests += \
test-login-tables \
test-login-shared
-
-nodist_systemunit_DATA += \
- units/systemd-logind.service
-
-dist_systemunit_DATA += \
- units/user.slice
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.login1.busname
-
-dist_dbussystemservice_DATA += \
- src/login/org.freedesktop.login1.service
-
-dist_dbuspolicy_DATA += \
- src/login/org.freedesktop.login1.conf
-
-nodist_pkgsysconf_DATA += \
- src/login/logind.conf
-
-polkitpolicy_files += \
- src/login/org.freedesktop.login1.policy
-
-INSTALL_DIRS += \
- $(systemdstatedir)
-
-MULTI_USER_TARGET_WANTS += \
- systemd-logind.service
-
-SYSTEM_UNIT_ALIASES += \
- systemd-logind.service dbus-org.freedesktop.login1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.login1.busname
-
-dist_udevrules_DATA += \
- src/login/70-uaccess.rules \
- src/login/70-power-switch.rules
-
-nodist_udevrules_DATA += \
- src/login/71-seat.rules \
- src/login/73-seat-late.rules
+nested.subdirs += loginctl systemd-logind
+nested.subdirs += pam_systemd systemd-inhibit
endif # ENABLE_LOGIND
-polkitpolicy_in_files += \
- src/login/org.freedesktop.login1.policy.in
-
-gperf_gperf_sources += \
- src/login/logind-gperf.gperf
-
-EXTRA_DIST += \
- src/login/71-seat.rules.in \
- src/login/73-seat-late.rules.in \
- units/systemd-logind.service.in \
- src/login/logind.conf.in
-
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/systemd-logind/Makefile b/src/grp-login/systemd-logind/Makefile
index b4da812a3e..18b18a1683 100644
--- a/src/grp-login/systemd-logind/Makefile
+++ b/src/grp-login/systemd-logind/Makefile
@@ -23,17 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-systemd_logind_SOURCES = \
- src/login/logind.c \
- src/login/logind.h
-
-nodist_systemd_logind_SOURCES = \
- src/login/logind-gperf.c
-
-systemd_logind_LDADD = \
- liblogind-core.la
-
-liblogind_core_la_SOURCES = \
+_liblogind_core_la_SOURCES = \
src/login/logind-core.c \
src/login/logind-device.c \
src/login/logind-device.h \
@@ -58,18 +48,81 @@ liblogind_core_la_SOURCES = \
src/login/logind-utmp.c \
src/login/logind-acl.h
-liblogind_core_la_LIBADD = \
- libshared.la
-
ifneq ($(HAVE_ACL),)
-liblogind_core_la_SOURCES += \
+_liblogind_core_la_SOURCES += \
src/login/logind-acl.c
endif # HAVE_ACL
-noinst_LTLIBRARIES += \
- liblogind-core.la
+systemd_logind_SOURCES = \
+ $(_liblogind_core_la_SOURCES) \
+ src/login/logind.c \
+ src/login/logind.h
+
+nodist_systemd_logind_SOURCES = \
+ src/login/logind-gperf.c
+
+systemd_logind_LDADD = \
+ libshared.la
rootlibexec_PROGRAMS += \
systemd-logind
+
+nodist_systemunit_DATA += \
+ units/systemd-logind.service
+
+dist_systemunit_DATA += \
+ units/user.slice
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.login1.busname
+
+dist_dbussystemservice_DATA += \
+ src/login/org.freedesktop.login1.service
+
+dist_dbuspolicy_DATA += \
+ src/login/org.freedesktop.login1.conf
+
+nodist_pkgsysconf_DATA += \
+ src/login/logind.conf
+
+polkitpolicy_files += \
+ src/login/org.freedesktop.login1.policy
+
+INSTALL_DIRS += \
+ $(systemdstatedir)
+
+MULTI_USER_TARGET_WANTS += \
+ systemd-logind.service
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-logind.service dbus-org.freedesktop.login1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.login1.busname
+
+dist_udevrules_DATA += \
+ src/login/70-uaccess.rules \
+ src/login/70-power-switch.rules
+
+nodist_udevrules_DATA += \
+ src/login/71-seat.rules \
+ src/login/73-seat-late.rules
+
+
+polkitpolicy_in_files += \
+ src/login/org.freedesktop.login1.policy.in
+
+gperf_gperf_sources += \
+ src/login/logind-gperf.gperf
+
+EXTRA_DIST += \
+ src/login/71-seat.rules.in \
+ src/login/73-seat-late.rules.in \
+ units/systemd-logind.service.in \
+ src/login/logind.conf.in
+
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+sd.CPPFLAGS += -DKEXEC=\"$(KEXEC)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/systemd-logind/logind-action.h b/src/grp-login/systemd-logind/logind-action.h
index fb40ae48d2..39ba3cf0f6 100644
--- a/src/grp-login/systemd-logind/logind-action.h
+++ b/src/grp-login/systemd-logind/logind-action.h
@@ -33,9 +33,10 @@ typedef enum HandleAction {
_HANDLE_ACTION_INVALID = -1
} HandleAction;
-#include "logind-inhibit.h"
#include "logind.h"
+#include "logind-inhibit.h"
+
int manager_handle_action(
Manager *m,
InhibitWhat inhibit_key,
diff --git a/src/grp-login/systemd-logind/logind-core.c b/src/grp-login/systemd-logind/logind-core.c
index 13ea97ae0d..1d6475f8d7 100644
--- a/src/grp-login/systemd-logind/logind-core.c
+++ b/src/grp-login/systemd-logind/logind-core.c
@@ -30,12 +30,11 @@
#include "basic/strv.h"
#include "basic/terminal-util.h"
#include "basic/user-util.h"
+#include "logind.h"
#include "sd-bus/bus-error.h"
#include "shared/bus-util.h"
#include "shared/udev-util.h"
-#include "logind.h"
-
int manager_add_device(Manager *m, const char *sysfs, bool master, Device **_device) {
Device *d;
diff --git a/src/grp-login/systemd-logind/logind-dbus.c b/src/grp-login/systemd-logind/logind-dbus.c
index 282ba64a3d..cb51e43a5c 100644
--- a/src/grp-login/systemd-logind/logind-dbus.c
+++ b/src/grp-login/systemd-logind/logind-dbus.c
@@ -41,6 +41,7 @@
#include "basic/terminal-util.h"
#include "basic/unit-name.h"
#include "basic/user-util.h"
+#include "logind.h"
#include "sd-bus/bus-common-errors.h"
#include "sd-bus/bus-error.h"
#include "shared/bus-util.h"
@@ -49,8 +50,6 @@
#include "shared/udev-util.h"
#include "shared/utmp-wtmp.h"
-#include "logind.h"
-
int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
Session *session;
diff --git a/src/grp-login/systemd-logind/logind-gperf.c b/src/grp-login/systemd-logind/logind-gperf.c
new file mode 100644
index 0000000000..9cac645686
--- /dev/null
+++ b/src/grp-login/systemd-logind/logind-gperf.c
@@ -0,0 +1,144 @@
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf */
+/* Computed positions: -k'10' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+
+#include <stddef.h>
+#include "shared/conf-parser.h"
+#include "logind.h"
+#include <string.h>
+
+#define TOTAL_KEYWORDS 23
+#define MIN_WORD_LENGTH 14
+#define MAX_WORD_LENGTH 33
+#define MIN_HASH_VALUE 14
+#define MAX_HASH_VALUE 44
+/* maximum key range = 31, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+logind_gperf_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 0, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 0, 0, 45, 45, 45, 20, 45, 45, 15, 45,
+ 45, 10, 0, 45, 0, 0, 0, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45
+ };
+ return len + asso_values[(unsigned char)str[9]];
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct ConfigPerfItem *
+logind_gperf_lookup (register const char *str, register unsigned int len)
+{
+ static const struct ConfigPerfItem wordlist[] =
+ {
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {(char*)0}, {(char*)0},
+ {"Login.NAutoVTs", config_parse_unsigned, 0, offsetof(Manager, n_autovts)},
+ {"Login.ReserveVT", config_parse_unsigned, 0, offsetof(Manager, reserve_vt)},
+ {"Login.IdleAction", config_parse_handle_action, 0, offsetof(Manager, idle_action)},
+ {"Login.SessionsMax", config_parse_uint64, 0, offsetof(Manager, sessions_max)},
+ {"Login.UserTasksMax", config_parse_uint64, 0, offsetof(Manager, user_tasks_max)},
+ {"Login.IdleActionSec", config_parse_sec, 0, offsetof(Manager, idle_action_usec)},
+ {"Login.HandlePowerKey", config_parse_handle_action, 0, offsetof(Manager, handle_power_key)},
+ {"Login.HandleLidSwitch", config_parse_handle_action, 0, offsetof(Manager, handle_lid_switch)},
+ {"Login.HandleSuspendKey", config_parse_handle_action, 0, offsetof(Manager, handle_suspend_key)},
+ {"Login.HoldoffTimeoutSec", config_parse_sec, 0, offsetof(Manager, holdoff_timeout_usec)},
+ {"Login.HandleHibernateKey", config_parse_handle_action, 0, offsetof(Manager, handle_hibernate_key)},
+ {"Login.RemoveIPC", config_parse_bool, 0, offsetof(Manager, remove_ipc)},
+ {"Login.RuntimeDirectorySize", config_parse_tmpfs_size, 0, offsetof(Manager, runtime_dir_size)},
+ {"Login.HandleLidSwitchDocked", config_parse_handle_action, 0, offsetof(Manager, handle_lid_switch_docked)},
+ {(char*)0},
+ {"Login.PowerKeyIgnoreInhibited", config_parse_bool, 0, offsetof(Manager, power_key_ignore_inhibited)},
+ {"Login.LidSwitchIgnoreInhibited", config_parse_bool, 0, offsetof(Manager, lid_switch_ignore_inhibited)},
+ {"Login.SuspendKeyIgnoreInhibited", config_parse_bool, 0, offsetof(Manager, suspend_key_ignore_inhibited)},
+ {(char*)0},
+ {"Login.HibernateKeyIgnoreInhibited", config_parse_bool, 0, offsetof(Manager, hibernate_key_ignore_inhibited)},
+ {"Login.KillOnlyUsers", config_parse_strv, 0, offsetof(Manager, kill_only_users)},
+ {(char*)0}, {(char*)0},
+ {"Login.KillExcludeUsers", config_parse_strv, 0, offsetof(Manager, kill_exclude_users)},
+ {"Login.KillUserProcesses", config_parse_bool, 0, offsetof(Manager, kill_user_processes)},
+ {"Login.InhibitorsMax", config_parse_uint64, 0, offsetof(Manager, inhibitors_max)},
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
+ {"Login.InhibitDelayMaxSec", config_parse_sec, 0, offsetof(Manager, inhibit_delay_max)}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = logind_gperf_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register const char *s = wordlist[key].section_and_lvalue;
+
+ if (s && *str == *s && !strcmp (str + 1, s + 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
diff --git a/src/grp-login/systemd-logind/logind-gperf.gperf b/src/grp-login/systemd-logind/logind-gperf.gperf
index 6bd08adc05..6d5c484439 100644
--- a/src/grp-login/systemd-logind/logind-gperf.gperf
+++ b/src/grp-login/systemd-logind/logind-gperf.gperf
@@ -1,6 +1,6 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "logind.h"
%}
struct ConfigPerfItem;
diff --git a/src/grp-login/systemd-logind/logind-seat-dbus.c b/src/grp-login/systemd-logind/logind-seat-dbus.c
index e4febe1ab5..fbebe6fcff 100644
--- a/src/grp-login/systemd-logind/logind-seat-dbus.c
+++ b/src/grp-login/systemd-logind/logind-seat-dbus.c
@@ -25,11 +25,11 @@
#include "basic/strv.h"
#include "basic/user-util.h"
#include "basic/util.h"
+#include "logind.h"
#include "sd-bus/bus-common-errors.h"
#include "shared/bus-util.h"
#include "logind-seat.h"
-#include "logind.h"
static int property_get_active_session(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-session-dbus.c b/src/grp-login/systemd-logind/logind-session-dbus.c
index f79f9b5003..76228d4474 100644
--- a/src/grp-login/systemd-logind/logind-session-dbus.c
+++ b/src/grp-login/systemd-logind/logind-session-dbus.c
@@ -26,12 +26,12 @@
#include "basic/signal-util.h"
#include "basic/strv.h"
#include "basic/util.h"
+#include "logind.h"
#include "sd-bus/bus-common-errors.h"
#include "shared/bus-util.h"
#include "logind-session-device.h"
#include "logind-session.h"
-#include "logind.h"
static int property_get_user(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-session.h b/src/grp-login/systemd-logind/logind-session.h
index 976046d847..23ff6576c9 100644
--- a/src/grp-login/systemd-logind/logind-session.h
+++ b/src/grp-login/systemd-logind/logind-session.h
@@ -19,12 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+typedef struct Session Session;
+typedef enum KillWho KillWho;
+
#include "basic/list.h"
#include "basic/login-util.h"
-typedef enum KillWho KillWho;
-typedef struct Session Session;
-
#include "logind-user.h"
typedef enum SessionState {
diff --git a/src/grp-login/systemd-logind/logind-user-dbus.c b/src/grp-login/systemd-logind/logind-user-dbus.c
index 57d1c857e6..d82ced605e 100644
--- a/src/grp-login/systemd-logind/logind-user-dbus.c
+++ b/src/grp-login/systemd-logind/logind-user-dbus.c
@@ -25,10 +25,10 @@
#include "basic/signal-util.h"
#include "basic/strv.h"
#include "basic/user-util.h"
+#include "logind.h"
#include "shared/bus-util.h"
#include "logind-user.h"
-#include "logind.h"
static int property_get_display(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-utmp.c b/src/grp-login/systemd-logind/logind-utmp.c
index 1e97083f78..c5dc137d61 100644
--- a/src/grp-login/systemd-logind/logind-utmp.c
+++ b/src/grp-login/systemd-logind/logind-utmp.c
@@ -31,13 +31,12 @@
#include "basic/strv.h"
#include "basic/unit-name.h"
#include "basic/user-util.h"
+#include "logind.h"
#include "sd-bus/bus-common-errors.h"
#include "sd-bus/bus-error.h"
#include "shared/bus-util.h"
#include "shared/utmp-wtmp.h"
-#include "logind.h"
-
_const_ static usec_t when_wall(usec_t n, usec_t elapse) {
usec_t left;
diff --git a/src/grp-machine/Makefile b/src/grp-machine/Makefile
index 7412341233..c5225e44b5 100644
--- a/src/grp-machine/Makefile
+++ b/src/grp-machine/Makefile
@@ -23,7 +23,8 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += machinectl systemd-machined
-at.subdirs += nss-mymachines
+nested.subdirs += machinectl systemd-machined
+nested.subdirs += nss-mymachines
+nested.subdirs += grp-import
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/Makefile b/src/grp-machine/grp-import/Makefile
new file mode 100644
index 0000000000..b996bd4c19
--- /dev/null
+++ b/src/grp-machine/grp-import/Makefile
@@ -0,0 +1,48 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifneq ($(ENABLE_IMPORTD),)
+
+ifneq ($(HAVE_LIBCURL),)
+ifneq ($(HAVE_XZ),)
+ifneq ($(HAVE_ZLIB),)
+ifneq ($(HAVE_BZIP2),)
+ifneq ($(HAVE_GCRYPT),)
+
+nested.subdirs += libimport
+nested.subdirs += systemd-export
+nested.subdirs += systemd-import
+nested.subdirs += systemd-importd
+nested.subdirs += systemd-pull
+
+endif # HAVE_GCRYPT
+endif # HAVE_BZIP2
+endif # HAVE_ZLIB
+endif # HAVE_XZ
+endif # HAVE_LIBCURL
+
+endif # ENABLE_IMPORTD
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/libimport/Makefile b/src/grp-machine/grp-import/libimport/Makefile
new file mode 100644
index 0000000000..5691d0bba1
--- /dev/null
+++ b/src/grp-machine/grp-import/libimport/Makefile
@@ -0,0 +1,51 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+noinst_LTLIBRARIES += libimport.la
+
+libimport_la_SOURCES = \
+ qcow2-util.c \
+ import-common.c \
+ import-compress.c
+
+libimport_la_LIBADD += libbasic.la
+
+manual_tests += \
+ test-qcow2
+
+test_qcow2_SOURCES = \
+ src/import/test-qcow2.c \
+ src/import/qcow2-util.c \
+ src/import/qcow2-util.h
+
+test_qcow2_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(ZLIB_CFLAGS)
+
+test_qcow2_LDADD = \
+ libshared.la \
+ $(ZLIB_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/libimport/import-common.h b/src/grp-machine/grp-import/libimport/import-common.h
index 07d3250e71..3abd62e8c3 100644
--- a/src/grp-machine/grp-import/libimport/import-common.h
+++ b/src/grp-machine/grp-import/libimport/import-common.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/types.h>
+
int import_make_read_only_fd(int fd);
int import_make_read_only(const char *path);
diff --git a/src/grp-machine/grp-import/systemd-export/Makefile b/src/grp-machine/grp-import/systemd-export/Makefile
index f6e15987a5..f8fcbc3cca 100644
--- a/src/grp-machine/grp-import/systemd-export/Makefile
+++ b/src/grp-machine/grp-import/systemd-export/Makefile
@@ -30,11 +30,7 @@ systemd_export_SOURCES = \
src/import/export-tar.c \
src/import/export-tar.h \
src/import/export-raw.c \
- src/import/export-raw.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h
+ src/import/export-raw.h
systemd_export_CFLAGS = \
$(AM_CFLAGS) \
@@ -44,6 +40,7 @@ systemd_export_CFLAGS = \
systemd_export_LDADD = \
libshared.la \
+ libimport.la \
$(XZ_LIBS) \
$(ZLIB_LIBS) \
$(BZIP2_LIBS)
diff --git a/src/grp-machine/grp-import/systemd-export/export-raw.c b/src/grp-machine/grp-import/systemd-export/export-raw.c
index db06e11b87..1e3f6e034e 100644
--- a/src/grp-machine/grp-import/systemd-export/export-raw.c
+++ b/src/grp-machine/grp-import/systemd-export/export-raw.c
@@ -25,18 +25,18 @@
#include <libgen.h>
#undef basename
-#include "sd-daemon.h"
+#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "copy.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/copy.h"
#include "export-raw.h"
-#include "fd-util.h"
-#include "fileio.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
#include "import-common.h"
-#include "ratelimit.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/ratelimit.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#define COPY_BUFFER_SIZE (16*1024)
diff --git a/src/grp-machine/grp-import/systemd-export/export-raw.h b/src/grp-machine/grp-import/systemd-export/export-raw.h
index cf34d512bc..00f6931d7b 100644
--- a/src/grp-machine/grp-import/systemd-export/export-raw.h
+++ b/src/grp-machine/grp-import/systemd-export/export-raw.h
@@ -25,6 +25,7 @@
#include "import-compress.h"
typedef struct RawExport RawExport;
+
typedef void (*RawExportFinished)(RawExport *export, int error, void *userdata);
int raw_export_new(RawExport **export, sd_event *event, RawExportFinished on_finished, void *userdata);
diff --git a/src/grp-machine/grp-import/systemd-export/export-tar.h b/src/grp-machine/grp-import/systemd-export/export-tar.h
index c048a6d642..9efde8931d 100644
--- a/src/grp-machine/grp-import/systemd-export/export-tar.h
+++ b/src/grp-machine/grp-import/systemd-export/export-tar.h
@@ -25,6 +25,7 @@
#include "import-compress.h"
typedef struct TarExport TarExport;
+
typedef void (*TarExportFinished)(TarExport *export, int error, void *userdata);
int tar_export_new(TarExport **export, sd_event *event, TarExportFinished on_finished, void *userdata);
diff --git a/src/grp-machine/grp-import/systemd-import/Makefile b/src/grp-machine/grp-import/systemd-import/Makefile
index e117efc68a..06fd01fcd7 100644
--- a/src/grp-machine/grp-import/systemd-import/Makefile
+++ b/src/grp-machine/grp-import/systemd-import/Makefile
@@ -29,13 +29,7 @@ systemd_import_SOURCES = \
src/import/import-raw.c \
src/import/import-raw.h \
src/import/import-tar.c \
- src/import/import-tar.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
+ src/import/import-tar.h
systemd_import_CFLAGS = \
$(AM_CFLAGS) \
@@ -45,6 +39,7 @@ systemd_import_CFLAGS = \
systemd_import_LDADD = \
libshared.la \
+ libimport.la \
$(XZ_LIBS) \
$(ZLIB_LIBS) \
$(BZIP2_LIBS)
diff --git a/src/grp-machine/grp-import/systemd-import/import-raw.c b/src/grp-machine/grp-import/systemd-import/import-raw.c
index 55a6d044ab..658c912f88 100644
--- a/src/grp-machine/grp-import/systemd-import/import-raw.c
+++ b/src/grp-machine/grp-import/systemd-import/import-raw.c
@@ -37,11 +37,11 @@
#include "basic/rm-rf.h"
#include "basic/string-util.h"
#include "basic/util.h"
-#include "import-common.h"
-#include "import-compress.h"
#include "qcow2-util.h"
#include "shared/machine-pool.h"
+#include "import-common.h"
+#include "import-compress.h"
#include "import-raw.h"
struct RawImport {
diff --git a/src/grp-machine/grp-import/systemd-import/import-raw.h b/src/grp-machine/grp-import/systemd-import/import-raw.h
index ae7e0b017d..61ec8cc91e 100644
--- a/src/grp-machine/grp-import/systemd-import/import-raw.h
+++ b/src/grp-machine/grp-import/systemd-import/import-raw.h
@@ -25,6 +25,7 @@
#include "shared/import-util.h"
typedef struct RawImport RawImport;
+
typedef void (*RawImportFinished)(RawImport *import, int error, void *userdata);
int raw_import_new(RawImport **import, sd_event *event, const char *image_root, RawImportFinished on_finished, void *userdata);
diff --git a/src/grp-machine/grp-import/systemd-import/import-tar.c b/src/grp-machine/grp-import/systemd-import/import-tar.c
index 0d61b5f01d..f66a7e7e4c 100644
--- a/src/grp-machine/grp-import/systemd-import/import-tar.c
+++ b/src/grp-machine/grp-import/systemd-import/import-tar.c
@@ -37,11 +37,11 @@
#include "basic/rm-rf.h"
#include "basic/string-util.h"
#include "basic/util.h"
-#include "import-common.h"
-#include "import-compress.h"
#include "qcow2-util.h"
#include "shared/machine-pool.h"
+#include "import-common.h"
+#include "import-compress.h"
#include "import-tar.h"
struct TarImport {
diff --git a/src/grp-machine/grp-import/systemd-import/import-tar.h b/src/grp-machine/grp-import/systemd-import/import-tar.h
index b5012f1ea4..35a08fcfc5 100644
--- a/src/grp-machine/grp-import/systemd-import/import-tar.h
+++ b/src/grp-machine/grp-import/systemd-import/import-tar.h
@@ -25,6 +25,7 @@
#include "shared/import-util.h"
typedef struct TarImport TarImport;
+
typedef void (*TarImportFinished)(TarImport *import, int error, void *userdata);
int tar_import_new(TarImport **import, sd_event *event, const char *image_root, TarImportFinished on_finished, void *userdata);
diff --git a/src/grp-machine/grp-import/systemd-importd/Makefile b/src/grp-machine/grp-import/systemd-importd/Makefile
index 0070c48d05..1f5bae1267 100644
--- a/src/grp-machine/grp-import/systemd-importd/Makefile
+++ b/src/grp-machine/grp-import/systemd-importd/Makefile
@@ -36,4 +36,34 @@ systemd_importd_CFLAGS = \
systemd_importd_LDADD = \
libshared.la
+dist_rootlibexec_DATA = \
+ src/import/import-pubring.gpg
+
+nodist_systemunit_DATA += \
+ units/systemd-importd.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.import1.busname
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.import1.busname
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-importd.service dbus-org.freedesktop.import1.service
+
+dist_dbussystemservice_DATA += \
+ src/import/org.freedesktop.import1.service
+
+dist_dbuspolicy_DATA += \
+ src/import/org.freedesktop.import1.conf
+
+polkitpolicy_files += \
+ src/import/org.freedesktop.import1.policy
+
+polkitpolicy_in_files += \
+ src/import/org.freedesktop.import1.policy.in
+
+EXTRA_DIST += \
+ units/systemd-importd.service.in
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/systemd-pull/Makefile b/src/grp-machine/grp-import/systemd-pull/Makefile
index 31a90fc90f..1ee9fa25de 100644
--- a/src/grp-machine/grp-import/systemd-pull/Makefile
+++ b/src/grp-machine/grp-import/systemd-pull/Makefile
@@ -34,14 +34,8 @@ systemd_pull_SOURCES = \
src/import/pull-job.h \
src/import/pull-common.c \
src/import/pull-common.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h \
src/import/curl-util.c \
- src/import/curl-util.h \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
+ src/import/curl-util.h
systemd_pull_CFLAGS = \
$(AM_CFLAGS) \
@@ -54,6 +48,7 @@ systemd_pull_CFLAGS = \
-D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
systemd_pull_LDADD = \
+ libimport.la \
libshared.la \
$(LIBCURL_LIBS) \
$(XZ_LIBS) \
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-job.h b/src/grp-machine/grp-import/systemd-pull/pull-job.h
index 296e32bd09..d8308e4046 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-job.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-job.h
@@ -22,11 +22,11 @@
#include <gcrypt.h>
#include "basic/macro.h"
-#include "import-compress.h"
-
#include "curl-util.h"
+#include "import-compress.h"
typedef struct PullJob PullJob;
+
typedef void (*PullJobFinished)(PullJob *job);
typedef int (*PullJobOpenDisk)(PullJob *job);
typedef int (*PullJobHeader)(PullJob *job, const char *header, size_t sz);
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-raw.c b/src/grp-machine/grp-import/systemd-pull/pull-raw.c
index 9602915a1f..59257d6a0c 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-raw.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-raw.c
@@ -41,11 +41,11 @@
#include "basic/utf8.h"
#include "basic/util.h"
#include "basic/web-util.h"
+#include "curl-util.h"
#include "import-common.h"
#include "qcow2-util.h"
#include "shared/import-util.h"
-#include "curl-util.h"
#include "pull-common.h"
#include "pull-job.h"
#include "pull-raw.h"
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-raw.h b/src/grp-machine/grp-import/systemd-pull/pull-raw.h
index 93032edf09..47ed499c12 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-raw.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-raw.h
@@ -25,6 +25,7 @@
#include "shared/import-util.h"
typedef struct RawPull RawPull;
+
typedef void (*RawPullFinished)(RawPull *pull, int error, void *userdata);
int raw_pull_new(RawPull **pull, sd_event *event, const char *image_root, RawPullFinished on_finished, void *userdata);
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-tar.c b/src/grp-machine/grp-import/systemd-pull/pull-tar.c
index 121ca31dbd..e6031db0ed 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-tar.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-tar.c
@@ -39,10 +39,10 @@
#include "basic/utf8.h"
#include "basic/util.h"
#include "basic/web-util.h"
+#include "curl-util.h"
#include "import-common.h"
#include "shared/import-util.h"
-#include "curl-util.h"
#include "pull-common.h"
#include "pull-job.h"
#include "pull-tar.h"
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-tar.h b/src/grp-machine/grp-import/systemd-pull/pull-tar.h
index 81797fa359..a2850fee9e 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-tar.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-tar.h
@@ -25,6 +25,7 @@
#include "shared/import-util.h"
typedef struct TarPull TarPull;
+
typedef void (*TarPullFinished)(TarPull *pull, int error, void *userdata);
int tar_pull_new(TarPull **pull, sd_event *event, const char *image_root, TarPullFinished on_finished, void *userdata);
diff --git a/src/grp-machine/systemd-machined/Makefile b/src/grp-machine/systemd-machined/Makefile
index 98d7a58d92..182b52edd2 100644
--- a/src/grp-machine/systemd-machined/Makefile
+++ b/src/grp-machine/systemd-machined/Makefile
@@ -23,17 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-systemd_machined_SOURCES = \
- src/machine/machined.c \
- src/machine/machined.h
-
-systemd_machined_LDADD = \
- libmachine-core.la
-
-rootlibexec_PROGRAMS += \
- systemd-machined
-
-libmachine_core_la_SOURCES = \
+_libmachine_core_la_SOURCES = \
src/machine/machine.c \
src/machine/machine.h \
src/machine/machined-dbus.c \
@@ -44,20 +34,18 @@ libmachine_core_la_SOURCES = \
src/machine/operation.c \
src/machine/operation.h
-libmachine_core_la_LIBADD = \
- libshared.la
-
-noinst_LTLIBRARIES += \
- libmachine-core.la
-
-test_machine_tables_SOURCES = \
- src/machine/test-machine-tables.c
+systemd_machined_SOURCES = \
+ $(_libmachine_core_la_SOURCES) \
+ src/machine/machined.c \
+ src/machine/machined.h
-test_machine_tables_LDADD = \
- libmachine-core.la
+systemd_machined_LDADD = \
+ libsystemd-internal.la \
+ libshared.la \
+ libbasic.la
-tests += \
- test-machine-tables
+rootlibexec_PROGRAMS += \
+ systemd-machined
nodist_systemunit_DATA += \
units/systemd-machined.service
@@ -90,4 +78,11 @@ polkitpolicy_in_files += \
EXTRA_DIST += \
units/systemd-machined.service.in
+test_machine_tables_SOURCES = \
+ $(_libmachine_core_la_SOURCES) \
+ src/machine/test-machine-tables.c
+
+tests += \
+ test-machine-tables
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/systemd-machined/machine-dbus.c b/src/grp-machine/systemd-machined/machine-dbus.c
index 7b9aa66d63..95f2084455 100644
--- a/src/grp-machine/systemd-machined/machine-dbus.c
+++ b/src/grp-machine/systemd-machined/machine-dbus.c
@@ -28,28 +28,29 @@
#include <libgen.h>
#undef basename
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-internal.h"
-#include "bus-label.h"
-#include "bus-util.h"
-#include "copy.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "in-addr-util.h"
-#include "local-addresses.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/copy.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-internal.h"
+#include "sd-netlink/local-addresses.h"
+#include "shared/bus-util.h"
+
#include "machine-dbus.h"
#include "machine.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "user-util.h"
static int property_get_id(
sd_bus *bus,
diff --git a/src/grp-machine/systemd-machined/machine.h b/src/grp-machine/systemd-machined/machine.h
index e93f0cf222..cba0311c23 100644
--- a/src/grp-machine/systemd-machined/machine.h
+++ b/src/grp-machine/systemd-machined/machine.h
@@ -19,10 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "basic/list.h"
-
-typedef enum KillWho KillWho;
typedef struct Machine Machine;
+typedef enum KillWho KillWho;
+
+#include "basic/list.h"
#include "machined.h"
#include "operation.h"
diff --git a/src/grp-network/Makefile b/src/grp-network/Makefile
index 7cbd9142d0..7502fcbdde 100644
--- a/src/grp-network/Makefile
+++ b/src/grp-network/Makefile
@@ -23,7 +23,8 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-dist_network_DATA = \
+# TODO
+_dist_network_DATA = \
network/99-default.link \
network/80-container-host0.network \
network/80-container-ve.network \
@@ -65,33 +66,6 @@ tests += \
test-network \
test-network-tables
-dist_systemunit_DATA += \
- units/systemd-networkd.socket
-
-nodist_systemunit_DATA += \
- units/systemd-networkd.service \
- units/systemd-networkd-wait-online.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.network1.busname
-
-dist_dbussystemservice_DATA += \
- src/network/org.freedesktop.network1.service
-
-dist_dbuspolicy_DATA += \
- src/network/org.freedesktop.network1.conf
-
-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
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.network1.busname
-
endif # ENABLE_NETWORKD
gperf_gperf_sources += \
@@ -99,9 +73,12 @@ gperf_gperf_sources += \
src/network/networkd-network-gperf.gperf \
src/network/networkd-netdev-gperf.gperf
-EXTRA_DIST += \
- units/systemd-networkd.service.m4.in \
- units/systemd-networkd-wait-online.service.in \
- test/networkd-test.py
+dist_systempreset_DATA = \
+ 90-networkd.preset
+
+nested.subdirs += libnetworkd-core
+nested.subdirs += networkctl
+nested.subdirs += systemd-networkd
+nested.subdirs += systemd-networkd-wait-online
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/libnetworkd-core/Makefile b/src/grp-network/libnetworkd-core/Makefile
index 53d65460f2..4375a4d4f3 100644
--- a/src/grp-network/libnetworkd-core/Makefile
+++ b/src/grp-network/libnetworkd-core/Makefile
@@ -88,6 +88,10 @@ nodist_libnetworkd_core_la_SOURCES = \
libnetworkd_core_la_LIBADD = \
libsystemd-network.la \
+ libsystemd-internal.la \
+ libfirewall.la \
libshared.la
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/libnetworkd-core/networkd-gperf.gperf b/src/grp-network/libnetworkd-core/networkd-gperf.gperf
index 3fdfe74955..e1e2a687e6 100644
--- a/src/grp-network/libnetworkd-core/networkd-gperf.gperf
+++ b/src/grp-network/libnetworkd-core/networkd-gperf.gperf
@@ -1,6 +1,6 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "networkd-conf.h"
%}
struct ConfigPerfItem;
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-gperf.gperf b/src/grp-network/libnetworkd-core/networkd-netdev-gperf.gperf
index ba04bb0165..cfbff05578 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-gperf.gperf
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-gperf.gperf
@@ -1,7 +1,7 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
-#include "network-internal.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/network-internal.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-ipvlan.h"
#include "networkd-netdev-macvlan.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-network-gperf.gperf b/src/grp-network/libnetworkd-core/networkd-network-gperf.gperf
index 03e4e3b39f..50e5d1c19e 100644
--- a/src/grp-network/libnetworkd-core/networkd-network-gperf.gperf
+++ b/src/grp-network/libnetworkd-core/networkd-network-gperf.gperf
@@ -1,9 +1,9 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "networkd.h"
#include "networkd-conf.h"
-#include "network-internal.h"
+#include "systemd-network/network-internal.h"
%}
struct ConfigPerfItem;
%null_strings
diff --git a/src/grp-network/systemd-networkd-wait-online/Makefile b/src/grp-network/systemd-networkd-wait-online/Makefile
index 12aa13c48f..8d1870c862 100644
--- a/src/grp-network/systemd-networkd-wait-online/Makefile
+++ b/src/grp-network/systemd-networkd-wait-online/Makefile
@@ -41,4 +41,13 @@ systemd_networkd_wait_online_LDADD = \
libsystemd-network.la \
libshared.la
+nodist_systemunit_DATA += \
+ units/systemd-networkd-wait-online.service
+
+GENERAL_ALIASES += \
+ $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
+
+EXTRA_DIST += \
+ units/systemd-networkd-wait-online.service.in
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/systemd-networkd/Makefile b/src/grp-network/systemd-networkd/Makefile
index 8b7e44062b..d6ef3bb91d 100644
--- a/src/grp-network/systemd-networkd/Makefile
+++ b/src/grp-network/systemd-networkd/Makefile
@@ -30,6 +30,7 @@ systemd_networkd_SOURCES = \
src/network/networkd.c
systemd_networkd_LDADD = \
+ libbasic.la \
libnetworkd-core.la
ifneq ($(HAVE_LIBIPTC),)
@@ -37,4 +38,33 @@ systemd_networkd_LDADD += \
libfirewall.la
endif # HAVE_LIBIPTC
+dist_systemunit_DATA += \
+ units/systemd-networkd.socket
+
+nodist_systemunit_DATA += \
+ units/systemd-networkd.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.network1.busname
+
+dist_dbussystemservice_DATA += \
+ src/network/org.freedesktop.network1.service
+
+dist_dbuspolicy_DATA += \
+ src/network/org.freedesktop.network1.conf
+
+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
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-networkd.service dbus-org.freedesktop.network1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.network1.busname
+
+EXTRA_DIST += \
+ units/systemd-networkd.service.m4.in \
+ test/networkd-test.py
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/systemd-networkd/systemd-networkd.tmpfiles b/src/grp-network/systemd-networkd/systemd-networkd.tmpfiles
new file mode 100644
index 0000000000..24197555ee
--- /dev/null
+++ b/src/grp-network/systemd-networkd/systemd-networkd.tmpfiles
@@ -0,0 +1,12 @@
+# This file is part of systemd.
+#
+# 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.
+
+# See tmpfiles.d(5) for details
+
+d /run/systemd/netif 0755 systemd-network systemd-network -
+d /run/systemd/netif/links 0755 systemd-network systemd-network -
+d /run/systemd/netif/leases 0755 systemd-network systemd-network -
diff --git a/src/grp-resolve/90-resolved.preset b/src/grp-resolve/90-resolved.preset
index c5a5063cc1..6033cd7ccc 100644
--- a/src/grp-resolve/90-resolved.preset
+++ b/src/grp-resolve/90-resolved.preset
@@ -5,7 +5,4 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
-# These ones should be enabled by default, even if distributions
-# generally follow a default-off policy.
-
enable systemd-resolved.service
diff --git a/src/grp-resolve/Makefile b/src/grp-resolve/Makefile
index ae0c5a2466..849af75af5 100644
--- a/src/grp-resolve/Makefile
+++ b/src/grp-resolve/Makefile
@@ -23,6 +23,10 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += systemd-resolved nss-resolve
+dist_systempreset_DATA = \
+ 90-resolved.preset
+
+nested.subdirs += libbasic-dns
+nested.subdirs += systemd-resolved systemd-resolve nss-resolve
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/libbasic-dns/Makefile b/src/grp-resolve/libbasic-dns/Makefile
new file mode 100644
index 0000000000..3c9fe3e783
--- /dev/null
+++ b/src/grp-resolve/libbasic-dns/Makefile
@@ -0,0 +1,115 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+$(outdir)/dns_type-list.txt: $(srcdir)/dns-type.h
+ $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
+
+$(outdir)/dns_type-to-name.h: $(outdir)/dns_type-list.txt
+ $(AM_V_GEN)$(AWK) '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" }' <$< >$@
+
+$(outdir)/dns_type-from-name.gperf: $(outdir)/dns_type-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
+
+basic_dns_sources =
+libbasic_dns_la_SOURCES = \
+ src/resolve/resolved-dns-dnssec.c \
+ src/resolve/resolved-dns-dnssec.h \
+ src/resolve/resolved-dns-packet.c \
+ src/resolve/resolved-dns-packet.h \
+ src/resolve/resolved-dns-rr.c \
+ src/resolve/resolved-dns-rr.h \
+ src/resolve/resolved-dns-answer.c \
+ src/resolve/resolved-dns-answer.h \
+ src/resolve/resolved-dns-question.c \
+ src/resolve/resolved-dns-question.h \
+ src/resolve/dns-type.c \
+ src/resolve/dns-type.h
+
+
+tests += \
+ test-dns-packet \
+ test-resolve-tables \
+ test-dnssec
+
+manual_tests += \
+ test-dnssec-complex
+
+test_resolve_tables_SOURCES = \
+ src/resolve/test-resolve-tables.c \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h \
+ $(basic_dns_sources) \
+ src/shared/test-tables.h
+
+test_resolve_tables_LDADD = \
+ libbasic-dns.la \
+ libshared.la
+
+test_dns_packet_SOURCES = \
+ src/resolve/test-dns-packet.c \
+ $(basic_dns_sources)
+
+test_dns_packet_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DRESOLVE_TEST_DIR=\"$(abs_top_srcdir)/src/resolve/test-data\"
+
+test_dns_packet_LDADD = \
+ libbasic-dns.la \
+ libshared.la
+
+EXTRA_DIST += \
+ src/resolve/test-data/_openpgpkey.fedoraproject.org.pkts \
+ src/resolve/test-data/fedoraproject.org.pkts \
+ src/resolve/test-data/gandi.net.pkts \
+ src/resolve/test-data/google.com.pkts \
+ src/resolve/test-data/root.pkts \
+ src/resolve/test-data/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
+ src/resolve/test-data/teamits.com.pkts \
+ src/resolve/test-data/zbyszek@fedoraproject.org.pkts \
+ src/resolve/test-data/_443._tcp.fedoraproject.org.pkts \
+ src/resolve/test-data/kyhwana.org.pkts \
+ src/resolve/test-data/fake-caa.pkts
+
+test_dnssec_SOURCES = \
+ src/resolve/test-dnssec.c \
+ $(basic_dns_sources)
+
+test_dnssec_LDADD = \
+ libbasic-dns.la \
+ libshared.la
+
+test_dnssec_complex_SOURCES = \
+ src/resolve/test-dnssec-complex.c \
+ src/resolve/dns-type.c \
+ src/resolve/dns-type.h
+
+test_dnssec_complex_LDADD = \
+ libshared.la
+
+noinst_LTLIBRARIES = libbasic-dns.la
+libbasic_dns_la_LIBADD = libshared.la
+$(outdir)/dns-type.lo: $(outdir)/dns_type-from-name.h $(outdir)/dns_type-to-name.h
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.c b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.c
index a54aed3a63..39afbada25 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.c
@@ -21,13 +21,13 @@
#include <gcrypt.h>
#endif
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "gcrypt-util.h"
-#include "hexdecoct.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+#include "shared/gcrypt-util.h"
+#include "basic/hexdecoct.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
-#include "string-table.h"
+#include "basic/string-table.h"
#define VERIFY_RRS_MAX 256
#define MAX_KEY_SIZE (32*1024)
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
index b73cc24100..81879e287f 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
@@ -19,11 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "shared/dns-domain.h"
-
typedef enum DnssecResult DnssecResult;
typedef enum DnssecVerdict DnssecVerdict;
+#include "shared/dns-domain.h"
+
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
diff --git a/src/grp-resolve/systemd-resolve/Makefile b/src/grp-resolve/systemd-resolve/Makefile
new file mode 100644
index 0000000000..46322830ac
--- /dev/null
+++ b/src/grp-resolve/systemd-resolve/Makefile
@@ -0,0 +1,52 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+basic_dns_sources =
+
+systemd_resolve_SOURCES = \
+ src/resolve/resolve-tool.c \
+ $(basic_dns_sources) \
+ src/shared/gcrypt-util.c \
+ src/shared/gcrypt-util.h
+
+nodist_systemd_resolve_SOURCES = \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h
+
+systemd_resolve_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ systemd-resolve
+
+dist_bashcompletion_data += \
+ shell-completion/bash/systemd-resolve
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_systemd-resolve
+
+systemd_resolve_LDADD += libbasic-dns.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolve/gcrypt-util.c b/src/grp-resolve/systemd-resolve/gcrypt-util.c
new file mode 120000
index 0000000000..5b2fae92e2
--- /dev/null
+++ b/src/grp-resolve/systemd-resolve/gcrypt-util.c
@@ -0,0 +1 @@
+../../libshared/src/gcrypt-util.c \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolve/gcrypt-util.h b/src/grp-resolve/systemd-resolve/gcrypt-util.h
new file mode 120000
index 0000000000..e1ad70b84f
--- /dev/null
+++ b/src/grp-resolve/systemd-resolve/gcrypt-util.h
@@ -0,0 +1 @@
+../../libshared/include/shared/gcrypt-util.h \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolve/resolve-tool.c b/src/grp-resolve/systemd-resolve/resolve-tool.c
index dee23289b3..d9f28576b7 100644
--- a/src/grp-resolve/systemd-resolve/resolve-tool.c
+++ b/src/grp-resolve/systemd-resolve/resolve-tool.c
@@ -28,12 +28,13 @@
#include "basic/in-addr-util.h"
#include "basic/parse-util.h"
#include "basic/terminal-util.h"
-#include "resolved-def.h"
-#include "resolved-dns-packet.h"
#include "sd-bus/bus-error.h"
#include "shared/bus-util.h"
#include "shared/gcrypt-util.h"
+#include "resolved-def.h"
+#include "resolved-dns-packet.h"
+
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
static int arg_family = AF_UNSPEC;
diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile
index e18b1b3d90..7a2cff2f2e 100644
--- a/src/grp-resolve/systemd-resolved/Makefile
+++ b/src/grp-resolve/systemd-resolved/Makefile
@@ -23,34 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-
-$(outdir)/dns_type-list.txt: src/resolve/dns-type.h
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
-
-$(outdir)/dns_type-to-name.h: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) '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" }' <$< >$@
-
-$(outdir)/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
-
-ifneq ($(ENABLE_RESOLVED),)
-
-basic_dns_sources = \
- src/resolve/resolved-dns-dnssec.c \
- src/resolve/resolved-dns-dnssec.h \
- src/resolve/resolved-dns-packet.c \
- src/resolve/resolved-dns-packet.h \
- src/resolve/resolved-dns-rr.c \
- src/resolve/resolved-dns-rr.h \
- src/resolve/resolved-dns-answer.c \
- src/resolve/resolved-dns-answer.h \
- src/resolve/resolved-dns-question.c \
- src/resolve/resolved-dns-question.h \
- src/resolve/dns-type.c \
- src/resolve/dns-type.h
+basic_dns_sources =
systemd_resolved_SOURCES = \
src/resolve/resolved.c \
@@ -133,87 +106,6 @@ GENERAL_ALIASES += \
nodist_pkgsysconf_DATA += \
src/resolve/resolved.conf
-systemd_resolve_SOURCES = \
- src/resolve/resolve-tool.c \
- $(basic_dns_sources) \
- src/shared/gcrypt-util.c \
- src/shared/gcrypt-util.h
-
-nodist_systemd_resolve_SOURCES = \
- src/resolve/dns_type-from-name.h \
- src/resolve/dns_type-to-name.h
-
-systemd_resolve_LDADD = \
- libshared.la
-
-bin_PROGRAMS += \
- systemd-resolve
-
-dist_bashcompletion_data += \
- shell-completion/bash/systemd-resolve
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_systemd-resolve
-
-tests += \
- test-dns-packet \
- test-resolve-tables \
- test-dnssec
-
-manual_tests += \
- test-dnssec-complex
-
-test_resolve_tables_SOURCES = \
- src/resolve/test-resolve-tables.c \
- src/resolve/dns_type-from-name.h \
- src/resolve/dns_type-to-name.h \
- $(basic_dns_sources) \
- src/shared/test-tables.h
-
-test_resolve_tables_LDADD = \
- libshared.la
-
-test_dns_packet_SOURCES = \
- src/resolve/test-dns-packet.c \
- $(basic_dns_sources)
-
-test_dns_packet_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DRESOLVE_TEST_DIR=\"$(abs_top_srcdir)/src/resolve/test-data\"
-
-test_dns_packet_LDADD = \
- libshared.la
-
-EXTRA_DIST += \
- src/resolve/test-data/_openpgpkey.fedoraproject.org.pkts \
- src/resolve/test-data/fedoraproject.org.pkts \
- src/resolve/test-data/gandi.net.pkts \
- src/resolve/test-data/google.com.pkts \
- src/resolve/test-data/root.pkts \
- src/resolve/test-data/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
- src/resolve/test-data/teamits.com.pkts \
- src/resolve/test-data/zbyszek@fedoraproject.org.pkts \
- src/resolve/test-data/_443._tcp.fedoraproject.org.pkts \
- src/resolve/test-data/kyhwana.org.pkts \
- src/resolve/test-data/fake-caa.pkts
-
-test_dnssec_SOURCES = \
- src/resolve/test-dnssec.c \
- $(basic_dns_sources)
-
-test_dnssec_LDADD = \
- libshared.la
-
-test_dnssec_complex_SOURCES = \
- src/resolve/test-dnssec-complex.c \
- src/resolve/dns-type.c \
- src/resolve/dns-type.h
-
-test_dnssec_complex_LDADD = \
- libshared.la
-
-endif # ENABLE_RESOLVED
-
gperf_txt_sources += \
src/resolve/dns_type-list.txt
@@ -224,4 +116,8 @@ EXTRA_DIST += \
units/systemd-resolved.service.m4.in \
src/resolve/resolved.conf.in
+systemd_resolved_LDADD += libbasic-dns.la
+
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/gcrypt-util.c b/src/grp-resolve/systemd-resolved/gcrypt-util.c
new file mode 120000
index 0000000000..5b2fae92e2
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/gcrypt-util.c
@@ -0,0 +1 @@
+../../libshared/src/gcrypt-util.c \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolved/gcrypt-util.h b/src/grp-resolve/systemd-resolved/gcrypt-util.h
new file mode 120000
index 0000000000..e1ad70b84f
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/gcrypt-util.h
@@ -0,0 +1 @@
+../../libshared/include/shared/gcrypt-util.h \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolved/resolved-bus.c b/src/grp-resolve/systemd-resolved/resolved-bus.c
index 1454e1f5f4..31c6999743 100644
--- a/src/grp-resolve/systemd-resolved/resolved-bus.c
+++ b/src/grp-resolve/systemd-resolved/resolved-bus.c
@@ -18,12 +18,12 @@
***/
#include "basic/alloc-util.h"
-#include "resolved-def.h"
#include "sd-bus/bus-common-errors.h"
#include "shared/bus-util.h"
#include "shared/dns-domain.h"
#include "resolved-bus.h"
+#include "resolved-def.h"
#include "resolved-dns-synthesize.h"
#include "resolved-link-bus.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
index 33e0582d98..8ef2048c49 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
@@ -22,11 +22,11 @@
#include "basic/af-list.h"
#include "basic/alloc-util.h"
#include "basic/string-util.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-packet.h"
#include "shared/dns-domain.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-cache.h"
+#include "resolved-dns-packet.h"
/* Never cache more than 4K entries. RFC 1536, Section 5 suggests to
* leave DNS caches unbounded, but that's crazy. */
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.c b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
index 7b9282a69d..f512748f8d 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
@@ -20,10 +20,10 @@
#include "basic/alloc-util.h"
#include "basic/hostname-util.h"
#include "basic/string-util.h"
-#include "dns-type.h"
#include "sd-netlink/local-addresses.h"
#include "shared/dns-domain.h"
+#include "dns-type.h"
#include "resolved-dns-query.h"
#include "resolved-dns-synthesize.h"
#include "resolved-etc-hosts.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.h b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
index 4a127930bd..86d861ce76 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
@@ -23,12 +23,12 @@
#include <systemd/sd-bus.h>
#include "basic/set.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
typedef struct DnsQuery DnsQuery;
typedef struct DnsQueryCandidate DnsQueryCandidate;
+#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-stream.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
index af1d01f694..293e2bdf37 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
@@ -20,15 +20,17 @@
***/
#include "basic/list.h"
-#include "resolved-dns-dnssec.h"
-#include "resolved-dns-packet.h"
typedef struct DnsScope DnsScope;
#include "resolved-dns-cache.h"
+#include "resolved-dns-dnssec.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-server.h"
+#include "resolved-dns-stream.h"
#include "resolved-dns-zone.h"
#include "resolved-link.h"
+#include "resolved-manager.h"
typedef enum DnsScopeMatch {
DNS_SCOPE_NO,
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.h b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
index 2855c97faa..bfbf692c64 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
@@ -23,16 +23,6 @@
typedef struct DnsServer DnsServer;
-typedef enum DnsServerType {
- DNS_SERVER_SYSTEM,
- DNS_SERVER_FALLBACK,
- DNS_SERVER_LINK,
-} DnsServerType;
-#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1)
-
-const char* dns_server_type_to_string(DnsServerType i) _const_;
-DnsServerType dns_server_type_from_string(const char *s) _pure_;
-
typedef enum DnsServerFeatureLevel {
DNS_SERVER_FEATURE_LEVEL_TCP,
DNS_SERVER_FEATURE_LEVEL_UDP,
@@ -52,6 +42,16 @@ int dns_server_feature_level_from_string(const char *s) _pure_;
#include "resolved-link.h"
#include "resolved-manager.h"
+typedef enum DnsServerType {
+ DNS_SERVER_SYSTEM,
+ DNS_SERVER_FALLBACK,
+ DNS_SERVER_LINK,
+} DnsServerType;
+#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1)
+
+const char* dns_server_type_to_string(DnsServerType i) _const_;
+DnsServerType dns_server_type_from_string(const char *s) _pure_;
+
struct DnsServer {
Manager *manager;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
index e610986833..a47b2ab3ed 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
@@ -20,11 +20,12 @@
***/
#include "basic/socket-util.h"
-#include "resolved-dns-packet.h"
typedef struct DnsStream DnsStream;
+#include "resolved-dns-packet.h"
#include "resolved-dns-transaction.h"
+#include "resolved-manager.h"
struct DnsStream {
Manager *manager;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
index 2309105068..5d829bb2e7 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
@@ -21,7 +21,6 @@
#include "resolved-dns-answer.h"
#include "resolved-dns-question.h"
-
#include "resolved-manager.h"
int dns_synthesize_ifindex(int ifindex);
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
index eaece91533..9783488200 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-event.h>
+
typedef struct DnsTransaction DnsTransaction;
typedef enum DnsTransactionState DnsTransactionState;
typedef enum DnsTransactionSource DnsTransactionSource;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
index c9f221d425..b7c0b08fba 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
@@ -29,9 +29,9 @@
#include "basic/set.h"
#include "basic/string-util.h"
#include "basic/strv.h"
-#include "resolved-dns-dnssec.h"
#include "shared/dns-domain.h"
+#include "resolved-dns-dnssec.h"
#include "resolved-dns-trust-anchor.h"
static const char trust_anchor_dirs[] = CONF_PATHS_NULSTR("dnssec-trust-anchors.d");
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
index ee5cda0748..193e4a6923 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
@@ -20,11 +20,12 @@
***/
#include "basic/hashmap.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-rr.h"
typedef struct DnsTrustAnchor DnsTrustAnchor;
+#include "resolved-dns-answer.h"
+#include "resolved-dns-rr.h"
+
/* This contains a fixed database mapping domain names to DS or DNSKEY records. */
struct DnsTrustAnchor {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-zone.c b/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
index 3d5bc9ea82..192811fc17 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
@@ -20,9 +20,9 @@
#include "basic/alloc-util.h"
#include "basic/list.h"
#include "basic/string-util.h"
-#include "resolved-dns-packet.h"
#include "shared/dns-domain.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-zone.h"
/* Never allow more than 1K entries */
diff --git a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
index e68d87417e..047443a896 100644
--- a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
+++ b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
@@ -21,7 +21,6 @@
#include "resolved-dns-answer.h"
#include "resolved-dns-question.h"
-
#include "resolved-manager.h"
void manager_etc_hosts_flush(Manager *m);
diff --git a/src/grp-resolve/systemd-resolved/resolved-gperf.gperf b/src/grp-resolve/systemd-resolved/resolved-gperf.gperf
index 82f26215df..5d1c209c35 100644
--- a/src/grp-resolve/systemd-resolved/resolved-gperf.gperf
+++ b/src/grp-resolve/systemd-resolved/resolved-gperf.gperf
@@ -1,6 +1,6 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "resolved-conf.h"
%}
struct ConfigPerfItem;
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.h b/src/grp-resolve/systemd-resolved/resolved-link.h
index 53a5f597ef..8aa270cfd6 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.h
+++ b/src/grp-resolve/systemd-resolved/resolved-link.h
@@ -23,12 +23,13 @@
#include "basic/in-addr-util.h"
#include "basic/ratelimit.h"
-#include "resolved-dns-rr.h"
#include "shared/resolve-util.h"
typedef struct Link Link;
typedef struct LinkAddress LinkAddress;
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-manager.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.c b/src/grp-resolve/systemd-resolved/resolved-manager.c
index b82c2569bf..a326823c3a 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.c
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.c
@@ -34,7 +34,6 @@
#include "basic/string-table.h"
#include "basic/string-util.h"
#include "basic/utf8.h"
-#include "sd-netlink/netlink-util.h"
#include "shared/dns-domain.h"
#include "systemd-network/network-internal.h"
diff --git a/src/grp-system/Makefile b/src/grp-system/Makefile
index ea8b031596..d97f45afcd 100644
--- a/src/grp-system/Makefile
+++ b/src/grp-system/Makefile
@@ -23,6 +23,11 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += systemctl systemd
+dist_systempreset_DATA = \
+ 90-systemd.preset
+
+nested.subdirs += systemctl systemd systemd-shutdown
+nested.subdirs += libcore
+nested.subdirs += grp-utils
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/Makefile b/src/grp-system/grp-utils/Makefile
new file mode 100644
index 0000000000..2c8cc75a7c
--- /dev/null
+++ b/src/grp-system/grp-utils/Makefile
@@ -0,0 +1,32 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+nested.subdirs += systemd-analyze
+nested.subdirs += systemd-delta
+nested.subdirs += systemd-fstab-generator
+nested.subdirs += systemd-run
+nested.subdirs += systemd-sysv-generator
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c b/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c
index 307941bb95..49c8487935 100644
--- a/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c
+++ b/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c
@@ -39,10 +39,11 @@
#include "basic/unit-name.h"
#include "basic/util.h"
#include "basic/virt.h"
-#include "mount-setup.h"
#include "shared/fstab-util.h"
#include "shared/generator.h"
+#include "mount-setup.h"
+
static const char *arg_dest = "/tmp";
static bool arg_fstab_enabled = true;
static char *arg_root_what = NULL;
diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c
new file mode 120000
index 0000000000..7f7ff15b46
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c
@@ -0,0 +1 @@
+../../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h
new file mode 120000
index 0000000000..50721d8bfc
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h
@@ -0,0 +1 @@
+../../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/grp-system/grp-utils/systemd-sysv-generator/Makefile b/src/grp-system/grp-utils/systemd-sysv-generator/Makefile
index 10dd75abc6..dfb065af90 100644
--- a/src/grp-system/grp-utils/systemd-sysv-generator/Makefile
+++ b/src/grp-system/grp-utils/systemd-sysv-generator/Makefile
@@ -29,4 +29,10 @@ systemd_sysv_generator_SOURCES = \
systemd_sysv_generator_LDADD = \
libcore.la
+sysvinit_DATA = \
+ docs/sysvinit/README
+
+EXTRA_DIST += \
+ docs/sysvinit/README.in \
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/libcore/Makefile b/src/grp-system/libcore/Makefile
index cbf4916c13..1f19355412 100644
--- a/src/grp-system/libcore/Makefile
+++ b/src/grp-system/libcore/Makefile
@@ -163,8 +163,13 @@ libcore_la_LIBADD = \
$(APPARMOR_LIBS) \
$(MOUNT_LIBS)
-$(outdir)/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/load-fragment-gperf-nulstr.c: $(outdir)/load-fragment-gperf.gperf
$(AM_V_GEN)$(AWK) '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 ";" }' < $< > $@
+sd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+sd.CPPFLAGS += -DMOUNT_PATH=\"$(MOUNT_PATH)\"
+sd.CPPFLAGS += -DUMOUNT_PATH=\"$(UMOUNT_PATH)\"
+sd.CPPFLAGS += -DSYSTEMD_CGROUP_AGENT_PATH=\"$(libexecdir)/systemd-cgroups-agent\"
+sd.CPPFLAGS += -DSYSTEMD_BINARY_PATH=\"$(libexecdir)/systemd\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/libcore/audit-fd.c b/src/grp-system/libcore/audit-fd.c
index 76afe3fe15..8ea525eda3 100644
--- a/src/grp-system/libcore/audit-fd.c
+++ b/src/grp-system/libcore/audit-fd.c
@@ -27,9 +27,9 @@
#include <libaudit.h>
#include <stdbool.h>
-#include "fd-util.h"
-#include "log.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/util.h"
static bool initialized = false;
static int audit_fd;
diff --git a/src/grp-system/libcore/busname.h b/src/grp-system/libcore/busname.h
index aa7f0ecb1b..95a356bddc 100644
--- a/src/grp-system/libcore/busname.h
+++ b/src/grp-system/libcore/busname.h
@@ -20,7 +20,6 @@
***/
typedef struct BusName BusName;
-typedef struct BusNamePolicy BusNamePolicy;
#include "bus-policy.h"
#include "unit.h"
diff --git a/src/grp-system/libcore/cgroup.h b/src/grp-system/libcore/cgroup.h
index abc780b5d5..36699fb21b 100644
--- a/src/grp-system/libcore/cgroup.h
+++ b/src/grp-system/libcore/cgroup.h
@@ -115,7 +115,6 @@ struct CGroupContext {
bool delegate;
};
-#include "cgroup-util.h"
#include "unit.h"
void cgroup_context_init(CGroupContext *c);
diff --git a/src/grp-system/libcore/dbus-automount.h b/src/grp-system/libcore/dbus-automount.h
index 7b51eb973a..d1168c8188 100644
--- a/src/grp-system/libcore/dbus-automount.h
+++ b/src/grp-system/libcore/dbus-automount.h
@@ -19,5 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-bus.h>
extern const sd_bus_vtable bus_automount_vtable[];
diff --git a/src/grp-system/libcore/dbus-busname.h b/src/grp-system/libcore/dbus-busname.h
index 8643d1a404..c6aa90a424 100644
--- a/src/grp-system/libcore/dbus-busname.h
+++ b/src/grp-system/libcore/dbus-busname.h
@@ -19,5 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-bus.h>
extern const sd_bus_vtable bus_busname_vtable[];
diff --git a/src/grp-system/libcore/dbus-execute.c b/src/grp-system/libcore/dbus-execute.c
index 06943c6365..b5530d945e 100644
--- a/src/grp-system/libcore/dbus-execute.c
+++ b/src/grp-system/libcore/dbus-execute.c
@@ -23,28 +23,28 @@
#include <seccomp.h>
#endif
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "capability-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "shared/bus-util.h"
+#include "basic/capability-util.h"
#include "dbus-execute.h"
-#include "env-util.h"
+#include "basic/env-util.h"
#include "execute.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "ioprio.h"
-#include "missing.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/ioprio.h"
+#include "basic/missing.h"
#include "namespace.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "rlimit-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
#ifdef HAVE_SECCOMP
-#include "seccomp-util.h"
+#include "shared/seccomp-util.h"
#endif
-#include "strv.h"
-#include "syslog-util.h"
-#include "utf8.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/utf8.h"
BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput);
diff --git a/src/grp-system/libcore/dbus-path.h b/src/grp-system/libcore/dbus-path.h
index d3c19e0c2b..f24b1d5d3d 100644
--- a/src/grp-system/libcore/dbus-path.h
+++ b/src/grp-system/libcore/dbus-path.h
@@ -19,6 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-
+#include <systemd/sd-bus.h>
extern const sd_bus_vtable bus_path_vtable[];
diff --git a/src/grp-system/libcore/device.h b/src/grp-system/libcore/device.h
index 184a1a349b..60d5122966 100644
--- a/src/grp-system/libcore/device.h
+++ b/src/grp-system/libcore/device.h
@@ -21,6 +21,8 @@
typedef struct Device Device;
+#include "unit.h"
+
typedef enum DeviceFound {
DEVICE_NOT_FOUND = 0,
DEVICE_FOUND_UDEV = 1,
diff --git a/src/grp-system/libcore/execute.c b/src/grp-system/libcore/execute.c
index 5eb3f13695..e7628bceb3 100644
--- a/src/grp-system/libcore/execute.c
+++ b/src/grp-system/libcore/execute.c
@@ -49,55 +49,55 @@
#include <sys/apparmor.h>
#endif
-#include "sd-messages.h"
+#include <systemd/sd-messages.h>
-#include "af-list.h"
-#include "alloc-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
#ifdef HAVE_APPARMOR
-#include "apparmor-util.h"
+#include "shared/apparmor-util.h"
#endif
-#include "async.h"
-#include "barrier.h"
-#include "cap-list.h"
-#include "capability-util.h"
-#include "def.h"
-#include "env-util.h"
-#include "errno-list.h"
+#include "basic/async.h"
+#include "basic/barrier.h"
+#include "basic/cap-list.h"
+#include "basic/capability-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/errno-list.h"
#include "execute.h"
-#include "exit-status.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "glob-util.h"
-#include "io-util.h"
-#include "ioprio.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
+#include "basic/exit-status.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/glob-util.h"
+#include "basic/io-util.h"
+#include "basic/ioprio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
#include "namespace.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "rlimit-util.h"
-#include "rm-rf.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
+#include "basic/rm-rf.h"
#ifdef HAVE_SECCOMP
-#include "seccomp-util.h"
+#include "shared/seccomp-util.h"
#endif
-#include "securebits.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "smack-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "terminal-util.h"
+#include "basic/securebits.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/smack-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/terminal-util.h"
#include "unit.h"
-#include "user-util.h"
-#include "util.h"
-#include "utmp-wtmp.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/utmp-wtmp.h"
#define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC)
#define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC)
diff --git a/src/grp-system/libcore/execute.h b/src/grp-system/libcore/execute.h
index 68560271d4..73292dd086 100644
--- a/src/grp-system/libcore/execute.h
+++ b/src/grp-system/libcore/execute.h
@@ -200,7 +200,7 @@ struct ExecContext {
bool no_new_privileges_set:1;
};
-#include "cgroup-util.h"
+#include "basic/cgroup-util.h"
#include "cgroup.h"
struct ExecParameters {
diff --git a/src/grp-system/libcore/killall.h b/src/grp-system/libcore/killall.h
index acc2439f00..bbb101c863 100644
--- a/src/grp-system/libcore/killall.h
+++ b/src/grp-system/libcore/killall.h
@@ -19,4 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup);
diff --git a/src/grp-system/libcore/kmod-setup.c b/src/grp-system/libcore/kmod-setup.c
index 3503db52ed..6ddf1137ec 100644
--- a/src/grp-system/libcore/kmod-setup.c
+++ b/src/grp-system/libcore/kmod-setup.c
@@ -24,10 +24,10 @@
#include <libkmod.h>
#endif
-#include "bus-util.h"
-#include "capability-util.h"
+#include "shared/bus-util.h"
+#include "basic/capability-util.h"
#include "kmod-setup.h"
-#include "macro.h"
+#include "basic/macro.h"
#ifdef HAVE_KMOD
static void systemd_kmod_log(
diff --git a/src/grp-system/libcore/load-fragment-gperf.gperf.m4 b/src/grp-system/libcore/load-fragment-gperf.gperf.m4
index 8193418980..c9f6e6acf7 100644
--- a/src/grp-system/libcore/load-fragment-gperf.gperf.m4
+++ b/src/grp-system/libcore/load-fragment-gperf.gperf.m4
@@ -1,8 +1,8 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "load-fragment.h"
-#include "missing.h"
+#include "basic/missing.h"
%}
struct ConfigPerfItem;
%null_strings
diff --git a/src/grp-system/libcore/load-fragment.c b/src/grp-system/libcore/load-fragment.c
index f01c72568b..0f17dc85c2 100644
--- a/src/grp-system/libcore/load-fragment.c
+++ b/src/grp-system/libcore/load-fragment.c
@@ -31,42 +31,42 @@
#include <sys/resource.h>
#include <sys/stat.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-internal.h"
-#include "bus-util.h"
-#include "cap-list.h"
-#include "capability-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-util.h"
+#include "basic/cap-list.h"
+#include "basic/capability-util.h"
#include "cgroup.h"
-#include "conf-parser.h"
-#include "cpu-set-util.h"
-#include "env-util.h"
-#include "errno-list.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "ioprio.h"
+#include "shared/conf-parser.h"
+#include "basic/cpu-set-util.h"
+#include "basic/env-util.h"
+#include "basic/errno-list.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/ioprio.h"
#include "load-fragment.h"
-#include "log.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "rlimit-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
#ifdef HAVE_SECCOMP
-#include "seccomp-util.h"
+#include "shared/seccomp-util.h"
#endif
-#include "securebits.h"
-#include "signal-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/securebits.h"
+#include "basic/signal-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
#include "unit-printf.h"
#include "unit.h"
-#include "utf8.h"
-#include "web-util.h"
+#include "basic/utf8.h"
+#include "basic/web-util.h"
int config_parse_warn_compat(
const char *unit,
diff --git a/src/grp-system/libcore/loopback-setup.c b/src/grp-system/libcore/loopback-setup.c
index d5b65bca9c..f92e346f8c 100644
--- a/src/grp-system/libcore/loopback-setup.c
+++ b/src/grp-system/libcore/loopback-setup.c
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include "basic/missing.h"
-#include "sd-netlink/netlink-util.h"
#include "sd-netlink/sd-netlink.h"
#include "loopback-setup.h"
diff --git a/src/grp-system/libcore/machine-id-setup.h b/src/grp-system/libcore/machine-id-setup.h
index a7e7678ed9..c5dd8d7790 100644
--- a/src/grp-system/libcore/machine-id-setup.h
+++ b/src/grp-system/libcore/machine-id-setup.h
@@ -19,5 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-id128.h>
+
int machine_id_commit(const char *root);
int machine_id_setup(const char *root, sd_id128_t machine_id);
diff --git a/src/grp-system/libcore/manager.c b/src/grp-system/libcore/manager.c
index ada22f52fd..2637296c9b 100644
--- a/src/grp-system/libcore/manager.c
+++ b/src/grp-system/libcore/manager.c
@@ -36,56 +36,56 @@
#include <libaudit.h>
#endif
-#include "sd-daemon.h"
-#include "sd-messages.h"
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-messages.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "audit-fd.h"
-#include "boot-timestamps.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-kernel.h"
-#include "bus-util.h"
+#include "shared/boot-timestamps.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-kernel.h"
+#include "shared/bus-util.h"
#include "dbus-job.h"
#include "dbus-manager.h"
#include "dbus-unit.h"
#include "dbus.h"
-#include "dirent-util.h"
-#include "env-util.h"
-#include "escape.h"
-#include "exit-status.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "io-util.h"
+#include "basic/dirent-util.h"
+#include "basic/env-util.h"
+#include "basic/escape.h"
+#include "basic/exit-status.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/io-util.h"
#include "locale-setup.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/log.h"
+#include "basic/macro.h"
#include "manager.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-lookup.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "ratelimit.h"
-#include "rm-rf.h"
-#include "signal-util.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "time-util.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "shared/path-lookup.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/ratelimit.h"
+#include "basic/rm-rf.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
#include "transaction.h"
-#include "umask-util.h"
-#include "unit-name.h"
-#include "util.h"
-#include "virt.h"
-#include "watchdog.h"
+#include "basic/umask-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "shared/watchdog.h"
#define NOTIFY_RCVBUF_SIZE (8*1024*1024)
#define CGROUPS_AGENT_RCVBUF_SIZE (8*1024*1024)
diff --git a/src/grp-system/libcore/manager.h b/src/grp-system/libcore/manager.h
index 1e99f1e1b6..87186b6e40 100644
--- a/src/grp-system/libcore/manager.h
+++ b/src/grp-system/libcore/manager.h
@@ -70,9 +70,9 @@ typedef enum StatusType {
#include "execute.h"
#include "job.h"
-#include "path-lookup.h"
+#include "shared/path-lookup.h"
#include "show-status.h"
-#include "unit-name.h"
+#include "basic/unit-name.h"
struct Manager {
/* Note that the set of units we know of is allowed to be
diff --git a/src/grp-system/libcore/scope.h b/src/grp-system/libcore/scope.h
index 2dc86325c5..f0cb3bd3e2 100644
--- a/src/grp-system/libcore/scope.h
+++ b/src/grp-system/libcore/scope.h
@@ -22,6 +22,7 @@
typedef struct Scope Scope;
#include "kill.h"
+#include "unit.h"
typedef enum ScopeResult {
SCOPE_SUCCESS,
diff --git a/src/grp-system/libcore/selinux-access.c b/src/grp-system/libcore/selinux-access.c
index cc287d602d..a259e128c1 100644
--- a/src/grp-system/libcore/selinux-access.c
+++ b/src/grp-system/libcore/selinux-access.c
@@ -29,17 +29,17 @@
#include <libaudit.h>
#endif
-#include "sd-bus.h"
+#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "audit-fd.h"
-#include "bus-util.h"
-#include "log.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "util.h"
+#include "shared/bus-util.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/stdio-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static bool initialized = false;
diff --git a/src/grp-system/libcore/selinux-setup.c b/src/grp-system/libcore/selinux-setup.c
index 4072df58e6..37a143bce4 100644
--- a/src/grp-system/libcore/selinux-setup.c
+++ b/src/grp-system/libcore/selinux-setup.c
@@ -25,12 +25,12 @@
#include <selinux/selinux.h>
#endif
-#include "log.h"
-#include "macro.h"
+#include "basic/log.h"
+#include "basic/macro.h"
#include "selinux-setup.h"
-#include "selinux-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/selinux-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#ifdef HAVE_SELINUX
_printf_(2,3)
diff --git a/src/grp-system/libcore/service.h b/src/grp-system/libcore/service.h
index ba9086d8cd..aa7d1de8b6 100644
--- a/src/grp-system/libcore/service.h
+++ b/src/grp-system/libcore/service.h
@@ -27,6 +27,7 @@ typedef struct ServiceFDStore ServiceFDStore;
#include "kill.h"
#include "path.h"
+#include "socket.h"
typedef enum ServiceRestart {
SERVICE_RESTART_NO,
@@ -199,7 +200,7 @@ struct Service {
extern const UnitVTable service_vtable;
-int service_set_socket_fd(Service *s, int fd, struct Socket *socket, bool selinux_context_net);
+int service_set_socket_fd(Service *s, int fd, Socket *socket, bool selinux_context_net);
void service_close_socket_fd(Service *s);
const char* service_restart_to_string(ServiceRestart i) _const_;
diff --git a/src/grp-system/libcore/slice.h b/src/grp-system/libcore/slice.h
index c9f3f61067..71e05a4d6a 100644
--- a/src/grp-system/libcore/slice.h
+++ b/src/grp-system/libcore/slice.h
@@ -21,6 +21,8 @@
typedef struct Slice Slice;
+#include "unit.h"
+
struct Slice {
Unit meta;
diff --git a/src/grp-system/libcore/smack-setup.h b/src/grp-system/libcore/smack-setup.h
index 78164c85e6..f8c62ce067 100644
--- a/src/grp-system/libcore/smack-setup.h
+++ b/src/grp-system/libcore/smack-setup.h
@@ -21,4 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
int mac_smack_setup(bool *loaded_policy);
diff --git a/src/grp-system/libcore/socket.h b/src/grp-system/libcore/socket.h
index 3b214946e0..232d653fbe 100644
--- a/src/grp-system/libcore/socket.h
+++ b/src/grp-system/libcore/socket.h
@@ -23,7 +23,6 @@
typedef struct Socket Socket;
-#include "mount.h"
#include "service.h"
typedef enum SocketExecCommand {
diff --git a/src/grp-system/libcore/swap.h b/src/grp-system/libcore/swap.h
index c2cbfc5d2a..52e22e22e8 100644
--- a/src/grp-system/libcore/swap.h
+++ b/src/grp-system/libcore/swap.h
@@ -24,6 +24,8 @@
typedef struct Swap Swap;
+#include "unit.h"
+
typedef enum SwapExecCommand {
SWAP_EXEC_ACTIVATE,
SWAP_EXEC_DEACTIVATE,
diff --git a/src/grp-system/libcore/target.c b/src/grp-system/libcore/target.c
index e62a49be84..74af0ced0c 100644
--- a/src/grp-system/libcore/target.c
+++ b/src/grp-system/libcore/target.c
@@ -23,7 +23,6 @@
#include "basic/unit-name.h"
#include "dbus-target.h"
-#include "target.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_TARGET_STATE_MAX] = {
diff --git a/src/grp-system/libcore/target.h b/src/grp-system/libcore/target.h
index 339aea154e..406b80019c 100644
--- a/src/grp-system/libcore/target.h
+++ b/src/grp-system/libcore/target.h
@@ -21,6 +21,8 @@
typedef struct Target Target;
+#include "unit.h"
+
struct Target {
Unit meta;
diff --git a/src/grp-system/libcore/timer.h b/src/grp-system/libcore/timer.h
index 99b47c3880..710ef126f0 100644
--- a/src/grp-system/libcore/timer.h
+++ b/src/grp-system/libcore/timer.h
@@ -23,6 +23,8 @@
typedef struct Timer Timer;
+#include "unit.h"
+
typedef enum TimerBase {
TIMER_ACTIVE,
TIMER_BOOT,
diff --git a/src/grp-system/libcore/unit.h b/src/grp-system/libcore/unit.h
index 9321537fe6..72ceed1fef 100644
--- a/src/grp-system/libcore/unit.h
+++ b/src/grp-system/libcore/unit.h
@@ -259,8 +259,10 @@ typedef enum UnitSetPropertiesMode {
#include "automount.h"
#include "busname.h"
#include "device.h"
+#include "mount.h"
#include "path.h"
#include "scope.h"
+#include "service.h"
#include "slice.h"
#include "socket.h"
#include "swap.h"
diff --git a/src/grp-system/systemctl/.gitignore b/src/grp-system/systemctl/.gitignore
index ebd59d3c9e..89c7427edd 100644
--- a/src/grp-system/systemctl/.gitignore
+++ b/src/grp-system/systemctl/.gitignore
@@ -1,2 +1,2 @@
-/systemctl
-/_systemctl
+/systemctl.completion.bash
+/systemctl.completion.zsh
diff --git a/src/grp-system/systemctl/Makefile b/src/grp-system/systemctl/Makefile
index 24585cc12b..114e58cb27 100644
--- a/src/grp-system/systemctl/Makefile
+++ b/src/grp-system/systemctl/Makefile
@@ -30,4 +30,12 @@ systemctl_SOURCES = \
systemctl_LDADD = \
libshared.la
+files.out.all += systemctl.completion.bash
+files.out.all += systemctl.completion.zsh
+sd.sed_files += systemctl.completion.bash
+sd.sed_files += systemctl.completion.zsh
+sd.CPPFLAGS += -DROOTLIBEXECDIR=\"$(rootlibexecdir)\"
+sd.CPPFLAGS += -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\"
+sd.CPPFLAGS += -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemd-shutdown/Makefile b/src/grp-system/systemd-shutdown/Makefile
index 87cffd19f3..257a057823 100644
--- a/src/grp-system/systemd-shutdown/Makefile
+++ b/src/grp-system/systemd-shutdown/Makefile
@@ -36,4 +36,7 @@ systemd_shutdown_SOURCES = \
systemd_shutdown_LDADD = \
libshared.la
+sd.CPPFLAGS += -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\"
+sd.CPPFLAGS += -DKEXEC=\"$(KEXEC)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemd-shutdown/killall.c b/src/grp-system/systemd-shutdown/killall.c
new file mode 120000
index 0000000000..5ddb36306b
--- /dev/null
+++ b/src/grp-system/systemd-shutdown/killall.c
@@ -0,0 +1 @@
+../libcore/killall.c \ No newline at end of file
diff --git a/src/grp-system/systemd-shutdown/killall.h b/src/grp-system/systemd-shutdown/killall.h
new file mode 120000
index 0000000000..60b334fe91
--- /dev/null
+++ b/src/grp-system/systemd-shutdown/killall.h
@@ -0,0 +1 @@
+../libcore/killall.h \ No newline at end of file
diff --git a/src/grp-system/systemd-shutdown/mount-setup.c b/src/grp-system/systemd-shutdown/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/grp-system/systemd-shutdown/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/grp-system/systemd-shutdown/mount-setup.h b/src/grp-system/systemd-shutdown/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/grp-system/systemd-shutdown/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/grp-system/systemd-shutdown/shutdown.c b/src/grp-system/systemd-shutdown/shutdown.c
index 516128e2d1..bf74b5ec99 100644
--- a/src/grp-system/systemd-shutdown/shutdown.c
+++ b/src/grp-system/systemd-shutdown/shutdown.c
@@ -42,10 +42,10 @@
#include "basic/terminal-util.h"
#include "basic/util.h"
#include "basic/virt.h"
-#include "killall.h"
#include "shared/switch-root.h"
#include "shared/watchdog.h"
+#include "killall.h"
#include "umount.h"
#define FINALIZE_ATTEMPTS 50
diff --git a/src/grp-system/systemd-shutdown/systemd-shutdown.xml b/src/grp-system/systemd-shutdown/systemd-shutdown.xml
index c94e2a1820..749158e5da 100644
--- a/src/grp-system/systemd-shutdown/systemd-shutdown.xml
+++ b/src/grp-system/systemd-shutdown/systemd-shutdown.xml
@@ -21,10 +21,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-halt.service">
+<refentry id="systemd-shutdown">
<refentryinfo>
- <title>systemd-halt.service</title>
+ <title>systemd-shutdown</title>
<productname>systemd</productname>
<authorgroup>
@@ -38,7 +38,7 @@
</refentryinfo>
<refmeta>
- <refentrytitle>systemd-halt.service</refentrytitle>
+ <refentrytitle>systemd-shutdown</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>
diff --git a/src/grp-system/systemd-shutdown/umount.c b/src/grp-system/systemd-shutdown/umount.c
index 3e756ec7fb..0079f8ec78 100644
--- a/src/grp-system/systemd-shutdown/umount.c
+++ b/src/grp-system/systemd-shutdown/umount.c
@@ -36,10 +36,10 @@
#include "basic/string-util.h"
#include "basic/util.h"
#include "basic/virt.h"
-#include "mount-setup.h"
#include "shared/fstab-util.h"
#include "shared/udev-util.h"
+#include "mount-setup.h"
#include "umount.h"
typedef struct MountPoint {
diff --git a/src/grp-system/systemd-shutdown/umount.h b/src/grp-system/systemd-shutdown/umount.h
index 4e2215a47d..ce2fd9ec58 100644
--- a/src/grp-system/systemd-shutdown/umount.h
+++ b/src/grp-system/systemd-shutdown/umount.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
int umount_all(bool *changed);
int swapoff_all(bool *changed);
diff --git a/src/grp-system/systemd/Makefile b/src/grp-system/systemd/Makefile
index cfef258c6d..3efc406281 100644
--- a/src/grp-system/systemd/Makefile
+++ b/src/grp-system/systemd/Makefile
@@ -35,6 +35,10 @@ systemd_CFLAGS = \
systemd_LDADD = \
libcore.la
+dist_tmpfiles_DATA = \
+ tmpfiles.d/systemd.conf \
+ systemd-tmpfs.conf
+
dist_pkgsysconf_DATA += \
src/core/system.conf \
src/core/user.conf
@@ -68,4 +72,10 @@ dist_systemunit_DATA_busnames += \
BUSNAMES_TARGET_WANTS += \
org.freedesktop.systemd1.busname
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
+sd.CPPFLAGS += -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\"
+sd.CPPFLAGS += -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\"
+sd.CPPFLAGS += -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemd/main.c b/src/grp-system/systemd/main.c
index 5ed8c3d3f5..aa7c126fcf 100644
--- a/src/grp-system/systemd/main.c
+++ b/src/grp-system/systemd/main.c
@@ -35,56 +35,56 @@
#include <valgrind/valgrind.h>
#endif
-#include "sd-bus.h"
-#include "sd-daemon.h"
-
-#include "alloc-util.h"
-#include "architecture.h"
-#include "build.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "capability-util.h"
-#include "clock-util.h"
-#include "conf-parser.h"
-#include "cpu-set-util.h"
+#include <systemd/sd-bus.h>
+#include <systemd/sd-daemon.h>
+
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/build.h"
+#include "basic/capability-util.h"
+#include "basic/clock-util.h"
+#include "basic/cpu-set-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fdset.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/virt.h"
#include "dbus-manager.h"
-#include "def.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fdset.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
#include "hostname-setup.h"
#include "ima-setup.h"
#include "killall.h"
#include "kmod-setup.h"
#include "load-fragment.h"
-#include "log.h"
#include "loopback-setup.h"
#include "machine-id-setup.h"
#include "manager.h"
-#include "missing.h"
#include "mount-setup.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "rlimit-util.h"
+#include "sd-bus/bus-error.h"
#include "selinux-setup.h"
-#include "selinux-util.h"
-#include "signal-util.h"
+#include "shared/bus-util.h"
+#include "shared/conf-parser.h"
+#include "shared/pager.h"
+#include "shared/switch-root.h"
+#include "shared/watchdog.h"
#include "smack-setup.h"
-#include "special.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "switch-root.h"
-#include "terminal-util.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "virt.h"
-#include "watchdog.h"
static enum {
ACTION_RUN,
diff --git a/src/grp-system/systemd/systemd-tmpfs.tmpfiles b/src/grp-system/systemd/systemd-tmpfs.tmpfiles
index 98050d329d..52f6743d56 100644
--- a/src/grp-system/systemd/systemd-tmpfs.tmpfiles
+++ b/src/grp-system/systemd/systemd-tmpfs.tmpfiles
@@ -7,6 +7,8 @@
# See tmpfiles.d(5) for details
+# Clear tmp directories separately, to make them easier to override
+
# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
diff --git a/src/grp-system/systemd/systemd.tmpfiles b/src/grp-system/systemd/systemd.tmpfiles
new file mode 100644
index 0000000000..00951c92c9
--- /dev/null
+++ b/src/grp-system/systemd/systemd.tmpfiles
@@ -0,0 +1,20 @@
+# This file is part of systemd.
+#
+# 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.
+
+# See tmpfiles.d(5) for details
+
+d /run/user 0755 root root -
+F! /run/utmp 0664 root utmp -
+
+d /run/systemd/ask-password 0755 root root -
+d /run/systemd/seats 0755 root root -
+d /run/systemd/sessions 0755 root root -
+d /run/systemd/users 0755 root root -
+d /run/systemd/machines 0755 root root -
+d /run/systemd/shutdown 0755 root root -
+
+d /var/lib/systemd 0755 root root -
diff --git a/src/grp-timedate/Makefile b/src/grp-timedate/Makefile
index bb8be753da..01c4f2f841 100644
--- a/src/grp-timedate/Makefile
+++ b/src/grp-timedate/Makefile
@@ -23,6 +23,6 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += timedatectl systemd-timedated
+nested.subdirs += timedatectl systemd-timedated
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-timedate/timedatectl/Makefile b/src/grp-timedate/timedatectl/Makefile
index c1be945443..4394bf892b 100644
--- a/src/grp-timedate/timedatectl/Makefile
+++ b/src/grp-timedate/timedatectl/Makefile
@@ -39,4 +39,5 @@ dist_bashcompletion_data += \
dist_zshcompletion_data += \
shell-completion/zsh/_timedatectl
endif # ENABLE_TIMEDATED
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/.vimrc b/src/grp-udev/.vimrc
new file mode 100644
index 0000000000..366fbdca4b
--- /dev/null
+++ b/src/grp-udev/.vimrc
@@ -0,0 +1,4 @@
+" 'set exrc' in ~/.vimrc will read .vimrc from the current directory
+set tabstop=8
+set shiftwidth=8
+set expandtab
diff --git a/src/grp-udev/Makefile b/src/grp-udev/Makefile
index cc85f0317f..965c9b2f22 100644
--- a/src/grp-udev/Makefile
+++ b/src/grp-udev/Makefile
@@ -42,6 +42,11 @@ dist_udevrules_DATA += \
rules/78-sound-card.rules \
rules/80-net-setup-link.rules
+ifneq ($(HAVE_KMOD),)
+dist_udevrules_DATA += \
+ rules/80-drivers.rules
+endif # HAVE_KMOD
+
nodist_udevrules_DATA += \
rules/99-systemd.rules
@@ -69,4 +74,7 @@ SYSINIT_TARGET_WANTS += \
systemd-udevd.service \
systemd-udev-trigger.service
+nested.subdirs += systemd-udevd udevadm
+nested.subdirs += ata_id cdrom_id collect mtd_probe scsi_id v4l_id
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/hwdb/Makefile b/src/grp-udev/hwdb/Makefile
index e3e51d5c74..3f89c1ed8f 100644
--- a/src/grp-udev/hwdb/Makefile
+++ b/src/grp-udev/hwdb/Makefile
@@ -20,7 +20,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/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
.PHONY: hwdb-update
diff --git a/src/grp-udev/libudev-core/Makefile b/src/grp-udev/libudev-core/Makefile
index bc889eac2b..36aaa55431 100644
--- a/src/grp-udev/libudev-core/Makefile
+++ b/src/grp-udev/libudev-core/Makefile
@@ -38,7 +38,7 @@ $(outdir)/keyboard-keys-from-name.h: $(outdir)/keyboard-keys-from-name.gperf
gperf_txt_sources += \
src/udev/keyboard-keys-list.txt
-libudev_core_la_SOURCES = \
+_libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-event.c \
src/udev/udev-watch.c \
@@ -59,7 +59,7 @@ libudev_core_la_SOURCES = \
src/udev/net/ethtool-util.h \
src/udev/net/ethtool-util.c
-nodist_libudev_core_la_SOURCES = \
+_nodist_libudev_core_la_SOURCES = \
src/udev/keyboard-keys-from-name.h \
src/udev/net/link-config-gperf.c
@@ -80,9 +80,6 @@ libudev_core_la_LIBADD = \
ifneq ($(HAVE_KMOD),)
libudev_core_la_SOURCES += \
src/udev/udev-builtin-kmod.c
-
-dist_udevrules_DATA += \
- rules/80-drivers.rules
endif # HAVE_KMOD
ifneq ($(HAVE_BLKID),)
@@ -98,4 +95,10 @@ libudev_core_la_SOURCES += \
src/systemd/sd-login.h
endif # HAVE_ACL
+sd.libudev-core_SOURCES = $(patsubst src/udev/%,%,$(filter %.c,$(_libudev_core_la_SOURCES) $(_nodist_libudev_core_la_SOURCES)))
+$(outdir)/libudev-core.la: $(addprefix $(outdir)/,$(sd.libudev-core_SOURCES:.c=.lo))
+nested.subdirs += net
+$(outdir)/udev-builtin-keyboard.lo: $(outdir)/keyboard-keys-from-name.h
+sd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/logind-acl.c b/src/grp-udev/libudev-core/logind-acl.c
new file mode 120000
index 0000000000..dd15b7973f
--- /dev/null
+++ b/src/grp-udev/libudev-core/logind-acl.c
@@ -0,0 +1 @@
+../../grp-login/systemd-logind/logind-acl.c \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/logind-acl.h b/src/grp-udev/libudev-core/logind-acl.h
new file mode 120000
index 0000000000..6065dde301
--- /dev/null
+++ b/src/grp-udev/libudev-core/logind-acl.h
@@ -0,0 +1 @@
+../../grp-login/systemd-logind/logind-acl.h \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/net/Makefile b/src/grp-udev/libudev-core/net/Makefile
new file mode 100644
index 0000000000..5ccbd00002
--- /dev/null
+++ b/src/grp-udev/libudev-core/net/Makefile
@@ -0,0 +1,30 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+sd.CPPFLAGS += $(libshared.CPPFLAGS)
+sd.CPPFLAGS += $(libsystemd-network.CPPFLAGS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/net/link-config-gperf.gperf b/src/grp-udev/libudev-core/net/link-config-gperf.gperf
index b25e4b3344..20cbdf1f5f 100644
--- a/src/grp-udev/libudev-core/net/link-config-gperf.gperf
+++ b/src/grp-udev/libudev-core/net/link-config-gperf.gperf
@@ -1,7 +1,7 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
-#include "network-internal.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/network-internal.h"
#include "link-config.h"
#include "ethtool-util.h"
%}
diff --git a/src/grp-udev/libudev-core/sd-login.c b/src/grp-udev/libudev-core/sd-login.c
new file mode 120000
index 0000000000..913dcedc6a
--- /dev/null
+++ b/src/grp-udev/libudev-core/sd-login.c
@@ -0,0 +1 @@
+../../libsystemd/src/sd-login/sd-login.c \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/udev-builtin-btrfs.c b/src/grp-udev/libudev-core/udev-builtin-btrfs.c
index cfaa463804..333229de55 100644
--- a/src/grp-udev/libudev-core/udev-builtin-btrfs.c
+++ b/src/grp-udev/libudev-core/udev-builtin-btrfs.c
@@ -25,9 +25,9 @@
#include <linux/btrfs.h>
#endif
-#include "fd-util.h"
-#include "missing.h"
-#include "string-util.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
+#include "basic/string-util.h"
#include "udev.h"
static int builtin_btrfs(struct udev_device *dev, int argc, char *argv[], bool test) {
diff --git a/src/grp-udev/libudev-core/udev-builtin-input_id.c b/src/grp-udev/libudev-core/udev-builtin-input_id.c
index bc2cab1cb8..386ef5b5dc 100644
--- a/src/grp-udev/libudev-core/udev-builtin-input_id.c
+++ b/src/grp-udev/libudev-core/udev-builtin-input_id.c
@@ -28,8 +28,8 @@
#include <string.h>
#include <unistd.h>
-#include <linux/limits.h>
#include <linux/input.h>
+#include <linux/limits.h>
#include "basic/fd-util.h"
#include "basic/stdio-util.h"
diff --git a/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c b/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
index bf36b42957..3f3522f5e1 100644
--- a/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
+++ b/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
@@ -19,9 +19,10 @@
#include "basic/alloc-util.h"
#include "basic/log.h"
-#include "link-config.h"
#include "udev.h"
+#include "net/link-config.h"
+
static link_config_ctx *ctx = NULL;
static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv, bool test) {
diff --git a/src/grp-udev/libudev-core/udev-builtin-uaccess.c b/src/grp-udev/libudev-core/udev-builtin-uaccess.c
index 91bd843f80..aab1c376de 100644
--- a/src/grp-udev/libudev-core/udev-builtin-uaccess.c
+++ b/src/grp-udev/libudev-core/udev-builtin-uaccess.c
@@ -26,9 +26,10 @@
#include "basic/login-util.h"
#include "basic/util.h"
-#include "logind-acl.h"
#include "udev.h"
+#include "logind-acl.h"
+
static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool test) {
int r;
const char *path = NULL, *seat;
diff --git a/src/grp-udev/mtd_probe/Makefile b/src/grp-udev/mtd_probe/Makefile
index d7392a8a3b..50703dddda 100644
--- a/src/grp-udev/mtd_probe/Makefile
+++ b/src/grp-udev/mtd_probe/Makefile
@@ -34,4 +34,6 @@ dist_udevrules_DATA += \
udevlibexec_PROGRAMS += \
mtd_probe
+mtd_probe_LDADD += libbasic.la
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/scsi_id/scsi.h b/src/grp-udev/scsi_id/scsi.h
index a27a84a40a..497cfe3e31 100644
--- a/src/grp-udev/scsi_id/scsi.h
+++ b/src/grp-udev/scsi_id/scsi.h
@@ -13,6 +13,7 @@
*/
#include <scsi/scsi.h>
+#include <sys/types.h>
struct scsi_ioctl_command {
unsigned int inlen; /* excluding scsi command length */
diff --git a/src/grp-udev/scsi_id/scsi_id.h b/src/grp-udev/scsi_id/scsi_id.h
index 5c2e1c28ee..86d56a0c3f 100644
--- a/src/grp-udev/scsi_id/scsi_id.h
+++ b/src/grp-udev/scsi_id/scsi_id.h
@@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <libudev.h>
+
#define MAX_PATH_LEN 512
/*
diff --git a/src/grp-udev/systemd-hwdb/Makefile b/src/grp-udev/systemd-hwdb/Makefile
index 03e7c283f2..1e5da1d244 100644
--- a/src/grp-udev/systemd-hwdb/Makefile
+++ b/src/grp-udev/systemd-hwdb/Makefile
@@ -20,7 +20,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/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_HWDB),)
@@ -73,4 +73,6 @@ EXTRA_DIST += \
hwdb/ids-update.pl \
hwdb/sdio.ids
+sd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/systemd-udevd/udevd.c b/src/grp-udev/systemd-udevd/udevd.c
index 4915a285a5..07edbb3450 100644
--- a/src/grp-udev/systemd-udevd/udevd.c
+++ b/src/grp-udev/systemd-udevd/udevd.c
@@ -61,7 +61,6 @@
#include "basic/string-util.h"
#include "basic/terminal-util.h"
#include "basic/user-util.h"
-#include "sd-netlink/netlink-util.h"
#include "shared/dev-setup.h"
#include "shared/udev-util.h"
#include "udev.h"
diff --git a/src/grp-udev/udevadm/Makefile b/src/grp-udev/udevadm/Makefile
index ba3b466935..6fa837f6e3 100644
--- a/src/grp-udev/udevadm/Makefile
+++ b/src/grp-udev/udevadm/Makefile
@@ -42,4 +42,6 @@ udevadm_SOURCES = \
udevadm_LDADD = \
libudev-core.la
+sd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/Makefile b/src/grp-utils/Makefile
new file mode 100644
index 0000000000..9d510cf3cc
--- /dev/null
+++ b/src/grp-utils/Makefile
@@ -0,0 +1,32 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+nested.subdirs += systemd-ac-power
+nested.subdirs += systemd-escape
+nested.subdirs += systemd-notify
+nested.subdirs += systemd-path
+nested.subdirs += systemd-socket-activate
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-escape/systemd-escape.completion.bash b/src/grp-utils/systemd-escape/systemd-escape.completion.bash
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-utils/systemd-escape/systemd-escape.completion.bash
diff --git a/src/grp-utils/systemd-escape/systemd-escape.completion.zsh b/src/grp-utils/systemd-escape/systemd-escape.completion.zsh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-utils/systemd-escape/systemd-escape.completion.zsh
diff --git a/src/grp-utils/systemd-path/Makefile b/src/grp-utils/systemd-path/Makefile
index 442dbf00b4..9fcae47938 100644
--- a/src/grp-utils/systemd-path/Makefile
+++ b/src/grp-utils/systemd-path/Makefile
@@ -26,9 +26,13 @@ include $(topsrcdir)/build-aux/Makefile.head.mk
bin_PROGRAMS += systemd-path
systemd_path_SOURCES = \
+ sd-path.c \
src/path/path.c
systemd_path_LDADD = \
- libshared.la
+ libbasic.la
+
+sd.CPPFLAGS += -DLIBDIR=\"$(libdir)\"
+sd.CPPFLAGS += -DROOTLIBDIR=\"$(rootlibdir)\"
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-path/_sd-common.h b/src/grp-utils/systemd-path/_sd-common.h
new file mode 120000
index 0000000000..d2b5d6f4e4
--- /dev/null
+++ b/src/grp-utils/systemd-path/_sd-common.h
@@ -0,0 +1 @@
+../../libsystemd/include/systemd/_sd-common.h \ No newline at end of file
diff --git a/src/grp-utils/systemd-path/sd-path.h b/src/grp-utils/systemd-path/sd-path.h
index cac5ce761d..be6abdcd03 100644
--- a/src/grp-utils/systemd-path/sd-path.h
+++ b/src/grp-utils/systemd-path/sd-path.h
@@ -22,7 +22,7 @@
#include <inttypes.h>
-#include <systemd/_sd-common.h>
+#include "_sd-common.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/grp-utils/systemd-path/systemd-path.completion.zsh b/src/grp-utils/systemd-path/systemd-path.completion.zsh
new file mode 100644
index 0000000000..4919cf4250
--- /dev/null
+++ b/src/grp-utils/systemd-path/systemd-path.completion.zsh
@@ -0,0 +1,18 @@
+#compdef systemd-path
+
+__get_names() {
+ systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
+}
+
+__names() {
+ local -a _names
+ _names=(${(fo)"$(__get_names)"})
+ typeset -U _names
+ _describe 'names' _names
+}
+
+_arguments \
+ {-h,--help}'[Show help message]' \
+ '--version[Show package version]' \
+ '--host=[Sufix to append to paths]:suffix' \
+ '*:name:__names'
diff --git a/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.bash b/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.bash
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.bash
diff --git a/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.zsh b/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.zsh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/grp-utils/systemd-socket-activate/systemd-socket-activate.completion.zsh
diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile
index 45d408fa19..47ce9cf936 100644
--- a/src/libbasic/Makefile
+++ b/src/libbasic/Makefile
@@ -23,5 +23,5 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += src include
+nested.subdirs += src include
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/Makefile b/src/libbasic/include/Makefile
index 0aa8325a7e..d3a3e62a0e 100644
--- a/src/libbasic/include/Makefile
+++ b/src/libbasic/include/Makefile
@@ -23,5 +23,5 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += basic
+nested.subdirs += basic
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/basic/Makefile b/src/libbasic/include/basic/Makefile
index eb8483fe8f..8cebc9cac0 100644
--- a/src/libbasic/include/basic/Makefile
+++ b/src/libbasic/include/basic/Makefile
@@ -23,7 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-$(outdir)/errno-list.txt:
+$(outdir)/errno-list.txt: | $(outdir)/.deps
$(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
$(outdir)/errno-to-name.h: $(outdir)/errno-list.txt
@@ -47,8 +47,8 @@ $(outdir)/arphrd-from-name.gperf: $(outdir)/arphrd-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
-$(outdir)/cap-list.txt:
- $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
+$(outdir)/cap-list.txt: $(srcdir)/missing.h
+ $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/capability.h -include $< - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
$(outdir)/cap-to-name.h: $(outdir)/cap-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
@@ -59,4 +59,6 @@ $(outdir)/cap-from-name.gperf: $(outdir)/cap-list.txt
$(outdir)/cap-from-name.h: $(outdir)/cap-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
+sd.CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/basic/btrfs-ctree.h b/src/libbasic/include/basic/btrfs-ctree.h
index 66bdf9736e..15e6d5582c 100644
--- a/src/libbasic/include/basic/btrfs-ctree.h
+++ b/src/libbasic/include/basic/btrfs-ctree.h
@@ -1,6 +1,7 @@
#pragma once
#include "macro.h"
+#include "missing.h" /* for BTRFS_UUID_SIZE */
#include "sparse-endian.h"
/* Stolen from btrfs' ctree.h */
diff --git a/src/libbasic/include/basic/missing_syscall.h b/src/libbasic/include/basic/missing_syscall.h
index d502d3b9ca..2929123679 100644
--- a/src/libbasic/include/basic/missing_syscall.h
+++ b/src/libbasic/include/basic/missing_syscall.h
@@ -22,6 +22,10 @@
/* Missing glibc definitions to access certain kernel APIs */
+#if __INCLUDE_LEVEL__ <= 1
+#error "Do not include missing_syscall.h directly; include it through missing.h."
+#endif
+
#if !HAVE_DECL_PIVOT_ROOT
static inline int pivot_root(const char *new_root, const char *put_old) {
return syscall(SYS_pivot_root, new_root, put_old);
diff --git a/src/libbasic/include/basic/rm-rf.h b/src/libbasic/include/basic/rm-rf.h
index f693a5bb7c..8d315792ac 100644
--- a/src/libbasic/include/basic/rm-rf.h
+++ b/src/libbasic/include/basic/rm-rf.h
@@ -19,8 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdlib.h>
#include <sys/stat.h>
+#include "macro.h"
+
typedef enum RemoveFlags {
REMOVE_ONLY_DIRECTORIES = 1,
REMOVE_ROOT = 2,
diff --git a/src/libbasic/include/basic/socket-util.h b/src/libbasic/include/basic/socket-util.h
index bad1f32e09..2b717a91d4 100644
--- a/src/libbasic/include/basic/socket-util.h
+++ b/src/libbasic/include/basic/socket-util.h
@@ -27,8 +27,8 @@
#include <sys/types.h>
#include <sys/un.h>
-#include <linux/netlink.h>
#include <linux/if_packet.h>
+#include <linux/netlink.h>
#include "macro.h"
#include "util.h"
diff --git a/src/libbasic/include/basic/time-util.h b/src/libbasic/include/basic/time-util.h
index a5e3f567ec..8324bb0dd0 100644
--- a/src/libbasic/include/basic/time-util.h
+++ b/src/libbasic/include/basic/time-util.h
@@ -26,6 +26,8 @@
#include <stdio.h>
#include <time.h>
+#include "macro.h"
+
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
diff --git a/src/libbasic/src/Makefile b/src/libbasic/src/Makefile
index 2fc52e91f5..19883d92a1 100644
--- a/src/libbasic/src/Makefile
+++ b/src/libbasic/src/Makefile
@@ -240,4 +240,11 @@ libbasic_la_LIBADD = \
-lrt \
-lm
+_inc = $(call at.path,$(addprefix $(outdir)/../include/basic/,$1))
+$(outdir)/af-list.lo: $(call _inc,af-from-name.h af-to-name.h)
+$(outdir)/arphrd-list.lo: $(call _inc,arphrd-from-name.h arphrd-to-name.h)
+$(outdir)/cap-list.lo: $(call _inc,cap-from-name.h cap-to-name.h)
+$(outdir)/errno-list.lo: $(call _inc,errno-from-name.h errno-to-name.h)
+sd.CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/src/af-list.c b/src/libbasic/src/af-list.c
index 434af37851..1c75c926bb 100644
--- a/src/libbasic/src/af-list.c
+++ b/src/libbasic/src/af-list.c
@@ -25,8 +25,8 @@
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
-#include "af-from-name.h"
-#include "af-to-name.h"
+#include "basic/af-from-name.h"
+#include "basic/af-to-name.h"
const char *af_to_name(int id) {
diff --git a/src/libbasic/src/arphrd-list.c b/src/libbasic/src/arphrd-list.c
index fbebe8ca09..649bd37456 100644
--- a/src/libbasic/src/arphrd-list.c
+++ b/src/libbasic/src/arphrd-list.c
@@ -25,8 +25,8 @@
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
-#include "arphrd-from-name.h"
-#include "arphrd-to-name.h"
+#include "basic/arphrd-from-name.h"
+#include "basic/arphrd-to-name.h"
const char *arphrd_to_name(int id) {
diff --git a/src/libbasic/src/btrfs-util.c b/src/libbasic/src/btrfs-util.c
index 7a5f6b7e76..acbcb5f6b9 100644
--- a/src/libbasic/src/btrfs-util.c
+++ b/src/libbasic/src/btrfs-util.c
@@ -36,23 +36,23 @@
#include <linux/btrfs.h>
#endif
-#include "alloc-util.h"
-#include "btrfs-ctree.h"
-#include "btrfs-util.h"
-#include "copy.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "smack-util.h"
-#include "sparse-endian.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-ctree.h"
+#include "basic/btrfs-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
/* WARNING: Be careful with file system ioctls! When we get an fd, we
* need to make sure it either refers to only a regular file or
diff --git a/src/libbasic/src/cap-list.c b/src/libbasic/src/cap-list.c
index 9821644444..22fc8b9b31 100644
--- a/src/libbasic/src/cap-list.c
+++ b/src/libbasic/src/cap-list.c
@@ -28,8 +28,8 @@
static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
-#include "cap-from-name.h"
-#include "cap-to-name.h"
+#include "basic/cap-from-name.h"
+#include "basic/cap-to-name.h"
const char *capability_to_name(int id) {
diff --git a/src/libbasic/src/errno-list.c b/src/libbasic/src/errno-list.c
index 2d39044b50..a40c4efc2e 100644
--- a/src/libbasic/src/errno-list.c
+++ b/src/libbasic/src/errno-list.c
@@ -25,8 +25,8 @@
static const struct errno_name* lookup_errno(register const char *str,
register unsigned int len);
-#include "errno-from-name.h"
-#include "errno-to-name.h"
+#include "basic/errno-from-name.h"
+#include "basic/errno-to-name.h"
const char *errno_to_name(int id) {
diff --git a/src/libbasic/src/hashmap.c b/src/libbasic/src/hashmap.c
index 38a4bb3feb..0b744c525a 100644
--- a/src/libbasic/src/hashmap.c
+++ b/src/libbasic/src/hashmap.c
@@ -36,7 +36,7 @@
#ifdef ENABLE_DEBUG_HASHMAP
#include <pthread.h>
-#include "list.h"
+#include "basic/list.h"
#endif
/*
diff --git a/src/libbasic/src/memfd-util.c b/src/libbasic/src/memfd-util.c
index 8c8cc78ebf..810dd37ee7 100644
--- a/src/libbasic/src/memfd-util.c
+++ b/src/libbasic/src/memfd-util.c
@@ -28,13 +28,13 @@
#include <sys/mman.h>
#include <sys/prctl.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "memfd-util.h"
-#include "missing.h"
-#include "string-util.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/memfd-util.h"
+#include "basic/missing.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
int memfd_new(const char *name) {
_cleanup_free_ char *g = NULL;
diff --git a/src/libbasic/src/path-util.c b/src/libbasic/src/path-util.c
index b2fa81a294..143380dec2 100644
--- a/src/libbasic/src/path-util.c
+++ b/src/libbasic/src/path-util.c
@@ -31,17 +31,17 @@
#include <libgen.h>
#undef basename
-#include "alloc-util.h"
-#include "extract-word.h"
-#include "fs-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "path-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/path-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
bool path_is_absolute(const char *p) {
return p[0] == '/';
diff --git a/src/libbasic/src/process-util.c b/src/libbasic/src/process-util.c
index 02d6f3cca3..fcda02b7a9 100644
--- a/src/libbasic/src/process-util.c
+++ b/src/libbasic/src/process-util.c
@@ -38,23 +38,23 @@
#include <valgrind/valgrind.h>
#endif
-#include "alloc-util.h"
-#include "architecture.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "ioprio.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/ioprio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
int get_process_state(pid_t pid) {
const char *p;
diff --git a/src/libbasic/src/random-util.c b/src/libbasic/src/random-util.c
index 6f797879eb..f5b7e54a68 100644
--- a/src/libbasic/src/random-util.c
+++ b/src/libbasic/src/random-util.c
@@ -31,11 +31,11 @@
#include <sys/auxv.h>
#endif
-#include "fd-util.h"
-#include "io-util.h"
-#include "missing.h"
-#include "random-util.h"
-#include "time-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/missing.h"
+#include "basic/random-util.h"
+#include "basic/time-util.h"
int dev_urandom(void *p, size_t n) {
static int have_syscall = -1;
diff --git a/src/libbasic/src/selinux-util.c b/src/libbasic/src/selinux-util.c
index 10c2f39369..34d2dcdccf 100644
--- a/src/libbasic/src/selinux-util.c
+++ b/src/libbasic/src/selinux-util.c
@@ -32,13 +32,13 @@
#include <selinux/selinux.h>
#endif
-#include "alloc-util.h"
-#include "log.h"
-#include "macro.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
#ifdef HAVE_SELINUX
DEFINE_TRIVIAL_CLEANUP_FUNC(security_context_t, freecon);
diff --git a/src/libfirewall/Makefile b/src/libfirewall/Makefile
index ced0f7e476..0302964186 100644
--- a/src/libfirewall/Makefile
+++ b/src/libfirewall/Makefile
@@ -39,4 +39,6 @@ libfirewall_la_LIBADD = \
$(LIBIPTC_LIBS)
endif # HAVE_LIBIPTC
+sd.CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libfirewall/firewall-util.c b/src/libfirewall/firewall-util.c
index aa924c406e..212bbe00ee 100644
--- a/src/libfirewall/firewall-util.c
+++ b/src/libfirewall/firewall-util.c
@@ -38,11 +38,11 @@
#include <linux/netfilter/xt_addrtype.h>
#include <libiptc/libiptc.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "firewall-util.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "socket-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/socket-util.h"
DEFINE_TRIVIAL_CLEANUP_FUNC(struct xtc_handle*, iptc_free);
diff --git a/src/libshared/Makefile b/src/libshared/Makefile
index 7ed2706100..d6a307fc5a 100644
--- a/src/libshared/Makefile
+++ b/src/libshared/Makefile
@@ -23,5 +23,5 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += src
+nested.subdirs += src
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/include/shared/install.h b/src/libshared/include/shared/install.h
index e056d374b6..d73dfef4ec 100644
--- a/src/libshared/include/shared/install.h
+++ b/src/libshared/include/shared/install.h
@@ -19,6 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+typedef enum UnitFileScope UnitFileScope;
+typedef enum UnitFileState UnitFileState;
+typedef enum UnitFilePresetMode UnitFilePresetMode;
+typedef enum UnitFileChangeType UnitFileChangeType;
+typedef enum UnitFileType UnitFileType;
#include <stdbool.h>
#include "basic/hashmap.h"
@@ -26,11 +31,6 @@
#include "basic/strv.h"
#include "basic/unit-name.h"
-typedef enum UnitFileChangeType UnitFileChangeType;
-typedef enum UnitFilePresetMode UnitFilePresetMode;
-typedef enum UnitFileScope UnitFileScope;
-typedef enum UnitFileState UnitFileState;
-typedef enum UnitFileType UnitFileType;
typedef struct UnitFileChange UnitFileChange;
typedef struct UnitFileInstallInfo UnitFileInstallInfo;
typedef struct UnitFileList UnitFileList;
diff --git a/src/libshared/include/shared/test-tables.h b/src/libshared/include/shared/test-tables.h
index 228e510104..bf286bede5 100644
--- a/src/libshared/include/shared/test-tables.h
+++ b/src/libshared/include/shared/test-tables.h
@@ -20,6 +20,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "basic/macro.h"
+
typedef const char* (*lookup_t)(int);
typedef int (*reverse_t)(const char*);
diff --git a/src/libshared/src/Makefile b/src/libshared/src/Makefile
index d808b55361..9ac9ba59ac 100644
--- a/src/libshared/src/Makefile
+++ b/src/libshared/src/Makefile
@@ -134,10 +134,27 @@ libshared_la_CFLAGS = \
libshared_la_LIBADD = \
libsystemd-internal.la \
- libsystemd-journal-internal.la \
libudev-internal.la \
$(ACL_LIBS) \
$(LIBIDN_LIBS) \
$(SECCOMP_LIBS)
+sd.CPPFLAGS += $(addprefix -I,$(call at.path,$(srcdir)/../include $(srcdir)/../include/shared))
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+sd.CPPFLAGS += -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\"
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+sd.CPPFLAGS += -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\"
+sd.CPPFLAGS += -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\"
+sd.CPPFLAGS += -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\"
+sd.CPPFLAGS += -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\"
+
+sd.CPPFLAGS += -DSYSTEMD_FSCK_PATH=\"$(libexecdir)/systemd-fsck\"
+
+sd.CPPFLAGS += -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(bindir)/systemd-tty-ask-password-agent\"
+
+sd.CPPFLAGS += -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\"
+sd.CPPFLAGS += -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\"
+
+sd.CPPFLAGS += -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/src/dns-domain.c b/src/libshared/src/dns-domain.c
index 835557c6b2..63793edcfa 100644
--- a/src/libshared/src/dns-domain.c
+++ b/src/libshared/src/dns-domain.c
@@ -28,16 +28,16 @@
#include <string.h>
#include <sys/socket.h>
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "hashmap.h"
-#include "hexdecoct.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+#include "basic/hashmap.h"
+#include "basic/hexdecoct.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
int dns_label_unescape(const char **name, char *dest, size_t sz) {
const char *n;
diff --git a/src/libshared/src/gcrypt-util.c b/src/libshared/src/gcrypt-util.c
index 069134a4be..36ee4b0256 100644
--- a/src/libshared/src/gcrypt-util.c
+++ b/src/libshared/src/gcrypt-util.c
@@ -23,7 +23,8 @@
#include <gcrypt.h>
#include "basic/hexdecoct.h"
-#include "shared/gcrypt-util.h"
+
+#include "gcrypt-util.h"
void initialize_libgcrypt(bool secmem) {
const char *p;
diff --git a/src/libsystemd-network/Makefile b/src/libsystemd-network/Makefile
index 96f14f58f2..afd9224056 100644
--- a/src/libsystemd-network/Makefile
+++ b/src/libsystemd-network/Makefile
@@ -23,5 +23,5 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += src test
+nested.subdirs += src test
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd-network/include/systemd-network/_sd-common.h b/src/libsystemd-network/include/systemd-network/_sd-common.h
new file mode 120000
index 0000000000..653327c267
--- /dev/null
+++ b/src/libsystemd-network/include/systemd-network/_sd-common.h
@@ -0,0 +1 @@
+../../../libsystemd/include/systemd/_sd-common.h \ No newline at end of file
diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h
index 4fd418ed35..4704c6b440 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h
@@ -25,9 +25,9 @@
#include <netinet/in.h>
#include <sys/types.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
#include "sd-dhcp-lease.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h
index 014288b8c1..2f565ca825 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h
@@ -26,7 +26,7 @@
#include <netinet/in.h>
#include <sys/types.h>
-#include <systemd/_sd-common.h>
+#include "_sd-common.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h
index 8f0cbaefad..bbb2bb203c 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h
@@ -24,9 +24,10 @@
#include <inttypes.h>
#include <netinet/in.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
+
_SD_BEGIN_DECLARATIONS;
typedef struct sd_dhcp_server sd_dhcp_server;
diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h b/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h
index fd30f0cd03..16947079bb 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h
@@ -24,9 +24,9 @@
#include <net/ethernet.h>
#include <sys/types.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
#include "sd-dhcp6-lease.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h b/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h
index 3e633548d0..184fbb8e0d 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h
@@ -24,7 +24,7 @@
#include <inttypes.h>
#include <netinet/in.h>
-#include <systemd/_sd-common.h>
+#include "_sd-common.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h b/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h
index b6ba392921..93db7a4a6c 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h
@@ -24,9 +24,10 @@
#include <net/ethernet.h>
#include <netinet/in.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
+
_SD_BEGIN_DECLARATIONS;
enum {
diff --git a/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h b/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h
index 9314360b6f..9167623167 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h
@@ -23,9 +23,10 @@
#include <net/ethernet.h>
#include <netinet/in.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
+
_SD_BEGIN_DECLARATIONS;
enum {
diff --git a/src/libsystemd-network/include/systemd-network/sd-lldp.h b/src/libsystemd-network/include/systemd-network/sd-lldp.h
index 6559df44b6..391e7c2a2e 100644
--- a/src/libsystemd-network/include/systemd-network/sd-lldp.h
+++ b/src/libsystemd-network/include/systemd-network/sd-lldp.h
@@ -24,9 +24,10 @@
#include <inttypes.h>
#include <net/ethernet.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
+
_SD_BEGIN_DECLARATIONS;
typedef struct sd_lldp sd_lldp;
diff --git a/src/libsystemd-network/include/systemd-network/sd-ndisc.h b/src/libsystemd-network/include/systemd-network/sd-ndisc.h
index e918fef71e..30eb5bc404 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ndisc.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ndisc.h
@@ -22,10 +22,12 @@
#include <inttypes.h>
#include <net/ethernet.h>
+#include <netinet/in.h>
-#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
+#include "_sd-common.h"
+
_SD_BEGIN_DECLARATIONS;
enum {
diff --git a/src/libsystemd-network/src/Makefile b/src/libsystemd-network/src/Makefile
index 69a415c2bb..30afeae1ef 100644
--- a/src/libsystemd-network/src/Makefile
+++ b/src/libsystemd-network/src/Makefile
@@ -78,4 +78,8 @@ libsystemd_network_la_SOURCES = \
libsystemd_network_la_LIBADD = \
$(KMOD_LIBS)
+sd.CPPFLAGS += $(libsystemd-network.CPPFLAGS)
+sd.CPPFLAGS += $(libshared.CPPFLAGS)
+sd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd-network/src/network-internal.c b/src/libsystemd-network/src/network-internal.c
index d9f7603104..53a2202068 100644
--- a/src/libsystemd-network/src/network-internal.c
+++ b/src/libsystemd-network/src/network-internal.c
@@ -23,6 +23,7 @@
#include <linux/if.h>
#include "basic/alloc-util.h"
+#include "basic/ether-addr-util.h"
#include "basic/hexdecoct.h"
#include "basic/log.h"
#include "basic/parse-util.h"
@@ -32,7 +33,6 @@
#include "basic/strv.h"
#include "basic/utf8.h"
#include "basic/util.h"
-#include "ether-addr-util.c"
#include "shared/condition.h"
#include "shared/conf-parser.h"
#include "systemd-network/dhcp-lease-internal.h"
diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile
index 2c6505918b..5c26912ef1 100644
--- a/src/libsystemd/Makefile
+++ b/src/libsystemd/Makefile
@@ -32,14 +32,14 @@ EXTRA_DIST += \
src/libsystemd/sd-bus/DIFFERENCES \
src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
-libsystemd_la_SOURCES = \
+#libsystemd_la_SOURCES = \
$(libsystemd_internal_la_SOURCES) \
$(libsystemd_journal_internal_la_SOURCES)
-nodist_libsystemd_la_SOURCES = \
+#nodist_libsystemd_la_SOURCES = \
$(nodist_libsystemd_internal_la_SOURCES)
-libsystemd_la_CFLAGS = \
+#libsystemd_la_CFLAGS = \
$(libsystemd_internal_la_CFLAGS) \
$(libsystemd_journal_internal_la_CFLAGS)
@@ -48,14 +48,16 @@ libsystemd_la_LDFLAGS = \
-version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
-Wl,--version-script=$(srcdir)/libsystemd.sym
-libsystemd_la_LIBADD = \
+#libsystemd_la_LIBADD = \
$(libsystemd_internal_la_LIBADD) \
$(libsystemd_journal_internal_la_LIBADD)
+libsystemd_la_LIBADD = $(libsystemd-internal.DEPENDS)
+
pkgconfiglib_DATA += \
src/libsystemd/libsystemd.pc
-pkginclude_HEADERS += \
+_pkginclude_HEADERS += \
src/systemd/sd-bus.h \
src/systemd/sd-bus-protocol.h \
src/systemd/sd-bus-vtable.h \
@@ -64,7 +66,12 @@ pkginclude_HEADERS += \
src/systemd/sd-id128.h \
src/systemd/sd-daemon.h
-lib_LTLIBRARIES += \
+_pkginclude_HEADERS += \
+ src/systemd/sd-journal.h \
+ src/systemd/sd-messages.h \
+ src/systemd/_sd-common.h
+
+rootlib_LTLIBRARIES += \
libsystemd.la
# ------------------------------------------------------------------------------
@@ -90,21 +97,27 @@ tests += \
test-local-addresses \
test-resolve
-test-libsystemd-sym.c: \
- $(top_builddir)/src/libsystemd/libsystemd.sym \
- src/systemd/sd-journal.h \
- src/systemd/sd-daemon.h \
- src/systemd/sd-login.h \
- src/systemd/sd-bus.h \
- src/systemd/sd-utf8.h \
- src/systemd/sd-resolve.h \
- src/systemd/sd-path.h \
- src/systemd/sd-event.h
- $(generate-sym-test)
+$(outdir)/test-libsystemd-sym.c: \
+ $(srcdir)/include/systemd/sd-journal.h \
+ $(srcdir)/include/systemd/sd-daemon.h \
+ $(srcdir)/include/systemd/sd-login.h \
+ $(srcdir)/include/systemd/sd-bus.h \
+ $(srcdir)/include/systemd/sd-utf8.h \
+ $(srcdir)/include/systemd/sd-resolve.h \
+ $(srcdir)/include/systemd/sd-path.h \
+ $(srcdir)/include/systemd/sd-event.h
nodist_test_libsystemd_sym_SOURCES = \
test-libsystemd-sym.c
test_libsystemd_sym_LDADD = \
libsystemd.la
+$(DESTDIR)$(pkgincludedir)/%.h: $(srcdir)/include/systemd/%.h
+ @$(NORMAL_INSTALL)
+ $(am.INSTALL_HEADERS)
+
+files.sys.all += $(addprefix $(pkgincludedir)/,$(notdir $(_pkginclude_HEADERS)))
+$(outdir)/libsystemd.la: $(srcdir)/libsystemd.sym
+nested.subdirs += src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/include/systemd/sd-utf8.h b/src/libsystemd/include/systemd/sd-utf8.h
deleted file mode 100644
index 6781983878..0000000000
--- a/src/libsystemd/include/systemd/sd-utf8.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef foosdutf8hfoo
-#define foosdutf8hfoo
-
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- 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 "_sd-common.h"
-
-_SD_BEGIN_DECLARATIONS;
-
-_sd_pure_ const char *sd_utf8_is_valid(const char *s);
-_sd_pure_ const char *sd_ascii_is_valid(const char *s);
-
-_SD_END_DECLARATIONS;
-
-#endif
diff --git a/src/libsystemd/sd_event_get_fd.xml b/src/libsystemd/sd_event_get_fd.xml
index f68752dd0e..982f279657 100644
--- a/src/libsystemd/sd_event_get_fd.xml
+++ b/src/libsystemd/sd_event_get_fd.xml
@@ -119,7 +119,7 @@
<example>
<title>Integration in the GLib event loop</title>
- <programlisting><xi:include href="glib-event-glue.c" parse="text" /></programlisting>
+ <programlisting><xi:include href="sd_event_get_fd-glib-example.c" parse="text" /></programlisting>
</example>
</refsect1>
diff --git a/src/libsystemd/src/Makefile b/src/libsystemd/src/Makefile
index dceadf81da..10d3e668e8 100644
--- a/src/libsystemd/src/Makefile
+++ b/src/libsystemd/src/Makefile
@@ -23,18 +23,16 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-libsystemd_internal_la_SOURCES = \
+_libsystemd_internal_la_SOURCES = \
src/systemd/sd-bus.h \
src/systemd/sd-bus-protocol.h \
src/systemd/sd-bus-vtable.h \
- src/systemd/sd-utf8.h \
src/systemd/sd-event.h \
src/systemd/sd-netlink.h \
src/systemd/sd-resolve.h \
src/systemd/sd-login.h \
src/systemd/sd-id128.h \
src/systemd/sd-daemon.h \
- src/systemd/sd-path.h \
src/systemd/sd-network.h \
src/systemd/sd-hwdb.h \
src/systemd/sd-device.h \
@@ -81,7 +79,6 @@ libsystemd_internal_la_SOURCES = \
src/libsystemd/sd-bus/kdbus.h \
src/libsystemd/sd-bus/bus-dump.c \
src/libsystemd/sd-bus/bus-dump.h \
- src/libsystemd/sd-utf8/sd-utf8.c \
src/libsystemd/sd-event/sd-event.c \
src/libsystemd/sd-netlink/sd-netlink.c \
src/libsystemd/sd-netlink/netlink-internal.h \
@@ -97,7 +94,6 @@ libsystemd_internal_la_SOURCES = \
src/libsystemd/sd-id128/sd-id128.c \
src/libsystemd/sd-daemon/sd-daemon.c \
src/libsystemd/sd-login/sd-login.c \
- src/libsystemd/sd-path/sd-path.c \
src/libsystemd/sd-network/sd-network.c \
src/libsystemd/sd-network/network-util.h \
src/libsystemd/sd-network/network-util.c \
@@ -120,142 +116,7 @@ libsystemd_internal_la_LIBADD = \
noinst_LTLIBRARIES += \
libsystemd-internal.la
-test_bus_marshal_SOURCES = \
- src/libsystemd/sd-bus/test-bus-marshal.c
-
-test_bus_marshal_LDADD = \
- libshared.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-
-test_bus_marshal_CFLAGS = \
- $(AM_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS)
-
-test_bus_signature_SOURCES = \
- src/libsystemd/sd-bus/test-bus-signature.c
-
-test_bus_signature_LDADD = \
- libshared.la
-
-test_bus_chat_SOURCES = \
- src/libsystemd/sd-bus/test-bus-chat.c
-
-test_bus_chat_LDADD = \
- libshared.la
-
-test_bus_cleanup_SOURCES = \
- src/libsystemd/sd-bus/test-bus-cleanup.c
-
-test_bus_cleanup_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_bus_cleanup_LDADD = \
- libshared.la
-
-test_bus_server_SOURCES = \
- src/libsystemd/sd-bus/test-bus-server.c
-
-test_bus_server_LDADD = \
- libshared.la
-
-test_bus_objects_SOURCES = \
- src/libsystemd/sd-bus/test-bus-objects.c
-
-test_bus_objects_LDADD = \
- libshared.la
-
-test_bus_error_SOURCES = \
- src/libsystemd/sd-bus/test-bus-error.c
-
-test_bus_error_LDADD = \
- libshared.la
-
-test_bus_gvariant_SOURCES = \
- src/libsystemd/sd-bus/test-bus-gvariant.c
-
-test_bus_gvariant_LDADD = \
- libshared.la \
- $(GLIB_LIBS)
-
-test_bus_gvariant_CFLAGS = \
- $(AM_CFLAGS) \
- $(GLIB_CFLAGS)
-
-test_bus_creds_SOURCES = \
- src/libsystemd/sd-bus/test-bus-creds.c
-
-test_bus_creds_LDADD = \
- libshared.la
-
-test_bus_match_SOURCES = \
- src/libsystemd/sd-bus/test-bus-match.c
-
-test_bus_match_LDADD = \
- libshared.la
-
-test_bus_kernel_SOURCES = \
- src/libsystemd/sd-bus/test-bus-kernel.c
-
-test_bus_kernel_LDADD = \
- libshared.la
-
-test_bus_kernel_bloom_SOURCES = \
- src/libsystemd/sd-bus/test-bus-kernel-bloom.c
-
-test_bus_kernel_bloom_LDADD = \
- libshared.la
-
-test_bus_benchmark_SOURCES = \
- src/libsystemd/sd-bus/test-bus-benchmark.c
-
-test_bus_benchmark_LDADD = \
- libshared.la
-
-test_bus_zero_copy_SOURCES = \
- src/libsystemd/sd-bus/test-bus-zero-copy.c
-
-test_bus_zero_copy_LDADD = \
- libshared.la
-
-test_bus_introspect_SOURCES = \
- src/libsystemd/sd-bus/test-bus-introspect.c
-
-test_bus_introspect_LDADD = \
- libshared.la
-
-test_event_SOURCES = \
- src/libsystemd/sd-event/test-event.c
-
-test_event_LDADD = \
- libshared.la
-
-test_netlink_SOURCES = \
- src/libsystemd/sd-netlink/test-netlink.c
-
-test_netlink_LDADD = \
- libshared.la
-
-test_local_addresses_SOURCES = \
- src/libsystemd/sd-netlink/test-local-addresses.c
-
-test_local_addresses_LDADD = \
- libshared.la
-
-test_resolve_SOURCES = \
- src/libsystemd/sd-resolve/test-resolve.c
-
-test_resolve_LDADD = \
- libshared.la
-
-pkginclude_HEADERS += \
- src/systemd/sd-journal.h \
- src/systemd/sd-messages.h \
- src/systemd/_sd-common.h
-
-libsystemd_journal_internal_la_SOURCES = \
+_libsystemd_journal_internal_la_SOURCES = \
src/journal/sd-journal.c \
src/systemd/sd-journal.h \
src/systemd/_sd-common.h \
@@ -280,7 +141,7 @@ libsystemd_journal_internal_la_SOURCES = \
src/shared/gcrypt-util.h \
src/shared/gcrypt-util.c
-nodist_libsystemd_journal_internal_la_SOURCES = \
+#nodist_libsystemd_journal_internal_la_SOURCES = \
src/journal/audit_type-to-name.h
gperf_txt_sources += \
@@ -309,7 +170,7 @@ libsystemd_journal_internal_la_LIBADD += \
endif # HAVE_LZ4
ifneq ($(HAVE_GCRYPT),)
-libsystemd_journal_internal_la_SOURCES += \
+_libsystemd_journal_internal_la_SOURCES += \
src/journal/journal-authenticate.c \
src/journal/journal-authenticate.h \
src/journal/fsprg.c \
@@ -318,12 +179,25 @@ 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 # HAVE_GCRYPT
-noinst_LTLIBRARIES += \
+#noinst_LTLIBRARIES += \
libsystemd-journal-internal.la
+
+# Hook into the `am` module
+libsystemd_internal_la_CFLAGS += $(libsystemd_journal_internal_la_CFLAGS)
+libsystemd_internal_la_LIBADD += $(libsystemd_journal_internal_la_LIBADD)
+
+# Don't bother trying to hook into the `am` module for the sources; the only
+# thing it adds over declaring the dependencies is adding the appropriate
+# directories to am.subdirs=>at.subdirs; but we can do that here just as easily
+# with nested.subdirs.
+sd.libsystemd_SOURCES =
+sd.libsystemd_SOURCES += $(patsubst src/libsystemd/%,%,$(filter %.c,$(_libsystemd_internal_la_SOURCES)))
+sd.libsystemd_SOURCES += $(addprefix sd-journal/,$(notdir $(filter %.c,$(_libsystemd_journal_internal_la_SOURCES))))
+$(outdir)/libsystemd-internal.la: $(addprefix $(outdir)/,$(sd.libsystemd_SOURCES:.c=.lo))
+nested.subdirs += $(sort $(dir $(sd.libsystemd_SOURCES)))
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/src/sd-bus/Makefile b/src/libsystemd/src/sd-bus/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-bus/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-bus/bus-control.c b/src/libsystemd/src/sd-bus/bus-control.c
index 52128e7b5c..5582a17aae 100644
--- a/src/libsystemd/src/sd-bus/bus-control.c
+++ b/src/libsystemd/src/sd-bus/bus-control.c
@@ -24,19 +24,19 @@
#include <errno.h>
#include <stddef.h>
-#include "sd-bus.h"
+#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "bus-bloom.h"
#include "bus-control.h"
#include "bus-internal.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "capability-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
+#include "shared/bus-util.h"
+#include "basic/capability-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
_public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
int r;
diff --git a/src/libsystemd/src/sd-bus/bus-kernel.c b/src/libsystemd/src/sd-bus/bus-kernel.c
index 59398b841d..ef9fb87ee5 100644
--- a/src/libsystemd/src/sd-bus/bus-kernel.c
+++ b/src/libsystemd/src/sd-bus/bus-kernel.c
@@ -32,24 +32,24 @@
#include <libgen.h>
#undef basename
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "bus-bloom.h"
#include "bus-internal.h"
#include "bus-kernel.h"
-#include "bus-label.h"
+#include "basic/bus-label.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "capability-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "memfd-util.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "shared/bus-util.h"
+#include "basic/capability-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/memfd-util.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
#define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t))
diff --git a/src/libsystemd/src/sd-bus/bus-signature.h b/src/libsystemd/src/sd-bus/bus-signature.h
index 1e0cd7f587..8b7a45cef5 100644
--- a/src/libsystemd/src/sd-bus/bus-signature.h
+++ b/src/libsystemd/src/sd-bus/bus-signature.h
@@ -20,6 +20,7 @@
***/
#include <stdbool.h>
+#include <sys/types.h>
bool signature_is_single(const char *s, bool allow_dict_entry);
bool signature_is_pair(const char *s);
diff --git a/src/libsystemd/src/sd-bus/bus-socket.h b/src/libsystemd/src/sd-bus/bus-socket.h
index 6e1d32e6a7..712e37bcc0 100644
--- a/src/libsystemd/src/sd-bus/bus-socket.h
+++ b/src/libsystemd/src/sd-bus/bus-socket.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
#include <systemd/sd-bus.h>
void bus_socket_setup(sd_bus *b);
diff --git a/src/libsystemd/src/sd-bus/bus-track.h b/src/libsystemd/src/sd-bus/bus-track.h
index 7d93a727d6..73b7503ae5 100644
--- a/src/libsystemd/src/sd-bus/bus-track.h
+++ b/src/libsystemd/src/sd-bus/bus-track.h
@@ -19,4 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-bus.h>
+
void bus_track_dispatch(sd_bus_track *track);
diff --git a/src/libsystemd/src/sd-bus/test-bus-gvariant.c b/src/libsystemd/src/sd-bus/test-bus-gvariant.c
index 83f114a0fe..bffc7247c2 100644
--- a/src/libsystemd/src/sd-bus/test-bus-gvariant.c
+++ b/src/libsystemd/src/sd-bus/test-bus-gvariant.c
@@ -21,16 +21,16 @@
#include <glib.h>
#endif
-#include "sd-bus.h"
+#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "bus-dump.h"
#include "bus-gvariant.h"
#include "bus-internal.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "macro.h"
-#include "util.h"
+#include "shared/bus-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
static void test_bus_gvariant_is_fixed_size(void) {
assert_se(bus_gvariant_is_fixed_size("") > 0);
diff --git a/src/libsystemd/src/sd-bus/test-bus-marshal.c b/src/libsystemd/src/sd-bus/test-bus-marshal.c
index a28cc5b79e..59a11718d9 100644
--- a/src/libsystemd/src/sd-bus/test-bus-marshal.c
+++ b/src/libsystemd/src/sd-bus/test-bus-marshal.c
@@ -28,17 +28,17 @@
#include <dbus/dbus.h>
#endif
-#include "sd-bus.h"
+#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "bus-dump.h"
-#include "bus-label.h"
+#include "basic/bus-label.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "hexdecoct.h"
-#include "log.h"
-#include "util.h"
+#include "shared/bus-util.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/log.h"
+#include "basic/util.h"
static void test_bus_path_encode_unique(void) {
_cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL;
diff --git a/src/libsystemd/src/sd-daemon/Makefile b/src/libsystemd/src/sd-daemon/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-daemon/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-device/Makefile b/src/libsystemd/src/sd-device/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-device/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-device/device-internal.h b/src/libsystemd/src/sd-device/device-internal.h
index 5e5ae47339..a1a1d3c4e3 100644
--- a/src/libsystemd/src/sd-device/device-internal.h
+++ b/src/libsystemd/src/sd-device/device-internal.h
@@ -23,6 +23,8 @@
#include "basic/hashmap.h"
#include "basic/set.h"
+#include "sd-device.h"
+
struct sd_device {
uint64_t n_ref;
diff --git a/src/libsystemd/src/sd-event/Makefile b/src/libsystemd/src/sd-event/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-event/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-hwdb/Makefile b/src/libsystemd/src/sd-hwdb/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-hwdb/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-id128/Makefile b/src/libsystemd/src/sd-id128/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-id128/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-journal/Makefile b/src/libsystemd/src/sd-journal/Makefile
index 6d1ff3c0a5..f13c2b51fa 100644
--- a/src/libsystemd/src/sd-journal/Makefile
+++ b/src/libsystemd/src/sd-journal/Makefile
@@ -23,15 +23,22 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-audit_list_includes = -include linux/audit.h -include missing.h
+audit_list_includes = -include linux/audit.h -include $(topsrcdir)/src/libbasic/include/basic/missing.h
ifneq ($(HAVE_AUDIT),)
audit_list_includes += -include libaudit.h
endif # HAVE_AUDIT
-$(outdir)/audit_type-list.txt:
+$(outdir)/audit_type-list.txt: $(call at.path,$(topsrcdir)/src/libbasic/include/basic/missing.h)
$(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM $(audit_list_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 >$@
$(outdir)/audit_type-to-name.h: $(outdir)/audit_type-list.txt
$(AM_V_GEN)$(AWK) '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" }' <$< >$@
+# fsprg.c is a drop-in file using void pointer arithmetic
+$(outdir)/fsprg.lo: sd.ALL_CFLAGS += -Wno-pointer-arith
+
+sd.CPPFLAGS += $(libbasic.CPPFLAGS)
+sd.CPPFLAGS += -DCATALOG_DATABASE=\"$(catalogstatedir)/database\"
+$(outdir)/audit-type.lo: $(outdir)/audit_type-to-name.h
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/src/sd-journal/audit-type.c b/src/libsystemd/src/sd-journal/audit-type.c
index 1dde7f414e..1a10a378b2 100644
--- a/src/libsystemd/src/sd-journal/audit-type.c
+++ b/src/libsystemd/src/sd-journal/audit-type.c
@@ -24,7 +24,7 @@
# include <libaudit.h>
#endif
-#include "missing.h"
+#include "basic/missing.h"
#include "audit-type.h"
#include "audit_type-to-name.h"
-#include "macro.h"
+#include "basic/macro.h"
diff --git a/src/libsystemd/src/sd-journal/compress.c b/src/libsystemd/src/sd-journal/compress.c
index ba734b5561..f763ceeac8 100644
--- a/src/libsystemd/src/sd-journal/compress.c
+++ b/src/libsystemd/src/sd-journal/compress.c
@@ -32,16 +32,16 @@
#include <lz4frame.h>
#endif
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
#include "compress.h"
-#include "fd-util.h"
-#include "io-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
#include "journal-def.h"
-#include "macro.h"
-#include "sparse-endian.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#ifdef HAVE_LZ4
DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_compressionContext_t, LZ4F_freeCompressionContext);
diff --git a/src/libsystemd/src/sd-journal/fsprg.c b/src/libsystemd/src/sd-journal/fsprg.c
index acb8263151..612b10f3a9 100644
--- a/src/libsystemd/src/sd-journal/fsprg.c
+++ b/src/libsystemd/src/sd-journal/fsprg.c
@@ -29,9 +29,8 @@
#include <gcrypt.h>
#include <string.h>
-#include "shared/gcrypt-util.h"
-
#include "fsprg.h"
+#include "gcrypt-util.h"
#define ISVALID_SECPAR(secpar) (((secpar) % 16 == 0) && ((secpar) >= 16) && ((secpar) <= 16384))
#define VALIDATE_SECPAR(secpar) assert(ISVALID_SECPAR(secpar));
diff --git a/src/libsystemd/src/sd-journal/gcrypt-util.c b/src/libsystemd/src/sd-journal/gcrypt-util.c
new file mode 120000
index 0000000000..56bb2382a6
--- /dev/null
+++ b/src/libsystemd/src/sd-journal/gcrypt-util.c
@@ -0,0 +1 @@
+../../../libshared/src/gcrypt-util.c \ No newline at end of file
diff --git a/src/libsystemd/src/sd-journal/gcrypt-util.h b/src/libsystemd/src/sd-journal/gcrypt-util.h
new file mode 120000
index 0000000000..c1168ad265
--- /dev/null
+++ b/src/libsystemd/src/sd-journal/gcrypt-util.h
@@ -0,0 +1 @@
+../../../libshared/include/shared/gcrypt-util.h \ No newline at end of file
diff --git a/src/libsystemd/src/sd-journal/journal-authenticate.c b/src/libsystemd/src/sd-journal/journal-authenticate.c
index 8e983f7e8f..5400d38ffd 100644
--- a/src/libsystemd/src/sd-journal/journal-authenticate.c
+++ b/src/libsystemd/src/sd-journal/journal-authenticate.c
@@ -22,9 +22,9 @@
#include "basic/fd-util.h"
#include "basic/hexdecoct.h"
-#include "shared/gcrypt-util.h"
#include "fsprg.h"
+#include "gcrypt-util.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
diff --git a/src/libsystemd/src/sd-journal/journal-file.h b/src/libsystemd/src/sd-journal/journal-file.h
index 564e1a8179..366d168166 100644
--- a/src/libsystemd/src/sd-journal/journal-file.h
+++ b/src/libsystemd/src/sd-journal/journal-file.h
@@ -25,14 +25,14 @@
#include <gcrypt.h>
#endif
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
#include "journal-def.h"
-#include "macro.h"
+#include "basic/macro.h"
#include "mmap-cache.h"
-#include "sd-event.h"
-#include "sparse-endian.h"
+#include <systemd/sd-event.h>
+#include "basic/sparse-endian.h"
typedef struct JournalMetrics {
/* For all these: -1 means "pick automatically", and 0 means "no limit enforced" */
diff --git a/src/libsystemd/src/sd-journal/journal-send.c b/src/libsystemd/src/sd-journal/journal-send.c
index 5e8a3e3200..7197758289 100644
--- a/src/libsystemd/src/sd-journal/journal-send.c
+++ b/src/libsystemd/src/sd-journal/journal-send.c
@@ -27,17 +27,17 @@
#define SD_JOURNAL_SUPPRESS_LOCATION
-#include "sd-journal.h"
-
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
-#include "memfd-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "util.h"
+#include <systemd/sd-journal.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
+#include "basic/memfd-util.h"
+#include "basic/socket-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#define SNDBUF_SIZE (8*1024*1024)
diff --git a/src/libsystemd/src/sd-journal/mmap-cache.h b/src/libsystemd/src/sd-journal/mmap-cache.h
index 199d944647..d7eca3c237 100644
--- a/src/libsystemd/src/sd-journal/mmap-cache.h
+++ b/src/libsystemd/src/sd-journal/mmap-cache.h
@@ -20,7 +20,9 @@
***/
#include <stdbool.h>
+#include <stdint.h>
#include <sys/stat.h>
+#include <sys/types.h>
/* One context per object type, plus one of the header, plus one "additional" one */
#define MMAP_CACHE_MAX_CONTEXTS 9
diff --git a/src/libsystemd/src/sd-login/Makefile b/src/libsystemd/src/sd-login/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-login/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-netlink/Makefile b/src/libsystemd/src/sd-netlink/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-netlink/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-netlink/local-addresses.c b/src/libsystemd/src/sd-netlink/local-addresses.c
index 81e99e0e5d..0baaab557f 100644
--- a/src/libsystemd/src/sd-netlink/local-addresses.c
+++ b/src/libsystemd/src/sd-netlink/local-addresses.c
@@ -22,7 +22,6 @@
#include "basic/macro.h"
#include "local-addresses.h"
-#include "netlink-util.h"
#include "sd-netlink.h"
static int address_compare(const void *_a, const void *_b) {
diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.h b/src/libsystemd/src/sd-netlink/sd-netlink.h
index d88506a9d7..1df902d30e 100644
--- a/src/libsystemd/src/sd-netlink/sd-netlink.h
+++ b/src/libsystemd/src/sd-netlink/sd-netlink.h
@@ -24,8 +24,8 @@
#include <netinet/ether.h>
#include <netinet/in.h>
-#include <linux/rtnetlink.h>
#include <linux/neighbour.h>
+#include <linux/rtnetlink.h>
#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
diff --git a/src/libsystemd/src/sd-network/Makefile b/src/libsystemd/src/sd-network/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-network/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-network/network-util.h b/src/libsystemd/src/sd-network/network-util.h
index 26780dce28..902be2b2e8 100644
--- a/src/libsystemd/src/sd-network/network-util.h
+++ b/src/libsystemd/src/sd-network/network-util.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
#include "sd-network.h"
bool network_is_online(void);
diff --git a/src/libsystemd/src/sd-resolve/Makefile b/src/libsystemd/src/sd-resolve/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/src/sd-resolve/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/src/sd-utf8/sd-utf8.c b/src/libsystemd/src/sd-utf8/sd-utf8.c
deleted file mode 100644
index 58e4a88f07..0000000000
--- a/src/libsystemd/src/sd-utf8/sd-utf8.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- 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 <systemd/sd-utf8.h>
-
-#include "basic/utf8.h"
-#include "basic/util.h"
-
-_public_ const char *sd_utf8_is_valid(const char *s) {
- assert_return(s, NULL);
-
- return utf8_is_valid(s);
-}
-
-_public_ const char *sd_ascii_is_valid(const char *s) {
- assert_return(s, NULL);
-
- return ascii_is_valid(s);
-}
diff --git a/src/libsystemd/src/subdir.mk b/src/libsystemd/src/subdir.mk
index 35def00fdc..71691e8dac 100644
--- a/src/libsystemd/src/subdir.mk
+++ b/src/libsystemd/src/subdir.mk
@@ -20,10 +20,13 @@
#
# 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 $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-systemd.CPPFLAGS += -DLIBDIR=\"$(libdir)\"
-systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+sd.CPPFLAGS += $(libsystemd.CPPFLAGS)
+sd.CPPFLAGS += $(libbasic.CPPFLAGS)
+sd.CPPFLAGS += $(libshared.CPPFLAGS)
+sd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/src/test.mk b/src/libsystemd/src/test.mk
new file mode 100644
index 0000000000..0290b33f6b
--- /dev/null
+++ b/src/libsystemd/src/test.mk
@@ -0,0 +1,152 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# 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/>.
+
+test_bus_marshal_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-marshal.c
+
+test_bus_marshal_LDADD = \
+ libshared.la \
+ $(GLIB_LIBS) \
+ $(DBUS_LIBS)
+
+test_bus_marshal_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(DBUS_CFLAGS)
+
+test_bus_signature_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-signature.c
+
+test_bus_signature_LDADD = \
+ libshared.la
+
+test_bus_chat_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-chat.c
+
+test_bus_chat_LDADD = \
+ libshared.la
+
+test_bus_cleanup_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-cleanup.c
+
+test_bus_cleanup_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(SECCOMP_CFLAGS)
+
+test_bus_cleanup_LDADD = \
+ libshared.la
+
+test_bus_server_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-server.c
+
+test_bus_server_LDADD = \
+ libshared.la
+
+test_bus_objects_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-objects.c
+
+test_bus_objects_LDADD = \
+ libshared.la
+
+test_bus_error_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-error.c
+
+test_bus_error_LDADD = \
+ libshared.la
+
+test_bus_gvariant_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-gvariant.c
+
+test_bus_gvariant_LDADD = \
+ libshared.la \
+ $(GLIB_LIBS)
+
+test_bus_gvariant_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+test_bus_creds_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-creds.c
+
+test_bus_creds_LDADD = \
+ libshared.la
+
+test_bus_match_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-match.c
+
+test_bus_match_LDADD = \
+ libshared.la
+
+test_bus_kernel_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-kernel.c
+
+test_bus_kernel_LDADD = \
+ libshared.la
+
+test_bus_kernel_bloom_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-kernel-bloom.c
+
+test_bus_kernel_bloom_LDADD = \
+ libshared.la
+
+test_bus_benchmark_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-benchmark.c
+
+test_bus_benchmark_LDADD = \
+ libshared.la
+
+test_bus_zero_copy_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-zero-copy.c
+
+test_bus_zero_copy_LDADD = \
+ libshared.la
+
+test_bus_introspect_SOURCES = \
+ src/libsystemd/sd-bus/test-bus-introspect.c
+
+test_bus_introspect_LDADD = \
+ libshared.la
+
+test_event_SOURCES = \
+ src/libsystemd/sd-event/test-event.c
+
+test_event_LDADD = \
+ libshared.la
+
+test_netlink_SOURCES = \
+ src/libsystemd/sd-netlink/test-netlink.c
+
+test_netlink_LDADD = \
+ libshared.la
+
+test_local_addresses_SOURCES = \
+ src/libsystemd/sd-netlink/test-local-addresses.c
+
+test_local_addresses_LDADD = \
+ libshared.la
+
+test_resolve_SOURCES = \
+ src/libsystemd/sd-resolve/test-resolve.c
+
+test_resolve_LDADD = \
+ libshared.la
diff --git a/src/libudev/Makefile b/src/libudev/Makefile
index 8d9fecb1fb..0ca3d15841 100644
--- a/src/libudev/Makefile
+++ b/src/libudev/Makefile
@@ -23,6 +23,40 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-at.subdirs += src
+LIBUDEV_CURRENT=7
+LIBUDEV_REVISION=4
+LIBUDEV_AGE=6
+
+include_HEADERS += \
+ src/libudev/libudev.h
+
+rootlib_LTLIBRARIES += \
+ libudev.la
+
+libudev_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
+ -Wl,--version-script=$(srcdir)/libudev.sym
+
+libudev_la_LIBADD += $(libudev-internal.DEPENDS)
+
+pkgconfiglib_DATA += \
+ src/libudev/libudev.pc
+
+EXTRA_DIST += \
+ src/libudev/libudev.pc.in
+
+$(outdir)/test-libudev-sym.c: \
+ $(srcdir)/udev.h
+
+nodist_test_libudev_sym_SOURCES = \
+ test-libudev-sym.c
+test_libudev_sym_CFLAGS = \
+ $(AM_CFLAGS) \
+ -Wno-deprecated-declarations
+test_libudev_sym_LDADD = \
+ libudev.la
+
+nested.subdirs += src
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libudev/src/Makefile b/src/libudev/src/Makefile
index ed606315e1..3f2f59ed39 100644
--- a/src/libudev/src/Makefile
+++ b/src/libudev/src/Makefile
@@ -23,17 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-LIBUDEV_CURRENT=7
-LIBUDEV_REVISION=4
-LIBUDEV_AGE=6
-
-include_HEADERS += \
- src/libudev/libudev.h
-
-lib_LTLIBRARIES += \
- libudev.la
-
-libudev_la_SOURCES =\
+libudev_internal_la_SOURCES =\
src/libudev/libudev.sym \
src/libudev/libudev-private.h \
src/libudev/libudev-device-internal.h \
@@ -47,37 +37,10 @@ libudev_la_SOURCES =\
src/libudev/libudev-queue.c \
src/libudev/libudev-hwdb.c
-libudev_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -Wl,--version-script=$(srcdir)/libudev.sym
-
-libudev_la_LIBADD = \
+libudev_internal_la_LIBADD = \
libsystemd-internal.la
-pkgconfiglib_DATA += \
- src/libudev/libudev.pc
-
-EXTRA_DIST += \
- src/libudev/libudev.pc.in
-
noinst_LTLIBRARIES += \
libudev-internal.la
-libudev_internal_la_SOURCES =\
- $(libudev_la_SOURCES)
-
-test-libudev-sym.c: \
- src/libudev/libudev.sym \
- src/udev/udev.h
- $(generate-sym-test)
-
-nodist_test_libudev_sym_SOURCES = \
- test-libudev-sym.c
-test_libudev_sym_CFLAGS = \
- $(AM_CFLAGS) \
- -Wno-deprecated-declarations
-test_libudev_sym_LDADD = \
- libudev.la
-
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cryptsetup/Makefile b/src/systemd-cryptsetup/Makefile
index 73a46bf6da..981bd89c85 100644
--- a/src/systemd-cryptsetup/Makefile
+++ b/src/systemd-cryptsetup/Makefile
@@ -56,4 +56,6 @@ SYSINIT_TARGET_WANTS += \
endif # HAVE_LIBCRYPTSETUP
+sd.CPPFLAGS += -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-dbus1-generator/Makefile b/src/systemd-dbus1-generator/Makefile
index 1d7f0d1a81..8a4193621a 100644
--- a/src/systemd-dbus1-generator/Makefile
+++ b/src/systemd-dbus1-generator/Makefile
@@ -40,10 +40,14 @@ dbus1-generator-install-hook:
dbus1-generator-uninstall-hook:
rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-dist_xinitrc_SCRIPTS = \
+# TODO
+_dist_xinitrc_SCRIPTS = \
xorg/50-systemd-user.sh
INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+sd.CPPFLAGS += -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-debug-generator/Makefile b/src/systemd-debug-generator/Makefile
index bba46c2905..d07c97f2ef 100644
--- a/src/systemd-debug-generator/Makefile
+++ b/src/systemd-debug-generator/Makefile
@@ -31,4 +31,6 @@ systemd_debug_generator_SOURCES = \
systemd_debug_generator_LDADD = \
libshared.la
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-getty-generator/Makefile b/src/systemd-getty-generator/Makefile
index 14f7d02a86..9ca689c035 100644
--- a/src/systemd-getty-generator/Makefile
+++ b/src/systemd-getty-generator/Makefile
@@ -30,4 +30,6 @@ systemd_getty_generator_SOURCES = \
systemd_getty_generator_LDADD = \
libshared.la
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-gpt-auto-generator/Makefile b/src/systemd-gpt-auto-generator/Makefile
index 177db8da7c..ef832ad737 100644
--- a/src/systemd-gpt-auto-generator/Makefile
+++ b/src/systemd-gpt-auto-generator/Makefile
@@ -40,4 +40,6 @@ systemd_gpt_auto_generator_CFLAGS = \
$(BLKID_CFLAGS)
endif # HAVE_BLKID
+sd.CPPFLAGS += -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-machine-id-setup/machine-id-setup-main.c b/src/systemd-machine-id-setup/machine-id-setup-main.c
index fdc009b225..009bb5c5c0 100644
--- a/src/systemd-machine-id-setup/machine-id-setup-main.c
+++ b/src/systemd-machine-id-setup/machine-id-setup-main.c
@@ -25,6 +25,7 @@
#include "basic/log.h"
#include "basic/path-util.h"
#include "basic/util.h"
+
#include "machine-id-setup.h"
static char *arg_root = NULL;
diff --git a/src/systemd-machine-id-setup/machine-id-setup.c b/src/systemd-machine-id-setup/machine-id-setup.c
new file mode 120000
index 0000000000..78f80e2b73
--- /dev/null
+++ b/src/systemd-machine-id-setup/machine-id-setup.c
@@ -0,0 +1 @@
+../grp-system/libcore/machine-id-setup.c \ No newline at end of file
diff --git a/src/systemd-machine-id-setup/machine-id-setup.h b/src/systemd-machine-id-setup/machine-id-setup.h
new file mode 120000
index 0000000000..d2659724ce
--- /dev/null
+++ b/src/systemd-machine-id-setup/machine-id-setup.h
@@ -0,0 +1 @@
+../grp-system/libcore/machine-id-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile
index d6f928ebd6..2fe9bcc143 100644
--- a/src/systemd-nspawn/Makefile
+++ b/src/systemd-nspawn/Makefile
@@ -82,4 +82,9 @@ test_patch_uid_LDADD = \
manual_tests += \
test-patch-uid
+dist_tmpfiles_DATA = \
+ tmpfiles.d/systemd-nspawn.conf
+
+sd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/loopback-setup.c b/src/systemd-nspawn/loopback-setup.c
new file mode 120000
index 0000000000..da633f4936
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.c
@@ -0,0 +1 @@
+../grp-system/libcore/loopback-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/loopback-setup.h b/src/systemd-nspawn/loopback-setup.h
new file mode 120000
index 0000000000..dc051ab1bd
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.h
@@ -0,0 +1 @@
+../grp-system/libcore/loopback-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/machine-id-setup.c b/src/systemd-nspawn/machine-id-setup.c
new file mode 120000
index 0000000000..78f80e2b73
--- /dev/null
+++ b/src/systemd-nspawn/machine-id-setup.c
@@ -0,0 +1 @@
+../grp-system/libcore/machine-id-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/machine-id-setup.h b/src/systemd-nspawn/machine-id-setup.h
new file mode 120000
index 0000000000..d2659724ce
--- /dev/null
+++ b/src/systemd-nspawn/machine-id-setup.h
@@ -0,0 +1 @@
+../grp-system/libcore/machine-id-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.c b/src/systemd-nspawn/mount-setup.c
new file mode 120000
index 0000000000..67cb74c218
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.c
@@ -0,0 +1 @@
+../grp-system/libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.h b/src/systemd-nspawn/mount-setup.h
new file mode 120000
index 0000000000..bae54ba700
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.h
@@ -0,0 +1 @@
+../grp-system/libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c
index 6c9dbf4508..a00e7600aa 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.c
+++ b/src/systemd-nspawn/nspawn-expose-ports.c
@@ -26,7 +26,6 @@
#include "basic/util.h"
#include "firewall-util.h"
#include "sd-netlink/local-addresses.h"
-#include "sd-netlink/netlink-util.h"
#include "sd-netlink/sd-netlink.h"
#include "nspawn-expose-ports.h"
diff --git a/src/systemd-nspawn/nspawn-gperf.gperf b/src/systemd-nspawn/nspawn-gperf.gperf
index 2b5d452662..f814ed8863 100644
--- a/src/systemd-nspawn/nspawn-gperf.gperf
+++ b/src/systemd-nspawn/nspawn-gperf.gperf
@@ -1,6 +1,6 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "nspawn-settings.h"
#include "nspawn-expose-ports.h"
%}
diff --git a/src/systemd-nspawn/nspawn-mount.h b/src/systemd-nspawn/nspawn-mount.h
index 0daf145412..0b3f3fbefa 100644
--- a/src/systemd-nspawn/nspawn-mount.h
+++ b/src/systemd-nspawn/nspawn-mount.h
@@ -20,6 +20,7 @@
***/
#include <stdbool.h>
+#include <sys/types.h>
typedef enum VolatileMode {
VOLATILE_NO,
diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c
index f27b6c4105..1ae0a52f03 100644
--- a/src/systemd-nspawn/nspawn-network.c
+++ b/src/systemd-nspawn/nspawn-network.c
@@ -32,7 +32,6 @@
#include "basic/stat-util.h"
#include "basic/string-util.h"
#include "basic/util.h"
-#include "sd-netlink/netlink-util.h"
#include "sd-netlink/sd-netlink.h"
#include "shared/udev-util.h"
diff --git a/src/systemd-nspawn/nspawn-patch-uid.c b/src/systemd-nspawn/nspawn-patch-uid.c
index 998bd9725d..2cdb541ebb 100644
--- a/src/systemd-nspawn/nspawn-patch-uid.c
+++ b/src/systemd-nspawn/nspawn-patch-uid.c
@@ -27,16 +27,16 @@
#include <sys/vfs.h>
#include <unistd.h>
-#include "acl-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "missing.h"
+#include "shared/acl-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
#include "nspawn-patch-uid.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
#ifdef HAVE_ACL
diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c
index f1ed51e8b8..3f174b6f24 100644
--- a/src/systemd-nspawn/nspawn-register.c
+++ b/src/systemd-nspawn/nspawn-register.c
@@ -22,7 +22,7 @@
#include "basic/stat-util.h"
#include "basic/strv.h"
#include "basic/util.h"
-#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-error.h" /* for bus_error_message */
#include "shared/bus-unit-util.h"
#include "shared/bus-util.h"
diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c
index 8ec058431b..fc913a2363 100644
--- a/src/systemd-nspawn/nspawn.c
+++ b/src/systemd-nspawn/nspawn.c
@@ -43,36 +43,35 @@
#include <sys/types.h>
#include <unistd.h>
-#include "sd-daemon.h"
-#include "sd-id128.h"
-
-#include "alloc-util.h"
-#include "barrier.h"
-#include "base-filesystem.h"
-#include "blkid-util.h"
-#include "btrfs-util.h"
-#include "cap-list.h"
-#include "capability-util.h"
-#include "cgroup-util.h"
-#include "copy.h"
-#include "dev-setup.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fdset.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "gpt.h"
-#include "hostname-util.h"
-#include "log.h"
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-id128.h>
+
+#include "basic/alloc-util.h"
+#include "basic/barrier.h"
+#include "shared/base-filesystem.h"
+#include "basic/blkid-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/cap-list.h"
+#include "basic/capability-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/copy.h"
+#include "shared/dev-setup.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fdset.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "shared/gpt.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
#include "loopback-setup.h"
#include "machine-id-setup.h"
-#include "machine-image.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "netlink-util.h"
+#include "shared/machine-image.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
#include "nspawn-cgroup.h"
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"
@@ -82,27 +81,27 @@
#include "nspawn-settings.h"
#include "nspawn-setuid.h"
#include "nspawn-stub-pid1.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "ptyfwd.h"
-#include "random-util.h"
-#include "rm-rf.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "shared/ptyfwd.h"
+#include "basic/random-util.h"
+#include "basic/rm-rf.h"
#ifdef HAVE_SECCOMP
-#include "seccomp-util.h"
+#include "shared/seccomp-util.h"
#endif
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "udev-util.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "shared/udev-util.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
/* Note that devpts's gid= parameter parses GIDs as signed values, hence we stay away from the upper half of the 32bit
* UID range here */
diff --git a/src/systemd-remount-fs/Makefile b/src/systemd-remount-fs/Makefile
index 49b10a879a..a0dcf27135 100644
--- a/src/systemd-remount-fs/Makefile
+++ b/src/systemd-remount-fs/Makefile
@@ -32,4 +32,7 @@ systemd_remount_fs_SOURCES = \
systemd_remount_fs_LDADD = \
libshared.la
+sd.CPPFLAGS += -DMOUNT_PATH=\"$(MOUNT_PATH)\"
+sd.CPPFLAGS += -DUMOUNT_PATH=\"$(UMOUNT_PATH)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-remount-fs/mount-setup.c b/src/systemd-remount-fs/mount-setup.c
new file mode 120000
index 0000000000..67cb74c218
--- /dev/null
+++ b/src/systemd-remount-fs/mount-setup.c
@@ -0,0 +1 @@
+../grp-system/libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-remount-fs/mount-setup.h b/src/systemd-remount-fs/mount-setup.h
new file mode 120000
index 0000000000..bae54ba700
--- /dev/null
+++ b/src/systemd-remount-fs/mount-setup.h
@@ -0,0 +1 @@
+../grp-system/libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-remount-fs/remount-fs.c b/src/systemd-remount-fs/remount-fs.c
index 936b5f11b3..116c370ef7 100644
--- a/src/systemd-remount-fs/remount-fs.c
+++ b/src/systemd-remount-fs/remount-fs.c
@@ -33,6 +33,7 @@
#include "basic/signal-util.h"
#include "basic/strv.h"
#include "basic/util.h"
+
#include "mount-setup.h"
/* Goes through /etc/fstab and remounts all API file systems, applying
diff --git a/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.bash b/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.bash
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.bash
diff --git a/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.zsh b/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.zsh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/systemd-stdio-bridge/systemd-stdio-bridge.completion.zsh
diff --git a/src/systemd-system-update-generator/Makefile b/src/systemd-system-update-generator/Makefile
index fd44aef359..2fa9008ff6 100644
--- a/src/systemd-system-update-generator/Makefile
+++ b/src/systemd-system-update-generator/Makefile
@@ -30,4 +30,6 @@ systemd_system_update_generator_SOURCES = \
systemd_system_update_generator_LDADD = \
libshared.la
+sd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-timesyncd/Makefile b/src/systemd-timesyncd/Makefile
index c9289846c4..511c86ba82 100644
--- a/src/systemd-timesyncd/Makefile
+++ b/src/systemd-timesyncd/Makefile
@@ -61,4 +61,9 @@ EXTRA_DIST += \
units/systemd-timesyncd.service.in \
src/timesync/timesyncd.conf.in
+dist_systempreset_DATA = \
+ 90-timesyncd.preset
+
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-timesyncd/timesyncd-gperf.gperf b/src/systemd-timesyncd/timesyncd-gperf.gperf
index 29a2cfeef6..b8af831105 100644
--- a/src/systemd-timesyncd/timesyncd-gperf.gperf
+++ b/src/systemd-timesyncd/timesyncd-gperf.gperf
@@ -1,6 +1,6 @@
%{
#include <stddef.h>
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
#include "timesyncd-conf.h"
%}
struct ConfigPerfItem;
diff --git a/src/test/test-af-list.c b/src/test/test-af-list.c
index 8139df55b3..b773de60e7 100644
--- a/src/test/test-af-list.c
+++ b/src/test/test-af-list.c
@@ -27,7 +27,7 @@
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
#include "af-from-name.h"
-#include "af-list.h"
+#include "basic/af-list.h"
#include "af-to-name.h"
int main(int argc, const char *argv[]) {
diff --git a/src/test/test-arphrd-list.c b/src/test/test-arphrd-list.c
index 3755a3e3d0..f24871398e 100644
--- a/src/test/test-arphrd-list.c
+++ b/src/test/test-arphrd-list.c
@@ -27,7 +27,7 @@
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
#include "arphrd-from-name.h"
-#include "arphrd-list.h"
+#include "basic/arphrd-list.h"
#include "arphrd-to-name.h"
int main(int argc, const char *argv[]) {
diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c
index 49b659b3a9..50c960882c 100644
--- a/src/test/test-netlink-manual.c
+++ b/src/test/test-netlink-manual.c
@@ -21,8 +21,8 @@
#include <libkmod.h>
#include <net/if.h>
-#include <linux/ip.h>
#include <linux/if_tunnel.h>
+#include <linux/ip.h>
#include "basic/macro.h"
#include "basic/util.h"