summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile27
-rw-r--r--src/busctl/Makefile37
-rw-r--r--src/busctl/busctl-introspect.c9
-rw-r--r--src/busctl/busctl.c37
-rw-r--r--src/grp-boot/Makefile28
-rw-r--r--src/grp-boot/bootctl/Makefile54
-rw-r--r--src/grp-boot/bootctl/bootctl.c20
-rw-r--r--src/grp-boot/kernel-install/Makefile33
-rw-r--r--src/grp-boot/systemd-boot/Makefile194
-rw-r--r--src/grp-boot/systemd-boot/boot.c2
-rw-r--r--src/grp-boot/systemd-boot/measure.c1
-rw-r--r--src/grp-boot/systemd-boot/stub.c2
-rw-r--r--src/grp-coredump/Makefile28
-rw-r--r--src/grp-coredump/coredumpctl/Makefile41
-rw-r--r--src/grp-coredump/coredumpctl/coredumpctl.c36
-rw-r--r--src/grp-coredump/systemd-coredump/Makefile81
-rw-r--r--src/grp-coredump/systemd-coredump/coredump-vacuum.c19
-rw-r--r--src/grp-coredump/systemd-coredump/coredump.c6
-rw-r--r--src/grp-coredump/systemd-coredump/stacktrace.c13
-rw-r--r--src/grp-hostname/Makefile79
-rw-r--r--src/grp-hostname/hostnamectl/hostnamectl.c14
-rw-r--r--src/grp-hostname/systemd-hostnamed/hostnamed.c26
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/hibernate-resume-generator.c18
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile60
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-hibernate-resume/hibernate-resume.c8
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-sleep/Makefile33
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-sleep/sleep.c16
-rw-r--r--src/grp-initprogs/systemd-backlight/Makefile43
-rw-r--r--src/grp-initprogs/systemd-backlight/backlight.c24
-rw-r--r--src/grp-initprogs/systemd-binfmt/Makefile56
-rw-r--r--src/grp-initprogs/systemd-binfmt/binfmt.c18
-rw-r--r--src/grp-initprogs/systemd-detect-virt/Makefile36
-rw-r--r--src/grp-initprogs/systemd-detect-virt/detect-virt.c4
-rw-r--r--src/grp-initprogs/systemd-firstboot/Makefile47
-rw-r--r--src/grp-initprogs/systemd-firstboot/firstboot.c36
-rw-r--r--src/grp-initprogs/systemd-fsck/Makefile33
-rw-r--r--src/grp-initprogs/systemd-fsck/fsck.c36
-rw-r--r--src/grp-initprogs/systemd-modules-load/Makefile60
-rw-r--r--src/grp-initprogs/systemd-modules-load/modules-load.c18
-rw-r--r--src/grp-initprogs/systemd-quotacheck/Makefile46
-rw-r--r--src/grp-initprogs/systemd-quotacheck/quotacheck.c10
-rw-r--r--src/grp-initprogs/systemd-random-seed/Makefile47
-rw-r--r--src/grp-initprogs/systemd-random-seed/random-seed.c14
-rw-r--r--src/grp-initprogs/systemd-rfkill/Makefile46
-rw-r--r--src/grp-initprogs/systemd-rfkill/rfkill.c29
-rw-r--r--src/grp-initprogs/systemd-sysctl/Makefile33
-rw-r--r--src/grp-initprogs/systemd-sysctl/sysctl.c22
-rw-r--r--src/grp-initprogs/systemd-sysusers/Makefile61
-rw-r--r--src/grp-initprogs/systemd-sysusers/sysusers.c36
-rw-r--r--src/grp-initprogs/systemd-tmpfiles/Makefile84
-rw-r--r--src/grp-initprogs/systemd-tmpfiles/tmpfiles.c73
-rw-r--r--src/grp-initprogs/systemd-update-done/Makefile34
-rw-r--r--src/grp-initprogs/systemd-update-done/update-done.c8
-rw-r--r--src/grp-initprogs/systemd-update-utmp/Makefile42
-rw-r--r--src/grp-initprogs/systemd-update-utmp/update-utmp.c2
-rw-r--r--src/grp-initprogs/systemd-user-sessions/Makefile48
-rw-r--r--src/grp-initprogs/systemd-user-sessions/user-sessions.c12
-rw-r--r--src/grp-initprogs/systemd-vconsole-setup/Makefile50
-rw-r--r--src/grp-initprogs/systemd-vconsole-setup/vconsole-setup.c33
-rw-r--r--src/grp-journal/Makefile170
-rw-r--r--src/grp-journal/grp-remote/Makefile93
-rw-r--r--src/grp-journal/grp-remote/microhttpd-util.h2
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile68
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c6
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/Makefile85
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c11
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c3
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.h2
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c2
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h5
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/Makefile54
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c12
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c29
-rw-r--r--src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h3
-rw-r--r--src/grp-journal/journalctl/Makefile49
-rw-r--r--src/grp-journal/journalctl/journalctl.c72
-rw-r--r--src/grp-journal/libjournal-core/Makefile56
-rw-r--r--src/grp-journal/libjournal-core/journald-audit.c15
-rw-r--r--src/grp-journal/libjournal-core/journald-audit.h3
-rw-r--r--src/grp-journal/libjournal-core/journald-console.c19
-rw-r--r--src/grp-journal/libjournal-core/journald-kmsg.c19
-rw-r--r--src/grp-journal/libjournal-core/journald-native.c21
-rw-r--r--src/grp-journal/libjournal-core/journald-rate-limit.c13
-rw-r--r--src/grp-journal/libjournal-core/journald-rate-limit.h2
-rw-r--r--src/grp-journal/libjournal-core/journald-server.c6
-rw-r--r--src/grp-journal/libjournal-core/journald-server.h7
-rw-r--r--src/grp-journal/libjournal-core/journald-stream.c4
-rw-r--r--src/grp-journal/libjournal-core/journald-stream.h3
-rw-r--r--src/grp-journal/libjournal-core/journald-syslog.c21
-rw-r--r--src/grp-journal/libjournal-core/journald-wall.c11
-rw-r--r--src/grp-journal/libjournal-core/test-audit-type.c3
-rw-r--r--src/grp-journal/libjournal-core/test-catalog.c16
-rw-r--r--src/grp-journal/libjournal-core/test-compress-benchmark.c14
-rw-r--r--src/grp-journal/libjournal-core/test-journal-enum.c6
-rw-r--r--src/grp-journal/libjournal-core/test-journal-flush.c10
-rw-r--r--src/grp-journal/libjournal-core/test-journal-init.c8
-rw-r--r--src/grp-journal/libjournal-core/test-journal-interleaving.c14
-rw-r--r--src/grp-journal/libjournal-core/test-journal-match.c10
-rw-r--r--src/grp-journal/libjournal-core/test-journal-send.c2
-rw-r--r--src/grp-journal/libjournal-core/test-journal-stream.c16
-rw-r--r--src/grp-journal/libjournal-core/test-journal-syslog.c7
-rw-r--r--src/grp-journal/libjournal-core/test-journal-verify.c14
-rw-r--r--src/grp-journal/libjournal-core/test-journal.c10
-rw-r--r--src/grp-journal/libjournal-core/test-mmap-cache.c10
-rw-r--r--src/grp-journal/systemd-cat/cat.c10
-rw-r--r--src/grp-journal/systemd-journald/Makefile94
-rw-r--r--src/grp-journal/systemd-journald/journald.c6
-rw-r--r--src/grp-locale/Makefile90
-rw-r--r--src/grp-locale/localectl/localectl.c24
-rw-r--r--src/grp-locale/systemd-localed/localed.c2
-rw-r--r--src/grp-login/Makefile115
-rw-r--r--src/grp-login/loginctl/Makefile41
-rw-r--r--src/grp-login/loginctl/loginctl.c41
-rw-r--r--src/grp-login/loginctl/sysfs-show.c17
-rw-r--r--src/grp-login/pam_systemd/Makefile56
-rw-r--r--src/grp-login/pam_systemd/pam_systemd.c34
-rw-r--r--src/grp-login/systemd-inhibit/Makefile37
-rw-r--r--src/grp-login/systemd-inhibit/inhibit.c20
-rw-r--r--src/grp-login/systemd-logind/Makefile75
-rw-r--r--src/grp-login/systemd-logind/logind-acl.c21
-rw-r--r--src/grp-login/systemd-logind/logind-acl.h2
-rw-r--r--src/grp-login/systemd-logind/logind-action.c23
-rw-r--r--src/grp-login/systemd-logind/logind-button.c10
-rw-r--r--src/grp-login/systemd-logind/logind-core.c20
-rw-r--r--src/grp-login/systemd-logind/logind-dbus.c49
-rw-r--r--src/grp-login/systemd-logind/logind-device.c5
-rw-r--r--src/grp-login/systemd-logind/logind-device.h3
-rw-r--r--src/grp-login/systemd-logind/logind-inhibit.c23
-rw-r--r--src/grp-login/systemd-logind/logind-seat-dbus.c15
-rw-r--r--src/grp-login/systemd-logind/logind-seat.c21
-rw-r--r--src/grp-login/systemd-logind/logind-seat.h3
-rw-r--r--src/grp-login/systemd-logind/logind-session-dbus.c17
-rw-r--r--src/grp-login/systemd-logind/logind-session-device.c16
-rw-r--r--src/grp-login/systemd-logind/logind-session-device.h3
-rw-r--r--src/grp-login/systemd-logind/logind-session.c38
-rw-r--r--src/grp-login/systemd-logind/logind-session.h7
-rw-r--r--src/grp-login/systemd-logind/logind-user-dbus.c13
-rw-r--r--src/grp-login/systemd-logind/logind-user.c51
-rw-r--r--src/grp-login/systemd-logind/logind-user.h3
-rw-r--r--src/grp-login/systemd-logind/logind-utmp.c23
-rw-r--r--src/grp-login/systemd-logind/logind.c27
-rw-r--r--src/grp-login/systemd-logind/logind.h8
-rw-r--r--src/grp-login/test-inhibit.c8
-rw-r--r--src/grp-login/test-login-shared.c4
-rw-r--r--src/grp-login/test-login-tables.c2
-rw-r--r--src/grp-machine/Makefile29
-rw-r--r--src/grp-machine/grp-import/libimport/import-common.c11
-rw-r--r--src/grp-machine/grp-import/libimport/import-compress.c5
-rw-r--r--src/grp-machine/grp-import/libimport/import-compress.h2
-rw-r--r--src/grp-machine/grp-import/libimport/qcow2-util.c9
-rw-r--r--src/grp-machine/grp-import/libimport/test-qcow2.c7
-rw-r--r--src/grp-machine/grp-import/systemd-export/Makefile51
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-raw.c2
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-raw.h3
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-tar.c19
-rw-r--r--src/grp-machine/grp-import/systemd-export/export-tar.h3
-rw-r--r--src/grp-machine/grp-import/systemd-export/export.c19
-rw-r--r--src/grp-machine/grp-import/systemd-import/Makefile52
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-raw.c35
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-raw.h5
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-tar.c35
-rw-r--r--src/grp-machine/grp-import/systemd-import/import-tar.h5
-rw-r--r--src/grp-machine/grp-import/systemd-import/import.c19
-rw-r--r--src/grp-machine/grp-import/systemd-importd/Makefile39
-rw-r--r--src/grp-machine/grp-import/systemd-importd/importd.c42
-rw-r--r--src/grp-machine/grp-import/systemd-pull/Makefile64
-rw-r--r--src/grp-machine/grp-import/systemd-pull/curl-util.c7
-rw-r--r--src/grp-machine/grp-import/systemd-pull/curl-util.h2
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-common.c35
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-common.h3
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-job.c19
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-job.h6
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-raw.c44
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-raw.h5
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-tar.c39
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull-tar.h5
-rw-r--r--src/grp-machine/grp-import/systemd-pull/pull.c19
-rw-r--r--src/grp-machine/machinectl/Makefile42
-rw-r--r--src/grp-machine/machinectl/machinectl.c56
-rw-r--r--src/grp-machine/nss-mymachines/Makefile46
-rw-r--r--src/grp-machine/nss-mymachines/nss-mymachines.c20
-rw-r--r--src/grp-machine/systemd-machined/Makefile93
-rw-r--r--src/grp-machine/systemd-machined/image-dbus.c19
-rw-r--r--src/grp-machine/systemd-machined/machine.c35
-rw-r--r--src/grp-machine/systemd-machined/machine.h5
-rw-r--r--src/grp-machine/systemd-machined/machined-dbus.c35
-rw-r--r--src/grp-machine/systemd-machined/machined.c23
-rw-r--r--src/grp-machine/systemd-machined/machined.h4
-rw-r--r--src/grp-machine/systemd-machined/operation.c7
-rw-r--r--src/grp-machine/systemd-machined/operation.h2
-rw-r--r--src/grp-machine/systemd-machined/test-machine-tables.c3
-rw-r--r--src/grp-network/Makefile107
-rw-r--r--src/grp-network/libnetworkd-core/Makefile93
-rw-r--r--src/grp-network/libnetworkd-core/networkd-address-pool.c7
-rw-r--r--src/grp-network/libnetworkd-core/networkd-address-pool.h7
-rw-r--r--src/grp-network/libnetworkd-core/networkd-address.c19
-rw-r--r--src/grp-network/libnetworkd-core/networkd-address.h2
-rw-r--r--src/grp-network/libnetworkd-core/networkd-conf.c11
-rw-r--r--src/grp-network/libnetworkd-core/networkd-dhcp4.c10
-rw-r--r--src/grp-network/libnetworkd-core/networkd-dhcp6.c5
-rw-r--r--src/grp-network/libnetworkd-core/networkd-fdb.c9
-rw-r--r--src/grp-network/libnetworkd-core/networkd-fdb.h4
-rw-r--r--src/grp-network/libnetworkd-core/networkd-ipv4ll.c4
-rw-r--r--src/grp-network/libnetworkd-core/networkd-link-bus.c9
-rw-r--r--src/grp-network/libnetworkd-core/networkd-link.c34
-rw-r--r--src/grp-network/libnetworkd-core/networkd-link.h20
-rw-r--r--src/grp-network/libnetworkd-core/networkd-lldp-tx.c19
-rw-r--r--src/grp-network/libnetworkd-core/networkd-manager-bus.c5
-rw-r--r--src/grp-network/libnetworkd-core/networkd-manager.c34
-rw-r--r--src/grp-network/libnetworkd-core/networkd-ndisc.c3
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-bond.c15
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-bond.h4
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-bridge.c7
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.c5
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.h3
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-macvlan.c5
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c15
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-tunnel.h2
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-tuntap.c10
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-veth.c3
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-vxlan.c13
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev-vxlan.h3
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev.c23
-rw-r--r--src/grp-network/libnetworkd-core/networkd-netdev.h7
-rw-r--r--src/grp-network/libnetworkd-core/networkd-network-bus.c7
-rw-r--r--src/grp-network/libnetworkd-core/networkd-network.c27
-rw-r--r--src/grp-network/libnetworkd-core/networkd-network.h10
-rw-r--r--src/grp-network/libnetworkd-core/networkd-route.c17
-rw-r--r--src/grp-network/libnetworkd-core/networkd-util.c11
-rw-r--r--src/grp-network/libnetworkd-core/networkd-util.h2
-rw-r--r--src/grp-network/libnetworkd-core/networkd.h10
-rw-r--r--src/grp-network/networkctl/Makefile39
-rw-r--r--src/grp-network/networkctl/networkctl.c53
-rw-r--r--src/grp-network/systemd-networkd-wait-online/Makefile44
-rw-r--r--src/grp-network/systemd-networkd-wait-online/networkd-wait-online-link.c6
-rw-r--r--src/grp-network/systemd-networkd-wait-online/networkd-wait-online-manager.c14
-rw-r--r--src/grp-network/systemd-networkd-wait-online/networkd-wait-online.c5
-rw-r--r--src/grp-network/systemd-networkd-wait-online/networkd-wait-online.h6
-rw-r--r--src/grp-network/systemd-networkd/Makefile40
-rw-r--r--src/grp-network/systemd-networkd/networkd.c8
-rw-r--r--src/grp-network/test-network-tables.c8
-rw-r--r--src/grp-network/test-network.c6
-rw-r--r--src/grp-network/test-networkd-conf.c13
-rw-r--r--src/grp-resolve/Makefile28
-rw-r--r--src/grp-resolve/libbasic-dns/dns-type.c5
-rw-r--r--src/grp-resolve/libbasic-dns/dns-type.h2
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-answer.c7
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-answer.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-packet.c15
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-packet.h10
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-question.c5
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-question.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-rr.c17
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-rr.h11
-rw-r--r--src/grp-resolve/libbasic-dns/test-dns-packet.c17
-rw-r--r--src/grp-resolve/libbasic-dns/test-dnssec-complex.c13
-rw-r--r--src/grp-resolve/libbasic-dns/test-dnssec.c7
-rw-r--r--src/grp-resolve/libbasic-dns/test-resolve-tables.c3
-rw-r--r--src/grp-resolve/nss-resolve/Makefile46
-rw-r--r--src/grp-resolve/nss-resolve/nss-resolve.c14
-rw-r--r--src/grp-resolve/systemd-resolve/resolve-tool.c18
-rw-r--r--src/grp-resolve/systemd-resolved/Makefile227
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-bus.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-conf.c13
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-cache.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-cache.h8
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.h10
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.c19
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.h6
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c5
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.h4
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c7
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-transaction.c15
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c25
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h6
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-zone.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-zone.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-etc-hosts.c15
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-etc-hosts.h5
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link-bus.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.c12
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.h8
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-llmnr.c3
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.c33
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.h12
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-mdns.c7
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-resolv-conf.c17
-rw-r--r--src/grp-resolve/systemd-resolved/resolved.c11
-rw-r--r--src/grp-system/Makefile28
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/Makefile40
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/analyze-verify.c19
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/analyze-verify.h2
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/analyze.c33
-rw-r--r--src/grp-system/grp-utils/systemd-delta/Makefile33
-rw-r--r--src/grp-system/grp-utils/systemd-delta/delta.c34
-rw-r--r--src/grp-system/grp-utils/systemd-fstab-generator/Makefile34
-rw-r--r--src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c36
-rw-r--r--src/grp-system/grp-utils/systemd-run/Makefile33
-rw-r--r--src/grp-system/grp-utils/systemd-run/run.c34
-rw-r--r--src/grp-system/grp-utils/systemd-sysv-generator/Makefile32
-rw-r--r--src/grp-system/grp-utils/systemd-sysv-generator/sysv-generator.c36
-rw-r--r--src/grp-system/libcore/Makefile170
-rw-r--r--src/grp-system/libcore/automount.c42
-rw-r--r--src/grp-system/libcore/bus-policy.c13
-rw-r--r--src/grp-system/libcore/bus-policy.h6
-rw-r--r--src/grp-system/libcore/busname.c27
-rw-r--r--src/grp-system/libcore/busname.h2
-rw-r--r--src/grp-system/libcore/cgroup.c25
-rw-r--r--src/grp-system/libcore/cgroup.h6
-rw-r--r--src/grp-system/libcore/dbus-automount.c5
-rw-r--r--src/grp-system/libcore/dbus-busname.c5
-rw-r--r--src/grp-system/libcore/dbus-cgroup.c13
-rw-r--r--src/grp-system/libcore/dbus-job.c7
-rw-r--r--src/grp-system/libcore/dbus-kill.c5
-rw-r--r--src/grp-system/libcore/dbus-manager.c37
-rw-r--r--src/grp-system/libcore/dbus-mount.c5
-rw-r--r--src/grp-system/libcore/dbus-path.c5
-rw-r--r--src/grp-system/libcore/dbus-scope.c9
-rw-r--r--src/grp-system/libcore/dbus-service.c17
-rw-r--r--src/grp-system/libcore/dbus-socket.c7
-rw-r--r--src/grp-system/libcore/dbus-swap.c5
-rw-r--r--src/grp-system/libcore/dbus-timer.c7
-rw-r--r--src/grp-system/libcore/dbus-unit.c25
-rw-r--r--src/grp-system/libcore/dbus.c29
-rw-r--r--src/grp-system/libcore/device.c19
-rw-r--r--src/grp-system/libcore/execute.c2
-rw-r--r--src/grp-system/libcore/execute.h19
-rw-r--r--src/grp-system/libcore/failure-action.c12
-rw-r--r--src/grp-system/libcore/failure-action.h3
-rw-r--r--src/grp-system/libcore/hostname-setup.c15
-rw-r--r--src/grp-system/libcore/ima-setup.c9
-rw-r--r--src/grp-system/libcore/job.c29
-rw-r--r--src/grp-system/libcore/job.h4
-rw-r--r--src/grp-system/libcore/kill.c7
-rw-r--r--src/grp-system/libcore/kill.h6
-rw-r--r--src/grp-system/libcore/killall.c19
-rw-r--r--src/grp-system/libcore/load-dropin.c9
-rw-r--r--src/grp-system/libcore/load-dropin.h3
-rw-r--r--src/grp-system/libcore/load-fragment.c1
-rw-r--r--src/grp-system/libcore/locale-setup.c15
-rw-r--r--src/grp-system/libcore/loopback-setup.c6
-rw-r--r--src/grp-system/libcore/machine-id-setup.c35
-rw-r--r--src/grp-system/libcore/manager.c7
-rw-r--r--src/grp-system/libcore/manager.h10
-rw-r--r--src/grp-system/libcore/mount-setup.c37
-rw-r--r--src/grp-system/libcore/mount.c33
-rw-r--r--src/grp-system/libcore/namespace.c32
-rw-r--r--src/grp-system/libcore/namespace.h2
-rw-r--r--src/grp-system/libcore/path.c25
-rw-r--r--src/grp-system/libcore/scope.c15
-rw-r--r--src/grp-system/libcore/selinux-access.c2
-rw-r--r--src/grp-system/libcore/selinux-access.h3
-rw-r--r--src/grp-system/libcore/service.c51
-rw-r--r--src/grp-system/libcore/service.h5
-rw-r--r--src/grp-system/libcore/show-status.c15
-rw-r--r--src/grp-system/libcore/show-status.h2
-rw-r--r--src/grp-system/libcore/slice.c13
-rw-r--r--src/grp-system/libcore/smack-setup.c17
-rw-r--r--src/grp-system/libcore/socket.c52
-rw-r--r--src/grp-system/libcore/socket.h3
-rw-r--r--src/grp-system/libcore/swap.c33
-rw-r--r--src/grp-system/libcore/swap.h2
-rw-r--r--src/grp-system/libcore/target.c11
-rw-r--r--src/grp-system/libcore/timer.c25
-rw-r--r--src/grp-system/libcore/timer.h4
-rw-r--r--src/grp-system/libcore/transaction.c11
-rw-r--r--src/grp-system/libcore/transaction.h3
-rw-r--r--src/grp-system/libcore/unit-printf.c19
-rw-r--r--src/grp-system/libcore/unit.c53
-rw-r--r--src/grp-system/libcore/unit.h11
-rw-r--r--src/grp-system/systemctl/Makefile33
-rw-r--r--src/grp-system/systemctl/systemctl.c101
-rw-r--r--src/grp-system/systemd-shutdown/Makefile39
-rw-r--r--src/grp-system/systemd-shutdown/shutdown.c32
-rw-r--r--src/grp-system/systemd-shutdown/umount.c28
-rw-r--r--src/grp-system/systemd/Makefile71
-rw-r--r--src/grp-system/systemd/main.c4
-rw-r--r--src/grp-timedate/Makefile28
-rw-r--r--src/grp-timedate/systemd-timedated/Makefile65
-rw-r--r--src/grp-timedate/systemd-timedated/timedated.c26
-rw-r--r--src/grp-timedate/timedatectl/Makefile42
-rw-r--r--src/grp-timedate/timedatectl/timedatectl.c16
-rw-r--r--src/grp-udev/Makefile72
-rw-r--r--src/grp-udev/ata_id/Makefile35
-rw-r--r--src/grp-udev/ata_id/ata_id.c13
-rw-r--r--src/grp-udev/cdrom_id/Makefile38
-rw-r--r--src/grp-udev/cdrom_id/cdrom_id.c7
-rw-r--r--src/grp-udev/collect/Makefile35
-rw-r--r--src/grp-udev/collect/collect.c8
-rw-r--r--src/grp-udev/hwdb/Makefile36
-rw-r--r--src/grp-udev/libudev-core/Makefile101
-rw-r--r--src/grp-udev/libudev-core/net/ethtool-util.c12
-rw-r--r--src/grp-udev/libudev-core/net/ethtool-util.h2
-rw-r--r--src/grp-udev/libudev-core/net/link-config.c38
-rw-r--r--src/grp-udev/libudev-core/net/link-config.h7
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-blkid.c10
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-hwdb.c11
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-input_id.c9
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-keyboard.c9
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-kmod.c2
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-net_id.c9
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-net_setup_link.c4
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-path_id.c4
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-uaccess.c4
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-usb_id.c6
-rw-r--r--src/grp-udev/libudev-core/udev-builtin.c2
-rw-r--r--src/grp-udev/libudev-core/udev-ctrl.c8
-rw-r--r--src/grp-udev/libudev-core/udev-event.c14
-rw-r--r--src/grp-udev/libudev-core/udev-node.c12
-rw-r--r--src/grp-udev/libudev-core/udev-rules.c30
-rw-r--r--src/grp-udev/libudev-core/udev-watch.c2
-rw-r--r--src/grp-udev/mtd_probe/Makefile37
-rw-r--r--src/grp-udev/mtd_probe/mtd_probe.h2
-rw-r--r--src/grp-udev/scsi_id/Makefile41
-rw-r--r--src/grp-udev/scsi_id/scsi_id.c9
-rw-r--r--src/grp-udev/scsi_id/scsi_serial.c12
-rw-r--r--src/grp-udev/systemd-hwdb/Makefile76
-rw-r--r--src/grp-udev/systemd-hwdb/hwdb.c26
-rw-r--r--src/grp-udev/systemd-udevd/Makefile35
-rw-r--r--src/grp-udev/systemd-udevd/udevd.c42
-rw-r--r--src/grp-udev/udevadm/Makefile45
-rw-r--r--src/grp-udev/udevadm/udevadm-control.c2
-rw-r--r--src/grp-udev/udevadm/udevadm-hwdb.c18
-rw-r--r--src/grp-udev/udevadm/udevadm-info.c7
-rw-r--r--src/grp-udev/udevadm/udevadm-monitor.c6
-rw-r--r--src/grp-udev/udevadm/udevadm-settle.c4
-rw-r--r--src/grp-udev/udevadm/udevadm-test-builtin.c2
-rw-r--r--src/grp-udev/udevadm/udevadm-test.c4
-rw-r--r--src/grp-udev/udevadm/udevadm-trigger.c7
-rw-r--r--src/grp-udev/udevadm/udevadm-util.c3
-rw-r--r--src/grp-udev/udevadm/udevadm.c4
-rw-r--r--src/grp-udev/v4l_id/Makefile38
-rw-r--r--src/grp-udev/v4l_id/v4l_id.c5
-rw-r--r--src/grp-utils/systemd-ac-power/Makefile33
-rw-r--r--src/grp-utils/systemd-ac-power/ac-power.c2
-rw-r--r--src/grp-utils/systemd-escape/Makefile34
-rw-r--r--src/grp-utils/systemd-escape/escape.c10
-rw-r--r--src/grp-utils/systemd-notify/Makefile33
-rw-r--r--src/grp-utils/systemd-notify/notify.c16
-rw-r--r--src/grp-utils/systemd-path/Makefile34
-rw-r--r--src/grp-utils/systemd-path/path.c12
-rw-r--r--src/grp-utils/systemd-path/sd-path.c24
-rw-r--r--src/grp-utils/systemd-path/sd-path.h2
-rw-r--r--src/grp-utils/systemd-socket-activate/Makefile36
-rw-r--r--src/grp-utils/systemd-socket-activate/activate.c18
-rw-r--r--src/libbasic/Makefile27
-rw-r--r--src/libbasic/include/Makefile27
-rw-r--r--src/libbasic/include/basic/Makefile62
-rw-r--r--src/libbasic/include/basic/escape.h2
-rw-r--r--src/libbasic/include/basic/missing.h13
-rw-r--r--src/libbasic/include/basic/socket-util.h1
-rw-r--r--src/libbasic/src/Makefile243
-rw-r--r--src/libbasic/src/MurmurHash2.c2
-rw-r--r--src/libbasic/src/af-list.c4
-rw-r--r--src/libbasic/src/alloc-util.c6
-rw-r--r--src/libbasic/src/architecture.c8
-rw-r--r--src/libbasic/src/arphrd-list.c4
-rw-r--r--src/libbasic/src/async.c10
-rw-r--r--src/libbasic/src/audit-util.c19
-rw-r--r--src/libbasic/src/barrier.c6
-rw-r--r--src/libbasic/src/bitmap.c8
-rw-r--r--src/libbasic/src/btrfs-util.c3
-rw-r--r--src/libbasic/src/bus-label.c8
-rw-r--r--src/libbasic/src/calendarspec.c12
-rw-r--r--src/libbasic/src/cap-list.c10
-rw-r--r--src/libbasic/src/capability-util.c14
-rw-r--r--src/libbasic/src/cgroup-util.c52
-rw-r--r--src/libbasic/src/chattr-util.c7
-rw-r--r--src/libbasic/src/clock-util.c15
-rw-r--r--src/libbasic/src/conf-files.c22
-rw-r--r--src/libbasic/src/copy.c32
-rw-r--r--src/libbasic/src/cpu-set-util.c14
-rw-r--r--src/libbasic/src/device-nodes.c4
-rw-r--r--src/libbasic/src/dirent-util.c6
-rw-r--r--src/libbasic/src/env-util.c16
-rw-r--r--src/libbasic/src/errno-list.c4
-rw-r--r--src/libbasic/src/escape.c10
-rw-r--r--src/libbasic/src/ether-addr-util.c6
-rw-r--r--src/libbasic/src/exit-status.c6
-rw-r--r--src/libbasic/src/extract-word.c14
-rw-r--r--src/libbasic/src/fd-util.c18
-rw-r--r--src/libbasic/src/fdset.c14
-rw-r--r--src/libbasic/src/fileio-label.c6
-rw-r--r--src/libbasic/src/fileio.c36
-rw-r--r--src/libbasic/src/fs-util.c34
-rw-r--r--src/libbasic/src/glob-util.c6
-rw-r--r--src/libbasic/src/gunicode.c2
-rw-r--r--src/libbasic/src/hash-funcs.c2
-rw-r--r--src/libbasic/src/hashmap.c20
-rw-r--r--src/libbasic/src/hexdecoct.c8
-rw-r--r--src/libbasic/src/hostname-util.c10
-rw-r--r--src/libbasic/src/in-addr-util.c8
-rw-r--r--src/libbasic/src/io-util.c4
-rw-r--r--src/libbasic/src/label.c8
-rw-r--r--src/libbasic/src/locale-util.c20
-rw-r--r--src/libbasic/src/lockfile-util.c12
-rw-r--r--src/libbasic/src/log.c38
-rw-r--r--src/libbasic/src/login-util.c4
-rw-r--r--src/libbasic/src/mempool.c6
-rw-r--r--src/libbasic/src/mkdir-label.c4
-rw-r--r--src/libbasic/src/mkdir.c12
-rw-r--r--src/libbasic/src/mount-util.c22
-rw-r--r--src/libbasic/src/ordered-set.c4
-rw-r--r--src/libbasic/src/parse-util.c10
-rw-r--r--src/libbasic/src/prioq.c6
-rw-r--r--src/libbasic/src/proc-cmdline.c22
-rw-r--r--src/libbasic/src/process-util.c3
-rw-r--r--src/libbasic/src/random-util.c3
-rw-r--r--src/libbasic/src/ratelimit.c4
-rw-r--r--src/libbasic/src/replace-var.c8
-rw-r--r--src/libbasic/src/rlimit-util.c16
-rw-r--r--src/libbasic/src/rm-rf.c18
-rw-r--r--src/libbasic/src/sigbus.c6
-rw-r--r--src/libbasic/src/signal-util.c12
-rw-r--r--src/libbasic/src/siphash24.c6
-rw-r--r--src/libbasic/src/smack-util.c18
-rw-r--r--src/libbasic/src/socket-label.c18
-rw-r--r--src/libbasic/src/socket-util.c32
-rw-r--r--src/libbasic/src/stat-util.c17
-rw-r--r--src/libbasic/src/strbuf.c4
-rw-r--r--src/libbasic/src/string-table.c4
-rw-r--r--src/libbasic/src/string-util.c12
-rw-r--r--src/libbasic/src/strv.c14
-rw-r--r--src/libbasic/src/strxcpyx.c2
-rw-r--r--src/libbasic/src/syslog-util.c8
-rw-r--r--src/libbasic/src/terminal-util.c43
-rw-r--r--src/libbasic/src/time-util.c22
-rw-r--r--src/libbasic/src/unit-name.c20
-rw-r--r--src/libbasic/src/user-util.c18
-rw-r--r--src/libbasic/src/utf8.c8
-rw-r--r--src/libbasic/src/util.c48
-rw-r--r--src/libbasic/src/verbs.c10
-rw-r--r--src/libbasic/src/virt.c20
-rw-r--r--src/libbasic/src/web-util.c6
-rw-r--r--src/libbasic/src/xattr-util.c14
-rw-r--r--src/libbasic/src/xml.c6
-rw-r--r--src/libfirewall/Makefile42
-rw-r--r--src/libfirewall/firewall-util.c2
-rw-r--r--src/libfirewall/firewall-util.h2
-rw-r--r--src/libshared/Makefile27
-rw-r--r--src/libshared/include/shared/acl-util.h2
-rw-r--r--src/libshared/include/shared/acpi-fpdt.h2
-rw-r--r--src/libshared/include/shared/ask-password-api.h2
-rw-r--r--src/libshared/include/shared/boot-timestamps.h2
-rw-r--r--src/libshared/include/shared/bus-unit-util.h2
-rw-r--r--src/libshared/include/shared/bus-util.h6
-rw-r--r--src/libshared/include/shared/condition.h4
-rw-r--r--src/libshared/include/shared/conf-parser.h6
-rw-r--r--src/libshared/include/shared/dns-domain.h4
-rw-r--r--src/libshared/include/shared/dropin.h8
-rw-r--r--src/libshared/include/shared/efivars.h2
-rw-r--r--src/libshared/include/shared/fstab-util.h2
-rw-r--r--src/libshared/include/shared/import-util.h2
-rw-r--r--src/libshared/include/shared/install.h19
-rw-r--r--src/libshared/include/shared/logs-show.h7
-rw-r--r--src/libshared/include/shared/machine-image.h12
-rw-r--r--src/libshared/include/shared/output-mode.h2
-rw-r--r--src/libshared/include/shared/pager.h2
-rw-r--r--src/libshared/include/shared/path-lookup.h3
-rw-r--r--src/libshared/include/shared/ptyfwd.h2
-rw-r--r--src/libshared/include/shared/resolve-util.h2
-rw-r--r--src/libshared/include/shared/udev-util.h2
-rw-r--r--src/libshared/include/shared/utmp-wtmp.h4
-rw-r--r--src/libshared/include/shared/watchdog.h4
-rw-r--r--src/libshared/src/Makefile143
-rw-r--r--src/libshared/src/acl-util.c12
-rw-r--r--src/libshared/src/acpi-fpdt.c10
-rw-r--r--src/libshared/src/apparmor-util.c8
-rw-r--r--src/libshared/src/ask-password-api.c40
-rw-r--r--src/libshared/src/base-filesystem.c18
-rw-r--r--src/libshared/src/boot-timestamps.c10
-rw-r--r--src/libshared/src/bus-unit-util.c40
-rw-r--r--src/libshared/src/bus-util.c30
-rw-r--r--src/libshared/src/cgroup-show.c24
-rw-r--r--src/libshared/src/clean-ipc.c18
-rw-r--r--src/libshared/src/condition.c48
-rw-r--r--src/libshared/src/conf-parser.c36
-rw-r--r--src/libshared/src/dev-setup.c14
-rw-r--r--src/libshared/src/dropin.c30
-rw-r--r--src/libshared/src/efivars.c24
-rw-r--r--src/libshared/src/fstab-util.c20
-rw-r--r--src/libshared/src/gcrypt-util.c4
-rw-r--r--src/libshared/src/generator.c32
-rw-r--r--src/libshared/src/ima-util.c2
-rw-r--r--src/libshared/src/import-util.c18
-rw-r--r--src/libshared/src/install-printf.c14
-rw-r--r--src/libshared/src/install.c50
-rw-r--r--src/libshared/src/logs-show.c40
-rw-r--r--src/libshared/src/machine-image.c46
-rw-r--r--src/libshared/src/machine-pool.c39
-rw-r--r--src/libshared/src/output-mode.c4
-rw-r--r--src/libshared/src/pager.c20
-rw-r--r--src/libshared/src/path-lookup.c24
-rw-r--r--src/libshared/src/ptyfwd.c12
-rw-r--r--src/libshared/src/resolve-util.c6
-rw-r--r--src/libshared/src/seccomp-util.c6
-rw-r--r--src/libshared/src/sleep-config.c24
-rw-r--r--src/libshared/src/spawn-ask-password-agent.c8
-rw-r--r--src/libshared/src/spawn-polkit-agent.c18
-rw-r--r--src/libshared/src/specifier.c10
-rw-r--r--src/libshared/src/switch-root.c24
-rw-r--r--src/libshared/src/sysctl-util.c10
-rw-r--r--src/libshared/src/tests.c4
-rw-r--r--src/libshared/src/uid-range.c6
-rw-r--r--src/libshared/src/utmp-wtmp.c22
-rw-r--r--src/libshared/src/watchdog.c9
-rw-r--r--src/libsystemd-network/Makefile27
-rw-r--r--src/libsystemd-network/include/systemd-network/arp-util.h4
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp-identifier.h6
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp-internal.h7
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp-lease-internal.h7
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp-protocol.h4
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp-server-internal.h9
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp6-internal.h6
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp6-lease-internal.h3
-rw-r--r--src/libsystemd-network/include/systemd-network/dhcp6-protocol.h4
-rw-r--r--src/libsystemd-network/include/systemd-network/lldp-internal.h9
-rw-r--r--src/libsystemd-network/include/systemd-network/lldp-neighbor.h6
-rw-r--r--src/libsystemd-network/include/systemd-network/network-internal.h6
-rw-r--r--src/libsystemd-network/include/systemd-network/sd-dhcp-client.h4
-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.h4
-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.h3
-rw-r--r--src/libsystemd-network/src/Makefile81
-rw-r--r--src/libsystemd-network/src/arp-util.c9
-rw-r--r--src/libsystemd-network/src/dhcp-identifier.c16
-rw-r--r--src/libsystemd-network/src/dhcp-network.c7
-rw-r--r--src/libsystemd-network/src/dhcp-option.c7
-rw-r--r--src/libsystemd-network/src/dhcp-packet.c4
-rw-r--r--src/libsystemd-network/src/dhcp6-network.c9
-rw-r--r--src/libsystemd-network/src/dhcp6-option.c19
-rw-r--r--src/libsystemd-network/src/icmp6-util.c7
-rw-r--r--src/libsystemd-network/src/lldp-neighbor.c16
-rw-r--r--src/libsystemd-network/src/lldp-network.c9
-rw-r--r--src/libsystemd-network/src/network-internal.c32
-rw-r--r--src/libsystemd-network/src/sd-dhcp-client.c26
-rw-r--r--src/libsystemd-network/src/sd-dhcp-lease.c31
-rw-r--r--src/libsystemd-network/src/sd-dhcp-server.c17
-rw-r--r--src/libsystemd-network/src/sd-dhcp6-client.c28
-rw-r--r--src/libsystemd-network/src/sd-dhcp6-lease.c10
-rw-r--r--src/libsystemd-network/src/sd-ipv4acd.c21
-rw-r--r--src/libsystemd-network/src/sd-ipv4ll.c21
-rw-r--r--src/libsystemd-network/src/sd-lldp.c17
-rw-r--r--src/libsystemd-network/src/sd-ndisc.c17
-rw-r--r--src/libsystemd-network/test/Makefile118
-rw-r--r--src/libsystemd-network/test/test-acd.c12
-rw-r--r--src/libsystemd-network/test/test-dhcp-client.c14
-rw-r--r--src/libsystemd-network/test/test-dhcp-option.c10
-rw-r--r--src/libsystemd-network/test/test-dhcp-server.c4
-rw-r--r--src/libsystemd-network/test/test-dhcp6-client.c16
-rw-r--r--src/libsystemd-network/test/test-ipv4ll-manual.c19
-rw-r--r--src/libsystemd-network/test/test-ipv4ll.c11
-rw-r--r--src/libsystemd-network/test/test-lldp.c12
-rw-r--r--src/libsystemd-network/test/test-ndisc-rs.c7
-rw-r--r--src/libsystemd/Makefile110
-rw-r--r--src/libsystemd/include/systemd/sd-bus-vtable.h2
-rw-r--r--src/libsystemd/include/systemd/sd-bus.h9
-rw-r--r--src/libsystemd/include/systemd/sd-journal.h3
-rw-r--r--src/libsystemd/include/systemd/sd-messages.h3
-rw-r--r--src/libsystemd/src/Makefile329
-rw-r--r--src/libsystemd/src/sd-bus/bus-bloom.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-container.c7
-rw-r--r--src/libsystemd/src/sd-bus/bus-control.c2
-rw-r--r--src/libsystemd/src/sd-bus/bus-convenience.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-creds.c38
-rw-r--r--src/libsystemd/src/sd-bus/bus-dump.c23
-rw-r--r--src/libsystemd/src/sd-bus/bus-error.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-error.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-gvariant.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-internal.c7
-rw-r--r--src/libsystemd/src/sd-bus/bus-internal.h13
-rw-r--r--src/libsystemd/src/sd-bus/bus-introspect.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-introspect.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-match.c15
-rw-r--r--src/libsystemd/src/sd-bus/bus-match.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-message.c21
-rw-r--r--src/libsystemd/src/sd-bus/bus-message.h5
-rw-r--r--src/libsystemd/src/sd-bus/bus-objects.c11
-rw-r--r--src/libsystemd/src/sd-bus/bus-protocol.h2
-rw-r--r--src/libsystemd/src/sd-bus/bus-signature.c2
-rw-r--r--src/libsystemd/src/sd-bus/bus-slot.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-socket.c27
-rw-r--r--src/libsystemd/src/sd-bus/bus-track.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-type.h2
-rw-r--r--src/libsystemd/src/sd-bus/sd-bus.c29
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-benchmark.c13
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-chat.c15
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-cleanup.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-creds.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-error.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-gvariant.c2
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-introspect.c3
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c11
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-kernel.c11
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-marshal.c2
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-match.c7
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-objects.c13
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-server.c9
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-signature.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-zero-copy.c13
-rw-r--r--src/libsystemd/src/sd-daemon/sd-daemon.c16
-rw-r--r--src/libsystemd/src/sd-device/device-enumerator-private.h2
-rw-r--r--src/libsystemd/src/sd-device/device-enumerator.c18
-rw-r--r--src/libsystemd/src/sd-device/device-internal.h4
-rw-r--r--src/libsystemd/src/sd-device/device-private.c36
-rw-r--r--src/libsystemd/src/sd-device/device-private.h2
-rw-r--r--src/libsystemd/src/sd-device/device-util.h2
-rw-r--r--src/libsystemd/src/sd-device/sd-device.c30
-rw-r--r--src/libsystemd/src/sd-device/sd-device.h2
-rw-r--r--src/libsystemd/src/sd-event/sd-event.c28
-rw-r--r--src/libsystemd/src/sd-event/test-event.c10
-rw-r--r--src/libsystemd/src/sd-hwdb/hwdb-internal.h4
-rw-r--r--src/libsystemd/src/sd-hwdb/hwdb-util.h4
-rw-r--r--src/libsystemd/src/sd-hwdb/sd-hwdb.c12
-rw-r--r--src/libsystemd/src/sd-hwdb/sd-hwdb.h2
-rw-r--r--src/libsystemd/src/sd-id128/sd-id128.c12
-rw-r--r--src/libsystemd/src/sd-journal/Makefile37
-rw-r--r--src/libsystemd/src/sd-journal/audit-type.c1
-rw-r--r--src/libsystemd/src/sd-journal/audit-type.h2
-rw-r--r--src/libsystemd/src/sd-journal/catalog.c29
-rw-r--r--src/libsystemd/src/sd-journal/catalog.h4
-rw-r--r--src/libsystemd/src/sd-journal/fsprg.c3
-rw-r--r--src/libsystemd/src/sd-journal/fsprg.h4
-rw-r--r--src/libsystemd/src/sd-journal/journal-authenticate.c7
-rw-r--r--src/libsystemd/src/sd-journal/journal-def.h4
-rw-r--r--src/libsystemd/src/sd-journal/journal-file.c27
-rw-r--r--src/libsystemd/src/sd-journal/journal-file.h4
-rw-r--r--src/libsystemd/src/sd-journal/journal-internal.h7
-rw-r--r--src/libsystemd/src/sd-journal/journal-send.c2
-rw-r--r--src/libsystemd/src/sd-journal/journal-vacuum.c15
-rw-r--r--src/libsystemd/src/sd-journal/journal-vacuum.h2
-rw-r--r--src/libsystemd/src/sd-journal/journal-verify.c13
-rw-r--r--src/libsystemd/src/sd-journal/lookup3.h2
-rw-r--r--src/libsystemd/src/sd-journal/mmap-cache.c17
-rw-r--r--src/libsystemd/src/sd-journal/sd-journal.c38
-rw-r--r--src/libsystemd/src/sd-login/sd-login.c38
-rw-r--r--src/libsystemd/src/sd-login/test-login.c12
-rw-r--r--src/libsystemd/src/sd-netlink/local-addresses.c6
-rw-r--r--src/libsystemd/src/sd-netlink/local-addresses.h4
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-internal.h8
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-message.c14
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-socket.c14
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-types.c10
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-types.h2
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-util.c3
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-util.h4
-rw-r--r--src/libsystemd/src/sd-netlink/rtnl-message.c12
-rw-r--r--src/libsystemd/src/sd-netlink/sd-netlink.c16
-rw-r--r--src/libsystemd/src/sd-netlink/sd-netlink.h4
-rw-r--r--src/libsystemd/src/sd-netlink/test-local-addresses.c7
-rw-r--r--src/libsystemd/src/sd-netlink/test-netlink.c14
-rw-r--r--src/libsystemd/src/sd-network/network-util.c7
-rw-r--r--src/libsystemd/src/sd-network/network-util.h2
-rw-r--r--src/libsystemd/src/sd-network/sd-network.c24
-rw-r--r--src/libsystemd/src/sd-network/sd-network.h2
-rw-r--r--src/libsystemd/src/sd-resolve/sd-resolve.c18
-rw-r--r--src/libsystemd/src/sd-resolve/sd-resolve.h3
-rw-r--r--src/libsystemd/src/sd-resolve/test-resolve.c10
-rw-r--r--src/libsystemd/src/sd-utf8/sd-utf8.c4
-rw-r--r--src/libsystemd/src/subdir.mk29
-rw-r--r--src/libudev/Makefile28
-rw-r--r--src/libudev/src/Makefile83
-rw-r--r--src/libudev/src/libudev-device-internal.h5
-rw-r--r--src/libudev/src/libudev-device-private.c5
-rw-r--r--src/libudev/src/libudev-device.c16
-rw-r--r--src/libudev/src/libudev-enumerate.c11
-rw-r--r--src/libudev/src/libudev-hwdb.c6
-rw-r--r--src/libudev/src/libudev-list.c3
-rw-r--r--src/libudev/src/libudev-monitor.c24
-rw-r--r--src/libudev/src/libudev-private.h10
-rw-r--r--src/libudev/src/libudev-queue.c7
-rw-r--r--src/libudev/src/libudev-util.c11
-rw-r--r--src/libudev/src/libudev.c11
-rw-r--r--src/libudev/src/udev.h13
-rw-r--r--src/nss-myhostname/Makefile47
-rw-r--r--src/nss-myhostname/nss-myhostname.c16
-rw-r--r--src/systemd-ask-password/Makefile33
-rw-r--r--src/systemd-ask-password/ask-password.c10
-rw-r--r--src/systemd-cgls/Makefile33
-rw-r--r--src/systemd-cgls/cgls.c24
-rw-r--r--src/systemd-cgroups-agent/Makefile33
-rw-r--r--src/systemd-cgroups-agent/cgroups-agent.c6
-rw-r--r--src/systemd-cgtop/Makefile33
-rw-r--r--src/systemd-cgtop/cgtop.c28
-rw-r--r--src/systemd-cryptsetup/Makefile59
-rw-r--r--src/systemd-cryptsetup/cryptsetup-generator.c32
-rw-r--r--src/systemd-cryptsetup/cryptsetup.c27
-rw-r--r--src/systemd-dbus1-generator/Makefile49
-rw-r--r--src/systemd-dbus1-generator/dbus1-generator.c24
-rw-r--r--src/systemd-debug-generator/Makefile34
-rw-r--r--src/systemd-debug-generator/debug-generator.c18
-rw-r--r--src/systemd-getty-generator/Makefile33
-rw-r--r--src/systemd-getty-generator/getty-generator.c24
-rw-r--r--src/systemd-gpt-auto-generator/Makefile43
-rw-r--r--src/systemd-gpt-auto-generator/gpt-auto-generator.c48
-rw-r--r--src/systemd-initctl/Makefile33
-rw-r--r--src/systemd-initctl/initctl.c22
-rw-r--r--src/systemd-machine-id-setup/Makefile38
-rw-r--r--src/systemd-machine-id-setup/machine-id-setup-main.c6
-rw-r--r--src/systemd-nspawn/Makefile85
-rw-r--r--src/systemd-nspawn/nspawn-cgroup.c17
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.c22
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.h6
-rw-r--r--src/systemd-nspawn/nspawn-mount.c34
-rw-r--r--src/systemd-nspawn/nspawn-network.c28
-rw-r--r--src/systemd-nspawn/nspawn-patch-uid.c1
-rw-r--r--src/systemd-nspawn/nspawn-register.c13
-rw-r--r--src/systemd-nspawn/nspawn-settings.c21
-rw-r--r--src/systemd-nspawn/nspawn-settings.h3
-rw-r--r--src/systemd-nspawn/nspawn-setuid.c17
-rw-r--r--src/systemd-nspawn/nspawn-stub-pid1.c13
-rw-r--r--src/systemd-nspawn/nspawn.c4
-rw-r--r--src/systemd-nspawn/test-patch-uid.c7
-rw-r--r--src/systemd-rc-local-generator/Makefile32
-rw-r--r--src/systemd-rc-local-generator/rc-local-generator.c10
-rw-r--r--src/systemd-remount-fs/Makefile35
-rw-r--r--src/systemd-remount-fs/remount-fs.c16
-rw-r--r--src/systemd-reply-password/Makefile33
-rw-r--r--src/systemd-reply-password/reply-password.c12
-rw-r--r--src/systemd-socket-proxyd/Makefile34
-rw-r--r--src/systemd-socket-proxyd/socket-proxyd.c20
-rw-r--r--src/systemd-stdio-bridge/Makefile33
-rw-r--r--src/systemd-stdio-bridge/stdio-bridge.c10
-rw-r--r--src/systemd-system-update-generator/Makefile33
-rw-r--r--src/systemd-system-update-generator/system-update-generator.c8
-rw-r--r--src/systemd-timesyncd/Makefile64
-rw-r--r--src/systemd-timesyncd/timesyncd-conf.c9
-rw-r--r--src/systemd-timesyncd/timesyncd-conf.h3
-rw-r--r--src/systemd-timesyncd/timesyncd-manager.c29
-rw-r--r--src/systemd-timesyncd/timesyncd-manager.h8
-rw-r--r--src/systemd-timesyncd/timesyncd-server.c3
-rw-r--r--src/systemd-timesyncd/timesyncd-server.h4
-rw-r--r--src/systemd-timesyncd/timesyncd.c15
-rw-r--r--src/systemd-tty-ask-password-agent/Makefile33
-rw-r--r--src/systemd-tty-ask-password-agent/tty-ask-password-agent.c34
-rw-r--r--src/test/Makefile35
-rw-r--r--src/test/test-acl-util.c10
-rw-r--r--src/test/test-af-list.c6
-rw-r--r--src/test/test-alloc-util.c6
-rw-r--r--src/test/test-architecture.c8
-rw-r--r--src/test/test-arphrd-list.c6
-rw-r--r--src/test/test-ask-password-api.c6
-rw-r--r--src/test/test-async.c8
-rw-r--r--src/test/test-barrier.c4
-rw-r--r--src/test/test-bitmap.c2
-rw-r--r--src/test/test-boot-timestamps.c10
-rw-r--r--src/test/test-btrfs.c14
-rw-r--r--src/test/test-calendarspec.c8
-rw-r--r--src/test/test-cap-list.c12
-rw-r--r--src/test/test-capability.c8
-rw-r--r--src/test/test-cgroup-mask.c9
-rw-r--r--src/test/test-cgroup-util.c21
-rw-r--r--src/test/test-cgroup.c8
-rw-r--r--src/test/test-clock.c12
-rw-r--r--src/test/test-condition.c24
-rw-r--r--src/test/test-conf-files.c20
-rw-r--r--src/test/test-conf-parser.c12
-rw-r--r--src/test/test-copy.c26
-rw-r--r--src/test/test-cpu-set-util.c6
-rw-r--r--src/test/test-daemon.c2
-rw-r--r--src/test/test-date.c6
-rw-r--r--src/test/test-device-nodes.c8
-rw-r--r--src/test/test-dns-domain.c8
-rw-r--r--src/test/test-ellipsize.c10
-rw-r--r--src/test/test-engine.c7
-rw-r--r--src/test/test-env-util.c8
-rw-r--r--src/test/test-escape.c6
-rw-r--r--src/test/test-execute.c17
-rw-r--r--src/test/test-extract-word.c6
-rw-r--r--src/test/test-fd-util.c8
-rw-r--r--src/test/test-fdset.c10
-rw-r--r--src/test/test-fileio.c24
-rw-r--r--src/test/test-firewall-util.c2
-rw-r--r--src/test/test-fs-util.c20
-rw-r--r--src/test/test-fstab-util.c10
-rw-r--r--src/test/test-glob-util.c8
-rw-r--r--src/test/test-hashmap-plain.c10
-rw-r--r--src/test/test-hashmap.c4
-rw-r--r--src/test/test-helper.h2
-rw-r--r--src/test/test-hexdecoct.c8
-rw-r--r--src/test/test-hostname-util.c10
-rw-r--r--src/test/test-hostname.c2
-rw-r--r--src/test/test-id128.c8
-rw-r--r--src/test/test-install-root.c12
-rw-r--r--src/test/test-install.c2
-rw-r--r--src/test/test-io-util.c8
-rw-r--r--src/test/test-ipcrm.c6
-rw-r--r--src/test/test-libudev.c16
-rw-r--r--src/test/test-list.c4
-rw-r--r--src/test/test-locale-util.c6
-rw-r--r--src/test/test-log.c6
-rw-r--r--src/test/test-loopback.c2
-rw-r--r--src/test/test-namespace.c10
-rw-r--r--src/test/test-netlink-manual.c10
-rw-r--r--src/test/test-ns.c2
-rw-r--r--src/test/test-nss.c28
-rw-r--r--src/test/test-parse-util.c4
-rw-r--r--src/test/test-path-lookup.c10
-rw-r--r--src/test/test-path-util.c18
-rw-r--r--src/test/test-path.c23
-rw-r--r--src/test/test-prioq.c10
-rw-r--r--src/test/test-proc-cmdline.c12
-rw-r--r--src/test/test-process-util.c18
-rw-r--r--src/test/test-ratelimit.c6
-rw-r--r--src/test/test-replace-var.c8
-rw-r--r--src/test/test-rlimit-util.c12
-rw-r--r--src/test/test-sched-prio.c7
-rw-r--r--src/test/test-selinux.c14
-rw-r--r--src/test/test-set.c2
-rw-r--r--src/test/test-sigbus.c6
-rw-r--r--src/test/test-signal-util.c4
-rw-r--r--src/test/test-siphash24.c4
-rw-r--r--src/test/test-sizeof.c4
-rw-r--r--src/test/test-sleep.c8
-rw-r--r--src/test/test-socket-util.c18
-rw-r--r--src/test/test-stat-util.c10
-rw-r--r--src/test/test-strbuf.c8
-rw-r--r--src/test/test-string-util.c8
-rw-r--r--src/test/test-strip-tab-ansi.c6
-rw-r--r--src/test/test-strv.c10
-rw-r--r--src/test/test-strxcpyx.c6
-rw-r--r--src/test/test-tables.c24
-rw-r--r--src/test/test-terminal-util.c12
-rw-r--r--src/test/test-time.c4
-rw-r--r--src/test/test-tmpfiles.c16
-rw-r--r--src/test/test-udev.c14
-rw-r--r--src/test/test-uid-range.c8
-rw-r--r--src/test/test-unaligned.c6
-rw-r--r--src/test/test-unit-file.c33
-rw-r--r--src/test/test-unit-name.c23
-rw-r--r--src/test/test-user-util.c10
-rw-r--r--src/test/test-utf8.c8
-rw-r--r--src/test/test-util.c12
-rw-r--r--src/test/test-verbs.c6
-rw-r--r--src/test/test-watchdog.c4
-rw-r--r--src/test/test-web-util.c4
-rw-r--r--src/test/test-xattr-util.c12
-rw-r--r--src/test/test-xml.c8
950 files changed, 12646 insertions, 5049 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000000..b84e6076a0
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,27 @@
+# -*- 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
+
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/busctl/Makefile b/src/busctl/Makefile
new file mode 100644
index 0000000000..e7ef92824c
--- /dev/null
+++ b/src/busctl/Makefile
@@ -0,0 +1,37 @@
+# -*- 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
+
+bin_PROGRAMS += \
+ busctl
+
+busctl_SOURCES = \
+ src/libsystemd/sd-bus/busctl.c \
+ src/libsystemd/sd-bus/busctl-introspect.c \
+ src/libsystemd/sd-bus/busctl-introspect.h
+
+busctl_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/busctl/busctl-introspect.c b/src/busctl/busctl-introspect.c
index 3c49ad5c57..5c92c55483 100644
--- a/src/busctl/busctl-introspect.c
+++ b/src/busctl/busctl-introspect.c
@@ -19,11 +19,12 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/xml.h"
+
#include "busctl-introspect.h"
-#include "string-util.h"
-#include "util.h"
-#include "xml.h"
#define NODE_DEPTH_MAX 16
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index 0281409edf..9e7d2159ed 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -21,25 +21,26 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-dump.h"
-#include "bus-internal.h"
-#include "bus-signature.h"
-#include "bus-type.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-dump.h"
+#include "sd-bus/bus-internal.h"
+#include "sd-bus/bus-signature.h"
+#include "sd-bus/bus-type.h"
+#include "shared/bus-util.h"
+#include "shared/pager.h"
+
#include "busctl-introspect.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "locale-util.h"
-#include "log.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "set.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "user-util.h"
-#include "util.h"
static bool arg_no_pager = false;
static bool arg_legend = true;
diff --git a/src/grp-boot/Makefile b/src/grp-boot/Makefile
new file mode 100644
index 0000000000..922d8a32d3
--- /dev/null
+++ b/src/grp-boot/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += bootctl systemd-boot
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/bootctl/Makefile b/src/grp-boot/bootctl/Makefile
new file mode 100644
index 0000000000..84253d2387
--- /dev/null
+++ b/src/grp-boot/bootctl/Makefile
@@ -0,0 +1,54 @@
+# -*- 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_EFI),)
+ifneq ($(HAVE_BLKID),)
+bootctl_SOURCES = \
+ src/boot/bootctl.c
+
+bootctl_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\" \
+ -DBOOTLIBDIR=\"$(bootlibdir)\"
+
+bootctl_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(BLKID_CFLAGS)
+
+bootctl_LDADD = \
+ libshared.la \
+ $(BLKID_LIBS)
+
+bin_PROGRAMS += \
+ bootctl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/bootctl
+
+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/bootctl/bootctl.c b/src/grp-boot/bootctl/bootctl.c
index 4a356d25d1..3ea43e0624 100644
--- a/src/grp-boot/bootctl/bootctl.c
+++ b/src/grp-boot/bootctl/bootctl.c
@@ -35,16 +35,16 @@
#include <sys/statfs.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "blkid-util.h"
-#include "dirent-util.h"
-#include "efivars.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "locale-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/blkid-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/locale-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/efivars.h"
static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t *psize, sd_id128_t *uuid) {
struct statfs sfs;
diff --git a/src/grp-boot/kernel-install/Makefile b/src/grp-boot/kernel-install/Makefile
new file mode 100644
index 0000000000..6a937f516c
--- /dev/null
+++ b/src/grp-boot/kernel-install/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+dist_bin_SCRIPTS = \
+ src/kernel-install/kernel-install
+
+dist_kernelinstall_SCRIPTS = \
+ src/kernel-install/50-depmod.install \
+ src/kernel-install/90-loaderentry.install
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile
new file mode 100644
index 0000000000..5b53fdc7e4
--- /dev/null
+++ b/src/grp-boot/systemd-boot/Makefile
@@ -0,0 +1,194 @@
+# -*- 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_EFI),)
+ifneq ($(HAVE_GNUEFI),)
+efi_cppflags = \
+ $(EFI_CPPFLAGS) \
+ -I$(top_builddir) -include config.h \
+ -I$(EFI_INC_DIR)/efi \
+ -I$(EFI_INC_DIR)/efi/$(EFI_ARCH) \
+ -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\"
+
+efi_cflags = \
+ $(EFI_CFLAGS) \
+ -Wall \
+ -Wextra \
+ -std=gnu90 \
+ -nostdinc \
+ -ggdb -O0 \
+ -fpic \
+ -fshort-wchar \
+ -nostdinc \
+ -ffreestanding \
+ -fno-strict-aliasing \
+ -fno-stack-protector \
+ -Wsign-compare \
+ -Wno-missing-field-initializers
+
+ifneq ($(ARCH_X86_64),)
+efi_cflags += \
+ -mno-red-zone \
+ -mno-sse \
+ -mno-mmx \
+ -DEFI_FUNCTION_WRAPPER \
+ -DGNU_EFI_USE_MS_ABI
+endif # ARCH_X86_64
+
+ifneq ($(ARCH_IA32),)
+efi_cflags += \
+ -mno-sse \
+ -mno-mmx
+endif # ARCH_IA32
+
+efi_ldflags = \
+ $(EFI_LDFLAGS) \
+ -T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \
+ -shared \
+ -Bsymbolic \
+ -nostdlib \
+ -znocombreloc \
+ -L $(EFI_LIB_DIR) \
+ $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
+
+# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' instead,
+# and add required symbols manually.
+ifneq ($(ARCH_AARCH64),)
+efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
+EFI_FORMAT = -O binary
+else
+EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
+endif # ARCH_AARCH64
+endif # HAVE_GNUEFI
+endif # ENABLE_EFI
+
+# ------------------------------------------------------------------------------
+systemd_boot_headers = \
+ src/boot/efi/util.h \
+ src/boot/efi/console.h \
+ src/boot/efi/graphics.h \
+ src/boot/efi/pefile.h \
+ src/boot/efi/measure.h \
+ src/boot/efi/disk.h
+
+systemd_boot_sources = \
+ src/boot/efi/util.c \
+ src/boot/efi/console.c \
+ src/boot/efi/graphics.c \
+ src/boot/efi/pefile.c \
+ src/boot/efi/disk.c \
+ 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)
+
+# ------------------------------------------------------------------------------
+stub_headers = \
+ src/boot/efi/util.h \
+ src/boot/efi/pefile.h \
+ src/boot/efi/disk.h \
+ src/boot/efi/graphics.h \
+ src/boot/efi/splash.h \
+ src/boot/efi/measure.h \
+ src/boot/efi/linux.h
+
+stub_sources = \
+ src/boot/efi/util.c \
+ src/boot/efi/pefile.c \
+ src/boot/efi/disk.c \
+ src/boot/efi/graphics.c \
+ src/boot/efi/splash.c \
+ src/boot/efi/linux.c \
+ src/boot/efi/measure.c \
+ src/boot/efi/stub.c
+
+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)
+
+
+# ------------------------------------------------------------------------------
+CLEANFILES += test-efi-disk.img
+
+test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh
+ $(AM_V_GEN)test/test-efi-create-disk.sh
+
+test-efi: 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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/boot.c b/src/grp-boot/systemd-boot/boot.c
index 30c1ead1aa..9dfaed6d46 100644
--- a/src/grp-boot/systemd-boot/boot.c
+++ b/src/grp-boot/systemd-boot/boot.c
@@ -20,9 +20,9 @@
#include "disk.h"
#include "graphics.h"
#include "linux.h"
+#include "measure.h"
#include "pefile.h"
#include "util.h"
-#include "measure.h"
#ifndef EFI_OS_INDICATIONS_BOOT_TO_FW_UI
#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL
diff --git a/src/grp-boot/systemd-boot/measure.c b/src/grp-boot/systemd-boot/measure.c
index 7c016387c1..63f8280107 100644
--- a/src/grp-boot/systemd-boot/measure.c
+++ b/src/grp-boot/systemd-boot/measure.c
@@ -15,6 +15,7 @@
#include <efi.h>
#include <efilib.h>
+
#include "measure.h"
#define EFI_TCG_PROTOCOL_GUID { 0xf541796d, 0xa62e, 0x4954, {0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd} }
diff --git a/src/grp-boot/systemd-boot/stub.c b/src/grp-boot/systemd-boot/stub.c
index 1e250f34f4..9fae0c1372 100644
--- a/src/grp-boot/systemd-boot/stub.c
+++ b/src/grp-boot/systemd-boot/stub.c
@@ -17,10 +17,10 @@
#include "disk.h"
#include "graphics.h"
#include "linux.h"
+#include "measure.h"
#include "pefile.h"
#include "splash.h"
#include "util.h"
-#include "measure.h"
/* magic string to find in the binary image */
static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " VERSION " ####";
diff --git a/src/grp-coredump/Makefile b/src/grp-coredump/Makefile
new file mode 100644
index 0000000000..2e604d7b86
--- /dev/null
+++ b/src/grp-coredump/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += coredumpctl systemd-coredump
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/coredumpctl/Makefile b/src/grp-coredump/coredumpctl/Makefile
new file mode 100644
index 0000000000..47a4397fa4
--- /dev/null
+++ b/src/grp-coredump/coredumpctl/Makefile
@@ -0,0 +1,41 @@
+# -*- 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
+
+coredumpctl_SOURCES = \
+ src/coredump/coredumpctl.c
+
+coredumpctl_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ coredumpctl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/coredumpctl
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_coredumpctl
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/coredumpctl/coredumpctl.c b/src/grp-coredump/coredumpctl/coredumpctl.c
index dc95da3613..19d28f744e 100644
--- a/src/grp-coredump/coredumpctl/coredumpctl.c
+++ b/src/grp-coredump/coredumpctl/coredumpctl.c
@@ -26,24 +26,24 @@
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "compress.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "journal-internal.h"
-#include "log.h"
-#include "macro.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "set.h"
-#include "sigbus.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/sigbus.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-journal/compress.h"
+#include "sd-journal/journal-internal.h"
+#include "shared/pager.h"
static enum {
ACTION_NONE,
diff --git a/src/grp-coredump/systemd-coredump/Makefile b/src/grp-coredump/systemd-coredump/Makefile
new file mode 100644
index 0000000000..bc71db120e
--- /dev/null
+++ b/src/grp-coredump/systemd-coredump/Makefile
@@ -0,0 +1,81 @@
+# -*- 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_COREDUMP),)
+systemd_coredump_SOURCES = \
+ src/coredump/coredump.c \
+ src/coredump/coredump-vacuum.c \
+ src/coredump/coredump-vacuum.h
+
+systemd_coredump_LDADD = \
+ libshared.la
+
+ifneq ($(HAVE_ELFUTILS),)
+systemd_coredump_SOURCES += \
+ src/coredump/stacktrace.c \
+ src/coredump/stacktrace.h
+
+systemd_coredump_LDADD += \
+ $(ELFUTILS_LIBS)
+endif # HAVE_ELFUTILS
+
+nodist_systemunit_DATA += \
+ units/systemd-coredump@.service
+
+dist_systemunit_DATA += \
+ units/systemd-coredump.socket
+
+SOCKETS_TARGET_WANTS += \
+ systemd-coredump.socket
+
+rootlibexec_PROGRAMS += \
+ systemd-coredump
+
+dist_pkgsysconf_DATA += \
+ src/coredump/coredump.conf
+
+manual_tests += \
+ test-coredump-vacuum
+
+test_coredump_vacuum_SOURCES = \
+ src/coredump/test-coredump-vacuum.c \
+ src/coredump/coredump-vacuum.c \
+ src/coredump/coredump-vacuum.h
+
+test_coredump_vacuum_LDADD = \
+ libshared.la
+
+nodist_sysctl_DATA = \
+ sysctl.d/50-coredump.conf
+
+CLEANFILES += \
+ sysctl.d/50-coredump.conf
+endif # ENABLE_COREDUMP
+
+EXTRA_DIST += \
+ sysctl.d/50-coredump.conf.in \
+ units/systemd-coredump@.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/systemd-coredump/coredump-vacuum.c b/src/grp-coredump/systemd-coredump/coredump-vacuum.c
index f02b6dbd87..7fc6e85436 100644
--- a/src/grp-coredump/systemd-coredump/coredump-vacuum.c
+++ b/src/grp-coredump/systemd-coredump/coredump-vacuum.c
@@ -19,16 +19,17 @@
#include <sys/statvfs.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "coredump-vacuum.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "macro.h"
-#include "string-util.h"
-#include "time-util.h"
-#include "user-util.h"
-#include "util.h"
#define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */
#define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */
diff --git a/src/grp-coredump/systemd-coredump/coredump.c b/src/grp-coredump/systemd-coredump/coredump.c
index bf0e0a038b..999de63900 100644
--- a/src/grp-coredump/systemd-coredump/coredump.c
+++ b/src/grp-coredump/systemd-coredump/coredump.c
@@ -28,9 +28,9 @@
#include <elfutils/libdwfl.h>
#endif
-#include <systemd/sd-journal.h>
-#include <systemd/sd-login.h>
-#include <systemd/sd-daemon.h>
+#include "sd-journal.h"
+#include "sd-login.h"
+#include "sd-daemon.h"
#include "acl-util.h"
#include "alloc-util.h"
diff --git a/src/grp-coredump/systemd-coredump/stacktrace.c b/src/grp-coredump/systemd-coredump/stacktrace.c
index cc4dad9465..e51b2986e6 100644
--- a/src/grp-coredump/systemd-coredump/stacktrace.c
+++ b/src/grp-coredump/systemd-coredump/stacktrace.c
@@ -20,13 +20,14 @@
#include <dwarf.h>
#include <elfutils/libdwfl.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "stacktrace.h"
-#include "string-util.h"
-#include "util.h"
#define FRAMES_MAX 64
#define THREADS_MAX 64
diff --git a/src/grp-hostname/Makefile b/src/grp-hostname/Makefile
new file mode 100644
index 0000000000..911188454c
--- /dev/null
+++ b/src/grp-hostname/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_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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-hostname/hostnamectl/hostnamectl.c b/src/grp-hostname/hostnamectl/hostnamectl.c
index aabc3b30c0..8a24813934 100644
--- a/src/grp-hostname/hostnamectl/hostnamectl.c
+++ b/src/grp-hostname/hostnamectl/hostnamectl.c
@@ -26,13 +26,13 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "architecture.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "hostname-util.h"
-#include "spawn-polkit-agent.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/hostname-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/spawn-polkit-agent.h"
static bool arg_ask_password = true;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
diff --git a/src/grp-hostname/systemd-hostnamed/hostnamed.c b/src/grp-hostname/systemd-hostnamed/hostnamed.c
index d11756e615..22eabc469b 100644
--- a/src/grp-hostname/systemd-hostnamed/hostnamed.c
+++ b/src/grp-hostname/systemd-hostnamed/hostnamed.c
@@ -22,19 +22,19 @@
#include <sys/utsname.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "def.h"
-#include "env-util.h"
-#include "fileio-label.h"
-#include "hostname-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/fileio-label.h"
+#include "basic/hostname-util.h"
+#include "basic/parse-util.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 "basic/virt.h"
+#include "shared/bus-util.h"
#define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:")
diff --git a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/hibernate-resume-generator.c b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/hibernate-resume-generator.c
index d7ee80d58f..6380c297c2 100644
--- a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/hibernate-resume-generator.c
+++ b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume-generator/hibernate-resume-generator.c
@@ -20,15 +20,15 @@
#include <errno.h>
#include <stdio.h>
-#include "alloc-util.h"
-#include "fstab-util.h"
-#include "log.h"
-#include "mkdir.h"
-#include "proc-cmdline.h"
-#include "special.h"
-#include "string-util.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/proc-cmdline.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "shared/fstab-util.h"
static const char *arg_dest = "/tmp";
static char *arg_resume_dev = NULL;
diff --git a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile
new file mode 100644
index 0000000000..4a5590dbf5
--- /dev/null
+++ b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/Makefile
@@ -0,0 +1,60 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += \
+ systemd-hibernate-resume
+
+systemd_hibernate_resume_SOURCES = \
+ src/hibernate-resume/hibernate-resume.c
+
+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
+endif # ENABLE_HIBERNATE
+
+EXTRA_DIST += \
+ units/systemd-hibernate.service.in \
+ units/systemd-hibernate-resume@.service.in \
+ units/systemd-hybrid-sleep.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/hibernate-resume.c b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/hibernate-resume.c
index 21df3c4461..64d14bf64b 100644
--- a/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/hibernate-resume.c
+++ b/src/grp-initprogs/grp-sleep/systemd-hibernate-resume/hibernate-resume.c
@@ -21,10 +21,10 @@
#include <stdio.h>
#include <sys/stat.h>
-#include "alloc-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
struct stat st;
diff --git a/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile b/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile
new file mode 100644
index 0000000000..db103f05c9
--- /dev/null
+++ b/src/grp-initprogs/grp-sleep/systemd-sleep/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-sleep
+systemd_sleep_SOURCES = \
+ src/sleep/sleep.c
+
+systemd_sleep_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/grp-sleep/systemd-sleep/sleep.c b/src/grp-initprogs/grp-sleep/systemd-sleep/sleep.c
index 7f8a95728d..e9e84bc893 100644
--- a/src/grp-initprogs/grp-sleep/systemd-sleep/sleep.c
+++ b/src/grp-initprogs/grp-sleep/systemd-sleep/sleep.c
@@ -24,14 +24,14 @@
#include <systemd/sd-messages.h>
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "sleep-config.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/sleep-config.h"
static char* arg_verb = NULL;
diff --git a/src/grp-initprogs/systemd-backlight/Makefile b/src/grp-initprogs/systemd-backlight/Makefile
new file mode 100644
index 0000000000..cf55ac4db9
--- /dev/null
+++ b/src/grp-initprogs/systemd-backlight/Makefile
@@ -0,0 +1,43 @@
+# -*- 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_BACKLIGHT),)
+rootlibexec_PROGRAMS += \
+ systemd-backlight
+
+nodist_systemunit_DATA += \
+ units/systemd-backlight@.service
+
+systemd_backlight_SOURCES = \
+ src/backlight/backlight.c
+
+systemd_backlight_LDADD = \
+ libshared.la
+endif # ENABLE_BACKLIGHT
+
+EXTRA_DIST += \
+ units/systemd-backlight@.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-backlight/backlight.c b/src/grp-initprogs/systemd-backlight/backlight.c
index 45be135a23..aa8d852024 100644
--- a/src/grp-initprogs/systemd-backlight/backlight.c
+++ b/src/grp-initprogs/systemd-backlight/backlight.c
@@ -17,18 +17,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
-
-#include "alloc-util.h"
-#include "def.h"
-#include "escape.h"
-#include "fileio.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "util.h"
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/escape.h"
+#include "basic/fileio.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/udev-util.h"
static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) {
struct udev_device *parent;
diff --git a/src/grp-initprogs/systemd-binfmt/Makefile b/src/grp-initprogs/systemd-binfmt/Makefile
new file mode 100644
index 0000000000..3e5c1ac270
--- /dev/null
+++ b/src/grp-initprogs/systemd-binfmt/Makefile
@@ -0,0 +1,56 @@
+# -*- 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_BINFMT),)
+systemd_binfmt_SOURCES = \
+ src/binfmt/binfmt.c
+
+systemd_binfmt_LDADD = \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-binfmt
+
+dist_systemunit_DATA += \
+ units/proc-sys-fs-binfmt_misc.automount \
+ units/proc-sys-fs-binfmt_misc.mount
+
+nodist_systemunit_DATA += \
+ units/systemd-binfmt.service
+
+INSTALL_DIRS += \
+ $(prefix)/lib/binfmt.d \
+ $(sysconfdir)/binfmt.d
+
+SYSINIT_TARGET_WANTS += \
+ systemd-binfmt.service \
+ proc-sys-fs-binfmt_misc.automount
+
+endif # ENABLE_BINFMT
+
+EXTRA_DIST += \
+ units/systemd-binfmt.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-binfmt/binfmt.c b/src/grp-initprogs/systemd-binfmt/binfmt.c
index eeef04fb1c..39bbdb5335 100644
--- a/src/grp-initprogs/systemd-binfmt/binfmt.c
+++ b/src/grp-initprogs/systemd-binfmt/binfmt.c
@@ -25,15 +25,15 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static const char conf_file_dirs[] = CONF_PATHS_NULSTR("binfmt.d");
diff --git a/src/grp-initprogs/systemd-detect-virt/Makefile b/src/grp-initprogs/systemd-detect-virt/Makefile
new file mode 100644
index 0000000000..7b9b9f667b
--- /dev/null
+++ b/src/grp-initprogs/systemd-detect-virt/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
+
+bin_PROGRAMS += systemd-detect-virt
+systemd_detect_virt_SOURCES = \
+ src/detect-virt/detect-virt.c
+
+systemd_detect_virt_LDADD = \
+ libshared.la
+
+INSTALL_EXEC_HOOKS += \
+ systemd-detect-virt-install-hook
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-detect-virt/detect-virt.c b/src/grp-initprogs/systemd-detect-virt/detect-virt.c
index 5d51589a31..06cdab5297 100644
--- a/src/grp-initprogs/systemd-detect-virt/detect-virt.c
+++ b/src/grp-initprogs/systemd-detect-virt/detect-virt.c
@@ -22,8 +22,8 @@
#include <stdbool.h>
#include <stdlib.h>
-#include "util.h"
-#include "virt.h"
+#include "basic/util.h"
+#include "basic/virt.h"
static bool arg_quiet = false;
static enum {
diff --git a/src/grp-initprogs/systemd-firstboot/Makefile b/src/grp-initprogs/systemd-firstboot/Makefile
new file mode 100644
index 0000000000..b94b344bb9
--- /dev/null
+++ b/src/grp-initprogs/systemd-firstboot/Makefile
@@ -0,0 +1,47 @@
+# -*- 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_FIRSTBOOT),)
+systemd_firstboot_SOURCES = \
+ src/firstboot/firstboot.c
+
+systemd_firstboot_LDADD = \
+ libshared.la \
+ -lcrypt
+
+rootbin_PROGRAMS += \
+ systemd-firstboot
+
+nodist_systemunit_DATA += \
+ units/systemd-firstboot.service
+
+SYSINIT_TARGET_WANTS += \
+ systemd-firstboot.service
+endif # ENABLE_FIRSTBOOT
+
+EXTRA_DIST += \
+ units/systemd-firstboot.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-firstboot/firstboot.c b/src/grp-initprogs/systemd-firstboot/firstboot.c
index 1e1a592b7c..d2059a943f 100644
--- a/src/grp-initprogs/systemd-firstboot/firstboot.c
+++ b/src/grp-initprogs/systemd-firstboot/firstboot.c
@@ -22,24 +22,24 @@
#include <shadow.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "ask-password-api.h"
-#include "copy.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
-#include "locale-util.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "umask-util.h"
-#include "user-util.h"
+#include "basic/alloc-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/locale-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "shared/ask-password-api.h"
static char *arg_root = NULL;
static char *arg_locale = NULL; /* $LANG */
diff --git a/src/grp-initprogs/systemd-fsck/Makefile b/src/grp-initprogs/systemd-fsck/Makefile
new file mode 100644
index 0000000000..f29fba4d20
--- /dev/null
+++ b/src/grp-initprogs/systemd-fsck/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-fsck
+systemd_fsck_SOURCES = \
+ src/fsck/fsck.c
+
+systemd_fsck_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-fsck/fsck.c b/src/grp-initprogs/systemd-fsck/fsck.c
index d7f0829ffc..4ca018763f 100644
--- a/src/grp-initprogs/systemd-fsck/fsck.c
+++ b/src/grp-initprogs/systemd-fsck/fsck.c
@@ -28,24 +28,24 @@
#include <unistd.h>
#include <systemd/sd-bus.h>
-#include <systemd/sd-device.h>
-
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "device-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "special.h"
-#include "stdio-util.h"
-#include "util.h"
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/special.h"
+#include "basic/stdio-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "sd-device/device-util.h"
+#include "sd-device/sd-device.h"
+#include "shared/bus-util.h"
/* exit codes as defined in fsck(8) */
enum {
diff --git a/src/grp-initprogs/systemd-modules-load/Makefile b/src/grp-initprogs/systemd-modules-load/Makefile
new file mode 100644
index 0000000000..8503fb32a2
--- /dev/null
+++ b/src/grp-initprogs/systemd-modules-load/Makefile
@@ -0,0 +1,60 @@
+# -*- 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 ($(HAVE_KMOD),)
+systemd_modules_load_SOURCES = \
+ src/modules-load/modules-load.c
+
+systemd_modules_load_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(KMOD_CFLAGS)
+
+systemd_modules_load_LDADD = \
+ libshared.la \
+ $(KMOD_LIBS)
+
+rootlibexec_PROGRAMS += \
+ systemd-modules-load
+
+nodist_systemunit_DATA += \
+ units/systemd-modules-load.service
+
+SYSINIT_TARGET_WANTS += \
+ systemd-modules-load.service
+
+ifneq ($(ENABLE_TMPFILES),)
+nodist_systemunit_DATA += \
+ units/kmod-static-nodes.service
+
+SYSINIT_TARGET_WANTS += \
+ kmod-static-nodes.service
+endif # ENABLE_TMPFILES
+endif # HAVE_KMOD
+
+EXTRA_DIST += \
+ units/systemd-modules-load.service.in \
+ units/kmod-static-nodes.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-modules-load/modules-load.c b/src/grp-initprogs/systemd-modules-load/modules-load.c
index f75015d8c3..d7ea7886c6 100644
--- a/src/grp-initprogs/systemd-modules-load/modules-load.c
+++ b/src/grp-initprogs/systemd-modules-load/modules-load.c
@@ -24,15 +24,15 @@
#include <string.h>
#include <sys/stat.h>
-#include "conf-files.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "proc-cmdline.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/conf-files.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/proc-cmdline.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static char **arg_proc_cmdline_modules = NULL;
diff --git a/src/grp-initprogs/systemd-quotacheck/Makefile b/src/grp-initprogs/systemd-quotacheck/Makefile
new file mode 100644
index 0000000000..4220946f39
--- /dev/null
+++ b/src/grp-initprogs/systemd-quotacheck/Makefile
@@ -0,0 +1,46 @@
+# -*- 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_QUOTACHECK),)
+rootlibexec_PROGRAMS += \
+ systemd-quotacheck
+
+nodist_systemunit_DATA += \
+ units/systemd-quotacheck.service
+
+systemd_quotacheck_SOURCES = \
+ src/quotacheck/quotacheck.c
+
+systemd_quotacheck_LDADD = \
+ libshared.la
+endif # ENABLE_QUOTACHECK
+
+EXTRA_DIST += \
+ units/systemd-quotacheck.service.in
+
+nodist_systemunit_DATA += \
+ units/quotaon.service
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-quotacheck/quotacheck.c b/src/grp-initprogs/systemd-quotacheck/quotacheck.c
index 6d8c05f046..3c2292b0c4 100644
--- a/src/grp-initprogs/systemd-quotacheck/quotacheck.c
+++ b/src/grp-initprogs/systemd-quotacheck/quotacheck.c
@@ -23,11 +23,11 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static bool arg_skip = false;
static bool arg_force = false;
diff --git a/src/grp-initprogs/systemd-random-seed/Makefile b/src/grp-initprogs/systemd-random-seed/Makefile
new file mode 100644
index 0000000000..56d1af7431
--- /dev/null
+++ b/src/grp-initprogs/systemd-random-seed/Makefile
@@ -0,0 +1,47 @@
+# -*- 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_RANDOMSEED),)
+rootlibexec_PROGRAMS += \
+ systemd-random-seed
+
+nodist_systemunit_DATA += \
+ units/systemd-random-seed.service
+
+systemd_random_seed_SOURCES = \
+ src/random-seed/random-seed.c
+
+systemd_random_seed_LDADD = \
+ libshared.la
+
+SYSINIT_TARGET_WANTS += \
+ systemd-random-seed.service
+
+endif # ENABLE_RANDOMSEED
+
+EXTRA_DIST += \
+ units/systemd-random-seed.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-random-seed/random-seed.c b/src/grp-initprogs/systemd-random-seed/random-seed.c
index 6748bb9dd3..7fea6069f3 100644
--- a/src/grp-initprogs/systemd-random-seed/random-seed.c
+++ b/src/grp-initprogs/systemd-random-seed/random-seed.c
@@ -23,13 +23,13 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "log.h"
-#include "mkdir.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#define POOL_SIZE_MIN 512
diff --git a/src/grp-initprogs/systemd-rfkill/Makefile b/src/grp-initprogs/systemd-rfkill/Makefile
new file mode 100644
index 0000000000..2b4430b712
--- /dev/null
+++ b/src/grp-initprogs/systemd-rfkill/Makefile
@@ -0,0 +1,46 @@
+# -*- 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_RFKILL),)
+rootlibexec_PROGRAMS += \
+ systemd-rfkill
+
+nodist_systemunit_DATA += \
+ units/systemd-rfkill.service
+
+dist_systemunit_DATA += \
+ units/systemd-rfkill.socket
+
+systemd_rfkill_SOURCES = \
+ src/rfkill/rfkill.c
+
+systemd_rfkill_LDADD = \
+ libshared.la
+endif # ENABLE_RFKILL
+
+EXTRA_DIST += \
+ units/systemd-rfkill.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-rfkill/rfkill.c b/src/grp-initprogs/systemd-rfkill/rfkill.c
index f0b0ad9275..86779e9ac8 100644
--- a/src/grp-initprogs/systemd-rfkill/rfkill.c
+++ b/src/grp-initprogs/systemd-rfkill/rfkill.c
@@ -17,24 +17,25 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/rfkill.h>
#include <poll.h>
-#include "libudev.h"
+#include <linux/rfkill.h>
+
+#include <libudev.h>
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/udev-util.h"
#define EXIT_USEC (5 * USEC_PER_SEC)
diff --git a/src/grp-initprogs/systemd-sysctl/Makefile b/src/grp-initprogs/systemd-sysctl/Makefile
new file mode 100644
index 0000000000..3af80e7bef
--- /dev/null
+++ b/src/grp-initprogs/systemd-sysctl/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-sysctl
+systemd_sysctl_SOURCES = \
+ src/sysctl/sysctl.c
+
+systemd_sysctl_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-sysctl/sysctl.c b/src/grp-initprogs/systemd-sysctl/sysctl.c
index ce7c26e7d3..c44aa0aabb 100644
--- a/src/grp-initprogs/systemd-sysctl/sysctl.c
+++ b/src/grp-initprogs/systemd-sysctl/sysctl.c
@@ -25,17 +25,17 @@
#include <stdlib.h>
#include <string.h>
-#include "conf-files.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "log.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "sysctl-util.h"
-#include "util.h"
+#include "basic/conf-files.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/sysctl-util.h"
static char **arg_prefixes = NULL;
diff --git a/src/grp-initprogs/systemd-sysusers/Makefile b/src/grp-initprogs/systemd-sysusers/Makefile
new file mode 100644
index 0000000000..4753ca75d0
--- /dev/null
+++ b/src/grp-initprogs/systemd-sysusers/Makefile
@@ -0,0 +1,61 @@
+# -*- 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_SYSUSERS),)
+systemd_sysusers_SOURCES = \
+ src/sysusers/sysusers.c
+
+systemd_sysusers_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ systemd-sysusers
+
+nodist_systemunit_DATA += \
+ units/systemd-sysusers.service
+
+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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-sysusers/sysusers.c b/src/grp-initprogs/systemd-sysusers/sysusers.c
index 4377f1b910..a71d777720 100644
--- a/src/grp-initprogs/systemd-sysusers/sysusers.c
+++ b/src/grp-initprogs/systemd-sysusers/sysusers.c
@@ -24,24 +24,24 @@
#include <shadow.h>
#include <utmp.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "copy.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "formats-util.h"
-#include "hashmap.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "smack-util.h"
-#include "specifier.h"
-#include "string-util.h"
-#include "strv.h"
-#include "uid-range.h"
-#include "user-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/copy.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/formats-util.h"
+#include "basic/hashmap.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "shared/specifier.h"
+#include "shared/uid-range.h"
typedef enum ItemType {
ADD_USER = 'u',
diff --git a/src/grp-initprogs/systemd-tmpfiles/Makefile b/src/grp-initprogs/systemd-tmpfiles/Makefile
new file mode 100644
index 0000000000..d12c910883
--- /dev/null
+++ b/src/grp-initprogs/systemd-tmpfiles/Makefile
@@ -0,0 +1,84 @@
+# -*- 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_TMPFILES),)
+systemd_tmpfiles_SOURCES = \
+ src/tmpfiles/tmpfiles.c
+
+systemd_tmpfiles_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ systemd-tmpfiles
+
+dist_systemunit_DATA += \
+ units/systemd-tmpfiles-clean.timer
+
+nodist_systemunit_DATA += \
+ units/systemd-tmpfiles-setup-dev.service \
+ units/systemd-tmpfiles-setup.service \
+ units/systemd-tmpfiles-clean.service
+
+nodist_tmpfiles_DATA = \
+ tmpfiles.d/systemd.conf \
+ tmpfiles.d/etc.conf
+
+dist_tmpfiles_DATA = \
+ tmpfiles.d/systemd-nologin.conf \
+ 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
+
+ifneq ($(HAVE_SYSV_COMPAT),)
+dist_tmpfiles_DATA += \
+ tmpfiles.d/legacy.conf
+endif # HAVE_SYSV_COMPAT
+
+SYSINIT_TARGET_WANTS += \
+ systemd-tmpfiles-setup-dev.service \
+ systemd-tmpfiles-setup.service
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_systemd-tmpfiles
+
+TIMERS_TARGET_WANTS += \
+ systemd-tmpfiles-clean.timer
+
+INSTALL_DIRS += \
+ $(tmpfilesdir) \
+ $(sysconfdir)/tmpfiles.d
+endif # ENABLE_TMPFILES
+
+EXTRA_DIST += \
+ tmpfiles.d/systemd.conf.m4 \
+ tmpfiles.d/etc.conf.m4 \
+ units/systemd-tmpfiles-setup-dev.service.in \
+ units/systemd-tmpfiles-setup.service.in \
+ units/systemd-tmpfiles-clean.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c b/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
index 2053d35a67..c674bf1226 100644
--- a/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
+++ b/src/grp-initprogs/systemd-tmpfiles/tmpfiles.c
@@ -25,7 +25,6 @@
#include <getopt.h>
#include <glob.h>
#include <limits.h>
-#include <linux/fs.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
@@ -36,41 +35,43 @@
#include <time.h>
#include <unistd.h>
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "capability-util.h"
-#include "chattr-util.h"
-#include "conf-files.h"
-#include "copy.h"
-#include "def.h"
-#include "escape.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 "label.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "selinux-util.h"
-#include "set.h"
-#include "specifier.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "util.h"
+#include <linux/fs.h>
+
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/capability-util.h"
+#include "basic/chattr-util.h"
+#include "basic/conf-files.h"
+#include "basic/copy.h"
+#include "basic/def.h"
+#include "basic/escape.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/label.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/selinux-util.h"
+#include "basic/set.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"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/acl-util.h"
+#include "shared/specifier.h"
/* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
* them in the file system. This is intended to be used to create
diff --git a/src/grp-initprogs/systemd-update-done/Makefile b/src/grp-initprogs/systemd-update-done/Makefile
new file mode 100644
index 0000000000..90cb440874
--- /dev/null
+++ b/src/grp-initprogs/systemd-update-done/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-update-done
+
+systemd_update_done_SOURCES = \
+ src/update-done/update-done.c
+
+systemd_update_done_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-update-done/update-done.c b/src/grp-initprogs/systemd-update-done/update-done.c
index da306a4444..39d19ec048 100644
--- a/src/grp-initprogs/systemd-update-done/update-done.c
+++ b/src/grp-initprogs/systemd-update-done/update-done.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "fd-util.h"
-#include "io-util.h"
-#include "selinux-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/selinux-util.h"
+#include "basic/util.h"
#define MESSAGE \
"This file was created by systemd-update-done. Its only \n" \
diff --git a/src/grp-initprogs/systemd-update-utmp/Makefile b/src/grp-initprogs/systemd-update-utmp/Makefile
new file mode 100644
index 0000000000..0107808281
--- /dev/null
+++ b/src/grp-initprogs/systemd-update-utmp/Makefile
@@ -0,0 +1,42 @@
+# -*- 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 ($(HAVE_UTMP),)
+rootlibexec_PROGRAMS += \
+ systemd-update-utmp
+endif # HAVE_UTMP
+
+systemd_update_utmp_SOURCES = \
+ src/update-utmp/update-utmp.c
+
+systemd_update_utmp_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(AUDIT_CFLAGS)
+
+systemd_update_utmp_LDADD = \
+ libshared.la \
+ $(AUDIT_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-update-utmp/update-utmp.c b/src/grp-initprogs/systemd-update-utmp/update-utmp.c
index fedcaef91c..8ae4a8a833 100644
--- a/src/grp-initprogs/systemd-update-utmp/update-utmp.c
+++ b/src/grp-initprogs/systemd-update-utmp/update-utmp.c
@@ -25,7 +25,7 @@
#include <libaudit.h>
#endif
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-error.h"
diff --git a/src/grp-initprogs/systemd-user-sessions/Makefile b/src/grp-initprogs/systemd-user-sessions/Makefile
new file mode 100644
index 0000000000..66fa3b7059
--- /dev/null
+++ b/src/grp-initprogs/systemd-user-sessions/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 ($(HAVE_PAM),)
+
+systemd_user_sessions_SOURCES = \
+ src/user-sessions/user-sessions.c
+
+systemd_user_sessions_LDADD = \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-user-sessions
+
+nodist_systemunit_DATA += \
+ units/systemd-user-sessions.service
+
+MULTI_USER_TARGET_WANTS += \
+ systemd-user-sessions.service
+
+endif # HAVE_PAM
+
+EXTRA_DIST += \
+ units/systemd-user-sessions.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-user-sessions/user-sessions.c b/src/grp-initprogs/systemd-user-sessions/user-sessions.c
index 9b29b5ba1d..639c0200e6 100644
--- a/src/grp-initprogs/systemd-user-sessions/user-sessions.c
+++ b/src/grp-initprogs/systemd-user-sessions/user-sessions.c
@@ -20,12 +20,12 @@
#include <errno.h>
#include <unistd.h>
-#include "fileio.h"
-#include "fileio-label.h"
-#include "log.h"
-#include "selinux-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/fileio-label.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/selinux-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
int main(int argc, char*argv[]) {
diff --git a/src/grp-initprogs/systemd-vconsole-setup/Makefile b/src/grp-initprogs/systemd-vconsole-setup/Makefile
new file mode 100644
index 0000000000..99b369967e
--- /dev/null
+++ b/src/grp-initprogs/systemd-vconsole-setup/Makefile
@@ -0,0 +1,50 @@
+# -*- 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_VCONSOLE),)
+systemd_vconsole_setup_SOURCES = \
+ src/vconsole/vconsole-setup.c
+
+systemd_vconsole_setup_LDADD = \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-vconsole-setup
+
+nodist_udevrules_DATA += \
+ src/vconsole/90-vconsole.rules
+
+nodist_systemunit_DATA += \
+ units/systemd-vconsole-setup.service
+
+SYSINIT_TARGET_WANTS += \
+ systemd-vconsole-setup.service
+endif # ENABLE_VCONSOLE
+
+EXTRA_DIST += \
+ src/vconsole/90-vconsole.rules.in \
+ units/systemd-vconsole-setup.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-initprogs/systemd-vconsole-setup/vconsole-setup.c b/src/grp-initprogs/systemd-vconsole-setup/vconsole-setup.c
index 1118118450..87c0c2f066 100644
--- a/src/grp-initprogs/systemd-vconsole-setup/vconsole-setup.c
+++ b/src/grp-initprogs/systemd-vconsole-setup/vconsole-setup.c
@@ -20,28 +20,29 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <linux/kd.h>
-#include <linux/tiocl.h>
-#include <linux/vt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
-#include "locale-util.h"
-#include "log.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
-#include "virt.h"
+#include <linux/kd.h>
+#include <linux/tiocl.h>
+#include <linux/vt.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
static bool is_vconsole(int fd) {
unsigned char data[1];
diff --git a/src/grp-journal/Makefile b/src/grp-journal/Makefile
new file mode 100644
index 0000000000..fcefb81581
--- /dev/null
+++ b/src/grp-journal/Makefile
@@ -0,0 +1,170 @@
+# -*- 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
+
+test_journal_SOURCES = \
+ src/journal/test-journal.c
+
+test_journal_LDADD = \
+ libjournal-core.la
+
+test_journal_send_SOURCES = \
+ src/journal/test-journal-send.c
+
+test_journal_send_LDADD = \
+ libjournal-core.la
+
+test_journal_syslog_SOURCES = \
+ src/journal/test-journal-syslog.c
+
+test_journal_syslog_LDADD = \
+ libjournal-core.la
+
+test_journal_match_SOURCES = \
+ src/journal/test-journal-match.c
+
+test_journal_match_LDADD = \
+ libjournal-core.la
+
+test_journal_enum_SOURCES = \
+ src/journal/test-journal-enum.c
+
+test_journal_enum_LDADD = \
+ libjournal-core.la
+
+test_journal_stream_SOURCES = \
+ src/journal/test-journal-stream.c
+
+test_journal_stream_LDADD = \
+ libjournal-core.la
+
+test_journal_flush_SOURCES = \
+ src/journal/test-journal-flush.c
+
+test_journal_flush_LDADD = \
+ libjournal-core.la
+
+test_journal_init_SOURCES = \
+ src/journal/test-journal-init.c
+
+test_journal_init_LDADD = \
+ libjournal-core.la
+
+test_journal_verify_SOURCES = \
+ src/journal/test-journal-verify.c
+
+test_journal_verify_LDADD = \
+ libjournal-core.la
+
+test_journal_interleaving_SOURCES = \
+ src/journal/test-journal-interleaving.c
+
+test_journal_interleaving_LDADD = \
+ libjournal-core.la
+
+test_mmap_cache_SOURCES = \
+ src/journal/test-mmap-cache.c
+
+test_mmap_cache_LDADD = \
+ libjournal-core.la
+
+test_catalog_SOURCES = \
+ src/journal/test-catalog.c
+
+test_catalog_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
+
+test_catalog_LDADD = \
+ libjournal-core.la
+
+test_compress_SOURCES = \
+ src/journal/test-compress.c
+
+test_compress_LDADD = \
+ libshared.la
+
+test_compress_benchmark_SOURCES = \
+ src/journal/test-compress-benchmark.c
+
+test_compress_benchmark_LDADD = \
+ libshared.la
+
+test_audit_type_SOURCES = \
+ src/journal/test-audit-type.c
+
+test_audit_type_LDADD = \
+ libjournal-core.la
+
+journal-install-hook:
+ -$(MKDIR_P) $(DESTDIR)/var/log/journal
+ -chown 0:0 $(DESTDIR)/var/log/journal
+ -chmod 755 $(DESTDIR)/var/log/journal
+ -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
+ -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
+
+journal-uninstall-hook:
+ -rmdir $(DESTDIR)/var/log/journal/remote
+ -rmdir $(DESTDIR)/var/log/journal/
+
+INSTALL_EXEC_HOOKS += journal-install-hook
+UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
+
+# ------------------------------------------------------------------------------
+# Update catalog on installation. Do not bother if installing
+# in DESTDIR, since this is likely for packaging purposes.
+catalog-update-hook:
+ -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
+
+INSTALL_DATA_HOOKS += \
+ catalog-update-hook
+
+catalog-remove-hook:
+ -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
+
+UNINSTALL_DATA_HOOKS += \
+ catalog-remove-hook
+
+tests += \
+ test-journal \
+ test-journal-enum \
+ test-journal-send \
+ test-journal-syslog \
+ test-journal-match \
+ test-journal-stream \
+ test-journal-init \
+ test-journal-verify \
+ test-journal-interleaving \
+ test-journal-flush \
+ test-mmap-cache \
+ test-catalog \
+ test-audit-type
+
+ifneq ($(HAVE_COMPRESSION),)
+tests += \
+ test-compress \
+ test-compress-benchmark
+endif # HAVE_COMPRESSION
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/Makefile b/src/grp-journal/grp-remote/Makefile
new file mode 100644
index 0000000000..4a18cd13bb
--- /dev/null
+++ b/src/grp-journal/grp-remote/Makefile
@@ -0,0 +1,93 @@
+# -*- 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),)
+
+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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/microhttpd-util.h b/src/grp-journal/grp-remote/microhttpd-util.h
index ea160f212b..178e78f892 100644
--- a/src/grp-journal/grp-remote/microhttpd-util.h
+++ b/src/grp-journal/grp-remote/microhttpd-util.h
@@ -22,7 +22,7 @@
#include <microhttpd.h>
#include <stdarg.h>
-#include "macro.h"
+#include "basic/macro.h"
/* Compatiblity with libmicrohttpd < 0.9.38 */
#ifndef MHD_HTTP_NOT_ACCEPTABLE
diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile
new file mode 100644
index 0000000000..2003240fbe
--- /dev/null
+++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile
@@ -0,0 +1,68 @@
+# -*- 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 ($(HAVE_MICROHTTPD),)
+gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
+
+rootlibexec_PROGRAMS += \
+ systemd-journal-gatewayd
+
+systemd_journal_gatewayd_SOURCES = \
+ src/journal-remote/journal-gatewayd.c \
+ src/journal-remote/microhttpd-util.h \
+ src/journal-remote/microhttpd-util.c
+
+systemd_journal_gatewayd_LDADD = \
+ libshared.la \
+ $(MICROHTTPD_LIBS)
+
+ifneq ($(HAVE_GNUTLS),)
+systemd_journal_gatewayd_LDADD += \
+ $(GNUTLS_LIBS)
+endif # HAVE_GNUTLS
+
+systemd_journal_gatewayd_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(MICROHTTPD_CFLAGS)
+
+systemd_journal_gatewayd_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
+
+dist_systemunit_DATA += \
+ units/systemd-journal-gatewayd.socket
+
+nodist_systemunit_DATA += \
+ units/systemd-journal-gatewayd.service
+
+dist_gatewayddocumentroot_DATA = \
+ src/journal-remote/browse.html
+
+endif # HAVE_MICROHTTPD
+
+EXTRA_DIST += \
+ units/systemd-journal-gatewayd.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
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 1cfb5e2c9c..e265027a04 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,9 +27,9 @@
#include <string.h>
#include <unistd.h>
-#include <systemd/sd-bus.h>
-#include <systemd/sd-daemon.h>
-#include <systemd/sd-journal.h>
+#include "sd-bus.h"
+#include "sd-daemon.h"
+#include "sd-journal.h"
#include "alloc-util.h"
#include "bus-util.h"
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/Makefile b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile
new file mode 100644
index 0000000000..b387eae386
--- /dev/null
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile
@@ -0,0 +1,85 @@
+# -*- 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 ($(HAVE_MICROHTTPD),)
+rootlibexec_PROGRAMS += \
+ systemd-journal-remote
+
+systemd_journal_remote_SOURCES = \
+ src/journal-remote/journal-remote-parse.h \
+ src/journal-remote/journal-remote-parse.c \
+ src/journal-remote/journal-remote-write.h \
+ src/journal-remote/journal-remote-write.c \
+ src/journal-remote/journal-remote.h \
+ src/journal-remote/journal-remote.c
+
+systemd_journal_remote_LDADD = \
+ libjournal-core.la
+
+systemd_journal_remote_SOURCES += \
+ src/journal-remote/microhttpd-util.h \
+ src/journal-remote/microhttpd-util.c
+
+systemd_journal_remote_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(MICROHTTPD_CFLAGS)
+
+systemd_journal_remote_LDADD += \
+ $(MICROHTTPD_LIBS)
+
+ifneq ($(ENABLE_TMPFILES),)
+dist_tmpfiles_DATA += \
+ tmpfiles.d/systemd-remote.conf
+endif # ENABLE_TMPFILES
+
+ifneq ($(HAVE_GNUTLS),)
+systemd_journal_remote_LDADD += \
+ $(GNUTLS_LIBS)
+endif # HAVE_GNUTLS
+
+# systemd-journal-remote make sense mostly with full crypto stack
+dist_systemunit_DATA += \
+ units/systemd-journal-remote.socket
+
+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
+
+nodist_pkgsysconf_DATA += \
+ src/journal-remote/journal-remote.conf
+
+EXTRA_DIST += \
+ units/systemd-journal-remote.service.in \
+ src/journal-remote/journal-remote.conf.in \
+ src/journal-remote/log-generator.py
+endif # HAVE_MICROHTTPD
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c
index 9ba9ee3fc0..c71fedd816 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "journal-remote-parse.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
#include "journald-native.h"
-#include "parse-util.h"
-#include "string-util.h"
+
+#include "journal-remote-parse.h"
#define LINE_CHUNK 8*1024u
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c
index 7bba52566e..4e05eda103 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c
@@ -17,7 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+
#include "journal-remote.h"
int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.h b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.h
index 53ba45fc04..a61434ca75 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.h
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "journal-file.h"
+#include "sd-journal/journal-file.h"
typedef struct RemoteServer RemoteServer;
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 9b4d12d336..35a1e55f9e 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,7 +31,7 @@
#include <gnutls/gnutls.h>
#endif
-#include <systemd/sd-daemon.h>
+#include "sd-daemon.h"
#include "alloc-util.h"
#include "conf-parser.h"
diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h
index 58487e498a..6abfc1019d 100644
--- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h
+++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h
@@ -21,10 +21,11 @@
#include <systemd/sd-event.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
+#include "microhttpd-util.h"
+
#include "journal-remote-parse.h"
#include "journal-remote-write.h"
-#include "microhttpd-util.h"
typedef struct MHDDaemonWrapper MHDDaemonWrapper;
diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/Makefile b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile
new file mode 100644
index 0000000000..4a92997441
--- /dev/null
+++ b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile
@@ -0,0 +1,54 @@
+# -*- 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 ($(HAVE_LIBCURL),)
+rootlibexec_PROGRAMS += \
+ systemd-journal-upload
+
+systemd_journal_upload_SOURCES = \
+ src/journal-remote/journal-upload.h \
+ src/journal-remote/journal-upload.c \
+ src/journal-remote/journal-upload-journal.c
+
+systemd_journal_upload_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBCURL_CFLAGS)
+
+systemd_journal_upload_LDADD = \
+ libshared.la \
+ $(LIBCURL_LIBS)
+
+nodist_systemunit_DATA += \
+ units/systemd-journal-upload.service
+
+nodist_pkgsysconf_DATA += \
+ src/journal-remote/journal-upload.conf
+endif
+
+EXTRA_DIST += \
+ units/systemd-journal-upload.service.in \
+ src/journal-remote/journal-upload.conf.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c
index aef095c8c9..61d287da97 100644
--- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c
+++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c
@@ -20,13 +20,15 @@
#include <curl/curl.h>
#include <stdbool.h>
-#include "alloc-util.h"
-#include "journal-upload.h"
-#include "log.h"
-#include "utf8.h"
-#include "util.h"
#include <systemd/sd-daemon.h>
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+
+#include "journal-upload.h"
+
/**
* Write up to size bytes to buf. Return negative on error, and number of
* bytes written otherwise. The last case is a kind of an error too.
diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c
index e622f6c1e1..82d8331e76 100644
--- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c
+++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c
@@ -25,21 +25,22 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "glob-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/glob-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/sigbus.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
+
#include "journal-upload.h"
-#include "log.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "sigbus.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "util.h"
#define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-upload.pem"
#define CERT_FILE CERTIFICATE_ROOT "/certs/journal-upload.pem"
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 4a521bf78f..2decc7b22e 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
@@ -4,7 +4,8 @@
#include <systemd/sd-event.h>
#include <systemd/sd-journal.h>
-#include "time-util.h"
+
+#include "basic/time-util.h"
typedef enum {
ENTRY_CURSOR = 0, /* Nothing actually written yet. */
diff --git a/src/grp-journal/journalctl/Makefile b/src/grp-journal/journalctl/Makefile
new file mode 100644
index 0000000000..c3cdb6b27a
--- /dev/null
+++ b/src/grp-journal/journalctl/Makefile
@@ -0,0 +1,49 @@
+# -*- 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
+
+# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
+journalctl_CFLAGS = \
+ $(AM_CFLAGS)
+
+journalctl_SOURCES = \
+ src/journal/journalctl.c
+
+journalctl_LDADD = \
+ libshared.la \
+ libudev-core.la
+
+ifneq ($(HAVE_QRENCODE),)
+journalctl_SOURCES += \
+ src/journal/journal-qrcode.c \
+ src/journal/journal-qrcode.h
+
+journalctl_CFLAGS += \
+ $(QRENCODE_CFLAGS)
+
+journalctl_LDADD += \
+ $(QRENCODE_LIBS)
+endif # HAVE_QRENCODE
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/journalctl/journalctl.c b/src/grp-journal/journalctl/journalctl.c
index 3602bd0556..8901b46ae5 100644
--- a/src/grp-journal/journalctl/journalctl.c
+++ b/src/grp-journal/journalctl/journalctl.c
@@ -21,7 +21,6 @@
#include <fcntl.h>
#include <fnmatch.h>
#include <getopt.h>
-#include <linux/fs.h>
#include <locale.h>
#include <poll.h>
#include <signal.h>
@@ -33,44 +32,47 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <linux/fs.h>
+
#include <systemd/sd-bus.h>
#include <systemd/sd-journal.h>
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "catalog.h"
-#include "chattr-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "fsprg.h"
-#include "glob-util.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "journal-def.h"
-#include "journal-internal.h"
-#include "journal-qrcode.h"
-#include "journal-vacuum.h"
-#include "journal-verify.h"
-#include "locale-util.h"
-#include "log.h"
-#include "logs-show.h"
-#include "mkdir.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "rlimit-util.h"
-#include "set.h"
-#include "sigbus.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "terminal-util.h"
+#include "basic/alloc-util.h"
+#include "basic/chattr-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/glob-util.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/rlimit-util.h"
+#include "basic/set.h"
+#include "basic/sigbus.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-error.h"
+#include "sd-journal/catalog.h"
+#include "sd-journal/fsprg.h"
+#include "sd-journal/journal-def.h"
+#include "sd-journal/journal-internal.h"
+#include "sd-journal/journal-vacuum.h"
+#include "sd-journal/journal-verify.h"
+#include "shared/acl-util.h"
+#include "shared/bus-util.h"
+#include "shared/logs-show.h"
+#include "shared/pager.h"
+#include "shared/udev-util.h"
#include "udev.h"
-#include "udev-util.h"
-#include "unit-name.h"
-#include "user-util.h"
+
+#include "journal-qrcode.h"
#define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
diff --git a/src/grp-journal/libjournal-core/Makefile b/src/grp-journal/libjournal-core/Makefile
new file mode 100644
index 0000000000..d55aebfb49
--- /dev/null
+++ b/src/grp-journal/libjournal-core/Makefile
@@ -0,0 +1,56 @@
+# -*- 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
+
+libjournal_core_la_SOURCES = \
+ src/journal/journald-kmsg.c \
+ src/journal/journald-kmsg.h \
+ src/journal/journald-syslog.c \
+ src/journal/journald-syslog.h \
+ src/journal/journald-stream.c \
+ src/journal/journald-stream.h \
+ src/journal/journald-server.c \
+ src/journal/journald-server.h \
+ src/journal/journald-console.c \
+ src/journal/journald-console.h \
+ src/journal/journald-wall.c \
+ src/journal/journald-wall.h \
+ src/journal/journald-native.c \
+ src/journal/journald-native.h \
+ src/journal/journald-audit.c \
+ src/journal/journald-audit.h \
+ src/journal/journald-rate-limit.c \
+ src/journal/journald-rate-limit.h \
+ src/journal/journal-internal.h
+
+nodist_libjournal_core_la_SOURCES = \
+ src/journal/journald-gperf.c
+
+libjournal_core_la_LIBADD = \
+ libshared.la
+
+noinst_LTLIBRARIES += \
+ libjournal-core.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/libjournal-core/journald-audit.c b/src/grp-journal/libjournal-core/journald-audit.c
index a433c91c54..74ad0c017e 100644
--- a/src/grp-journal/libjournal-core/journald-audit.c
+++ b/src/grp-journal/libjournal-core/journald-audit.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "audit-type.h"
-#include "fd-util.h"
-#include "hexdecoct.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/io-util.h"
+#include "basic/missing.h"
+#include "basic/string-util.h"
+#include "sd-journal/audit-type.h"
+
#include "journald-audit.h"
-#include "missing.h"
-#include "string-util.h"
typedef struct MapField {
const char *audit_field;
diff --git a/src/grp-journal/libjournal-core/journald-audit.h b/src/grp-journal/libjournal-core/journald-audit.h
index 8c7457778c..98c07e95e4 100644
--- a/src/grp-journal/libjournal-core/journald-audit.h
+++ b/src/grp-journal/libjournal-core/journald-audit.h
@@ -19,8 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/socket-util.h"
+
#include "journald-server.h"
-#include "socket-util.h"
void server_process_audit_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const union sockaddr_union *sa, socklen_t salen);
diff --git a/src/grp-journal/libjournal-core/journald-console.c b/src/grp-journal/libjournal-core/journald-console.c
index fcc9f25814..b1e6828dc2 100644
--- a/src/grp-journal/libjournal-core/journald-console.c
+++ b/src/grp-journal/libjournal-core/journald-console.c
@@ -21,17 +21,18 @@
#include <sys/socket.h>
#include <time.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/stdio-util.h"
+#include "basic/terminal-util.h"
+
#include "journald-console.h"
#include "journald-server.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "stdio-util.h"
-#include "terminal-util.h"
static bool prefix_timestamp(void) {
diff --git a/src/grp-journal/libjournal-core/journald-kmsg.c b/src/grp-journal/libjournal-core/journald-kmsg.c
index 3712636de2..946318c184 100644
--- a/src/grp-journal/libjournal-core/journald-kmsg.c
+++ b/src/grp-journal/libjournal-core/journald-kmsg.c
@@ -23,20 +23,21 @@
#include <sys/socket.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
#include <systemd/sd-messages.h>
-#include "escape.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "io-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-syslog.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
void server_forward_kmsg(
Server *s,
diff --git a/src/grp-journal/libjournal-core/journald-native.c b/src/grp-journal/libjournal-core/journald-native.c
index 0a1ce205c2..9bfea935ad 100644
--- a/src/grp-journal/libjournal-core/journald-native.c
+++ b/src/grp-journal/libjournal-core/journald-native.c
@@ -23,22 +23,23 @@
#include <sys/statvfs.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/io-util.h"
+#include "basic/memfd-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+
#include "journald-console.h"
#include "journald-kmsg.h"
#include "journald-native.h"
#include "journald-server.h"
#include "journald-syslog.h"
#include "journald-wall.h"
-#include "memfd-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "socket-util.h"
-#include "string-util.h"
bool valid_user_field(const char *p, size_t l, bool allow_protected) {
const char *a;
diff --git a/src/grp-journal/libjournal-core/journald-rate-limit.c b/src/grp-journal/libjournal-core/journald-rate-limit.c
index fce799a6ce..22603bf8e6 100644
--- a/src/grp-journal/libjournal-core/journald-rate-limit.c
+++ b/src/grp-journal/libjournal-core/journald-rate-limit.c
@@ -20,13 +20,14 @@
#include <errno.h>
#include <string.h>
-#include "alloc-util.h"
-#include "hashmap.h"
+#include "basic/alloc-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "journald-rate-limit.h"
-#include "list.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "util.h"
#define POOLS_MAX 5
#define BUCKETS_MAX 127
diff --git a/src/grp-journal/libjournal-core/journald-rate-limit.h b/src/grp-journal/libjournal-core/journald-rate-limit.h
index bb0abb7ee9..533dd0f013 100644
--- a/src/grp-journal/libjournal-core/journald-rate-limit.h
+++ b/src/grp-journal/libjournal-core/journald-rate-limit.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
+#include "basic/util.h"
typedef struct JournalRateLimit JournalRateLimit;
diff --git a/src/grp-journal/libjournal-core/journald-server.c b/src/grp-journal/libjournal-core/journald-server.c
index cc29443e66..8f82d2a838 100644
--- a/src/grp-journal/libjournal-core/journald-server.c
+++ b/src/grp-journal/libjournal-core/journald-server.c
@@ -27,9 +27,9 @@
#include <linux/sockios.h>
#include "libudev.h"
-#include <systemd/sd-daemon.h>
-#include <systemd/sd-journal.h>
-#include <systemd/sd-messages.h>
+#include "sd-daemon.h"
+#include "sd-journal.h"
+#include "sd-messages.h"
#include "acl-util.h"
#include "alloc-util.h"
diff --git a/src/grp-journal/libjournal-core/journald-server.h b/src/grp-journal/libjournal-core/journald-server.h
index bebb056aa7..5f1af1e50b 100644
--- a/src/grp-journal/libjournal-core/journald-server.h
+++ b/src/grp-journal/libjournal-core/journald-server.h
@@ -24,13 +24,14 @@
#include <systemd/sd-event.h>
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "sd-journal/journal-file.h"
+
typedef struct Server Server;
-#include "hashmap.h"
-#include "journal-file.h"
#include "journald-rate-limit.h"
#include "journald-stream.h"
-#include "list.h"
typedef enum Storage {
STORAGE_AUTO,
diff --git a/src/grp-journal/libjournal-core/journald-stream.c b/src/grp-journal/libjournal-core/journald-stream.c
index 99d856301c..4ad16ee41c 100644
--- a/src/grp-journal/libjournal-core/journald-stream.c
+++ b/src/grp-journal/libjournal-core/journald-stream.c
@@ -24,8 +24,8 @@
#include <selinux/selinux.h>
#endif
-#include <systemd/sd-daemon.h>
-#include <systemd/sd-event.h>
+#include "sd-daemon.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "dirent-util.h"
diff --git a/src/grp-journal/libjournal-core/journald-stream.h b/src/grp-journal/libjournal-core/journald-stream.h
index db4c67fae3..c971d0a00d 100644
--- a/src/grp-journal/libjournal-core/journald-stream.h
+++ b/src/grp-journal/libjournal-core/journald-stream.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/fdset.h"
+
typedef struct StdoutStream StdoutStream;
-#include "fdset.h"
#include "journald-server.h"
int server_open_stdout_socket(Server *s);
diff --git a/src/grp-journal/libjournal-core/journald-syslog.c b/src/grp-journal/libjournal-core/journald-syslog.c
index 86fe81d179..bc793235d4 100644
--- a/src/grp-journal/libjournal-core/journald-syslog.c
+++ b/src/grp-journal/libjournal-core/journald-syslog.c
@@ -23,21 +23,22 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/process-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"
+
#include "journald-console.h"
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-syslog.h"
#include "journald-wall.h"
-#include "process-util.h"
-#include "selinux-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "syslog-util.h"
/* Warn once every 30s if we missed syslog message */
#define WARN_FORWARD_SYSLOG_MISSED_USEC (30 * USEC_PER_SEC)
diff --git a/src/grp-journal/libjournal-core/journald-wall.c b/src/grp-journal/libjournal-core/journald-wall.c
index 4d91fafffe..0c816de55f 100644
--- a/src/grp-journal/libjournal-core/journald-wall.c
+++ b/src/grp-journal/libjournal-core/journald-wall.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/formats-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "shared/utmp-wtmp.h"
+
#include "journald-server.h"
#include "journald-wall.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "utmp-wtmp.h"
void server_forward_wall(
Server *s,
diff --git a/src/grp-journal/libjournal-core/test-audit-type.c b/src/grp-journal/libjournal-core/test-audit-type.c
index 88a2e6d9d9..812a3953ea 100644
--- a/src/grp-journal/libjournal-core/test-audit-type.c
+++ b/src/grp-journal/libjournal-core/test-audit-type.c
@@ -18,9 +18,10 @@
***/
#include <stdio.h>
+
#include <linux/audit.h>
-#include "audit-type.h"
+#include "sd-journal/audit-type.h"
static void print_audit_label(int i) {
const char *name;
diff --git a/src/grp-journal/libjournal-core/test-catalog.c b/src/grp-journal/libjournal-core/test-catalog.c
index f939fcdc2a..73ffb16104 100644
--- a/src/grp-journal/libjournal-core/test-catalog.c
+++ b/src/grp-journal/libjournal-core/test-catalog.c
@@ -25,14 +25,14 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "catalog.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-journal/catalog.h"
static const char *catalog_dirs[] = {
CATALOG_DIR,
diff --git a/src/grp-journal/libjournal-core/test-compress-benchmark.c b/src/grp-journal/libjournal-core/test-compress-benchmark.c
index 6f6d71435d..4292e4f8cb 100644
--- a/src/grp-journal/libjournal-core/test-compress-benchmark.c
+++ b/src/grp-journal/libjournal-core/test-compress-benchmark.c
@@ -17,13 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "compress.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-journal/compress.h"
typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
size_t dst_alloc_size, size_t *dst_size);
diff --git a/src/grp-journal/libjournal-core/test-journal-enum.c b/src/grp-journal/libjournal-core/test-journal-enum.c
index 54df59f477..588e12c800 100644
--- a/src/grp-journal/libjournal-core/test-journal-enum.c
+++ b/src/grp-journal/libjournal-core/test-journal-enum.c
@@ -21,9 +21,9 @@
#include <systemd/sd-journal.h>
-#include "journal-internal.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "sd-journal/journal-internal.h"
int main(int argc, char *argv[]) {
unsigned n = 0;
diff --git a/src/grp-journal/libjournal-core/test-journal-flush.c b/src/grp-journal/libjournal-core/test-journal-flush.c
index 7e9814f8fa..66ae8f83c4 100644
--- a/src/grp-journal/libjournal-core/test-journal-flush.c
+++ b/src/grp-journal/libjournal-core/test-journal-flush.c
@@ -21,11 +21,11 @@
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "journal-file.h"
-#include "journal-internal.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-internal.h"
int main(int argc, char *argv[]) {
_cleanup_free_ char *fn = NULL;
diff --git a/src/grp-journal/libjournal-core/test-journal-init.c b/src/grp-journal/libjournal-core/test-journal-init.c
index e6713034dd..c5f1d345e9 100644
--- a/src/grp-journal/libjournal-core/test-journal-init.c
+++ b/src/grp-journal/libjournal-core/test-journal-init.c
@@ -19,10 +19,10 @@
#include <systemd/sd-journal.h>
-#include "log.h"
-#include "parse-util.h"
-#include "rm-rf.h"
-#include "util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/rm-rf.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
sd_journal *j;
diff --git a/src/grp-journal/libjournal-core/test-journal-interleaving.c b/src/grp-journal/libjournal-core/test-journal-interleaving.c
index d09ef011a6..004394d18a 100644
--- a/src/grp-journal/libjournal-core/test-journal-interleaving.c
+++ b/src/grp-journal/libjournal-core/test-journal-interleaving.c
@@ -23,13 +23,13 @@
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "journal-file.h"
-#include "journal-vacuum.h"
-#include "log.h"
-#include "parse-util.h"
-#include "rm-rf.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/rm-rf.h"
+#include "basic/util.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-vacuum.h"
/* This program tests skipping around in a multi-file journal.
*/
diff --git a/src/grp-journal/libjournal-core/test-journal-match.c b/src/grp-journal/libjournal-core/test-journal-match.c
index 5ee2adb827..967e30c46a 100644
--- a/src/grp-journal/libjournal-core/test-journal-match.c
+++ b/src/grp-journal/libjournal-core/test-journal-match.c
@@ -21,11 +21,11 @@
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "journal-internal.h"
-#include "log.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-journal/journal-internal.h"
int main(int argc, char *argv[]) {
_cleanup_(sd_journal_closep) sd_journal*j = NULL;
diff --git a/src/grp-journal/libjournal-core/test-journal-send.c b/src/grp-journal/libjournal-core/test-journal-send.c
index 169082f9a4..192e12c887 100644
--- a/src/grp-journal/libjournal-core/test-journal-send.c
+++ b/src/grp-journal/libjournal-core/test-journal-send.c
@@ -23,7 +23,7 @@
#include <systemd/sd-journal.h>
-#include "macro.h"
+#include "basic/macro.h"
int main(int argc, char *argv[]) {
char huge[4096*1024];
diff --git a/src/grp-journal/libjournal-core/test-journal-stream.c b/src/grp-journal/libjournal-core/test-journal-stream.c
index 0a1da47861..b71c44ef56 100644
--- a/src/grp-journal/libjournal-core/test-journal-stream.c
+++ b/src/grp-journal/libjournal-core/test-journal-stream.c
@@ -22,14 +22,14 @@
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "journal-file.h"
-#include "journal-internal.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "rm-rf.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/rm-rf.h"
+#include "basic/util.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-internal.h"
#define N_ENTRIES 200
diff --git a/src/grp-journal/libjournal-core/test-journal-syslog.c b/src/grp-journal/libjournal-core/test-journal-syslog.c
index 4ff7f3ec2e..4756126478 100644
--- a/src/grp-journal/libjournal-core/test-journal-syslog.c
+++ b/src/grp-journal/libjournal-core/test-journal-syslog.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+
#include "journald-syslog.h"
-#include "macro.h"
-#include "string-util.h"
static void test_syslog_parse_identifier(const char* str,
const char *ident, const char*pid, int ret) {
diff --git a/src/grp-journal/libjournal-core/test-journal-verify.c b/src/grp-journal/libjournal-core/test-journal-verify.c
index 3d2312fc55..485315c118 100644
--- a/src/grp-journal/libjournal-core/test-journal-verify.c
+++ b/src/grp-journal/libjournal-core/test-journal-verify.c
@@ -21,13 +21,13 @@
#include <stdio.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "journal-file.h"
-#include "journal-verify.h"
-#include "log.h"
-#include "rm-rf.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/rm-rf.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-verify.h"
#define N_ENTRIES 6000
#define RANDOM_RANGE 77
diff --git a/src/grp-journal/libjournal-core/test-journal.c b/src/grp-journal/libjournal-core/test-journal.c
index 2543d64b5b..05de15f0c0 100644
--- a/src/grp-journal/libjournal-core/test-journal.c
+++ b/src/grp-journal/libjournal-core/test-journal.c
@@ -20,11 +20,11 @@
#include <fcntl.h>
#include <unistd.h>
-#include "journal-authenticate.h"
-#include "journal-file.h"
-#include "journal-vacuum.h"
-#include "log.h"
-#include "rm-rf.h"
+#include "basic/log.h"
+#include "basic/rm-rf.h"
+#include "sd-journal/journal-authenticate.h"
+#include "sd-journal/journal-file.h"
+#include "sd-journal/journal-vacuum.h"
static bool arg_keep = false;
diff --git a/src/grp-journal/libjournal-core/test-mmap-cache.c b/src/grp-journal/libjournal-core/test-mmap-cache.c
index 009aabf55e..3eb5444480 100644
--- a/src/grp-journal/libjournal-core/test-mmap-cache.c
+++ b/src/grp-journal/libjournal-core/test-mmap-cache.c
@@ -22,11 +22,11 @@
#include <sys/mman.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
-#include "mmap-cache.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "sd-journal/mmap-cache.h"
int main(int argc, char *argv[]) {
int x, y, z, r;
diff --git a/src/grp-journal/systemd-cat/cat.c b/src/grp-journal/systemd-cat/cat.c
index 93ab6e7f96..8ab4febd53 100644
--- a/src/grp-journal/systemd-cat/cat.c
+++ b/src/grp-journal/systemd-cat/cat.c
@@ -26,11 +26,11 @@
#include <systemd/sd-journal.h>
-#include "fd-util.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "syslog-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/syslog-util.h"
+#include "basic/util.h"
static const char *arg_identifier = NULL;
static int arg_priority = LOG_INFO;
diff --git a/src/grp-journal/systemd-journald/Makefile b/src/grp-journal/systemd-journald/Makefile
new file mode 100644
index 0000000000..755e2d2c36
--- /dev/null
+++ b/src/grp-journal/systemd-journald/Makefile
@@ -0,0 +1,94 @@
+# -*- 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_journald_SOURCES = \
+ src/journal/journald.c \
+ src/journal/journald-server.h
+
+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
+
+dist_pkgsysconf_DATA += \
+ src/journal/journald.conf
+
+dist_catalog_DATA = \
+ catalog/systemd.bg.catalog \
+ catalog/systemd.be.catalog \
+ catalog/systemd.be@latin.catalog \
+ catalog/systemd.fr.catalog \
+ catalog/systemd.it.catalog \
+ catalog/systemd.pl.catalog \
+ catalog/systemd.pt_BR.catalog \
+ catalog/systemd.ru.catalog \
+ catalog/systemd.zh_CN.catalog \
+ catalog/systemd.zh_TW.catalog \
+ catalog/systemd.catalog
+
+SOCKETS_TARGET_WANTS += \
+ systemd-journald.socket \
+ systemd-journald-dev-log.socket \
+ systemd-journald-audit.socket
+
+SYSINIT_TARGET_WANTS += \
+ systemd-journald.service \
+ systemd-journal-flush.service \
+ systemd-journal-catalog-update.service
+
+EXTRA_DIST += \
+ units/systemd-journald.service.in \
+ units/systemd-journal-flush.service.in \
+ units/systemd-journal-catalog-update.service.in
+
+gperf_gperf_sources += \
+ src/journal/journald-gperf.gperf
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-journal/systemd-journald/journald.c b/src/grp-journal/systemd-journald/journald.c
index 1afe44fa8e..cd887feed8 100644
--- a/src/grp-journal/systemd-journald/journald.c
+++ b/src/grp-journal/systemd-journald/journald.c
@@ -22,12 +22,12 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-messages.h>
-#include "formats-util.h"
-#include "journal-authenticate.h"
+#include "basic/formats-util.h"
+#include "basic/sigbus.h"
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-syslog.h"
-#include "sigbus.h"
+#include "sd-journal/journal-authenticate.h"
int main(int argc, char *argv[]) {
Server server;
diff --git a/src/grp-locale/Makefile b/src/grp-locale/Makefile
new file mode 100644
index 0000000000..b34c066ec2
--- /dev/null
+++ b/src/grp-locale/Makefile
@@ -0,0 +1,90 @@
+# -*- 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
+
+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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-locale/localectl/localectl.c b/src/grp-locale/localectl/localectl.c
index c1b0a56346..72ac1c0303 100644
--- a/src/grp-locale/localectl/localectl.c
+++ b/src/grp-locale/localectl/localectl.c
@@ -27,18 +27,18 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
-#include "bus-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "locale-util.h"
-#include "pager.h"
-#include "set.h"
-#include "spawn-polkit-agent.h"
-#include "strv.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/locale-util.h"
+#include "basic/set.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/pager.h"
+#include "shared/spawn-polkit-agent.h"
static bool arg_no_pager = false;
static bool arg_ask_password = true;
diff --git a/src/grp-locale/systemd-localed/localed.c b/src/grp-locale/systemd-localed/localed.c
index 7b4cbadfd0..3b22a582ac 100644
--- a/src/grp-locale/systemd-localed/localed.c
+++ b/src/grp-locale/systemd-localed/localed.c
@@ -27,7 +27,7 @@
#include <dlfcn.h>
#endif
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-error.h"
diff --git a/src/grp-login/Makefile b/src/grp-login/Makefile
new file mode 100644
index 0000000000..381d653166
--- /dev/null
+++ b/src/grp-login/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
+
+ifneq ($(ENABLE_LOGIND),)
+test_login_SOURCES = \
+ src/libsystemd/sd-login/test-login.c
+
+test_login_LDADD = \
+ libshared.la
+
+test_login_shared_SOURCES = \
+ src/login/test-login-shared.c
+
+test_login_shared_LDADD = \
+ libshared.la
+
+test_inhibit_SOURCES = \
+ src/login/test-inhibit.c
+
+test_inhibit_LDADD = \
+ libshared.la
+
+test_login_tables_SOURCES = \
+ src/login/test-login-tables.c
+
+test_login_tables_LDADD = \
+ liblogind-core.la
+
+manual_tests += \
+ test-login \
+ test-inhibit
+
+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
+
+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/loginctl/Makefile b/src/grp-login/loginctl/Makefile
new file mode 100644
index 0000000000..7c8c3d91a0
--- /dev/null
+++ b/src/grp-login/loginctl/Makefile
@@ -0,0 +1,41 @@
+# -*- 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
+
+loginctl_SOURCES = \
+ src/login/loginctl.c \
+ src/login/sysfs-show.h \
+ src/login/sysfs-show.c
+
+loginctl_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ loginctl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/loginctl
+
+dist_zshcompletion_data += shell-completion/zsh/_loginctl
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/loginctl/loginctl.c b/src/grp-login/loginctl/loginctl.c
index f3f57b4b13..3ac325fc97 100644
--- a/src/grp-login/loginctl/loginctl.c
+++ b/src/grp-login/loginctl/loginctl.c
@@ -25,27 +25,28 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "log.h"
-#include "logs-show.h"
-#include "macro.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "spawn-polkit-agent.h"
-#include "strv.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "basic/verbs.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+#include "shared/cgroup-show.h"
+#include "shared/logs-show.h"
+#include "shared/pager.h"
+#include "shared/spawn-polkit-agent.h"
+
#include "sysfs-show.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "user-util.h"
-#include "util.h"
-#include "verbs.h"
static char **arg_property = NULL;
static bool arg_all = false;
diff --git a/src/grp-login/loginctl/sysfs-show.c b/src/grp-login/loginctl/sysfs-show.c
index 29785e2f11..12808c3336 100644
--- a/src/grp-login/loginctl/sysfs-show.c
+++ b/src/grp-login/loginctl/sysfs-show.c
@@ -20,16 +20,17 @@
#include <errno.h>
#include <string.h>
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/locale-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "shared/udev-util.h"
-#include "alloc-util.h"
-#include "locale-util.h"
-#include "path-util.h"
-#include "string-util.h"
#include "sysfs-show.h"
-#include "terminal-util.h"
-#include "udev-util.h"
-#include "util.h"
static int show_sysfs_one(
struct udev *udev,
diff --git a/src/grp-login/pam_systemd/Makefile b/src/grp-login/pam_systemd/Makefile
new file mode 100644
index 0000000000..8c87421bb0
--- /dev/null
+++ b/src/grp-login/pam_systemd/Makefile
@@ -0,0 +1,56 @@
+# -*- 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 ($(HAVE_PAM),)
+pam_systemd_la_SOURCES = \
+ src/login/pam_systemd.sym \
+ src/login/pam_systemd.c
+
+pam_systemd_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(PAM_CFLAGS)
+
+pam_systemd_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -module \
+ -export-dynamic \
+ -avoid-version \
+ -shared \
+ -Wl,--version-script=$(srcdir)/pam_systemd.sym
+
+pam_systemd_la_LIBADD = \
+ libshared.la \
+ $(PAM_LIBS)
+
+pamlib_LTLIBRARIES = \
+ pam_systemd.la
+
+dist_pamconf_DATA = \
+ src/login/systemd-user
+
+EXTRA_DIST += \
+ src/login/systemd-user.m4
+endif # HAVE_PAM
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/pam_systemd/pam_systemd.c b/src/grp-login/pam_systemd/pam_systemd.c
index 98dc201340..6f67506e5a 100644
--- a/src/grp-login/pam_systemd/pam_systemd.c
+++ b/src/grp-login/pam_systemd/pam_systemd.c
@@ -28,23 +28,23 @@
#include <security/pam_modutil.h>
#include <sys/file.h>
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "hostname-util.h"
-#include "login-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "socket-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/hostname-util.h"
+#include "basic/login-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/socket-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
static int parse_argv(
pam_handle_t *handle,
diff --git a/src/grp-login/systemd-inhibit/Makefile b/src/grp-login/systemd-inhibit/Makefile
new file mode 100644
index 0000000000..93440da575
--- /dev/null
+++ b/src/grp-login/systemd-inhibit/Makefile
@@ -0,0 +1,37 @@
+# -*- 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
+
+dist_zshcompletion_data += shell-completion/zsh/_systemd-inhibit
+
+systemd_inhibit_SOURCES = \
+ src/login/inhibit.c
+
+systemd_inhibit_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ systemd-inhibit
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/systemd-inhibit/inhibit.c b/src/grp-login/systemd-inhibit/inhibit.c
index 905e757a32..543bdb9e80 100644
--- a/src/grp-login/systemd-inhibit/inhibit.c
+++ b/src/grp-login/systemd-inhibit/inhibit.c
@@ -25,16 +25,16 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
static const char* arg_what = "idle:sleep:shutdown";
static const char* arg_who = NULL;
diff --git a/src/grp-login/systemd-logind/Makefile b/src/grp-login/systemd-logind/Makefile
new file mode 100644
index 0000000000..b4da812a3e
--- /dev/null
+++ b/src/grp-login/systemd-logind/Makefile
@@ -0,0 +1,75 @@
+# -*- 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_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 = \
+ src/login/logind-core.c \
+ src/login/logind-device.c \
+ src/login/logind-device.h \
+ src/login/logind-button.c \
+ src/login/logind-button.h \
+ src/login/logind-action.c \
+ src/login/logind-action.h \
+ src/login/logind-seat.c \
+ src/login/logind-seat.h \
+ src/login/logind-session.c \
+ src/login/logind-session.h \
+ src/login/logind-session-device.c \
+ src/login/logind-session-device.h \
+ src/login/logind-user.c \
+ src/login/logind-user.h \
+ src/login/logind-inhibit.c \
+ src/login/logind-inhibit.h \
+ src/login/logind-dbus.c \
+ src/login/logind-session-dbus.c \
+ src/login/logind-seat-dbus.c \
+ src/login/logind-user-dbus.c \
+ src/login/logind-utmp.c \
+ src/login/logind-acl.h
+
+liblogind_core_la_LIBADD = \
+ libshared.la
+
+ifneq ($(HAVE_ACL),)
+liblogind_core_la_SOURCES += \
+ src/login/logind-acl.c
+endif # HAVE_ACL
+
+noinst_LTLIBRARIES += \
+ liblogind-core.la
+
+rootlibexec_PROGRAMS += \
+ systemd-logind
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-login/systemd-logind/logind-acl.c b/src/grp-login/systemd-logind/logind-acl.c
index 0cef88a82d..44e49c1dad 100644
--- a/src/grp-login/systemd-logind/logind-acl.c
+++ b/src/grp-login/systemd-logind/logind-acl.c
@@ -20,17 +20,18 @@
#include <errno.h>
#include <string.h>
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/acl-util.h"
+#include "shared/udev-util.h"
+
#include "logind-acl.h"
-#include "set.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "util.h"
static int flush_acl(acl_t acl) {
acl_entry_t i;
diff --git a/src/grp-login/systemd-logind/logind-acl.h b/src/grp-login/systemd-logind/logind-acl.h
index 1286c6a3cd..7d324ea90a 100644
--- a/src/grp-login/systemd-logind/logind-acl.h
+++ b/src/grp-login/systemd-logind/logind-acl.h
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <sys/types.h>
-#include "libudev.h"
+#include <libudev.h>
#ifdef HAVE_ACL
diff --git a/src/grp-login/systemd-logind/logind-action.c b/src/grp-login/systemd-logind/logind-action.c
index 9a8089f97c..0cfeab3fdb 100644
--- a/src/grp-login/systemd-logind/logind-action.c
+++ b/src/grp-login/systemd-logind/logind-action.c
@@ -19,18 +19,19 @@
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "conf-parser.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/formats-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/conf-parser.h"
+#include "shared/sleep-config.h"
+
#include "logind-action.h"
-#include "process-util.h"
-#include "sleep-config.h"
-#include "special.h"
-#include "string-table.h"
-#include "terminal-util.h"
-#include "user-util.h"
int manager_handle_action(
Manager *m,
diff --git a/src/grp-login/systemd-logind/logind-button.c b/src/grp-login/systemd-logind/logind-button.c
index acf7504a2e..81c82117fc 100644
--- a/src/grp-login/systemd-logind/logind-button.c
+++ b/src/grp-login/systemd-logind/logind-button.c
@@ -22,15 +22,17 @@
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
+
#include <linux/input.h>
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "logind-button.h"
-#include "string-util.h"
-#include "util.h"
Button* button_new(Manager *m, const char *name) {
Button *b;
diff --git a/src/grp-login/systemd-logind/logind-core.c b/src/grp-login/systemd-logind/logind-core.c
index cbf8d757fe..13ea97ae0d 100644
--- a/src/grp-login/systemd-logind/logind-core.c
+++ b/src/grp-login/systemd-logind/logind-core.c
@@ -21,18 +21,20 @@
#include <pwd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+
#include <linux/vt.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/udev-util.h"
+
#include "logind.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "udev-util.h"
-#include "user-util.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 90dcd94710..282ba64a3d 100644
--- a/src/grp-login/systemd-logind/logind-dbus.c
+++ b/src/grp-login/systemd-logind/logind-dbus.c
@@ -24,31 +24,32 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "dirent-util.h"
-#include "efivars.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "formats-util.h"
-#include "fs-util.h"
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/selinux-util.h"
+#include "basic/special.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/efivars.h"
+#include "shared/sleep-config.h"
+#include "shared/udev-util.h"
+#include "shared/utmp-wtmp.h"
+
#include "logind.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "selinux-util.h"
-#include "sleep-config.h"
-#include "special.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "udev-util.h"
-#include "unit-name.h"
-#include "user-util.h"
-#include "utmp-wtmp.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;
diff --git a/src/grp-login/systemd-logind/logind-device.c b/src/grp-login/systemd-logind/logind-device.c
index eb5edd1cd5..6165a9ea6e 100644
--- a/src/grp-login/systemd-logind/logind-device.c
+++ b/src/grp-login/systemd-logind/logind-device.c
@@ -19,9 +19,10 @@
#include <string.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/util.h"
+
#include "logind-device.h"
-#include "util.h"
Device* device_new(Manager *m, const char *sysfs, bool master) {
Device *d;
diff --git a/src/grp-login/systemd-logind/logind-device.h b/src/grp-login/systemd-logind/logind-device.h
index 927068e00a..9e2678d801 100644
--- a/src/grp-login/systemd-logind/logind-device.h
+++ b/src/grp-login/systemd-logind/logind-device.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/list.h"
+
typedef struct Device Device;
-#include "list.h"
#include "logind-seat.h"
#include "logind-session-device.h"
diff --git a/src/grp-login/systemd-logind/logind-inhibit.c b/src/grp-login/systemd-logind/logind-inhibit.c
index 6c78e0dddc..8a35db0dc8 100644
--- a/src/grp-login/systemd-logind/logind-inhibit.c
+++ b/src/grp-login/systemd-logind/logind-inhibit.c
@@ -22,18 +22,19 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "logind-inhibit.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "util.h"
Inhibitor* inhibitor_new(Manager *m, const char* id) {
Inhibitor *i;
diff --git a/src/grp-login/systemd-logind/logind-seat-dbus.c b/src/grp-login/systemd-logind/logind-seat-dbus.c
index f934a5326a..e4febe1ab5 100644
--- a/src/grp-login/systemd-logind/logind-seat-dbus.c
+++ b/src/grp-login/systemd-logind/logind-seat-dbus.c
@@ -20,15 +20,16 @@
#include <errno.h>
#include <string.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-label.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/bus-util.h"
+
#include "logind-seat.h"
#include "logind.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
static int property_get_active_session(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-seat.c b/src/grp-login/systemd-logind/logind-seat.c
index aec67718a1..6525ad5d7b 100644
--- a/src/grp-login/systemd-logind/logind-seat.c
+++ b/src/grp-login/systemd-logind/logind-seat.c
@@ -24,18 +24,19 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
#include "logind-acl.h"
#include "logind-seat.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
Seat *seat_new(Manager *m, const char *id) {
Seat *s;
diff --git a/src/grp-login/systemd-logind/logind-seat.h b/src/grp-login/systemd-logind/logind-seat.h
index 9a4fbc5bc5..7fbeb5a727 100644
--- a/src/grp-login/systemd-logind/logind-seat.h
+++ b/src/grp-login/systemd-logind/logind-seat.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/list.h"
+
typedef struct Seat Seat;
-#include "list.h"
#include "logind-session.h"
struct Seat {
diff --git a/src/grp-login/systemd-logind/logind-session-dbus.c b/src/grp-login/systemd-logind/logind-session-dbus.c
index 22dea5db1f..f79f9b5003 100644
--- a/src/grp-login/systemd-logind/logind-session-dbus.c
+++ b/src/grp-login/systemd-logind/logind-session-dbus.c
@@ -20,17 +20,18 @@
#include <errno.h>
#include <string.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-label.h"
-#include "bus-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/fd-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/util.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"
-#include "signal-util.h"
-#include "strv.h"
-#include "util.h"
static int property_get_user(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-session-device.c b/src/grp-login/systemd-logind/logind-session-device.c
index 4055a23277..99528488c0 100644
--- a/src/grp-login/systemd-logind/logind-session-device.c
+++ b/src/grp-login/systemd-logind/logind-session-device.c
@@ -18,19 +18,21 @@
***/
#include <fcntl.h>
-#include <linux/input.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-#include "libudev.h"
+#include <linux/input.h>
+
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "fd-util.h"
#include "logind-session-device.h"
-#include "missing.h"
-#include "util.h"
enum SessionDeviceNotifications {
SESSION_DEVICE_RESUME,
diff --git a/src/grp-login/systemd-logind/logind-session-device.h b/src/grp-login/systemd-logind/logind-session-device.h
index 7c8503583f..4a22decb1d 100644
--- a/src/grp-login/systemd-logind/logind-session-device.h
+++ b/src/grp-login/systemd-logind/logind-session-device.h
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/list.h"
+
typedef enum DeviceType DeviceType;
typedef struct SessionDevice SessionDevice;
-#include "list.h"
#include "logind.h"
enum DeviceType {
diff --git a/src/grp-login/systemd-logind/logind-session.c b/src/grp-login/systemd-logind/logind-session.c
index 11a83106b1..928f4a6314 100644
--- a/src/grp-login/systemd-logind/logind-session.c
+++ b/src/grp-login/systemd-logind/logind-session.c
@@ -19,32 +19,34 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
#include <signal.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
+#include <linux/kd.h>
+#include <linux/vt.h>
+
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/string-table.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "logind-session.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "string-table.h"
-#include "terminal-util.h"
-#include "user-util.h"
-#include "util.h"
#define RELEASE_USEC (20*USEC_PER_SEC)
diff --git a/src/grp-login/systemd-logind/logind-session.h b/src/grp-login/systemd-logind/logind-session.h
index ffb7cd2d41..976046d847 100644
--- a/src/grp-login/systemd-logind/logind-session.h
+++ b/src/grp-login/systemd-logind/logind-session.h
@@ -19,11 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct Session Session;
+#include "basic/list.h"
+#include "basic/login-util.h"
+
typedef enum KillWho KillWho;
+typedef struct Session Session;
-#include "list.h"
-#include "login-util.h"
#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 af6392e025..57d1c857e6 100644
--- a/src/grp-login/systemd-logind/logind-user-dbus.c
+++ b/src/grp-login/systemd-logind/logind-user-dbus.c
@@ -20,14 +20,15 @@
#include <errno.h>
#include <string.h>
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/formats-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "shared/bus-util.h"
+
#include "logind-user.h"
#include "logind.h"
-#include "signal-util.h"
-#include "strv.h"
-#include "user-util.h"
static int property_get_display(
sd_bus *bus,
diff --git a/src/grp-login/systemd-logind/logind-user.c b/src/grp-login/systemd-logind/logind-user.c
index a826321bf0..015276efc8 100644
--- a/src/grp-login/systemd-logind/logind-user.c
+++ b/src/grp-login/systemd-logind/logind-user.c
@@ -22,32 +22,33 @@
#include <sys/mount.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "clean-ipc.h"
-#include "conf-parser.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "label.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.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/label.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/smack-util.h"
+#include "basic/special.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/clean-ipc.h"
+#include "shared/conf-parser.h"
+
#include "logind-user.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "smack-util.h"
-#include "special.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "unit-name.h"
-#include "user-util.h"
-#include "util.h"
int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name) {
_cleanup_(user_freep) User *u = NULL;
diff --git a/src/grp-login/systemd-logind/logind-user.h b/src/grp-login/systemd-logind/logind-user.h
index 4f0966dc77..b23c59fa1d 100644
--- a/src/grp-login/systemd-logind/logind-user.h
+++ b/src/grp-login/systemd-logind/logind-user.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/list.h"
+
typedef struct User User;
-#include "list.h"
#include "logind.h"
typedef enum UserState {
diff --git a/src/grp-login/systemd-logind/logind-utmp.c b/src/grp-login/systemd-logind/logind-utmp.c
index 47599fd466..1e97083f78 100644
--- a/src/grp-login/systemd-logind/logind-utmp.c
+++ b/src/grp-login/systemd-logind/logind-utmp.c
@@ -24,18 +24,19 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/formats-util.h"
+#include "basic/special.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.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"
-#include "special.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "user-util.h"
-#include "utmp-wtmp.h"
_const_ static usec_t when_wall(usec_t n, usec_t elapse) {
diff --git a/src/grp-login/systemd-logind/logind.c b/src/grp-login/systemd-logind/logind.c
index 925c04a344..e5e21f7567 100644
--- a/src/grp-login/systemd-logind/logind.c
+++ b/src/grp-login/systemd-logind/logind.c
@@ -22,22 +22,23 @@
#include <string.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/conf-parser.h"
+#include "shared/udev-util.h"
+
#include "logind.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "strv.h"
-#include "udev-util.h"
static void manager_free(Manager *m);
diff --git a/src/grp-login/systemd-logind/logind.h b/src/grp-login/systemd-logind/logind.h
index 9d43c2e7ee..effc498118 100644
--- a/src/grp-login/systemd-logind/logind.h
+++ b/src/grp-login/systemd-logind/logind.h
@@ -21,13 +21,13 @@
#include <stdbool.h>
-#include "libudev.h"
+#include <libudev.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "hashmap.h"
-#include "list.h"
-#include "set.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/set.h"
typedef struct Manager Manager;
diff --git a/src/grp-login/test-inhibit.c b/src/grp-login/test-inhibit.c
index be7145b4bc..2451d56446 100644
--- a/src/grp-login/test-inhibit.c
+++ b/src/grp-login/test-inhibit.c
@@ -21,10 +21,10 @@
#include <systemd/sd-bus.h>
-#include "bus-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
static int inhibit(sd_bus *bus, const char *what) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
diff --git a/src/grp-login/test-login-shared.c b/src/grp-login/test-login-shared.c
index 3d233f017c..5a9329f7ee 100644
--- a/src/grp-login/test-login-shared.c
+++ b/src/grp-login/test-login-shared.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "login-util.h"
-#include "macro.h"
+#include "basic/login-util.h"
+#include "basic/macro.h"
static void test_session_id_valid(void) {
assert_se(session_id_valid("c1"));
diff --git a/src/grp-login/test-login-tables.c b/src/grp-login/test-login-tables.c
index 4fbc893a9a..3f2f4f3054 100644
--- a/src/grp-login/test-login-tables.c
+++ b/src/grp-login/test-login-tables.c
@@ -19,7 +19,7 @@
#include "logind-action.h"
#include "logind-session.h"
-#include "test-tables.h"
+#include "shared/test-tables.h"
int main(int argc, char **argv) {
test_table(handle_action, HANDLE_ACTION);
diff --git a/src/grp-machine/Makefile b/src/grp-machine/Makefile
new file mode 100644
index 0000000000..7412341233
--- /dev/null
+++ b/src/grp-machine/Makefile
@@ -0,0 +1,29 @@
+# -*- 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
+
+at.subdirs += machinectl systemd-machined
+at.subdirs += nss-mymachines
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/libimport/import-common.c b/src/grp-machine/grp-import/libimport/import-common.c
index 287a3382a1..cd69e900ec 100644
--- a/src/grp-machine/grp-import/libimport/import-common.c
+++ b/src/grp-machine/grp-import/libimport/import-common.c
@@ -22,12 +22,13 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "btrfs-util.h"
-#include "capability-util.h"
-#include "fd-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/capability-util.h"
+#include "basic/fd-util.h"
+#include "basic/signal-util.h"
+#include "basic/util.h"
+
#include "import-common.h"
-#include "signal-util.h"
-#include "util.h"
int import_make_read_only_fd(int fd) {
int r;
diff --git a/src/grp-machine/grp-import/libimport/import-compress.c b/src/grp-machine/grp-import/libimport/import-compress.c
index f1766bbe3b..4f1a9891e8 100644
--- a/src/grp-machine/grp-import/libimport/import-compress.c
+++ b/src/grp-machine/grp-import/libimport/import-compress.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/string-table.h"
+#include "basic/util.h"
+
#include "import-compress.h"
-#include "string-table.h"
-#include "util.h"
void import_compress_free(ImportCompress *c) {
assert(c);
diff --git a/src/grp-machine/grp-import/libimport/import-compress.h b/src/grp-machine/grp-import/libimport/import-compress.h
index 6b59d0724b..130afb4cd0 100644
--- a/src/grp-machine/grp-import/libimport/import-compress.h
+++ b/src/grp-machine/grp-import/libimport/import-compress.h
@@ -24,7 +24,7 @@
#include <sys/types.h>
#include <zlib.h>
-#include "macro.h"
+#include "basic/macro.h"
typedef enum ImportCompressType {
IMPORT_COMPRESS_UNKNOWN,
diff --git a/src/grp-machine/grp-import/libimport/qcow2-util.c b/src/grp-machine/grp-import/libimport/qcow2-util.c
index ee2121cc36..bc50b7d0b3 100644
--- a/src/grp-machine/grp-import/libimport/qcow2-util.c
+++ b/src/grp-machine/grp-import/libimport/qcow2-util.c
@@ -19,11 +19,12 @@
#include <zlib.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/util.h"
+
#include "qcow2-util.h"
-#include "sparse-endian.h"
-#include "util.h"
#define QCOW2_MAGIC 0x514649fb
diff --git a/src/grp-machine/grp-import/libimport/test-qcow2.c b/src/grp-machine/grp-import/libimport/test-qcow2.c
index b820253d71..15d7c29aef 100644
--- a/src/grp-machine/grp-import/libimport/test-qcow2.c
+++ b/src/grp-machine/grp-import/libimport/test-qcow2.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "fd-util.h"
-#include "log.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/util.h"
+
#include "qcow2-util.h"
-#include "util.h"
int main(int argc, char *argv[]) {
_cleanup_close_ int sfd = -1, dfd = -1;
diff --git a/src/grp-machine/grp-import/systemd-export/Makefile b/src/grp-machine/grp-import/systemd-export/Makefile
new file mode 100644
index 0000000000..f6e15987a5
--- /dev/null
+++ b/src/grp-machine/grp-import/systemd-export/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
+
+rootlibexec_PROGRAMS += systemd-export
+
+systemd_export_SOURCES = \
+ src/import/export.c \
+ 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
+
+systemd_export_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(XZ_CFLAGS) \
+ $(ZLIB_CFLAGS) \
+ $(BZIP2_CFLAGS)
+
+systemd_export_LDADD = \
+ libshared.la \
+ $(XZ_LIBS) \
+ $(ZLIB_LIBS) \
+ $(BZIP2_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
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 658f835132..db06e11b87 100644
--- a/src/grp-machine/grp-import/systemd-export/export-raw.c
+++ b/src/grp-machine/grp-import/systemd-export/export-raw.c
@@ -25,7 +25,7 @@
#include <libgen.h>
#undef basename
-#include <systemd/sd-daemon.h>
+#include "sd-daemon.h"
#include "alloc-util.h"
#include "btrfs-util.h"
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 c7ac134603..cf34d512bc 100644
--- a/src/grp-machine/grp-import/systemd-export/export-raw.h
+++ b/src/grp-machine/grp-import/systemd-export/export-raw.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
+#include "basic/macro.h"
#include "import-compress.h"
-#include "macro.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.c b/src/grp-machine/grp-import/systemd-export/export-tar.c
index 9c511984c1..e2b3c5f2e9 100644
--- a/src/grp-machine/grp-import/systemd-export/export-tar.c
+++ b/src/grp-machine/grp-import/systemd-export/export-tar.c
@@ -19,16 +19,17 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "export-tar.h"
-#include "fd-util.h"
-#include "fileio.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/process-util.h"
+#include "basic/ratelimit.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "import-common.h"
-#include "process-util.h"
-#include "ratelimit.h"
-#include "string-util.h"
-#include "util.h"
+
+#include "export-tar.h"
#define COPY_BUFFER_SIZE (16*1024)
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 50206cabb3..c048a6d642 100644
--- a/src/grp-machine/grp-import/systemd-export/export-tar.h
+++ b/src/grp-machine/grp-import/systemd-export/export-tar.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
+#include "basic/macro.h"
#include "import-compress.h"
-#include "macro.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-export/export.c b/src/grp-machine/grp-import/systemd-export/export.c
index 0a5efe5476..5db164c7d1 100644
--- a/src/grp-machine/grp-import/systemd-export/export.c
+++ b/src/grp-machine/grp-import/systemd-export/export.c
@@ -21,17 +21,18 @@
#include <systemd/sd-event.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/verbs.h"
+#include "shared/import-util.h"
+#include "shared/machine-image.h"
+
#include "export-raw.h"
#include "export-tar.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "machine-image.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "verbs.h"
static ImportCompressType arg_compress = IMPORT_COMPRESS_UNKNOWN;
diff --git a/src/grp-machine/grp-import/systemd-import/Makefile b/src/grp-machine/grp-import/systemd-import/Makefile
new file mode 100644
index 0000000000..e117efc68a
--- /dev/null
+++ b/src/grp-machine/grp-import/systemd-import/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
+
+rootlibexec_PROGRAMS += systemd-import
+systemd_import_SOURCES = \
+ src/import/import.c \
+ 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
+
+systemd_import_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(XZ_CFLAGS) \
+ $(ZLIB_CFLAGS) \
+ $(BZIP2_CFLAGS)
+
+systemd_import_LDADD = \
+ libshared.la \
+ $(XZ_LIBS) \
+ $(ZLIB_LIBS) \
+ $(BZIP2_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
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 ce37392707..55a6d044ab 100644
--- a/src/grp-machine/grp-import/systemd-import/import-raw.c
+++ b/src/grp-machine/grp-import/systemd-import/import-raw.c
@@ -22,26 +22,27 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "chattr-util.h"
-#include "copy.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/chattr-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/ratelimit.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "import-common.h"
#include "import-compress.h"
-#include "import-raw.h"
-#include "io-util.h"
-#include "machine-pool.h"
-#include "mkdir.h"
-#include "path-util.h"
#include "qcow2-util.h"
-#include "ratelimit.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "util.h"
+#include "shared/machine-pool.h"
+
+#include "import-raw.h"
struct RawImport {
sd_event *event;
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 f0a315c088..ae7e0b017d 100644
--- a/src/grp-machine/grp-import/systemd-import/import-raw.h
+++ b/src/grp-machine/grp-import/systemd-import/import-raw.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
-#include "import-util.h"
-#include "macro.h"
+#include "basic/macro.h"
+#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 016d05e77d..0d61b5f01d 100644
--- a/src/grp-machine/grp-import/systemd-import/import-tar.c
+++ b/src/grp-machine/grp-import/systemd-import/import-tar.c
@@ -22,26 +22,27 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "copy.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/ratelimit.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "import-common.h"
#include "import-compress.h"
-#include "import-tar.h"
-#include "io-util.h"
-#include "machine-pool.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
#include "qcow2-util.h"
-#include "ratelimit.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "util.h"
+#include "shared/machine-pool.h"
+
+#include "import-tar.h"
struct TarImport {
sd_event *event;
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 b66b00ddfd..b5012f1ea4 100644
--- a/src/grp-machine/grp-import/systemd-import/import-tar.h
+++ b/src/grp-machine/grp-import/systemd-import/import-tar.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
-#include "import-util.h"
-#include "macro.h"
+#include "basic/macro.h"
+#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-import/import.c b/src/grp-machine/grp-import/systemd-import/import.c
index 338847dbc2..6744006312 100644
--- a/src/grp-machine/grp-import/systemd-import/import.c
+++ b/src/grp-machine/grp-import/systemd-import/import.c
@@ -21,17 +21,18 @@
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/verbs.h"
+#include "shared/import-util.h"
+#include "shared/machine-image.h"
+
#include "import-raw.h"
#include "import-tar.h"
-#include "import-util.h"
-#include "machine-image.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "verbs.h"
static bool arg_force = false;
static bool arg_read_only = false;
diff --git a/src/grp-machine/grp-import/systemd-importd/Makefile b/src/grp-machine/grp-import/systemd-importd/Makefile
new file mode 100644
index 0000000000..0070c48d05
--- /dev/null
+++ b/src/grp-machine/grp-import/systemd-importd/Makefile
@@ -0,0 +1,39 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-importd
+systemd_importd_SOURCES = \
+ src/import/importd.c
+
+systemd_importd_CFLAGS = \
+ $(AM_CFLAGS) \
+ -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\" \
+ -D SYSTEMD_IMPORT_PATH=\"$(rootlibexecdir)/systemd-import\" \
+ -D SYSTEMD_EXPORT_PATH=\"$(rootlibexecdir)/systemd-export\"
+
+systemd_importd_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/systemd-importd/importd.c b/src/grp-machine/grp-import/systemd-importd/importd.c
index e30dfdf805..e790c0c475 100644
--- a/src/grp-machine/grp-import/systemd-importd/importd.c
+++ b/src/grp-machine/grp-import/systemd-importd/importd.c
@@ -21,27 +21,27 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "machine-pool.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "user-util.h"
-#include "util.h"
-#include "web-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-table.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "basic/web-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/bus-util.h"
+#include "shared/import-util.h"
+#include "shared/machine-pool.h"
typedef struct Transfer Transfer;
typedef struct Manager Manager;
diff --git a/src/grp-machine/grp-import/systemd-pull/Makefile b/src/grp-machine/grp-import/systemd-pull/Makefile
new file mode 100644
index 0000000000..31a90fc90f
--- /dev/null
+++ b/src/grp-machine/grp-import/systemd-pull/Makefile
@@ -0,0 +1,64 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-pull
+systemd_pull_SOURCES = \
+ src/import/pull.c \
+ src/import/pull-raw.c \
+ src/import/pull-raw.h \
+ src/import/pull-tar.c \
+ src/import/pull-tar.h \
+ src/import/pull-job.c \
+ 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
+
+systemd_pull_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBCURL_CFLAGS) \
+ $(XZ_CFLAGS) \
+ $(ZLIB_CFLAGS) \
+ $(BZIP2_CFLAGS) \
+ $(GCRYPT_CFLAGS) \
+ -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \
+ -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
+
+systemd_pull_LDADD = \
+ libshared.la \
+ $(LIBCURL_LIBS) \
+ $(XZ_LIBS) \
+ $(ZLIB_LIBS) \
+ $(BZIP2_LIBS) \
+ $(GCRYPT_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/grp-import/systemd-pull/curl-util.c b/src/grp-machine/grp-import/systemd-pull/curl-util.c
index 6990c47f48..9e0d56e5c3 100644
--- a/src/grp-machine/grp-import/systemd-pull/curl-util.c
+++ b/src/grp-machine/grp-import/systemd-pull/curl-util.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
+
#include "curl-util.h"
-#include "fd-util.h"
-#include "string-util.h"
static void curl_glue_check_finished(CurlGlue *g) {
CURLMsg *msg;
diff --git a/src/grp-machine/grp-import/systemd-pull/curl-util.h b/src/grp-machine/grp-import/systemd-pull/curl-util.h
index 2e71bd3b5d..296b35d09c 100644
--- a/src/grp-machine/grp-import/systemd-pull/curl-util.h
+++ b/src/grp-machine/grp-import/systemd-pull/curl-util.h
@@ -24,7 +24,7 @@
#include <systemd/sd-event.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
typedef struct CurlGlue CurlGlue;
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-common.c b/src/grp-machine/grp-import/systemd-pull/pull-common.c
index dc4e4667a9..f5815c216d 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-common.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-common.c
@@ -19,25 +19,26 @@
#include <sys/prctl.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "capability-util.h"
-#include "copy.h"
-#include "dirent-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "path-util.h"
-#include "process-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/capability-util.h"
+#include "basic/copy.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rm-rf.h"
+#include "basic/signal-util.h"
+#include "basic/siphash24.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "basic/web-util.h"
+
#include "pull-common.h"
#include "pull-job.h"
-#include "rm-rf.h"
-#include "signal-util.h"
-#include "siphash24.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
-#include "web-util.h"
#define FILENAME_ESCAPE "/.#\"\'"
#define HASH_URL_THRESHOLD_LENGTH (_POSIX_PATH_MAX - 16)
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-common.h b/src/grp-machine/grp-import/systemd-pull/pull-common.h
index 929a131c88..96198a695a 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-common.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-common.h
@@ -21,7 +21,8 @@
#include <stdbool.h>
-#include "import-util.h"
+#include "shared/import-util.h"
+
#include "pull-job.h"
int pull_make_local_copy(const char *final, const char *root, const char *local, bool force_local);
diff --git a/src/grp-machine/grp-import/systemd-pull/pull-job.c b/src/grp-machine/grp-import/systemd-pull/pull-job.c
index 6bcf35ef4e..3735304e6d 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-job.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-job.c
@@ -19,16 +19,17 @@
#include <sys/xattr.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hexdecoct.h"
-#include "io-util.h"
-#include "machine-pool.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/xattr-util.h"
+#include "shared/machine-pool.h"
+
#include "pull-job.h"
-#include "string-util.h"
-#include "strv.h"
-#include "xattr-util.h"
PullJob* pull_job_unref(PullJob *j) {
if (!j)
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 3a152a50e3..296e32bd09 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-job.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-job.h
@@ -21,12 +21,12 @@
#include <gcrypt.h>
-#include "curl-util.h"
+#include "basic/macro.h"
#include "import-compress.h"
-#include "macro.h"
-typedef struct PullJob PullJob;
+#include "curl-util.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 19155cc53a..9602915a1f 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-raw.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-raw.c
@@ -18,35 +18,37 @@
***/
#include <curl/curl.h>
-#include <linux/fs.h>
#include <sys/xattr.h>
+#include <linux/fs.h>
+
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "chattr-util.h"
-#include "copy.h"
-#include "curl-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/chattr-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "basic/web-util.h"
#include "import-common.h"
-#include "import-util.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.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"
-#include "qcow2-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
-#include "util.h"
-#include "web-util.h"
typedef enum RawProgress {
RAW_DOWNLOADING,
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 6bafa6dafd..93032edf09 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-raw.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-raw.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
-#include "import-util.h"
-#include "macro.h"
+#include "basic/macro.h"
+#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 e0205c3841..121ca31dbd 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-tar.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull-tar.c
@@ -22,29 +22,30 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "copy.h"
-#include "curl-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "basic/web-util.h"
#include "import-common.h"
-#include "import-util.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
+#include "shared/import-util.h"
+
+#include "curl-util.h"
#include "pull-common.h"
#include "pull-job.h"
#include "pull-tar.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
-#include "util.h"
-#include "web-util.h"
typedef enum TarProgress {
TAR_DOWNLOADING,
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 9ff5bd5953..81797fa359 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull-tar.h
+++ b/src/grp-machine/grp-import/systemd-pull/pull-tar.h
@@ -21,11 +21,10 @@
#include <systemd/sd-event.h>
-#include "import-util.h"
-#include "macro.h"
+#include "basic/macro.h"
+#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/grp-import/systemd-pull/pull.c b/src/grp-machine/grp-import/systemd-pull/pull.c
index 74df24f993..166f91d6e1 100644
--- a/src/grp-machine/grp-import/systemd-pull/pull.c
+++ b/src/grp-machine/grp-import/systemd-pull/pull.c
@@ -21,17 +21,18 @@
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "machine-image.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/parse-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/verbs.h"
+#include "basic/web-util.h"
+#include "shared/import-util.h"
+#include "shared/machine-image.h"
+
#include "pull-raw.h"
#include "pull-tar.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "verbs.h"
-#include "web-util.h"
static bool arg_force = false;
static const char *arg_image_root = "/var/lib/machines";
diff --git a/src/grp-machine/machinectl/Makefile b/src/grp-machine/machinectl/Makefile
new file mode 100644
index 0000000000..a3ad40e59c
--- /dev/null
+++ b/src/grp-machine/machinectl/Makefile
@@ -0,0 +1,42 @@
+# -*- 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
+
+machinectl_SOURCES = \
+ src/machine/machinectl.c
+
+machinectl_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ machinectl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/machinectl
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_machinectl \
+ shell-completion/zsh/_sd_machines
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/machinectl/machinectl.c b/src/grp-machine/machinectl/machinectl.c
index 92ffa8b83d..fa607c57e4 100644
--- a/src/grp-machine/machinectl/machinectl.c
+++ b/src/grp-machine/machinectl/machinectl.c
@@ -31,34 +31,34 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "copy.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "import-util.h"
-#include "log.h"
-#include "logs-show.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "ptyfwd.h"
-#include "signal-util.h"
-#include "spawn-polkit-agent.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "util.h"
-#include "verbs.h"
-#include "web-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/copy.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.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/unit-name.h"
+#include "basic/util.h"
+#include "basic/verbs.h"
+#include "basic/web-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+#include "shared/cgroup-show.h"
+#include "shared/import-util.h"
+#include "shared/logs-show.h"
+#include "shared/pager.h"
+#include "shared/ptyfwd.h"
+#include "shared/spawn-polkit-agent.h"
static char **arg_property = NULL;
static bool arg_all = false;
diff --git a/src/grp-machine/nss-mymachines/Makefile b/src/grp-machine/nss-mymachines/Makefile
new file mode 100644
index 0000000000..c7c0d76907
--- /dev/null
+++ b/src/grp-machine/nss-mymachines/Makefile
@@ -0,0 +1,46 @@
+# -*- 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
+
+
+libnss_mymachines_la_SOURCES = \
+ src/nss-mymachines/nss-mymachines.sym \
+ src/nss-mymachines/nss-mymachines.c
+
+libnss_mymachines_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -module \
+ -export-dynamic \
+ -avoid-version \
+ -shared \
+ -shrext .so.2 \
+ -Wl,--version-script=$(srcdir)/nss-mymachines.sym
+
+libnss_mymachines_la_LIBADD = \
+ libsystemd-internal.la
+
+lib_LTLIBRARIES += \
+ libnss_mymachines.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/nss-mymachines/nss-mymachines.c b/src/grp-machine/nss-mymachines/nss-mymachines.c
index da09035fe7..0bcdd45d37 100644
--- a/src/grp-machine/nss-mymachines/nss-mymachines.c
+++ b/src/grp-machine/nss-mymachines/nss-mymachines.c
@@ -23,16 +23,16 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-login.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "hostname-util.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "nss-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/nss-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
NSS_GETHOSTBYNAME_PROTOTYPES(mymachines);
NSS_GETPW_PROTOTYPES(mymachines);
diff --git a/src/grp-machine/systemd-machined/Makefile b/src/grp-machine/systemd-machined/Makefile
new file mode 100644
index 0000000000..98d7a58d92
--- /dev/null
+++ b/src/grp-machine/systemd-machined/Makefile
@@ -0,0 +1,93 @@
+# -*- 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_machined_SOURCES = \
+ src/machine/machined.c \
+ src/machine/machined.h
+
+systemd_machined_LDADD = \
+ libmachine-core.la
+
+rootlibexec_PROGRAMS += \
+ systemd-machined
+
+libmachine_core_la_SOURCES = \
+ src/machine/machine.c \
+ src/machine/machine.h \
+ src/machine/machined-dbus.c \
+ src/machine/machine-dbus.c \
+ src/machine/machine-dbus.h \
+ src/machine/image-dbus.c \
+ src/machine/image-dbus.h \
+ 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
+
+test_machine_tables_LDADD = \
+ libmachine-core.la
+
+tests += \
+ test-machine-tables
+
+nodist_systemunit_DATA += \
+ units/systemd-machined.service
+
+dist_systemunit_DATA += \
+ units/machine.slice
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.machine1.busname
+
+dist_dbussystemservice_DATA += \
+ src/machine/org.freedesktop.machine1.service
+
+dist_dbuspolicy_DATA += \
+ src/machine/org.freedesktop.machine1.conf
+
+polkitpolicy_files += \
+ src/machine/org.freedesktop.machine1.policy
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-machined.service dbus-org.freedesktop.machine1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.machine1.busname
+
+
+polkitpolicy_in_files += \
+ src/machine/org.freedesktop.machine1.policy.in
+
+EXTRA_DIST += \
+ units/systemd-machined.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/systemd-machined/image-dbus.c b/src/grp-machine/systemd-machined/image-dbus.c
index 0eed9b81bb..584777e5ad 100644
--- a/src/grp-machine/systemd-machined/image-dbus.c
+++ b/src/grp-machine/systemd-machined/image-dbus.c
@@ -17,16 +17,17 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-label.h"
-#include "bus-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/process-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "shared/bus-util.h"
+#include "shared/machine-image.h"
+
#include "image-dbus.h"
-#include "io-util.h"
-#include "machine-image.h"
-#include "process-util.h"
-#include "strv.h"
-#include "user-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, image_type, ImageType);
diff --git a/src/grp-machine/systemd-machined/machine.c b/src/grp-machine/systemd-machined/machine.c
index 135f47dafc..82d8f66395 100644
--- a/src/grp-machine/systemd-machined/machine.c
+++ b/src/grp-machine/systemd-machined/machine.c
@@ -23,25 +23,26 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "escape.h"
-#include "extract-word.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "hashmap.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/extract-word.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/hashmap.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "machine-dbus.h"
#include "machine.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "util.h"
Machine* machine_new(Manager *manager, MachineClass class, const char *name) {
Machine *m;
diff --git a/src/grp-machine/systemd-machined/machine.h b/src/grp-machine/systemd-machined/machine.h
index e5d75361a9..e93f0cf222 100644
--- a/src/grp-machine/systemd-machined/machine.h
+++ b/src/grp-machine/systemd-machined/machine.h
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct Machine Machine;
+#include "basic/list.h"
+
typedef enum KillWho KillWho;
+typedef struct Machine Machine;
-#include "list.h"
#include "machined.h"
#include "operation.h"
diff --git a/src/grp-machine/systemd-machined/machined-dbus.c b/src/grp-machine/systemd-machined/machined-dbus.c
index 41f138882b..7caecd43a0 100644
--- a/src/grp-machine/systemd-machined/machined-dbus.c
+++ b/src/grp-machine/systemd-machined/machined-dbus.c
@@ -23,26 +23,27 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/stdio-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/bus-util.h"
+#include "shared/machine-image.h"
+#include "shared/machine-pool.h"
+
#include "image-dbus.h"
-#include "io-util.h"
#include "machine-dbus.h"
-#include "machine-image.h"
-#include "machine-pool.h"
#include "machined.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "user-util.h"
static int property_get_pool_path(
sd_bus *bus,
diff --git a/src/grp-machine/systemd-machined/machined.c b/src/grp-machine/systemd-machined/machined.c
index 151f0983ec..83a74e2549 100644
--- a/src/grp-machine/systemd-machined/machined.c
+++ b/src/grp-machine/systemd-machined/machined.c
@@ -23,18 +23,19 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "hostname-util.h"
-#include "label.h"
-#include "machine-image.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/hostname-util.h"
+#include "basic/label.h"
+#include "basic/signal-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/machine-image.h"
+
#include "machined.h"
-#include "signal-util.h"
Manager *manager_new(void) {
Manager *m;
diff --git a/src/grp-machine/systemd-machined/machined.h b/src/grp-machine/systemd-machined/machined.h
index 777571ebc0..b16ea3ef15 100644
--- a/src/grp-machine/systemd-machined/machined.h
+++ b/src/grp-machine/systemd-machined/machined.h
@@ -24,8 +24,8 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "hashmap.h"
-#include "list.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
typedef struct Manager Manager;
diff --git a/src/grp-machine/systemd-machined/operation.c b/src/grp-machine/systemd-machined/operation.c
index e6ddc41a55..f1bcb1d860 100644
--- a/src/grp-machine/systemd-machined/operation.c
+++ b/src/grp-machine/systemd-machined/operation.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/process-util.h"
+
#include "operation.h"
-#include "process-util.h"
static int operation_done(sd_event_source *s, const siginfo_t *si, void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
diff --git a/src/grp-machine/systemd-machined/operation.h b/src/grp-machine/systemd-machined/operation.h
index 9397cd5f6d..0821466a00 100644
--- a/src/grp-machine/systemd-machined/operation.h
+++ b/src/grp-machine/systemd-machined/operation.h
@@ -24,7 +24,7 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "list.h"
+#include "basic/list.h"
typedef struct Operation Operation;
diff --git a/src/grp-machine/systemd-machined/test-machine-tables.c b/src/grp-machine/systemd-machined/test-machine-tables.c
index f851a4d37d..7d44c55a4b 100644
--- a/src/grp-machine/systemd-machined/test-machine-tables.c
+++ b/src/grp-machine/systemd-machined/test-machine-tables.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "shared/test-tables.h"
+
#include "machine.h"
-#include "test-tables.h"
int main(int argc, char **argv) {
test_table(machine_class, MACHINE_CLASS);
diff --git a/src/grp-network/Makefile b/src/grp-network/Makefile
new file mode 100644
index 0000000000..7cbd9142d0
--- /dev/null
+++ b/src/grp-network/Makefile
@@ -0,0 +1,107 @@
+# -*- 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
+
+dist_network_DATA = \
+ network/99-default.link \
+ network/80-container-host0.network \
+ network/80-container-ve.network \
+ network/80-container-vz.network
+
+ifneq ($(ENABLE_NETWORKD),)
+test_networkd_conf_SOURCES = \
+ src/network/test-networkd-conf.c
+
+test_networkd_conf_LDADD = \
+ libnetworkd-core.la
+
+test_network_SOURCES = \
+ src/network/test-network.c
+
+test_network_LDADD = \
+ libnetworkd-core.la
+
+ifneq ($(HAVE_LIBIPTC),)
+test_network_LDADD += \
+ libfirewall.la
+endif # HAVE_LIBIPTC
+
+test_network_tables_SOURCES = \
+ src/network/test-network-tables.c \
+ src/shared/test-tables.h
+
+test_network_tables_LDADD = \
+ libnetworkd-core.la \
+ libudev-core.la
+
+ifneq ($(HAVE_LIBIPTC),)
+test_network_tables_LDADD += \
+ libfirewall.la
+endif # HAVE_LIBIPTC
+
+tests += \
+ test-networkd-conf \
+ 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 += \
+ src/network/networkd-gperf.gperf \
+ 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
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/libnetworkd-core/Makefile b/src/grp-network/libnetworkd-core/Makefile
new file mode 100644
index 0000000000..53d65460f2
--- /dev/null
+++ b/src/grp-network/libnetworkd-core/Makefile
@@ -0,0 +1,93 @@
+# -*- 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 += \
+ libnetworkd-core.la
+
+libnetworkd_core_la_CFLAGS = \
+ $(AM_CFLAGS)
+
+libnetworkd_core_la_SOURCES = \
+ src/libsystemd-network/network-internal.h \
+ src/network/networkd.h \
+ src/network/networkd-conf.h \
+ src/network/networkd-conf.c \
+ src/network/networkd-link.h \
+ src/network/networkd-link.c \
+ src/network/networkd-netdev.h \
+ src/network/networkd-netdev.c \
+ src/network/networkd-netdev-tunnel.h \
+ src/network/networkd-netdev-tunnel.c \
+ src/network/networkd-netdev-veth.h \
+ src/network/networkd-netdev-veth.c \
+ src/network/networkd-netdev-vxlan.h \
+ src/network/networkd-netdev-vxlan.c \
+ src/network/networkd-netdev-vlan.h \
+ src/network/networkd-netdev-vlan.c \
+ src/network/networkd-netdev-macvlan.h \
+ src/network/networkd-netdev-macvlan.c \
+ src/network/networkd-netdev-ipvlan.h \
+ src/network/networkd-netdev-ipvlan.c \
+ src/network/networkd-netdev-dummy.h \
+ src/network/networkd-netdev-dummy.c \
+ src/network/networkd-netdev-tuntap.h \
+ src/network/networkd-netdev-tuntap.c \
+ src/network/networkd-netdev-bond.h \
+ src/network/networkd-netdev-bond.c \
+ src/network/networkd-netdev-bridge.h \
+ src/network/networkd-netdev-bridge.c \
+ src/network/networkd-link-bus.c \
+ src/network/networkd-ipv4ll.c \
+ src/network/networkd-dhcp4.c \
+ src/network/networkd-dhcp6.c \
+ src/network/networkd-ndisc.c \
+ src/network/networkd-network.h \
+ src/network/networkd-network.c \
+ src/network/networkd-network-bus.c \
+ src/network/networkd-address.h \
+ src/network/networkd-address.c \
+ src/network/networkd-route.h \
+ src/network/networkd-route.c \
+ src/network/networkd-manager.c \
+ src/network/networkd-manager-bus.c \
+ src/network/networkd-fdb.h \
+ src/network/networkd-fdb.c \
+ src/network/networkd-address-pool.h \
+ src/network/networkd-address-pool.c \
+ src/network/networkd-util.h \
+ src/network/networkd-util.c \
+ src/network/networkd-lldp-tx.h \
+ src/network/networkd-lldp-tx.c
+
+nodist_libnetworkd_core_la_SOURCES = \
+ src/network/networkd-gperf.c \
+ src/network/networkd-network-gperf.c \
+ src/network/networkd-netdev-gperf.c
+
+libnetworkd_core_la_LIBADD = \
+ libsystemd-network.la \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/libnetworkd-core/networkd-address-pool.c b/src/grp-network/libnetworkd-core/networkd-address-pool.c
index ebc6c9eb9e..7b57f6be0e 100644
--- a/src/grp-network/libnetworkd-core/networkd-address-pool.c
+++ b/src/grp-network/libnetworkd-core/networkd-address-pool.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+
#include "networkd-address-pool.h"
#include "networkd.h"
-#include "set.h"
-#include "string-util.h"
int address_pool_new(
Manager *m,
diff --git a/src/grp-network/libnetworkd-core/networkd-address-pool.h b/src/grp-network/libnetworkd-core/networkd-address-pool.h
index af30decfe0..5d7020739d 100644
--- a/src/grp-network/libnetworkd-core/networkd-address-pool.h
+++ b/src/grp-network/libnetworkd-core/networkd-address-pool.h
@@ -19,11 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct AddressPool AddressPool;
-
-#include "in-addr-util.h"
-#include "list.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+typedef struct AddressPool AddressPool;
typedef struct Manager Manager;
struct AddressPool {
diff --git a/src/grp-network/libnetworkd-core/networkd-address.c b/src/grp-network/libnetworkd-core/networkd-address.c
index 367c340e08..3c814db91b 100644
--- a/src/grp-network/libnetworkd-core/networkd-address.c
+++ b/src/grp-network/libnetworkd-core/networkd-address.c
@@ -19,18 +19,19 @@
#include <net/if.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "basic/alloc-util.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
#include "firewall-util.h"
-#include "netlink-util.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/conf-parser.h"
+
#include "networkd-address.h"
#include "networkd.h"
-#include "parse-util.h"
-#include "set.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "utf8.h"
-#include "util.h"
int address_new(Address **ret) {
_cleanup_address_free_ Address *address = NULL;
diff --git a/src/grp-network/libnetworkd-core/networkd-address.h b/src/grp-network/libnetworkd-core/networkd-address.h
index 784ab18b27..1e178a0ca3 100644
--- a/src/grp-network/libnetworkd-core/networkd-address.h
+++ b/src/grp-network/libnetworkd-core/networkd-address.h
@@ -22,7 +22,7 @@
#include <inttypes.h>
#include <stdbool.h>
-#include "in-addr-util.h"
+#include "basic/in-addr-util.h"
typedef struct Address Address;
diff --git a/src/grp-network/libnetworkd-core/networkd-conf.c b/src/grp-network/libnetworkd-core/networkd-conf.c
index b67a1f6d09..e9993f9f32 100644
--- a/src/grp-network/libnetworkd-core/networkd-conf.c
+++ b/src/grp-network/libnetworkd-core/networkd-conf.c
@@ -19,12 +19,13 @@
#include <ctype.h>
-#include "conf-parser.h"
-#include "def.h"
-#include "dhcp-identifier.h"
-#include "hexdecoct.h"
+#include "basic/def.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-table.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/dhcp-identifier.h"
+
#include "networkd-conf.h"
-#include "string-table.h"
int manager_parse_config_file(Manager *m) {
assert(m);
diff --git a/src/grp-network/libnetworkd-core/networkd-dhcp4.c b/src/grp-network/libnetworkd-core/networkd-dhcp4.c
index 2ddcee9db8..fe565ad075 100644
--- a/src/grp-network/libnetworkd-core/networkd-dhcp4.c
+++ b/src/grp-network/libnetworkd-core/networkd-dhcp4.c
@@ -18,12 +18,14 @@
***/
#include <netinet/ether.h>
+
#include <linux/if.h>
-#include "alloc-util.h"
-#include "dhcp-lease-internal.h"
-#include "hostname-util.h"
-#include "network-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd.h"
static int dhcp4_route_handler(sd_netlink *rtnl, sd_netlink_message *m,
diff --git a/src/grp-network/libnetworkd-core/networkd-dhcp6.c b/src/grp-network/libnetworkd-core/networkd-dhcp6.c
index c5a3c52e94..6399849ff6 100644
--- a/src/grp-network/libnetworkd-core/networkd-dhcp6.c
+++ b/src/grp-network/libnetworkd-core/networkd-dhcp6.c
@@ -18,11 +18,12 @@
***/
#include <netinet/ether.h>
+
#include <linux/if.h>
-#include <systemd/sd-dhcp6-client.h>
+#include "systemd-network/network-internal.h"
+#include "systemd-network/sd-dhcp6-client.h"
-#include "network-internal.h"
#include "networkd.h"
static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link);
diff --git a/src/grp-network/libnetworkd-core/networkd-fdb.c b/src/grp-network/libnetworkd-core/networkd-fdb.c
index 241f486211..5f6146d52c 100644
--- a/src/grp-network/libnetworkd-core/networkd-fdb.c
+++ b/src/grp-network/libnetworkd-core/networkd-fdb.c
@@ -20,12 +20,13 @@
#include <net/ethernet.h>
#include <net/if.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
+#include "basic/alloc-util.h"
+#include "basic/util.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/conf-parser.h"
+
#include "networkd-fdb.h"
#include "networkd.h"
-#include "util.h"
/* create a new FDB entry or get an existing one. */
int fdb_entry_new_static(Network *const network,
diff --git a/src/grp-network/libnetworkd-core/networkd-fdb.h b/src/grp-network/libnetworkd-core/networkd-fdb.h
index 84410714f5..c04a2b0d37 100644
--- a/src/grp-network/libnetworkd-core/networkd-fdb.h
+++ b/src/grp-network/libnetworkd-core/networkd-fdb.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
-#include "macro.h"
+#include "basic/list.h"
+#include "basic/macro.h"
typedef struct Network Network;
typedef struct FdbEntry FdbEntry;
diff --git a/src/grp-network/libnetworkd-core/networkd-ipv4ll.c b/src/grp-network/libnetworkd-core/networkd-ipv4ll.c
index ae323d595b..735cbc624d 100644
--- a/src/grp-network/libnetworkd-core/networkd-ipv4ll.c
+++ b/src/grp-network/libnetworkd-core/networkd-ipv4ll.c
@@ -18,9 +18,11 @@
***/
#include <netinet/ether.h>
+
#include <linux/if.h>
-#include "network-internal.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd.h"
static int ipv4ll_address_lost(Link *link) {
diff --git a/src/grp-network/libnetworkd-core/networkd-link-bus.c b/src/grp-network/libnetworkd-core/networkd-link-bus.c
index 532557ed6c..aa352f447a 100644
--- a/src/grp-network/libnetworkd-core/networkd-link-bus.c
+++ b/src/grp-network/libnetworkd-core/networkd-link-bus.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/parse-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "networkd-link.h"
#include "networkd.h"
-#include "parse-util.h"
-#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_administrative_state, link_state, LinkState);
diff --git a/src/grp-network/libnetworkd-core/networkd-link.c b/src/grp-network/libnetworkd-core/networkd-link.c
index a021fc886f..72f6b5057e 100644
--- a/src/grp-network/libnetworkd-core/networkd-link.c
+++ b/src/grp-network/libnetworkd-core/networkd-link.c
@@ -18,25 +18,27 @@
***/
#include <netinet/ether.h>
-#include <linux/if.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "dhcp-lease-internal.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "networkd.h"
+#include <linux/if.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/set.h"
+#include "basic/socket-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/bus-util.h"
+#include "shared/udev-util.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd-lldp-tx.h"
-#include "set.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "udev-util.h"
-#include "util.h"
-#include "virt.h"
+#include "networkd.h"
static bool link_dhcp6_enabled(Link *link) {
assert(link);
diff --git a/src/grp-network/libnetworkd-core/networkd-link.h b/src/grp-network/libnetworkd-core/networkd-link.h
index 90cb9b93f6..ac10bd41b7 100644
--- a/src/grp-network/libnetworkd-core/networkd-link.h
+++ b/src/grp-network/libnetworkd-core/networkd-link.h
@@ -22,16 +22,16 @@
#include <endian.h>
#include <systemd/sd-bus.h>
-#include <systemd/sd-dhcp-client.h>
-#include <systemd/sd-dhcp-server.h>
-#include <systemd/sd-dhcp6-client.h>
-#include <systemd/sd-ipv4ll.h>
-#include <systemd/sd-lldp.h>
-#include <systemd/sd-ndisc.h>
-#include <systemd/sd-netlink.h>
-
-#include "list.h"
-#include "set.h"
+
+#include "basic/list.h"
+#include "basic/set.h"
+#include "sd-netlink/sd-netlink.h"
+#include "systemd-network/sd-dhcp-client.h"
+#include "systemd-network/sd-dhcp-server.h"
+#include "systemd-network/sd-dhcp6-client.h"
+#include "systemd-network/sd-ipv4ll.h"
+#include "systemd-network/sd-lldp.h"
+#include "systemd-network/sd-ndisc.h"
typedef enum LinkState {
LINK_STATE_PENDING,
diff --git a/src/grp-network/libnetworkd-core/networkd-lldp-tx.c b/src/grp-network/libnetworkd-core/networkd-lldp-tx.c
index 3aa768388b..6a015ec24f 100644
--- a/src/grp-network/libnetworkd-core/networkd-lldp-tx.c
+++ b/src/grp-network/libnetworkd-core/networkd-lldp-tx.c
@@ -21,17 +21,18 @@
#include <inttypes.h>
#include <string.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/parse-util.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/unaligned.h"
+
#include "networkd-lldp-tx.h"
#include "networkd.h"
-#include "parse-util.h"
-#include "random-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "unaligned.h"
/* The LLDP spec calls this "txFastInit", see 9.2.5.19 */
#define LLDP_TX_FAST_INIT 4U
diff --git a/src/grp-network/libnetworkd-core/networkd-manager-bus.c b/src/grp-network/libnetworkd-core/networkd-manager-bus.c
index 0c429b9471..53652953fe 100644
--- a/src/grp-network/libnetworkd-core/networkd-manager-bus.c
+++ b/src/grp-network/libnetworkd-core/networkd-manager-bus.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "shared/bus-util.h"
+
#include "networkd.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState);
diff --git a/src/grp-network/libnetworkd-core/networkd-manager.c b/src/grp-network/libnetworkd-core/networkd-manager.c
index 7af7abaa81..1bf22edcb7 100644
--- a/src/grp-network/libnetworkd-core/networkd-manager.c
+++ b/src/grp-network/libnetworkd-core/networkd-manager.c
@@ -18,27 +18,29 @@
***/
#include <sys/socket.h>
+
#include <linux/if.h>
#include <systemd/sd-daemon.h>
-#include <systemd/sd-netlink.h>
-
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio.h"
+
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/ordered-set.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/virt.h"
#include "libudev-private.h"
-#include "local-addresses.h"
-#include "netlink-util.h"
+#include "sd-netlink/local-addresses.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "shared/bus-util.h"
+#include "shared/conf-parser.h"
+#include "shared/dns-domain.h"
+#include "shared/udev-util.h"
+
#include "networkd.h"
-#include "ordered-set.h"
-#include "path-util.h"
-#include "set.h"
-#include "udev-util.h"
-#include "virt.h"
/* use 8 MB for receive socket kernel queue. */
#define RCVBUF_SIZE (8*1024*1024)
diff --git a/src/grp-network/libnetworkd-core/networkd-ndisc.c b/src/grp-network/libnetworkd-core/networkd-ndisc.c
index f3a4fc0fa5..c454be7ba3 100644
--- a/src/grp-network/libnetworkd-core/networkd-ndisc.c
+++ b/src/grp-network/libnetworkd-core/networkd-ndisc.c
@@ -20,9 +20,10 @@
#include <netinet/ether.h>
#include <netinet/icmp6.h>
#include <netinet/in.h>
+
#include <linux/if.h>
-#include <systemd/sd-ndisc.h>
+#include "systemd-network/sd-ndisc.h"
#include "networkd.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-bond.c b/src/grp-network/libnetworkd-core/networkd-netdev-bond.c
index 7005b165d9..7e7b8f8804 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-bond.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-bond.c
@@ -19,17 +19,18 @@
***/
#include <netinet/ether.h>
+
#include <linux/if_bonding.h>
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/missing.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "shared/conf-parser.h"
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "extract-word.h"
-#include "missing.h"
#include "networkd-netdev-bond.h"
-#include "string-table.h"
-#include "string-util.h"
/*
* Number of seconds between instances where the bonding
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-bond.h b/src/grp-network/libnetworkd-core/networkd-netdev-bond.h
index b941edb344..0ffb91b12e 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-bond.h
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-bond.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "in-addr-util.h"
-#include "list.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
#include "networkd-netdev.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-bridge.c b/src/grp-network/libnetworkd-core/networkd-netdev-bridge.c
index 4cfd00413f..54ef059df0 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-bridge.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-bridge.c
@@ -20,10 +20,11 @@
#include <net/if.h>
-#include "missing.h"
-#include "netlink-util.h"
-#include "networkd.h"
+#include "basic/missing.h"
+#include "sd-netlink/netlink-util.h"
+
#include "networkd-netdev-bridge.h"
+#include "networkd.h"
/* callback for brige netdev's parameter set */
static int netdev_bridge_set_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.c b/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.c
index af4177e43a..724fc86f92 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.c
@@ -19,9 +19,10 @@
#include <net/if.h>
-#include "conf-parser.h"
+#include "basic/string-table.h"
+#include "shared/conf-parser.h"
+
#include "networkd-netdev-ipvlan.h"
-#include "string-table.h"
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {
[NETDEV_IPVLAN_MODE_L2] = "L2",
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.h b/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.h
index 10d4079844..a7ccd4922a 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.h
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-ipvlan.h
@@ -19,7 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "missing.h"
+#include "basic/missing.h"
+
#include "networkd-netdev.h"
typedef enum IPVlanMode {
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-macvlan.c b/src/grp-network/libnetworkd-core/networkd-netdev-macvlan.c
index 48e98aa51b..bf559f1b46 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-macvlan.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-macvlan.c
@@ -19,9 +19,10 @@
#include <net/if.h>
-#include "conf-parser.h"
+#include "basic/string-table.h"
+#include "shared/conf-parser.h"
+
#include "networkd-netdev-macvlan.h"
-#include "string-table.h"
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
[NETDEV_MACVLAN_MODE_PRIVATE] = "private",
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c
index 26a9a972f1..c372dd7860 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c
@@ -19,20 +19,21 @@
#include <arpa/inet.h>
#include <net/if.h>
+
#include <linux/ip.h>
#include <linux/if_tunnel.h>
#include <linux/ip6_tunnel.h>
-#include <systemd/sd-netlink.h>
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "shared/conf-parser.h"
-#include "conf-parser.h"
-#include "missing.h"
#include "networkd-link.h"
#include "networkd-netdev-tunnel.h"
-#include "parse-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
#define DEFAULT_TNL_HOP_LIMIT 64
#define IP6_FLOWINFO_FLOWLABEL htonl(0x000FFFFF)
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.h b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.h
index 7d31e7b687..6b65431e7e 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.h
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "in-addr-util.h"
+#include "basic/in-addr-util.h"
#include "networkd-netdev.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-tuntap.c b/src/grp-network/libnetworkd-core/networkd-netdev-tuntap.c
index 088a4d8d32..ab5b90fcc9 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-tuntap.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-tuntap.c
@@ -18,17 +18,19 @@
***/
#include <fcntl.h>
-#include <linux/if_tun.h>
#include <net/if.h>
#include <netinet/if_ether.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include "alloc-util.h"
-#include "fd-util.h"
+#include <linux/if_tun.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/user-util.h"
+
#include "networkd-netdev-tuntap.h"
-#include "user-util.h"
#define TUN_DEV "/dev/net/tun"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-veth.c b/src/grp-network/libnetworkd-core/networkd-netdev-veth.c
index 185b441c5a..fb068c75bf 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-veth.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-veth.c
@@ -18,9 +18,10 @@
***/
#include <net/if.h>
+
#include <linux/veth.h>
-#include <systemd/sd-netlink.h>
+#include "sd-netlink/sd-netlink.h"
#include "networkd-netdev-veth.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.c b/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.c
index 363a6bdde6..8c611ac5db 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.c
@@ -19,13 +19,12 @@
#include <net/if.h>
-#include <systemd/sd-netlink.h>
-
-#include "conf-parser.h"
-#include "alloc-util.h"
-#include "extract-word.h"
-#include "parse-util.h"
-#include "missing.h"
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "shared/conf-parser.h"
#include "networkd-link.h"
#include "networkd-netdev-vxlan.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.h b/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.h
index 4614c66fd1..7950c867e3 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.h
+++ b/src/grp-network/libnetworkd-core/networkd-netdev-vxlan.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/in-addr-util.h"
+
typedef struct VxLan VxLan;
-#include "in-addr-util.h"
#include "networkd-netdev.h"
#define VXLAN_VID_MAX (1u << 24) - 1
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev.c b/src/grp-network/libnetworkd-core/networkd-netdev.c
index 851a36290c..c421042196 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev.c
+++ b/src/grp-network/libnetworkd-core/networkd-netdev.c
@@ -19,19 +19,20 @@
#include <net/if.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
-#include "fd-util.h"
-#include "list.h"
-#include "netlink-util.h"
-#include "network-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fd-util.h"
+#include "basic/list.h"
+#include "basic/siphash24.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd-netdev.h"
#include "networkd.h"
-#include "siphash24.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
diff --git a/src/grp-network/libnetworkd-core/networkd-netdev.h b/src/grp-network/libnetworkd-core/networkd-netdev.h
index ab3f068167..43311852b2 100644
--- a/src/grp-network/libnetworkd-core/networkd-netdev.h
+++ b/src/grp-network/libnetworkd-core/networkd-netdev.h
@@ -19,10 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-netlink.h>
-
-#include "list.h"
-#include "time-util.h"
+#include "basic/list.h"
+#include "basic/time-util.h"
+#include "sd-netlink/sd-netlink.h"
typedef struct netdev_join_callback netdev_join_callback;
typedef struct Link Link;
diff --git a/src/grp-network/libnetworkd-core/networkd-network-bus.c b/src/grp-network/libnetworkd-core/networkd-network-bus.c
index d6b7448a43..572c0913a9 100644
--- a/src/grp-network/libnetworkd-core/networkd-network-bus.c
+++ b/src/grp-network/libnetworkd-core/networkd-network-bus.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+
#include "networkd.h"
-#include "string-util.h"
-#include "strv.h"
static int property_get_ether_addrs(
sd_bus *bus,
diff --git a/src/grp-network/libnetworkd-core/networkd-network.c b/src/grp-network/libnetworkd-core/networkd-network.c
index dd89b3770c..2895fd4bd9 100644
--- a/src/grp-network/libnetworkd-core/networkd-network.c
+++ b/src/grp-network/libnetworkd-core/networkd-network.c
@@ -20,21 +20,22 @@
#include <ctype.h>
#include <net/if.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "network-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
+#include "shared/dns-domain.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd-network.h"
#include "networkd.h"
-#include "parse-util.h"
-#include "set.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
static int network_load_one(Manager *manager, const char *filename) {
_cleanup_network_free_ Network *network = NULL;
diff --git a/src/grp-network/libnetworkd-core/networkd-network.h b/src/grp-network/libnetworkd-core/networkd-network.h
index 177bc11ec4..fdf76b8924 100644
--- a/src/grp-network/libnetworkd-core/networkd-network.h
+++ b/src/grp-network/libnetworkd-core/networkd-network.h
@@ -20,12 +20,12 @@
***/
#include <systemd/sd-bus.h>
-#include "udev.h"
-#include "condition.h"
-#include "dhcp-identifier.h"
-#include "hashmap.h"
-#include "resolve-util.h"
+#include "basic/hashmap.h"
+#include "shared/condition.h"
+#include "shared/resolve-util.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "udev.h"
#include "networkd-address.h"
#include "networkd-fdb.h"
diff --git a/src/grp-network/libnetworkd-core/networkd-route.c b/src/grp-network/libnetworkd-core/networkd-route.c
index f001de772a..974a7fa847 100644
--- a/src/grp-network/libnetworkd-core/networkd-route.c
+++ b/src/grp-network/libnetworkd-core/networkd-route.c
@@ -17,16 +17,17 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "in-addr-util.h"
-#include "netlink-util.h"
+#include "basic/alloc-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/conf-parser.h"
+
#include "networkd-route.h"
#include "networkd.h"
-#include "parse-util.h"
-#include "set.h"
-#include "string-util.h"
-#include "util.h"
int route_new(Route **ret) {
_cleanup_route_free_ Route *route = NULL;
diff --git a/src/grp-network/libnetworkd-core/networkd-util.c b/src/grp-network/libnetworkd-core/networkd-util.c
index 555a7c68a1..e5a5bce8cb 100644
--- a/src/grp-network/libnetworkd-core/networkd-util.c
+++ b/src/grp-network/libnetworkd-core/networkd-util.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "conf-parser.h"
+#include "basic/parse-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
+
#include "networkd-util.h"
-#include "parse-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
const char *address_family_boolean_to_string(AddressFamilyBoolean b) {
if (b == ADDRESS_FAMILY_YES ||
diff --git a/src/grp-network/libnetworkd-core/networkd-util.h b/src/grp-network/libnetworkd-core/networkd-util.h
index d5c385bea4..d023782285 100644
--- a/src/grp-network/libnetworkd-core/networkd-util.h
+++ b/src/grp-network/libnetworkd-core/networkd-util.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
typedef enum AddressFamilyBoolean {
/* This is a bitmask, though it usually doesn't feel that way! */
diff --git a/src/grp-network/libnetworkd-core/networkd.h b/src/grp-network/libnetworkd-core/networkd.h
index b61e03920e..cfee5dd045 100644
--- a/src/grp-network/libnetworkd-core/networkd.h
+++ b/src/grp-network/libnetworkd-core/networkd.h
@@ -23,12 +23,12 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-netlink.h>
-#include "udev.h"
-#include "dhcp-identifier.h"
-#include "hashmap.h"
-#include "list.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "sd-netlink/sd-netlink.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "udev.h"
#include "networkd-address-pool.h"
#include "networkd-link.h"
diff --git a/src/grp-network/networkctl/Makefile b/src/grp-network/networkctl/Makefile
new file mode 100644
index 0000000000..f92d402f78
--- /dev/null
+++ b/src/grp-network/networkctl/Makefile
@@ -0,0 +1,39 @@
+# -*- 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
+
+rootbin_PROGRAMS += \
+ networkctl
+
+networkctl_SOURCES = \
+ src/network/networkctl.c
+
+networkctl_LDADD = \
+ libshared.la \
+ libsystemd-network.la
+
+dist_bashcompletion_data += \
+ shell-completion/bash/networkctl
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/networkctl/networkctl.c b/src/grp-network/networkctl/networkctl.c
index 85635b59bc..bedcca9a0e 100644
--- a/src/grp-network/networkctl/networkctl.c
+++ b/src/grp-network/networkctl/networkctl.c
@@ -21,33 +21,32 @@
#include <net/if.h>
#include <stdbool.h>
-#include <systemd/sd-device.h>
-#include <systemd/sd-hwdb.h>
-#include <systemd/sd-lldp.h>
-#include <systemd/sd-netlink.h>
-#include <systemd/sd-network.h>
-
-#include "alloc-util.h"
-#include "arphrd-list.h"
-#include "device-util.h"
-#include "ether-addr-util.h"
-#include "fd-util.h"
-#include "hwdb-util.h"
-#include "local-addresses.h"
-#include "locale-util.h"
-#include "netlink-util.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "socket-util.h"
-#include "sparse-endian.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "strxcpyx.h"
-#include "terminal-util.h"
-#include "util.h"
-#include "verbs.h"
+#include "basic/alloc-util.h"
+#include "basic/arphrd-list.h"
+#include "basic/ether-addr-util.h"
+#include "basic/fd-util.h"
+#include "basic/locale-util.h"
+#include "basic/parse-util.h"
+#include "basic/socket-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/strxcpyx.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "basic/verbs.h"
+#include "sd-device/device-util.h"
+#include "sd-device/sd-device.h"
+#include "sd-hwdb/hwdb-util.h"
+#include "sd-hwdb/sd-hwdb.h"
+#include "sd-netlink/local-addresses.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "sd-network/sd-network.h"
+#include "shared/pager.h"
+#include "systemd-network/sd-lldp.h"
static bool arg_no_pager = false;
static bool arg_legend = true;
diff --git a/src/grp-network/systemd-networkd-wait-online/Makefile b/src/grp-network/systemd-networkd-wait-online/Makefile
new file mode 100644
index 0000000000..12aa13c48f
--- /dev/null
+++ b/src/grp-network/systemd-networkd-wait-online/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
+
+rootlibexec_PROGRAMS += \
+ systemd-networkd-wait-online
+
+systemd_networkd_wait_online_CFLAGS = \
+ $(AM_CFLAGS)
+
+systemd_networkd_wait_online_SOURCES = \
+ src/libsystemd-network/network-internal.h \
+ src/network/networkd-wait-online.h \
+ src/network/networkd-wait-online-link.h \
+ src/network/networkd-wait-online.c \
+ src/network/networkd-wait-online-manager.c \
+ src/network/networkd-wait-online-link.c
+
+systemd_networkd_wait_online_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-link.c b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-link.c
index 971545296f..29384baca3 100644
--- a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-link.c
+++ b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-link.c
@@ -18,11 +18,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-network.h>
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "sd-network/sd-network.h"
-#include "alloc-util.h"
#include "networkd-wait-online-link.h"
-#include "string-util.h"
int link_new(Manager *m, Link **ret, int ifindex, const char *ifname) {
_cleanup_(link_freep) Link *l = NULL;
diff --git a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-manager.c b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-manager.c
index 2ff7ddb044..9ec0550d44 100644
--- a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-manager.c
+++ b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online-manager.c
@@ -17,17 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <fnmatch.h>
#include <netinet/ether.h>
+
#include <linux/if.h>
-#include <fnmatch.h>
-#include "alloc-util.h"
-#include "netlink-util.h"
-#include "network-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
+#include "sd-netlink/netlink-util.h"
+#include "systemd-network/network-internal.h"
+
#include "networkd-wait-online-link.h"
#include "networkd-wait-online.h"
-#include "time-util.h"
-#include "util.h"
bool manager_ignore_link(Manager *m, Link *link) {
char **ignore;
diff --git a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.c b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.c
index a08272463e..feea7c9f34 100644
--- a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.c
+++ b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.c
@@ -22,9 +22,10 @@
#include <systemd/sd-daemon.h>
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+
#include "networkd-wait-online.h"
-#include "signal-util.h"
-#include "strv.h"
static bool arg_quiet = false;
static usec_t arg_timeout = 120 * USEC_PER_SEC;
diff --git a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.h b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.h
index 7ac7f4018a..b0d70a18d0 100644
--- a/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.h
+++ b/src/grp-network/systemd-networkd-wait-online/networkd-wait-online.h
@@ -20,10 +20,10 @@
***/
#include <systemd/sd-event.h>
-#include <systemd/sd-netlink.h>
-#include <systemd/sd-network.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
+#include "sd-netlink/sd-netlink.h"
+#include "sd-network/sd-network.h"
typedef struct Manager Manager;
diff --git a/src/grp-network/systemd-networkd/Makefile b/src/grp-network/systemd-networkd/Makefile
new file mode 100644
index 0000000000..8b7e44062b
--- /dev/null
+++ b/src/grp-network/systemd-networkd/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
+
+rootlibexec_PROGRAMS += \
+ systemd-networkd
+
+systemd_networkd_SOURCES = \
+ src/network/networkd.c
+
+systemd_networkd_LDADD = \
+ libnetworkd-core.la
+
+ifneq ($(HAVE_LIBIPTC),)
+systemd_networkd_LDADD += \
+ libfirewall.la
+endif # HAVE_LIBIPTC
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-network/systemd-networkd/networkd.c b/src/grp-network/systemd-networkd/networkd.c
index 9f5c75ac3d..4f79dfd409 100644
--- a/src/grp-network/systemd-networkd/networkd.c
+++ b/src/grp-network/systemd-networkd/networkd.c
@@ -19,11 +19,11 @@
#include <systemd/sd-daemon.h>
-#include "capability-util.h"
-#include "networkd.h"
+#include "basic/capability-util.h"
+#include "basic/signal-util.h"
+#include "basic/user-util.h"
#include "networkd-conf.h"
-#include "signal-util.h"
-#include "user-util.h"
+#include "networkd.h"
int main(int argc, char *argv[]) {
_cleanup_manager_free_ Manager *m = NULL;
diff --git a/src/grp-network/test-network-tables.c b/src/grp-network/test-network-tables.c
index adbe09a5e1..366471e8bd 100644
--- a/src/grp-network/test-network-tables.c
+++ b/src/grp-network/test-network-tables.c
@@ -1,11 +1,11 @@
-#include "dhcp6-internal.h"
-#include "dhcp6-protocol.h"
#include "ethtool-util.h"
-#include "netlink-internal.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-macvlan.h"
#include "networkd.h"
-#include "test-tables.h"
+#include "sd-netlink/netlink-internal.h"
+#include "shared/test-tables.h"
+#include "systemd-network/dhcp6-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
int main(int argc, char **argv) {
test_table(bond_mode, NETDEV_BOND_MODE);
diff --git a/src/grp-network/test-network.c b/src/grp-network/test-network.c
index 855646173f..a6af304d03 100644
--- a/src/grp-network/test-network.c
+++ b/src/grp-network/test-network.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dhcp-lease-internal.h"
-#include "network-internal.h"
+#include "basic/alloc-util.h"
#include "networkd.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/network-internal.h"
static void test_deserialize_in_addr(void) {
_cleanup_free_ struct in_addr *addresses = NULL;
diff --git a/src/grp-network/test-networkd-conf.c b/src/grp-network/test-networkd-conf.c
index 0e1a18457d..d6a24281bb 100644
--- a/src/grp-network/test-networkd-conf.c
+++ b/src/grp-network/test-networkd-conf.c
@@ -17,15 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hexdecoct.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "ether-addr-util.h"
-
+#include "basic/ether-addr-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
#include "networkd-conf.h"
#include "networkd-network.h"
-#include "network-internal.h"
+#include "systemd-network/network-internal.h"
static void test_config_parse_duid_type_one(const char *rvalue, int ret, DUIDType expected) {
DUIDType actual = 0;
diff --git a/src/grp-resolve/Makefile b/src/grp-resolve/Makefile
new file mode 100644
index 0000000000..ae0c5a2466
--- /dev/null
+++ b/src/grp-resolve/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += systemd-resolved nss-resolve
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/libbasic-dns/dns-type.c b/src/grp-resolve/libbasic-dns/dns-type.c
index 78d9d5733f..6d5b9d616f 100644
--- a/src/grp-resolve/libbasic-dns/dns-type.c
+++ b/src/grp-resolve/libbasic-dns/dns-type.c
@@ -19,9 +19,10 @@
#include <sys/socket.h>
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+
#include "dns-type.h"
-#include "parse-util.h"
-#include "string-util.h"
typedef const struct {
uint16_t type;
diff --git a/src/grp-resolve/libbasic-dns/dns-type.h b/src/grp-resolve/libbasic-dns/dns-type.h
index 7b79d29d7e..a8ee105e16 100644
--- a/src/grp-resolve/libbasic-dns/dns-type.h
+++ b/src/grp-resolve/libbasic-dns/dns-type.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
/* DNS record types, taken from
* http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-answer.c b/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
index 0dadf8b1dd..1ade0507db 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
-#include "string-util.h"
DnsAnswer *dns_answer_new(unsigned n) {
DnsAnswer *a;
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-answer.h b/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
index 0679c610f5..92557a410a 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/macro.h"
+
typedef struct DnsAnswer DnsAnswer;
typedef struct DnsAnswerItem DnsAnswerItem;
-#include "macro.h"
#include "resolved-dns-rr.h"
/* A simple array of resource records. We keep track of the
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
index 77bd4d71bf..b73cc24100 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
@@ -19,10 +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 "dns-domain.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-packet.c b/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
index b7907bb511..37c0244b7e 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/string-table.h"
+#include "basic/strv.h"
+#include "basic/unaligned.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-packet.h"
-#include "string-table.h"
-#include "strv.h"
-#include "unaligned.h"
-#include "utf8.h"
-#include "util.h"
#define EDNS0_OPT_DO (1<<15)
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-packet.h b/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
index 416335d0a2..2e0eba83b6 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
@@ -22,13 +22,13 @@
#include <netinet/ip.h>
#include <netinet/udp.h>
-#include "hashmap.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/hashmap.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
-typedef struct DnsPacketHeader DnsPacketHeader;
typedef struct DnsPacket DnsPacket;
+typedef struct DnsPacketHeader DnsPacketHeader;
#include "resolved-def.h"
#include "resolved-dns-answer.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-question.c b/src/grp-resolve/libbasic-dns/resolved-dns-question.c
index c8b502d1cd..ee53dbff9d 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-question.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-question.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+
#include "dns-type.h"
#include "resolved-dns-question.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-question.h b/src/grp-resolve/libbasic-dns/resolved-dns-question.h
index ea41478975..320bf53488 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-question.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-question.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/macro.h"
+
typedef struct DnsQuestion DnsQuestion;
-#include "macro.h"
#include "resolved-dns-rr.h"
/* A simple array of resource keys */
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-rr.c b/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
index 6a29a93a26..c6a60b65b7 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
@@ -19,18 +19,19 @@
#include <math.h>
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "shared/dns-domain.h"
+
#include "dns-type.h"
-#include "escape.h"
-#include "hexdecoct.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
DnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
DnsResourceKey *k;
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-rr.h b/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
index 020a2abd77..daf9c8c210 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
@@ -21,12 +21,13 @@
#include <netinet/in.h>
-#include "bitmap.h"
+#include "basic/bitmap.h"
+#include "basic/hashmap.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "basic/string-util.h"
+
#include "dns-type.h"
-#include "hashmap.h"
-#include "in-addr-util.h"
-#include "list.h"
-#include "string-util.h"
typedef struct DnsResourceKey DnsResourceKey;
typedef struct DnsResourceRecord DnsResourceRecord;
diff --git a/src/grp-resolve/libbasic-dns/test-dns-packet.c b/src/grp-resolve/libbasic-dns/test-dns-packet.c
index c232a69ce1..18d04b930d 100644
--- a/src/grp-resolve/libbasic-dns/test-dns-packet.c
+++ b/src/grp-resolve/libbasic-dns/test-dns-packet.c
@@ -17,18 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/if.h>
#include <glob.h>
+#include <net/if.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/glob-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
-#include "alloc-util.h"
-#include "fileio.h"
-#include "glob-util.h"
-#include "log.h"
-#include "macro.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
-#include "string-util.h"
-#include "strv.h"
#define HASH_KEY SD_ID128_MAKE(d3,1e,48,90,4b,fa,4c,fe,af,9d,d5,a1,d7,2e,8a,b1)
diff --git a/src/grp-resolve/libbasic-dns/test-dnssec-complex.c b/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
index 568400ac77..ef78cd1ea5 100644
--- a/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
+++ b/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
@@ -21,13 +21,14 @@
#include <systemd/sd-bus.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-common-errors.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "sd-bus/bus-common-errors.h"
+
#include "dns-type.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "time-util.h"
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
diff --git a/src/grp-resolve/libbasic-dns/test-dnssec.c b/src/grp-resolve/libbasic-dns/test-dnssec.c
index b3018e8239..1f05196d8e 100644
--- a/src/grp-resolve/libbasic-dns/test-dnssec.c
+++ b/src/grp-resolve/libbasic-dns/test-dnssec.c
@@ -21,11 +21,12 @@
#include <netinet/in.h>
#include <sys/socket.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-util.h"
+
#include "resolved-dns-dnssec.h"
#include "resolved-dns-rr.h"
-#include "string-util.h"
-#include "hexdecoct.h"
static void test_dnssec_canonicalize_one(const char *original, const char *canonical, int r) {
char canonicalized[DNSSEC_CANONICAL_HOSTNAME_MAX];
diff --git a/src/grp-resolve/libbasic-dns/test-resolve-tables.c b/src/grp-resolve/libbasic-dns/test-resolve-tables.c
index 2d615130e1..0eaab70687 100644
--- a/src/grp-resolve/libbasic-dns/test-resolve-tables.c
+++ b/src/grp-resolve/libbasic-dns/test-resolve-tables.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "shared/test-tables.h"
+
#include "dns-type.h"
-#include "test-tables.h"
int main(int argc, char **argv) {
uint16_t i;
diff --git a/src/grp-resolve/nss-resolve/Makefile b/src/grp-resolve/nss-resolve/Makefile
new file mode 100644
index 0000000000..acfbe831ae
--- /dev/null
+++ b/src/grp-resolve/nss-resolve/Makefile
@@ -0,0 +1,46 @@
+# -*- 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
+
+libnss_resolve_la_SOURCES = \
+ src/nss-resolve/nss-resolve.sym \
+ src/nss-resolve/nss-resolve.c
+
+libnss_resolve_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -module \
+ -export-dynamic \
+ -avoid-version \
+ -shared \
+ -shrext .so.2 \
+ -Wl,--version-script=$(srcdir)/nss-resolve.sym
+
+libnss_resolve_la_LIBADD = \
+ libsystemd-internal.la \
+ -ldl
+
+lib_LTLIBRARIES += \
+ libnss_resolve.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/nss-resolve/nss-resolve.c b/src/grp-resolve/nss-resolve/nss-resolve.c
index 4c2101d856..e316803a58 100644
--- a/src/grp-resolve/nss-resolve/nss-resolve.c
+++ b/src/grp-resolve/nss-resolve/nss-resolve.c
@@ -26,13 +26,13 @@
#include <systemd/sd-bus.h>
-#include "bus-common-errors.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "nss-util.h"
-#include "string-util.h"
-#include "util.h"
-#include "signal-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/nss-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
diff --git a/src/grp-resolve/systemd-resolve/resolve-tool.c b/src/grp-resolve/systemd-resolve/resolve-tool.c
index fbf7b0e4f6..dee23289b3 100644
--- a/src/grp-resolve/systemd-resolve/resolve-tool.c
+++ b/src/grp-resolve/systemd-resolve/resolve-tool.c
@@ -22,17 +22,17 @@
#include <systemd/sd-bus.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "escape.h"
-#include "in-addr-util.h"
-#include "gcrypt-util.h"
-#include "parse-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#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 "terminal-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/gcrypt-util.h"
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile
new file mode 100644
index 0000000000..e18b1b3d90
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/Makefile
@@ -0,0 +1,227 @@
+# -*- 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: 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
+
+systemd_resolved_SOURCES = \
+ src/resolve/resolved.c \
+ src/resolve/resolved-manager.c \
+ src/resolve/resolved-manager.h \
+ src/resolve/resolved-conf.c \
+ src/resolve/resolved-conf.h \
+ src/resolve/resolved-resolv-conf.c \
+ src/resolve/resolved-resolv-conf.h \
+ src/resolve/resolved-bus.c \
+ src/resolve/resolved-bus.h \
+ src/resolve/resolved-link.h \
+ src/resolve/resolved-link.c \
+ src/resolve/resolved-link-bus.c \
+ src/resolve/resolved-link-bus.h \
+ src/resolve/resolved-llmnr.h \
+ src/resolve/resolved-llmnr.c \
+ src/resolve/resolved-mdns.h \
+ src/resolve/resolved-mdns.c \
+ src/resolve/resolved-def.h \
+ $(basic_dns_sources) \
+ src/resolve/resolved-dns-query.h \
+ src/resolve/resolved-dns-query.c \
+ src/resolve/resolved-dns-synthesize.h \
+ src/resolve/resolved-dns-synthesize.c \
+ src/resolve/resolved-dns-transaction.h \
+ src/resolve/resolved-dns-transaction.c \
+ src/resolve/resolved-dns-scope.h \
+ src/resolve/resolved-dns-scope.c \
+ src/resolve/resolved-dns-server.h \
+ src/resolve/resolved-dns-server.c \
+ src/resolve/resolved-dns-search-domain.h \
+ src/resolve/resolved-dns-search-domain.c \
+ src/resolve/resolved-dns-cache.h \
+ src/resolve/resolved-dns-cache.c \
+ src/resolve/resolved-dns-zone.h \
+ src/resolve/resolved-dns-zone.c \
+ src/resolve/resolved-dns-stream.h \
+ src/resolve/resolved-dns-stream.c \
+ src/resolve/resolved-dns-trust-anchor.h \
+ src/resolve/resolved-dns-trust-anchor.c \
+ src/resolve/resolved-etc-hosts.h \
+ src/resolve/resolved-etc-hosts.c \
+ src/shared/gcrypt-util.c \
+ src/shared/gcrypt-util.h
+
+nodist_systemd_resolved_SOURCES = \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h \
+ src/resolve/resolved-gperf.c
+
+systemd_resolved_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-resolved
+
+nodist_systemunit_DATA += \
+ units/systemd-resolved.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.resolve1.busname
+
+dist_dbuspolicy_DATA += \
+ src/resolve/org.freedesktop.resolve1.conf
+
+dist_dbussystemservice_DATA += \
+ src/resolve/org.freedesktop.resolve1.service
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-resolved.service dbus-org.freedesktop.resolve1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.resolve1.busname
+
+GENERAL_ALIASES += \
+ $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
+
+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
+
+gperf_gperf_sources += \
+ src/resolve/resolved-gperf.gperf
+
+EXTRA_DIST += \
+ units/systemd-resolved.service.m4.in \
+ src/resolve/resolved.conf.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/resolved-bus.c b/src/grp-resolve/systemd-resolved/resolved-bus.c
index 33f7c61557..1454e1f5f4 100644
--- a/src/grp-resolve/systemd-resolved/resolved-bus.c
+++ b/src/grp-resolve/systemd-resolved/resolved-bus.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
-#include "dns-domain.h"
-#include "resolved-bus.h"
+#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-dns-synthesize.h"
#include "resolved-link-bus.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-conf.c b/src/grp-resolve/systemd-resolved/resolved-conf.c
index 990dc03b60..4dc169094b 100644
--- a/src/grp-resolve/systemd-resolved/resolved-conf.c
+++ b/src/grp-resolve/systemd-resolved/resolved-conf.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "extract-word.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/extract-word.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "shared/conf-parser.h"
+
#include "resolved-conf.h"
-#include "string-util.h"
int manager_add_dns_server_by_string(Manager *m, DnsServerType type, const char *word) {
union in_addr_union address;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
index 77c42d7aad..33e0582d98 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
@@ -19,13 +19,14 @@
#include <net/if.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
#include "resolved-dns-answer.h"
-#include "resolved-dns-cache.h"
#include "resolved-dns-packet.h"
-#include "string-util.h"
+#include "shared/dns-domain.h"
+
+#include "resolved-dns-cache.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-cache.h b/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
index 2293718e86..e7cdd2e27a 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
@@ -19,10 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
-#include "list.h"
-#include "prioq.h"
-#include "time-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/prioq.h"
+#include "basic/time-util.h"
typedef struct DnsCache {
Hashmap *by_key;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.c b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
index ea04e58d61..7b9282a69d 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
@@ -17,15 +17,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/string-util.h"
#include "dns-type.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "sd-netlink/local-addresses.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-query.h"
#include "resolved-dns-synthesize.h"
#include "resolved-etc-hosts.h"
-#include "string-util.h"
/* How long to wait for the query in total */
#define QUERY_TIMEOUT_USEC (30 * USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.h b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
index 7f7c76ff20..4a127930bd 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
@@ -22,15 +22,15 @@
#include <systemd/sd-bus.h>
-#include "set.h"
+#include "basic/set.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
-typedef struct DnsQueryCandidate DnsQueryCandidate;
typedef struct DnsQuery DnsQuery;
+typedef struct DnsQueryCandidate DnsQueryCandidate;
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-stream.h"
#include "resolved-dns-search-domain.h"
+#include "resolved-dns-stream.h"
struct DnsQueryCandidate {
DnsQuery *query;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.c b/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
index 66e4585c18..cf878cc783 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
@@ -19,18 +19,19 @@
#include <netinet/tcp.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "missing.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/missing.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#include "basic/strv.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-scope.h"
#include "resolved-llmnr.h"
#include "resolved-mdns.h"
-#include "socket-util.h"
-#include "strv.h"
#define MULTICAST_RATELIMIT_INTERVAL_USEC (1*USEC_PER_SEC)
#define MULTICAST_RATELIMIT_BURST 1000
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
index 291e5817d0..af1d01f694 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
@@ -19,13 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
+#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-zone.h"
#include "resolved-link.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
index 732471027b..7798c498a0 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-search-domain.h"
int dns_search_domain_new(
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
index eaacef4edc..f047941db2 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
typedef struct DnsSearchDomain DnsSearchDomain;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.c b/src/grp-resolve/systemd-resolved/resolved-dns-server.c
index dedc9beb19..be11cfa743 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.c
@@ -19,12 +19,13 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/siphash24.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+
#include "resolved-dns-server.h"
#include "resolved-resolv-conf.h"
-#include "siphash24.h"
-#include "string-table.h"
-#include "string-util.h"
/* After how much time to repeat classic DNS requests */
#define DNS_TIMEOUT_MIN_USEC (500 * USEC_PER_MSEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.h b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
index 9f4a69c37a..2855c97faa 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "in-addr-util.h"
+#include "basic/in-addr-util.h"
typedef struct DnsServer DnsServer;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.c b/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
index a1040aeff4..0c55f6d6c7 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
@@ -19,10 +19,11 @@
#include <netinet/tcp.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "missing.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/missing.h"
+
#include "resolved-dns-stream.h"
#define DNS_STREAM_TIMEOUT_USEC (10 * USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
index 5ccc842249..e610986833 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
@@ -19,11 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "socket-util.h"
+#include "basic/socket-util.h"
+#include "resolved-dns-packet.h"
typedef struct DnsStream DnsStream;
-#include "resolved-dns-packet.h"
#include "resolved-dns-transaction.h"
struct DnsStream {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
index e3003411f7..16e0410f98 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "sd-netlink/local-addresses.h"
+
#include "resolved-dns-synthesize.h"
int dns_synthesize_ifindex(int ifindex) {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
index 5d829bb2e7..2309105068 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
@@ -21,6 +21,7 @@
#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.c b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
index 1b4b2b804b..3a19b12b47 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
@@ -19,16 +19,17 @@
#include <systemd/sd-messages.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "errno-list.h"
-#include "fd-util.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/errno-list.h"
+#include "basic/fd-util.h"
+#include "basic/random-util.h"
+#include "basic/string-table.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-cache.h"
#include "resolved-dns-transaction.h"
#include "resolved-llmnr.h"
-#include "string-table.h"
#define TRANSACTIONS_MAX 4096
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 0972792341..c9f221d425 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
@@ -19,19 +19,20 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "def.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hexdecoct.h"
-#include "parse-util.h"
-#include "resolved-dns-trust-anchor.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hexdecoct.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
#include "resolved-dns-dnssec.h"
-#include "set.h"
-#include "string-util.h"
-#include "strv.h"
+#include "shared/dns-domain.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 635c75fde5..ee5cda0748 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
@@ -19,12 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct DnsTrustAnchor DnsTrustAnchor;
-
-#include "hashmap.h"
+#include "basic/hashmap.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
+typedef struct DnsTrustAnchor DnsTrustAnchor;
+
/* 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 850eed8cb8..3d5bc9ea82 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "list.h"
+#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-zone.h"
-#include "string-util.h"
/* Never allow more than 1K entries */
#define ZONE_MAX 1024
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-zone.h b/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
index 408833c359..baddbc78ec 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
+#include "basic/hashmap.h"
typedef struct DnsZone {
Hashmap *by_key;
diff --git a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
index 40d650949d..2bab6fdc35 100644
--- a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
+++ b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "fd-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
-#include "resolved-etc-hosts.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+
#include "resolved-dns-synthesize.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
+#include "resolved-etc-hosts.h"
/* Recheck /etc/hosts at most once every 2s */
#define ETC_HOSTS_RECHECK_USEC (2*USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
index 9d5a175f18..e68d87417e 100644
--- a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
+++ b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "resolved-manager.h"
-#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
+
+#include "resolved-manager.h"
void manager_etc_hosts_flush(Manager *m);
int manager_etc_hosts_read(Manager *m);
diff --git a/src/grp-resolve/systemd-resolved/resolved-link-bus.c b/src/grp-resolve/systemd-resolved/resolved-link-bus.c
index 7f21891819..122c4dd45d 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link-bus.c
+++ b/src/grp-resolve/systemd-resolved/resolved-link-bus.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "parse-util.h"
-#include "resolve-util.h"
+#include "basic/alloc-util.h"
+#include "basic/parse-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+#include "shared/resolve-util.h"
+
#include "resolved-bus.h"
#include "resolved-link-bus.h"
-#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_resolve_support, resolve_support, ResolveSupport);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_dnssec_mode, dnssec_mode, DnssecMode);
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.c b/src/grp-resolve/systemd-resolved/resolved-link.c
index 4eef20599a..1d23e49172 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.c
+++ b/src/grp-resolve/systemd-resolved/resolved-link.c
@@ -19,14 +19,14 @@
#include <net/if.h>
-#include <systemd/sd-network.h>
+#include "basic/alloc-util.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "sd-network/sd-network.h"
-#include "alloc-util.h"
-#include "missing.h"
-#include "parse-util.h"
#include "resolved-link.h"
-#include "string-util.h"
-#include "strv.h"
int link_new(Manager *m, Link **ret, int ifindex) {
_cleanup_(link_freep) Link *l = NULL;
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.h b/src/grp-resolve/systemd-resolved/resolved-link.h
index f534c12824..53a5f597ef 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.h
+++ b/src/grp-resolve/systemd-resolved/resolved-link.h
@@ -21,14 +21,14 @@
#include <net/if.h>
-#include "in-addr-util.h"
-#include "ratelimit.h"
-#include "resolve-util.h"
+#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-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-manager.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-llmnr.c b/src/grp-resolve/systemd-resolved/resolved-llmnr.c
index 8b1d71a3eb..24b7a4784f 100644
--- a/src/grp-resolve/systemd-resolved/resolved-llmnr.c
+++ b/src/grp-resolve/systemd-resolved/resolved-llmnr.c
@@ -20,7 +20,8 @@
#include <netinet/in.h>
#include <resolv.h>
-#include "fd-util.h"
+#include "basic/fd-util.h"
+
#include "resolved-llmnr.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 7166b94d71..b82c2569bf 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.c
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.c
@@ -21,18 +21,23 @@
#include <poll.h>
#include <sys/ioctl.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "ordered-set.h"
-#include "parse-util.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/ordered-set.h"
+#include "basic/parse-util.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#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"
+
#include "resolved-bus.h"
#include "resolved-conf.h"
#include "resolved-etc-hosts.h"
@@ -40,10 +45,6 @@
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-resolv-conf.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "utf8.h"
#define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.h b/src/grp-resolve/systemd-resolved/resolved-manager.h
index 8bef2d2b28..dd2a534213 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.h
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.h
@@ -20,13 +20,13 @@
***/
#include <systemd/sd-event.h>
-#include <systemd/sd-netlink.h>
-#include <systemd/sd-network.h>
-#include "hashmap.h"
-#include "list.h"
-#include "ordered-set.h"
-#include "resolve-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/ordered-set.h"
+#include "sd-netlink/sd-netlink.h"
+#include "sd-network/sd-network.h"
+#include "shared/resolve-util.h"
typedef struct Manager Manager;
diff --git a/src/grp-resolve/systemd-resolved/resolved-mdns.c b/src/grp-resolve/systemd-resolved/resolved-mdns.c
index b13b1d0144..0c78f7bda5 100644
--- a/src/grp-resolve/systemd-resolved/resolved-mdns.c
+++ b/src/grp-resolve/systemd-resolved/resolved-mdns.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <resolv.h>
-#include <netinet/in.h>
#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <resolv.h>
+
+#include "basic/fd-util.h"
-#include "fd-util.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c b/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
index ff03acc772..c50796de2e 100644
--- a/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
+++ b/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
@@ -19,16 +19,17 @@
#include <resolv.h>
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "fileio.h"
-#include "ordered-set.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/fileio.h"
+#include "basic/ordered-set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/dns-domain.h"
+
#include "resolved-conf.h"
#include "resolved-resolv-conf.h"
-#include "string-util.h"
-#include "strv.h"
int manager_read_resolv_conf(Manager *m) {
_cleanup_fclose_ FILE *f = NULL;
diff --git a/src/grp-resolve/systemd-resolved/resolved.c b/src/grp-resolve/systemd-resolved/resolved.c
index 086a2fcac7..07952227ce 100644
--- a/src/grp-resolve/systemd-resolved/resolved.c
+++ b/src/grp-resolve/systemd-resolved/resolved.c
@@ -20,14 +20,15 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "capability-util.h"
-#include "mkdir.h"
+#include "basic/capability-util.h"
+#include "basic/mkdir.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/user-util.h"
+
#include "resolved-conf.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "user-util.h"
int main(int argc, char *argv[]) {
_cleanup_(manager_freep) Manager *m = NULL;
diff --git a/src/grp-system/Makefile b/src/grp-system/Makefile
new file mode 100644
index 0000000000..ea8b031596
--- /dev/null
+++ b/src/grp-system/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += systemctl systemd
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-analyze/Makefile b/src/grp-system/grp-utils/systemd-analyze/Makefile
new file mode 100644
index 0000000000..9d647e5a52
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-analyze/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
+
+bin_PROGRAMS += systemd-analyze
+systemd_analyze_SOURCES = \
+ src/analyze/analyze.c \
+ src/analyze/analyze-verify.c \
+ src/analyze/analyze-verify.h
+
+systemd_analyze_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(SECCOMP_CFLAGS) \
+ $(MOUNT_CFLAGS)
+
+systemd_analyze_LDADD = \
+ libcore.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-analyze/analyze-verify.c b/src/grp-system/grp-utils/systemd-analyze/analyze-verify.c
index 5fd3ee49eb..e27ae4f5c5 100644
--- a/src/grp-system/grp-utils/systemd-analyze/analyze-verify.c
+++ b/src/grp-system/grp-utils/systemd-analyze/analyze-verify.c
@@ -19,16 +19,17 @@
#include <stdlib.h>
-#include "alloc-util.h"
-#include "analyze-verify.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "log.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
#include "manager.h"
-#include "pager.h"
-#include "path-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/pager.h"
+
+#include "analyze-verify.h"
static int prepare_filename(const char *filename, char **ret) {
int r;
diff --git a/src/grp-system/grp-utils/systemd-analyze/analyze-verify.h b/src/grp-system/grp-utils/systemd-analyze/analyze-verify.h
index d8204dc69c..7b89007fd0 100644
--- a/src/grp-system/grp-utils/systemd-analyze/analyze-verify.h
+++ b/src/grp-system/grp-utils/systemd-analyze/analyze-verify.h
@@ -21,6 +21,6 @@
#include <stdbool.h>
-#include "path-lookup.h"
+#include "shared/path-lookup.h"
int verify_units(char **filenames, UnitFileScope scope, bool check_man);
diff --git a/src/grp-system/grp-utils/systemd-analyze/analyze.c b/src/grp-system/grp-utils/systemd-analyze/analyze.c
index 0e1eee16ec..41d3f0799a 100644
--- a/src/grp-system/grp-utils/systemd-analyze/analyze.c
+++ b/src/grp-system/grp-utils/systemd-analyze/analyze.c
@@ -25,23 +25,24 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/glob-util.h"
+#include "basic/hashmap.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/special.h"
+#include "basic/strv.h"
+#include "basic/strxcpyx.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+#include "shared/pager.h"
+
#include "analyze-verify.h"
-#include "bus-error.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "glob-util.h"
-#include "hashmap.h"
-#include "locale-util.h"
-#include "log.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "special.h"
-#include "strv.h"
-#include "strxcpyx.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "util.h"
#define SCALE_X (0.1 / 1000.0) /* pixels per us */
#define SCALE_Y (20.0)
diff --git a/src/grp-system/grp-utils/systemd-delta/Makefile b/src/grp-system/grp-utils/systemd-delta/Makefile
new file mode 100644
index 0000000000..4f5610d27a
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-delta/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-delta
+systemd_delta_SOURCES = \
+ src/delta/delta.c
+
+systemd_delta_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-delta/delta.c b/src/grp-system/grp-utils/systemd-delta/delta.c
index f32744def2..5da779624d 100644
--- a/src/grp-system/grp-utils/systemd-delta/delta.c
+++ b/src/grp-system/grp-utils/systemd-delta/delta.c
@@ -24,23 +24,23 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "locale-util.h"
-#include "log.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "shared/pager.h"
static const char prefixes[] =
"/etc\0"
diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/Makefile b/src/grp-system/grp-utils/systemd-fstab-generator/Makefile
new file mode 100644
index 0000000000..4f19808477
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-fstab-generator/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+systemgenerator_PROGRAMS += systemd-fstab-generator
+systemd_fstab_generator_SOURCES = \
+ src/fstab-generator/fstab-generator.c \
+ src/core/mount-setup.c
+
+systemd_fstab_generator_LDADD = \
+ libshared.la
+
+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 108522873e..307941bb95 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
@@ -23,25 +23,25 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fstab-util.h"
-#include "generator.h"
-#include "log.h"
-#include "mkdir.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "basic/virt.h"
#include "mount-setup.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "util.h"
-#include "virt.h"
+#include "shared/fstab-util.h"
+#include "shared/generator.h"
static const char *arg_dest = "/tmp";
static bool arg_fstab_enabled = true;
diff --git a/src/grp-system/grp-utils/systemd-run/Makefile b/src/grp-system/grp-utils/systemd-run/Makefile
new file mode 100644
index 0000000000..17d21167bc
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-run/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-run
+systemd_run_SOURCES = \
+ src/run/run.c
+
+systemd_run_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-run/run.c b/src/grp-system/grp-utils/systemd-run/run.c
index 29b5131f70..10b6b4440f 100644
--- a/src/grp-system/grp-utils/systemd-run/run.c
+++ b/src/grp-system/grp-utils/systemd-run/run.c
@@ -23,23 +23,23 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "calendarspec.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "ptyfwd.h"
-#include "signal-util.h"
-#include "spawn-polkit-agent.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "user-util.h"
+#include "basic/alloc-util.h"
+#include "basic/calendarspec.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+#include "shared/ptyfwd.h"
+#include "shared/spawn-polkit-agent.h"
static bool arg_ask_password = true;
static bool arg_scope = false;
diff --git a/src/grp-system/grp-utils/systemd-sysv-generator/Makefile b/src/grp-system/grp-utils/systemd-sysv-generator/Makefile
new file mode 100644
index 0000000000..10dd75abc6
--- /dev/null
+++ b/src/grp-system/grp-utils/systemd-sysv-generator/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
+
+systemd_sysv_generator_SOURCES = \
+ src/sysv-generator/sysv-generator.c
+
+systemd_sysv_generator_LDADD = \
+ libcore.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/grp-utils/systemd-sysv-generator/sysv-generator.c b/src/grp-system/grp-utils/systemd-sysv-generator/sysv-generator.c
index fe4bbeeb75..0fb1f0b8a3 100644
--- a/src/grp-system/grp-utils/systemd-sysv-generator/sysv-generator.c
+++ b/src/grp-system/grp-utils/systemd-sysv-generator/sysv-generator.c
@@ -23,24 +23,24 @@
#include <stdio.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "hexdecoct.h"
-#include "install.h"
-#include "log.h"
-#include "mkdir.h"
-#include "path-lookup.h"
-#include "path-util.h"
-#include "set.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/hexdecoct.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "shared/install.h"
+#include "shared/path-lookup.h"
typedef enum RunlevelType {
RUNLEVEL_UP,
diff --git a/src/grp-system/libcore/Makefile b/src/grp-system/libcore/Makefile
new file mode 100644
index 0000000000..cbf4916c13
--- /dev/null
+++ b/src/grp-system/libcore/Makefile
@@ -0,0 +1,170 @@
+# -*- 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 += \
+ libcore.la
+
+libcore_la_SOURCES = \
+ src/core/unit.c \
+ src/core/unit.h \
+ src/core/unit-printf.c \
+ src/core/unit-printf.h \
+ src/core/job.c \
+ src/core/job.h \
+ src/core/manager.c \
+ src/core/manager.h \
+ src/core/transaction.c \
+ src/core/transaction.h \
+ src/core/load-fragment.c \
+ src/core/load-fragment.h \
+ src/core/service.c \
+ src/core/service.h \
+ src/core/socket.c \
+ src/core/socket.h \
+ src/core/busname.c \
+ src/core/busname.h \
+ src/core/bus-policy.c \
+ src/core/bus-policy.h \
+ src/core/target.c \
+ src/core/target.h \
+ src/core/device.c \
+ src/core/device.h \
+ src/core/mount.c \
+ src/core/mount.h \
+ src/core/automount.c \
+ src/core/automount.h \
+ src/core/swap.c \
+ src/core/swap.h \
+ src/core/timer.c \
+ src/core/timer.h \
+ src/core/path.c \
+ src/core/path.h \
+ src/core/slice.c \
+ src/core/slice.h \
+ src/core/scope.c \
+ src/core/scope.h \
+ src/core/load-dropin.c \
+ src/core/load-dropin.h \
+ src/core/execute.c \
+ src/core/execute.h \
+ src/core/kill.c \
+ src/core/kill.h \
+ src/core/dbus.c \
+ src/core/dbus.h \
+ src/core/dbus-manager.c \
+ src/core/dbus-manager.h \
+ src/core/dbus-unit.c \
+ src/core/dbus-unit.h \
+ src/core/dbus-job.c \
+ src/core/dbus-job.h \
+ src/core/dbus-service.c \
+ src/core/dbus-service.h \
+ src/core/dbus-socket.c \
+ src/core/dbus-socket.h \
+ src/core/dbus-busname.c \
+ src/core/dbus-busname.h \
+ src/core/dbus-target.c \
+ src/core/dbus-target.h \
+ src/core/dbus-device.c \
+ src/core/dbus-device.h \
+ src/core/dbus-mount.c \
+ src/core/dbus-mount.h \
+ src/core/dbus-automount.c \
+ src/core/dbus-automount.h \
+ src/core/dbus-swap.c \
+ src/core/dbus-swap.h \
+ src/core/dbus-timer.c \
+ src/core/dbus-timer.h \
+ src/core/dbus-path.c \
+ src/core/dbus-path.h \
+ src/core/dbus-slice.c \
+ src/core/dbus-slice.h \
+ src/core/dbus-scope.c \
+ src/core/dbus-scope.h \
+ src/core/dbus-execute.c \
+ src/core/dbus-execute.h \
+ src/core/dbus-kill.c \
+ src/core/dbus-kill.h \
+ src/core/dbus-cgroup.c \
+ src/core/dbus-cgroup.h \
+ src/core/cgroup.c \
+ src/core/cgroup.h \
+ src/core/selinux-access.c \
+ src/core/selinux-access.h \
+ src/core/selinux-setup.c \
+ src/core/selinux-setup.h \
+ src/core/smack-setup.c \
+ src/core/smack-setup.h \
+ src/core/ima-setup.c \
+ src/core/ima-setup.h \
+ src/core/locale-setup.h \
+ src/core/locale-setup.c \
+ src/core/hostname-setup.c \
+ src/core/hostname-setup.h \
+ src/core/machine-id-setup.c \
+ src/core/machine-id-setup.h \
+ src/core/mount-setup.c \
+ src/core/mount-setup.h \
+ src/core/kmod-setup.c \
+ src/core/kmod-setup.h \
+ src/core/loopback-setup.h \
+ src/core/loopback-setup.c \
+ src/core/namespace.c \
+ src/core/namespace.h \
+ src/core/killall.h \
+ src/core/killall.c \
+ src/core/audit-fd.c \
+ src/core/audit-fd.h \
+ src/core/show-status.c \
+ src/core/show-status.h \
+ src/core/failure-action.c \
+ src/core/failure-action.h
+
+nodist_libcore_la_SOURCES = \
+ src/core/load-fragment-gperf.c \
+ src/core/load-fragment-gperf-nulstr.c
+
+libcore_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(PAM_CFLAGS) \
+ $(AUDIT_CFLAGS) \
+ $(KMOD_CFLAGS) \
+ $(APPARMOR_CFLAGS) \
+ $(MOUNT_CFLAGS) \
+ $(SECCOMP_CFLAGS)
+
+libcore_la_LIBADD = \
+ libshared.la \
+ $(PAM_LIBS) \
+ $(AUDIT_LIBS) \
+ $(KMOD_LIBS) \
+ $(APPARMOR_LIBS) \
+ $(MOUNT_LIBS)
+
+$(outdir)/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(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 ";" }' < $< > $@
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/libcore/automount.c b/src/grp-system/libcore/automount.c
index f06d837e30..726a044030 100644
--- a/src/grp-system/libcore/automount.c
+++ b/src/grp-system/libcore/automount.c
@@ -20,34 +20,36 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <linux/auto_dev-ioctl.h>
-#include <linux/auto_fs4.h>
#include <sys/epoll.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "async.h"
+#include <linux/auto_dev-ioctl.h>
+#include <linux/auto_fs4.h>
+
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/label.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "automount.h"
-#include "bus-error.h"
-#include "bus-util.h"
#include "dbus-automount.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "io-util.h"
-#include "label.h"
-#include "mkdir.h"
-#include "mount-util.h"
#include "mount.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "special.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "unit-name.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
diff --git a/src/grp-system/libcore/bus-policy.c b/src/grp-system/libcore/bus-policy.c
index 4907c268e8..b6dc2f5438 100644
--- a/src/grp-system/libcore/bus-policy.c
+++ b/src/grp-system/libcore/bus-policy.c
@@ -19,13 +19,14 @@
#include <stdlib.h>
-#include "alloc-util.h"
-#include "bus-kernel.h"
+#include "basic/alloc-util.h"
+#include "basic/string-table.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-kernel.h"
+#include "sd-bus/kdbus.h"
+
#include "bus-policy.h"
-#include "kdbus.h"
-#include "string-table.h"
-#include "user-util.h"
-#include "util.h"
int bus_kernel_translate_access(BusPolicyAccess access) {
assert(access >= 0);
diff --git a/src/grp-system/libcore/bus-policy.h b/src/grp-system/libcore/bus-policy.h
index 5b2c4d5953..8cb6910c00 100644
--- a/src/grp-system/libcore/bus-policy.h
+++ b/src/grp-system/libcore/bus-policy.h
@@ -19,9 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "kdbus.h"
-#include "list.h"
-#include "macro.h"
+#include "basic/list.h"
+#include "basic/macro.h"
+#include "sd-bus/kdbus.h"
typedef struct BusNamePolicy BusNamePolicy;
diff --git a/src/grp-system/libcore/busname.c b/src/grp-system/libcore/busname.c
index f03a95c24e..5d85c20730 100644
--- a/src/grp-system/libcore/busname.c
+++ b/src/grp-system/libcore/busname.c
@@ -19,23 +19,24 @@
#include <sys/mman.h>
-#include "alloc-util.h"
-#include "bus-internal.h"
-#include "bus-kernel.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "sd-bus/bus-internal.h"
+#include "sd-bus/bus-kernel.h"
+#include "sd-bus/kdbus.h"
+#include "shared/bus-util.h"
+
#include "bus-policy.h"
-#include "bus-util.h"
#include "busname.h"
#include "dbus-busname.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "kdbus.h"
-#include "parse-util.h"
-#include "process-util.h"
#include "service.h"
-#include "signal-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = {
[BUSNAME_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/busname.h b/src/grp-system/libcore/busname.h
index a8562db458..aa7f0ecb1b 100644
--- a/src/grp-system/libcore/busname.h
+++ b/src/grp-system/libcore/busname.h
@@ -22,8 +22,8 @@
typedef struct BusName BusName;
typedef struct BusNamePolicy BusNamePolicy;
-#include "unit.h"
#include "bus-policy.h"
+#include "unit.h"
typedef enum BusNameResult {
BUSNAME_SUCCESS,
diff --git a/src/grp-system/libcore/cgroup.c b/src/grp-system/libcore/cgroup.c
index 0fb63b1bd1..df850ec68f 100644
--- a/src/grp-system/libcore/cgroup.c
+++ b/src/grp-system/libcore/cgroup.c
@@ -20,19 +20,20 @@
#include <fcntl.h>
#include <fnmatch.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+
#include "cgroup.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "stdio-util.h"
#define CGROUP_CPU_QUOTA_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC)
diff --git a/src/grp-system/libcore/cgroup.h b/src/grp-system/libcore/cgroup.h
index 2b1edbafc4..abc780b5d5 100644
--- a/src/grp-system/libcore/cgroup.h
+++ b/src/grp-system/libcore/cgroup.h
@@ -21,9 +21,9 @@
#include <stdbool.h>
-#include "list.h"
-#include "time-util.h"
-#include "cgroup-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/list.h"
+#include "basic/time-util.h"
typedef struct CGroupContext CGroupContext;
typedef struct CGroupDeviceAllow CGroupDeviceAllow;
diff --git a/src/grp-system/libcore/dbus-automount.c b/src/grp-system/libcore/dbus-automount.c
index b2806ad86f..2949c49a3f 100644
--- a/src/grp-system/libcore/dbus-automount.c
+++ b/src/grp-system/libcore/dbus-automount.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "automount.h"
-#include "bus-util.h"
#include "dbus-automount.h"
-#include "string-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, automount_result, AutomountResult);
diff --git a/src/grp-system/libcore/dbus-busname.c b/src/grp-system/libcore/dbus-busname.c
index cf816ba15b..65815bb826 100644
--- a/src/grp-system/libcore/dbus-busname.c
+++ b/src/grp-system/libcore/dbus-busname.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "busname.h"
#include "dbus-busname.h"
-#include "string-util.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, busname_result, BusNameResult);
diff --git a/src/grp-system/libcore/dbus-cgroup.c b/src/grp-system/libcore/dbus-cgroup.c
index eef1c47c14..d707ac51c3 100644
--- a/src/grp-system/libcore/dbus-cgroup.c
+++ b/src/grp-system/libcore/dbus-cgroup.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/path-util.h"
+#include "shared/bus-util.h"
+
#include "cgroup.h"
#include "dbus-cgroup.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "path-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_cgroup_device_policy, cgroup_device_policy, CGroupDevicePolicy);
diff --git a/src/grp-system/libcore/dbus-job.c b/src/grp-system/libcore/dbus-job.c
index 1d739787bb..ee1774da36 100644
--- a/src/grp-system/libcore/dbus-job.c
+++ b/src/grp-system/libcore/dbus-job.c
@@ -19,13 +19,14 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+
#include "dbus-job.h"
#include "dbus.h"
#include "job.h"
-#include "log.h"
#include "selinux-access.h"
-#include "string-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, job_type, JobType);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_state, job_state, JobState);
diff --git a/src/grp-system/libcore/dbus-kill.c b/src/grp-system/libcore/dbus-kill.c
index 0f54c6b84b..ba7a3f3b72 100644
--- a/src/grp-system/libcore/dbus-kill.c
+++ b/src/grp-system/libcore/dbus-kill.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
+#include "basic/signal-util.h"
+#include "shared/bus-util.h"
+
#include "dbus-kill.h"
#include "kill.h"
-#include "signal-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_kill_mode, kill_mode, KillMode);
diff --git a/src/grp-system/libcore/dbus-manager.c b/src/grp-system/libcore/dbus-manager.c
index 86722e1162..b2ca867987 100644
--- a/src/grp-system/libcore/dbus-manager.c
+++ b/src/grp-system/libcore/dbus-manager.c
@@ -21,30 +21,31 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "architecture.h"
-#include "build.h"
-#include "bus-common-errors.h"
-#include "clock-util.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/build.h"
+#include "basic/clock-util.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/virt.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/install.h"
+#include "shared/watchdog.h"
+
#include "dbus-execute.h"
#include "dbus-job.h"
#include "dbus-manager.h"
#include "dbus-unit.h"
#include "dbus.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "install.h"
-#include "log.h"
-#include "path-util.h"
#include "selinux-access.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "virt.h"
-#include "watchdog.h"
static int property_get_version(
sd_bus *bus,
diff --git a/src/grp-system/libcore/dbus-mount.c b/src/grp-system/libcore/dbus-mount.c
index 935db7c48b..837a262f61 100644
--- a/src/grp-system/libcore/dbus-mount.c
+++ b/src/grp-system/libcore/dbus-mount.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-mount.h"
#include "mount.h"
-#include "string-util.h"
#include "unit.h"
static int property_get_what(
diff --git a/src/grp-system/libcore/dbus-path.c b/src/grp-system/libcore/dbus-path.c
index 1e153e503f..d312652be4 100644
--- a/src/grp-system/libcore/dbus-path.c
+++ b/src/grp-system/libcore/dbus-path.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "dbus-path.h"
#include "path.h"
-#include "string-util.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, path_result, PathResult);
diff --git a/src/grp-system/libcore/dbus-scope.c b/src/grp-system/libcore/dbus-scope.c
index 34ee9a8fa9..9ecc01d275 100644
--- a/src/grp-system/libcore/dbus-scope.c
+++ b/src/grp-system/libcore/dbus-scope.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-internal.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-kill.h"
#include "dbus-scope.h"
diff --git a/src/grp-system/libcore/dbus-service.c b/src/grp-system/libcore/dbus-service.c
index 03eecca911..a666c9db95 100644
--- a/src/grp-system/libcore/dbus-service.c
+++ b/src/grp-system/libcore/dbus-service.c
@@ -17,19 +17,20 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "async.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-service.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "path-util.h"
#include "service.h"
-#include "string-util.h"
-#include "strv.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, service_type, ServiceType);
diff --git a/src/grp-system/libcore/dbus-socket.c b/src/grp-system/libcore/dbus-socket.c
index 961340608d..4d99628725 100644
--- a/src/grp-system/libcore/dbus-socket.c
+++ b/src/grp-system/libcore/dbus-socket.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-socket.h"
#include "socket.h"
-#include "string-util.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, socket_result, SocketResult);
diff --git a/src/grp-system/libcore/dbus-swap.c b/src/grp-system/libcore/dbus-swap.c
index 292f8738c6..fc911b038f 100644
--- a/src/grp-system/libcore/dbus-swap.c
+++ b/src/grp-system/libcore/dbus-swap.c
@@ -18,11 +18,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-swap.h"
-#include "string-util.h"
#include "swap.h"
#include "unit.h"
diff --git a/src/grp-system/libcore/dbus-timer.c b/src/grp-system/libcore/dbus-timer.c
index a0e61b023e..02036de42f 100644
--- a/src/grp-system/libcore/dbus-timer.c
+++ b/src/grp-system/libcore/dbus-timer.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "dbus-timer.h"
-#include "strv.h"
#include "timer.h"
#include "unit.h"
diff --git a/src/grp-system/libcore/dbus-unit.c b/src/grp-system/libcore/dbus-unit.c
index dcd8db0898..31fbb0d54d 100644
--- a/src/grp-system/libcore/dbus-unit.c
+++ b/src/grp-system/libcore/dbus-unit.c
@@ -19,21 +19,22 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "cgroup-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-common-errors.h"
+
#include "dbus-unit.h"
#include "dbus.h"
-#include "fd-util.h"
-#include "locale-util.h"
-#include "log.h"
-#include "process-util.h"
#include "selinux-access.h"
-#include "signal-util.h"
-#include "special.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_job_mode, job_mode, JobMode);
diff --git a/src/grp-system/libcore/dbus.c b/src/grp-system/libcore/dbus.c
index 1b217da303..e8e57e6a89 100644
--- a/src/grp-system/libcore/dbus.c
+++ b/src/grp-system/libcore/dbus.c
@@ -23,11 +23,21 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-internal.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/strxcpyx.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-util.h"
+
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-job.h"
@@ -35,16 +45,7 @@
#include "dbus-manager.h"
#include "dbus-unit.h"
#include "dbus.h"
-#include "fd-util.h"
-#include "log.h"
-#include "missing.h"
-#include "mkdir.h"
#include "selinux-access.h"
-#include "special.h"
-#include "string-util.h"
-#include "strv.h"
-#include "strxcpyx.h"
-#include "user-util.h"
#define CONNECTIONS_MAX 4096
diff --git a/src/grp-system/libcore/device.c b/src/grp-system/libcore/device.c
index 16e56efcc3..11ee2ad047 100644
--- a/src/grp-system/libcore/device.c
+++ b/src/grp-system/libcore/device.c
@@ -20,19 +20,20 @@
#include <errno.h>
#include <sys/epoll.h>
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "shared/udev-util.h"
-#include "alloc-util.h"
#include "dbus-device.h"
#include "device.h"
-#include "log.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "stat-util.h"
-#include "string-util.h"
#include "swap.h"
-#include "udev-util.h"
-#include "unit-name.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
diff --git a/src/grp-system/libcore/execute.c b/src/grp-system/libcore/execute.c
index b58fb80be2..5eb3f13695 100644
--- a/src/grp-system/libcore/execute.c
+++ b/src/grp-system/libcore/execute.c
@@ -49,7 +49,7 @@
#include <sys/apparmor.h>
#endif
-#include <systemd/sd-messages.h>
+#include "sd-messages.h"
#include "af-list.h"
#include "alloc-util.h"
diff --git a/src/grp-system/libcore/execute.h b/src/grp-system/libcore/execute.h
index 41148bcea2..68560271d4 100644
--- a/src/grp-system/libcore/execute.h
+++ b/src/grp-system/libcore/execute.h
@@ -19,20 +19,21 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct ExecStatus ExecStatus;
-typedef struct ExecCommand ExecCommand;
-typedef struct ExecContext ExecContext;
-typedef struct ExecRuntime ExecRuntime;
-typedef struct ExecParameters ExecParameters;
-
#include <sched.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/capability.h>
-#include "fdset.h"
-#include "list.h"
-#include "missing.h"
+#include "basic/fdset.h"
+#include "basic/list.h"
+#include "basic/missing.h"
+
+typedef struct ExecCommand ExecCommand;
+typedef struct ExecContext ExecContext;
+typedef struct ExecParameters ExecParameters;
+typedef struct ExecRuntime ExecRuntime;
+typedef struct ExecStatus ExecStatus;
+
#include "namespace.h"
typedef enum ExecUtmpMode {
diff --git a/src/grp-system/libcore/failure-action.c b/src/grp-system/libcore/failure-action.c
index ddae46190f..e22c71dac6 100644
--- a/src/grp-system/libcore/failure-action.c
+++ b/src/grp-system/libcore/failure-action.c
@@ -19,14 +19,16 @@
***/
#include <sys/reboot.h>
+
#include <linux/reboot.h>
-#include "bus-error.h"
-#include "bus-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/terminal-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "failure-action.h"
-#include "special.h"
-#include "string-table.h"
-#include "terminal-util.h"
static void log_and_status(Manager *m, const char *message) {
log_warning("%s", message);
diff --git a/src/grp-system/libcore/failure-action.h b/src/grp-system/libcore/failure-action.h
index 1adac4ad5c..87b091f46e 100644
--- a/src/grp-system/libcore/failure-action.h
+++ b/src/grp-system/libcore/failure-action.h
@@ -32,7 +32,8 @@ typedef enum FailureAction {
_FAILURE_ACTION_INVALID = -1
} FailureAction;
-#include "macro.h"
+#include "basic/macro.h"
+
#include "manager.h"
int failure_action(Manager *m, FailureAction action, const char *reboot_arg);
diff --git a/src/grp-system/libcore/hostname-setup.c b/src/grp-system/libcore/hostname-setup.c
index 68be52856b..71e5649952 100644
--- a/src/grp-system/libcore/hostname-setup.c
+++ b/src/grp-system/libcore/hostname-setup.c
@@ -21,14 +21,15 @@
#include <stdio.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "fileio.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "hostname-setup.h"
-#include "hostname-util.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
int hostname_setup(void) {
int r;
diff --git a/src/grp-system/libcore/ima-setup.c b/src/grp-system/libcore/ima-setup.c
index d1b0ce76ef..0b283d95f1 100644
--- a/src/grp-system/libcore/ima-setup.c
+++ b/src/grp-system/libcore/ima-setup.c
@@ -22,11 +22,12 @@
#include <errno.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "fileio.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/util.h"
+
#include "ima-setup.h"
-#include "log.h"
-#include "util.h"
#define IMA_SECFS_DIR "/sys/kernel/security/ima"
#define IMA_SECFS_POLICY IMA_SECFS_DIR "/policy"
diff --git a/src/grp-system/libcore/job.c b/src/grp-system/libcore/job.c
index 42fdcb988a..9dc44189e4 100644
--- a/src/grp-system/libcore/job.c
+++ b/src/grp-system/libcore/job.c
@@ -22,24 +22,25 @@
#include <systemd/sd-id128.h>
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "async.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/escape.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/special.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/virt.h"
+
#include "dbus-job.h"
#include "dbus.h"
-#include "escape.h"
#include "job.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "set.h"
-#include "special.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
#include "unit.h"
-#include "virt.h"
Job* job_new_raw(Unit *unit) {
Job *j;
diff --git a/src/grp-system/libcore/job.h b/src/grp-system/libcore/job.h
index 68c2089b91..f88e5a0782 100644
--- a/src/grp-system/libcore/job.h
+++ b/src/grp-system/libcore/job.h
@@ -23,8 +23,8 @@
#include <systemd/sd-event.h>
-#include "list.h"
-#include "unit-name.h"
+#include "basic/list.h"
+#include "basic/unit-name.h"
typedef struct Job Job;
typedef struct JobDependency JobDependency;
diff --git a/src/grp-system/libcore/kill.c b/src/grp-system/libcore/kill.c
index 6854587d54..9f8b45971f 100644
--- a/src/grp-system/libcore/kill.c
+++ b/src/grp-system/libcore/kill.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/signal-util.h"
+#include "basic/string-table.h"
+#include "basic/util.h"
+
#include "kill.h"
-#include "signal-util.h"
-#include "string-table.h"
-#include "util.h"
void kill_context_init(KillContext *c) {
assert(c);
diff --git a/src/grp-system/libcore/kill.h b/src/grp-system/libcore/kill.h
index b3d2056cb0..481ffdf2ff 100644
--- a/src/grp-system/libcore/kill.h
+++ b/src/grp-system/libcore/kill.h
@@ -19,12 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct KillContext KillContext;
-
#include <stdbool.h>
#include <stdio.h>
-#include "macro.h"
+#include "basic/macro.h"
+
+typedef struct KillContext KillContext;
typedef enum KillMode {
/* The kill mode is a property of a unit. */
diff --git a/src/grp-system/libcore/killall.c b/src/grp-system/libcore/killall.c
index 09378f7085..bc4d67ae21 100644
--- a/src/grp-system/libcore/killall.c
+++ b/src/grp-system/libcore/killall.c
@@ -22,16 +22,17 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
#include "killall.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "set.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
#define TIMEOUT_USEC (10 * USEC_PER_SEC)
diff --git a/src/grp-system/libcore/load-dropin.c b/src/grp-system/libcore/load-dropin.c
index f83fa09301..9a65b5038b 100644
--- a/src/grp-system/libcore/load-dropin.c
+++ b/src/grp-system/libcore/load-dropin.c
@@ -18,12 +18,13 @@
***/
-#include "conf-parser.h"
+#include "basic/log.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "shared/conf-parser.h"
+
#include "load-dropin.h"
#include "load-fragment.h"
-#include "log.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit.h"
static int add_dependency_consumer(
diff --git a/src/grp-system/libcore/load-dropin.h b/src/grp-system/libcore/load-dropin.h
index 942d26724e..d91cf05197 100644
--- a/src/grp-system/libcore/load-dropin.h
+++ b/src/grp-system/libcore/load-dropin.h
@@ -19,7 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "dropin.h"
+#include "shared/dropin.h"
+
#include "unit.h"
/* Read service data supplementary drop-in directories */
diff --git a/src/grp-system/libcore/load-fragment.c b/src/grp-system/libcore/load-fragment.c
index 86b4fb071b..f01c72568b 100644
--- a/src/grp-system/libcore/load-fragment.c
+++ b/src/grp-system/libcore/load-fragment.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <fcntl.h>
+
#include <linux/fs.h>
#include <linux/oom.h>
#ifdef HAVE_SECCOMP
diff --git a/src/grp-system/libcore/locale-setup.c b/src/grp-system/libcore/locale-setup.c
index ccf61d29fb..ed50796c09 100644
--- a/src/grp-system/libcore/locale-setup.c
+++ b/src/grp-system/libcore/locale-setup.c
@@ -20,14 +20,15 @@
#include <errno.h>
#include <stdlib.h>
-#include "env-util.h"
-#include "fileio.h"
+#include "basic/env-util.h"
+#include "basic/fileio.h"
+#include "basic/locale-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+
#include "locale-setup.h"
-#include "locale-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
-#include "virt.h"
int locale_setup(char ***environment) {
char **add;
diff --git a/src/grp-system/libcore/loopback-setup.c b/src/grp-system/libcore/loopback-setup.c
index d56bbfa6fc..d5b65bca9c 100644
--- a/src/grp-system/libcore/loopback-setup.c
+++ b/src/grp-system/libcore/loopback-setup.c
@@ -20,11 +20,11 @@
#include <net/if.h>
#include <stdlib.h>
-#include <systemd/sd-netlink.h>
+#include "basic/missing.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
#include "loopback-setup.h"
-#include "missing.h"
-#include "netlink-util.h"
static int start_loopback(sd_netlink *rtnl) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
diff --git a/src/grp-system/libcore/machine-id-setup.c b/src/grp-system/libcore/machine-id-setup.c
index 812e4b038c..28722b46f0 100644
--- a/src/grp-system/libcore/machine-id-setup.c
+++ b/src/grp-system/libcore/machine-id-setup.c
@@ -27,24 +27,25 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hexdecoct.h"
-#include "io-util.h"
-#include "log.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/umask-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+
#include "machine-id-setup.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "umask-util.h"
-#include "util.h"
-#include "virt.h"
static int shorten_uuid(char destination[34], const char source[36]) {
unsigned i, j;
diff --git a/src/grp-system/libcore/manager.c b/src/grp-system/libcore/manager.c
index 831fdbaabf..ada22f52fd 100644
--- a/src/grp-system/libcore/manager.c
+++ b/src/grp-system/libcore/manager.c
@@ -20,7 +20,6 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <linux/kd.h>
#include <signal.h>
#include <string.h>
#include <sys/epoll.h>
@@ -31,12 +30,14 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <linux/kd.h>
+
#ifdef HAVE_AUDIT
#include <libaudit.h>
#endif
-#include <systemd/sd-daemon.h>
-#include <systemd/sd-messages.h>
+#include "sd-daemon.h"
+#include "sd-messages.h"
#include "alloc-util.h"
#include "audit-fd.h"
diff --git a/src/grp-system/libcore/manager.h b/src/grp-system/libcore/manager.h
index 70d79ce549..1e99f1e1b6 100644
--- a/src/grp-system/libcore/manager.h
+++ b/src/grp-system/libcore/manager.h
@@ -26,11 +26,11 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "cgroup-util.h"
-#include "fdset.h"
-#include "hashmap.h"
-#include "list.h"
-#include "ratelimit.h"
+#include "basic/cgroup-util.h"
+#include "basic/fdset.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/ratelimit.h"
/* Enforce upper limit how many names we allow */
#define MANAGER_MAX_NAMES 131072 /* 128K */
diff --git a/src/grp-system/libcore/mount-setup.c b/src/grp-system/libcore/mount-setup.c
index 40fc548b42..e90f0e918a 100644
--- a/src/grp-system/libcore/mount-setup.c
+++ b/src/grp-system/libcore/mount-setup.c
@@ -23,25 +23,26 @@
#include <sys/mount.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "dev-setup.h"
-#include "efivars.h"
-#include "label.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/label.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/smack-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "shared/bus-util.h"
+#include "shared/dev-setup.h"
+#include "shared/efivars.h"
+
#include "mount-setup.h"
-#include "mount-util.h"
-#include "path-util.h"
-#include "set.h"
-#include "smack-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
-#include "virt.h"
typedef enum MountMode {
MNT_NONE = 0,
diff --git a/src/grp-system/libcore/mount.c b/src/grp-system/libcore/mount.c
index 7db9d1325b..d4af6c65f6 100644
--- a/src/grp-system/libcore/mount.c
+++ b/src/grp-system/libcore/mount.c
@@ -24,26 +24,27 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/exit-status.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "shared/fstab-util.h"
+
#include "dbus-mount.h"
-#include "escape.h"
-#include "exit-status.h"
-#include "formats-util.h"
-#include "fstab-util.h"
-#include "log.h"
#include "manager.h"
-#include "mkdir.h"
#include "mount-setup.h"
-#include "mount-util.h"
#include "mount.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit.h"
#define RETRY_UMOUNT_MAX 32
diff --git a/src/grp-system/libcore/namespace.c b/src/grp-system/libcore/namespace.c
index 203d122810..db60336a60 100644
--- a/src/grp-system/libcore/namespace.c
+++ b/src/grp-system/libcore/namespace.c
@@ -24,25 +24,27 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
+
#include <linux/fs.h>
-#include "alloc-util.h"
-#include "dev-setup.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/selinux-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/dev-setup.h"
+
#include "loopback-setup.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mount-util.h"
#include "namespace.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "util.h"
#define DEV_MOUNT_OPTIONS (MS_NOSUID|MS_STRICTATIME|MS_NOEXEC)
diff --git a/src/grp-system/libcore/namespace.h b/src/grp-system/libcore/namespace.h
index b54b7b47d6..03097327dd 100644
--- a/src/grp-system/libcore/namespace.h
+++ b/src/grp-system/libcore/namespace.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "macro.h"
+#include "basic/macro.h"
typedef enum ProtectHome {
PROTECT_HOME_NO,
diff --git a/src/grp-system/libcore/path.c b/src/grp-system/libcore/path.c
index 0dd0d375d8..ee1b9a3480 100644
--- a/src/grp-system/libcore/path.c
+++ b/src/grp-system/libcore/path.c
@@ -22,20 +22,21 @@
#include <sys/inotify.h>
#include <unistd.h>
-#include "bus-error.h"
-#include "bus-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/glob-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "dbus-path.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "glob-util.h"
-#include "macro.h"
-#include "mkdir.h"
#include "path.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "unit-name.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = {
diff --git a/src/grp-system/libcore/scope.c b/src/grp-system/libcore/scope.c
index 238f63a729..c290529e14 100644
--- a/src/grp-system/libcore/scope.c
+++ b/src/grp-system/libcore/scope.c
@@ -20,16 +20,17 @@
#include <errno.h>
#include <unistd.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+
#include "dbus-scope.h"
#include "load-dropin.h"
-#include "log.h"
#include "scope.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_SCOPE_STATE_MAX] = {
diff --git a/src/grp-system/libcore/selinux-access.c b/src/grp-system/libcore/selinux-access.c
index 2c04fb0a8f..cc287d602d 100644
--- a/src/grp-system/libcore/selinux-access.c
+++ b/src/grp-system/libcore/selinux-access.c
@@ -29,7 +29,7 @@
#include <libaudit.h>
#endif
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "audit-fd.h"
diff --git a/src/grp-system/libcore/selinux-access.h b/src/grp-system/libcore/selinux-access.h
index cbf33ef6c4..8d91eea38f 100644
--- a/src/grp-system/libcore/selinux-access.h
+++ b/src/grp-system/libcore/selinux-access.h
@@ -21,7 +21,8 @@
#include <systemd/sd-bus.h>
-#include "bus-util.h"
+#include "shared/bus-util.h"
+
#include "manager.h"
int mac_selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error);
diff --git a/src/grp-system/libcore/service.c b/src/grp-system/libcore/service.c
index 7ebabca5d6..9b7f7bd68c 100644
--- a/src/grp-system/libcore/service.c
+++ b/src/grp-system/libcore/service.c
@@ -21,38 +21,39 @@
#include <signal.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "async.h"
-#include "bus-error.h"
-#include "bus-kernel.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/def.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/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-kernel.h"
+#include "shared/bus-util.h"
+
#include "dbus-service.h"
-#include "def.h"
-#include "env-util.h"
-#include "escape.h"
-#include "exit-status.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
#include "load-dropin.h"
#include "load-fragment.h"
-#include "log.h"
#include "manager.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
#include "service.h"
-#include "signal-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit-printf.h"
#include "unit.h"
-#include "utf8.h"
-#include "util.h"
static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
[SERVICE_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/service.h b/src/grp-system/libcore/service.h
index 4af3d40439..ba9086d8cd 100644
--- a/src/grp-system/libcore/service.h
+++ b/src/grp-system/libcore/service.h
@@ -19,13 +19,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/exit-status.h"
+#include "basic/ratelimit.h"
+
typedef struct Service Service;
typedef struct ServiceFDStore ServiceFDStore;
-#include "exit-status.h"
#include "kill.h"
#include "path.h"
-#include "ratelimit.h"
typedef enum ServiceRestart {
SERVICE_RESTART_NO,
diff --git a/src/grp-system/libcore/show-status.c b/src/grp-system/libcore/show-status.c
index 59ebdc7219..bb6889630d 100644
--- a/src/grp-system/libcore/show-status.c
+++ b/src/grp-system/libcore/show-status.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
#include "show-status.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
int parse_show_status(const char *v, ShowStatus *ret) {
int r;
diff --git a/src/grp-system/libcore/show-status.h b/src/grp-system/libcore/show-status.h
index 9a29e72645..56c56eb358 100644
--- a/src/grp-system/libcore/show-status.h
+++ b/src/grp-system/libcore/show-status.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "macro.h"
+#include "basic/macro.h"
/* Manager status */
diff --git a/src/grp-system/libcore/slice.c b/src/grp-system/libcore/slice.c
index c7700b8857..d646b838ac 100644
--- a/src/grp-system/libcore/slice.c
+++ b/src/grp-system/libcore/slice.c
@@ -19,14 +19,15 @@
#include <errno.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+
#include "dbus-slice.h"
-#include "log.h"
#include "slice.h"
-#include "special.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit.h"
static const UnitActiveState state_translation_table[_SLICE_STATE_MAX] = {
diff --git a/src/grp-system/libcore/smack-setup.c b/src/grp-system/libcore/smack-setup.c
index 5a6d11cfa1..ab316b69c9 100644
--- a/src/grp-system/libcore/smack-setup.c
+++ b/src/grp-system/libcore/smack-setup.c
@@ -26,15 +26,16 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "smack-setup.h"
-#include "string-util.h"
-#include "util.h"
#ifdef HAVE_SMACK
diff --git a/src/grp-system/libcore/socket.c b/src/grp-system/libcore/socket.c
index f6204d04bf..051cbdab8b 100644
--- a/src/grp-system/libcore/socket.c
+++ b/src/grp-system/libcore/socket.c
@@ -26,37 +26,39 @@
#include <sys/epoll.h>
#include <sys/stat.h>
#include <unistd.h>
+
#include <linux/sctp.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "copy.h"
+#include "basic/alloc-util.h"
+#include "basic/copy.h"
+#include "basic/def.h"
+#include "basic/exit-status.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/label.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/smack-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "dbus-socket.h"
-#include "def.h"
-#include "exit-status.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "io-util.h"
-#include "label.h"
-#include "log.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "smack-util.h"
#include "socket.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
#include "unit-printf.h"
#include "unit.h"
-#include "user-util.h"
static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
[SOCKET_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/socket.h b/src/grp-system/libcore/socket.h
index 0f1ac69c6f..3b214946e0 100644
--- a/src/grp-system/libcore/socket.h
+++ b/src/grp-system/libcore/socket.h
@@ -19,11 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/socket-util.h"
+
typedef struct Socket Socket;
#include "mount.h"
#include "service.h"
-#include "socket-util.h"
typedef enum SocketExecCommand {
SOCKET_EXEC_START_PRE,
diff --git a/src/grp-system/libcore/swap.c b/src/grp-system/libcore/swap.c
index a532b15be8..b787fc15a1 100644
--- a/src/grp-system/libcore/swap.c
+++ b/src/grp-system/libcore/swap.c
@@ -22,26 +22,27 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/exit-status.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/virt.h"
+#include "shared/fstab-util.h"
+#include "shared/udev-util.h"
-#include "alloc-util.h"
#include "dbus-swap.h"
-#include "escape.h"
-#include "exit-status.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "fstab-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
#include "swap.h"
-#include "udev-util.h"
-#include "unit-name.h"
#include "unit.h"
-#include "virt.h"
static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
[SWAP_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/swap.h b/src/grp-system/libcore/swap.h
index fbf66debdc..c2cbfc5d2a 100644
--- a/src/grp-system/libcore/swap.h
+++ b/src/grp-system/libcore/swap.h
@@ -20,7 +20,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
+#include <libudev.h>
typedef struct Swap Swap;
diff --git a/src/grp-system/libcore/target.c b/src/grp-system/libcore/target.c
index 61a91aad07..e62a49be84 100644
--- a/src/grp-system/libcore/target.c
+++ b/src/grp-system/libcore/target.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+
#include "dbus-target.h"
-#include "log.h"
-#include "special.h"
-#include "string-util.h"
-#include "unit-name.h"
-#include "unit.h"
#include "target.h"
+#include "unit.h"
static const UnitActiveState state_translation_table[_TARGET_STATE_MAX] = {
[TARGET_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/timer.c b/src/grp-system/libcore/timer.c
index 3206296f09..8b9fa71d27 100644
--- a/src/grp-system/libcore/timer.c
+++ b/src/grp-system/libcore/timer.c
@@ -19,21 +19,22 @@
#include <errno.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fs-util.h"
+#include "basic/parse-util.h"
+#include "basic/random-util.h"
+#include "basic/special.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/virt.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+
#include "dbus-timer.h"
-#include "fs-util.h"
-#include "parse-util.h"
-#include "random-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
#include "timer.h"
-#include "unit-name.h"
#include "unit.h"
-#include "user-util.h"
-#include "virt.h"
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
[TIMER_DEAD] = UNIT_INACTIVE,
diff --git a/src/grp-system/libcore/timer.h b/src/grp-system/libcore/timer.h
index 9c4b64f898..99b47c3880 100644
--- a/src/grp-system/libcore/timer.h
+++ b/src/grp-system/libcore/timer.h
@@ -19,9 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct Timer Timer;
+#include "basic/calendarspec.h"
-#include "calendarspec.h"
+typedef struct Timer Timer;
typedef enum TimerBase {
TIMER_ACTIVE,
diff --git a/src/grp-system/libcore/transaction.c b/src/grp-system/libcore/transaction.c
index e06a48a2f1..d19e19f978 100644
--- a/src/grp-system/libcore/transaction.c
+++ b/src/grp-system/libcore/transaction.c
@@ -20,12 +20,13 @@
#include <fcntl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "terminal-util.h"
-#include "transaction.h"
+#include "basic/alloc-util.h"
+#include "basic/terminal-util.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+
#include "dbus-unit.h"
+#include "transaction.h"
static void transaction_unlink_job(Transaction *tr, Job *j, bool delete_dependencies);
diff --git a/src/grp-system/libcore/transaction.h b/src/grp-system/libcore/transaction.h
index 6a3f927b0f..19d8d3d434 100644
--- a/src/grp-system/libcore/transaction.h
+++ b/src/grp-system/libcore/transaction.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/hashmap.h"
+
typedef struct Transaction Transaction;
-#include "hashmap.h"
#include "job.h"
#include "manager.h"
#include "unit.h"
diff --git a/src/grp-system/libcore/unit-printf.c b/src/grp-system/libcore/unit-printf.c
index f11df42af3..14c36ab494 100644
--- a/src/grp-system/libcore/unit-printf.c
+++ b/src/grp-system/libcore/unit-printf.c
@@ -17,17 +17,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "formats-util.h"
-#include "macro.h"
-#include "specifier.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/formats-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "shared/specifier.h"
+
#include "unit-printf.h"
#include "unit.h"
-#include "user-util.h"
static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
diff --git a/src/grp-system/libcore/unit.c b/src/grp-system/libcore/unit.c
index 8bd39f87f9..f539c3971d 100644
--- a/src/grp-system/libcore/unit.c
+++ b/src/grp-system/libcore/unit.c
@@ -26,38 +26,39 @@
#include <systemd/sd-id128.h>
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/escape.h"
+#include "basic/fileio-label.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/signal-util.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/umask-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/virt.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/bus-util.h"
+#include "shared/dropin.h"
+
#include "dbus-unit.h"
#include "dbus.h"
-#include "dropin.h"
-#include "escape.h"
#include "execute.h"
-#include "fileio-label.h"
-#include "formats-util.h"
#include "load-dropin.h"
#include "load-fragment.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "set.h"
-#include "signal-util.h"
-#include "special.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "umask-util.h"
-#include "unit-name.h"
#include "unit.h"
-#include "user-util.h"
-#include "virt.h"
const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = &service_vtable,
diff --git a/src/grp-system/libcore/unit.h b/src/grp-system/libcore/unit.h
index 08a927962d..9321537fe6 100644
--- a/src/grp-system/libcore/unit.h
+++ b/src/grp-system/libcore/unit.h
@@ -23,16 +23,17 @@
#include <stdlib.h>
#include <unistd.h>
+#include "basic/list.h"
+#include "basic/unit-name.h"
+#include "shared/condition.h"
+#include "shared/install.h"
+
typedef struct Unit Unit;
-typedef struct UnitVTable UnitVTable;
typedef struct UnitRef UnitRef;
typedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
+typedef struct UnitVTable UnitVTable;
-#include "condition.h"
#include "failure-action.h"
-#include "install.h"
-#include "list.h"
-#include "unit-name.h"
typedef enum KillOperation {
KILL_TERMINATE,
diff --git a/src/grp-system/systemctl/Makefile b/src/grp-system/systemctl/Makefile
new file mode 100644
index 0000000000..24585cc12b
--- /dev/null
+++ b/src/grp-system/systemctl/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemctl
+systemctl_SOURCES = \
+ src/systemctl/systemctl.c
+
+systemctl_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemctl/systemctl.c b/src/grp-system/systemctl/systemctl.c
index c7c00bbbc3..63818d07b8 100644
--- a/src/grp-system/systemctl/systemctl.c
+++ b/src/grp-system/systemctl/systemctl.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
-#include <linux/reboot.h>
#include <locale.h>
#include <stdbool.h>
#include <stddef.h>
@@ -31,59 +30,61 @@
#include <sys/socket.h>
#include <unistd.h>
+#include <linux/reboot.h>
+
#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-message.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "copy.h"
-#include "dropin.h"
-#include "efivars.h"
-#include "env-util.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 "hostname-util.h"
-#include "initreq.h"
-#include "install.h"
-#include "io-util.h"
-#include "list.h"
-#include "locale-util.h"
-#include "log.h"
-#include "logs-show.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "path-lookup.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "rlimit-util.h"
-#include "set.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "spawn-ask-password-agent.h"
-#include "spawn-polkit-agent.h"
-#include "special.h"
-#include "stat-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "user-util.h"
-#include "util.h"
-#include "utmp-wtmp.h"
-#include "verbs.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/copy.h"
+#include "basic/env-util.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/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/list.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
+#include "basic/set.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "basic/verbs.h"
+#include "basic/virt.h"
+#include "sd-bus/bus-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "sd-bus/bus-message.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+#include "shared/cgroup-show.h"
+#include "shared/dropin.h"
+#include "shared/efivars.h"
+#include "shared/initreq.h"
+#include "shared/install.h"
+#include "shared/logs-show.h"
+#include "shared/pager.h"
+#include "shared/path-lookup.h"
+#include "shared/spawn-ask-password-agent.h"
+#include "shared/spawn-polkit-agent.h"
+#include "shared/utmp-wtmp.h"
static char **arg_types = NULL;
static char **arg_states = NULL;
diff --git a/src/grp-system/systemd-shutdown/Makefile b/src/grp-system/systemd-shutdown/Makefile
new file mode 100644
index 0000000000..87cffd19f3
--- /dev/null
+++ b/src/grp-system/systemd-shutdown/Makefile
@@ -0,0 +1,39 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-shutdown
+systemd_shutdown_SOURCES = \
+ src/core/umount.c \
+ src/core/umount.h \
+ src/core/shutdown.c \
+ src/core/mount-setup.c \
+ src/core/mount-setup.h \
+ src/core/killall.h \
+ src/core/killall.c
+
+systemd_shutdown_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemd-shutdown/shutdown.c b/src/grp-system/systemd-shutdown/shutdown.c
index e14755d84e..516128e2d1 100644
--- a/src/grp-system/systemd-shutdown/shutdown.c
+++ b/src/grp-system/systemd-shutdown/shutdown.c
@@ -19,7 +19,6 @@
#include <errno.h>
#include <getopt.h>
-#include <linux/reboot.h>
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -29,22 +28,25 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "def.h"
-#include "fileio.h"
+#include <linux/reboot.h>
+
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/def.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
#include "killall.h"
-#include "log.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "switch-root.h"
-#include "terminal-util.h"
+#include "shared/switch-root.h"
+#include "shared/watchdog.h"
+
#include "umount.h"
-#include "util.h"
-#include "virt.h"
-#include "watchdog.h"
#define FINALIZE_ATTEMPTS 50
diff --git a/src/grp-system/systemd-shutdown/umount.c b/src/grp-system/systemd-shutdown/umount.c
index c21a2be54e..3e756ec7fb 100644
--- a/src/grp-system/systemd-shutdown/umount.c
+++ b/src/grp-system/systemd-shutdown/umount.c
@@ -19,26 +19,28 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/dm-ioctl.h>
-#include <linux/loop.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/swap.h>
-#include "libudev.h"
+#include <linux/dm-ioctl.h>
+#include <linux/loop.h>
+
+#include <libudev.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fstab-util.h"
-#include "list.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/list.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
#include "mount-setup.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "udev-util.h"
+#include "shared/fstab-util.h"
+#include "shared/udev-util.h"
+
#include "umount.h"
-#include "util.h"
-#include "virt.h"
typedef struct MountPoint {
char *path;
diff --git a/src/grp-system/systemd/Makefile b/src/grp-system/systemd/Makefile
new file mode 100644
index 0000000000..cfef258c6d
--- /dev/null
+++ b/src/grp-system/systemd/Makefile
@@ -0,0 +1,71 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd
+systemd_SOURCES = \
+ src/core/main.c
+
+systemd_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(SECCOMP_CFLAGS) \
+ $(MOUNT_CFLAGS)
+
+systemd_LDADD = \
+ libcore.la
+
+dist_pkgsysconf_DATA += \
+ src/core/system.conf \
+ src/core/user.conf
+
+dist_dbuspolicy_DATA += \
+ src/core/org.freedesktop.systemd1.conf
+
+dist_dbussystemservice_DATA += \
+ src/core/org.freedesktop.systemd1.service
+
+polkitpolicy_in_in_files += \
+ src/core/org.freedesktop.systemd1.policy.in.in
+
+pkgconfigdata_DATA += \
+ src/core/systemd.pc
+
+nodist_rpmmacros_DATA = \
+ src/core/macros.systemd
+
+BUILT_SOURCES += \
+ src/core/triggers.systemd
+
+EXTRA_DIST += \
+ src/core/systemd.pc.in \
+ src/core/macros.systemd.in \
+ src/core/triggers.systemd.in
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.systemd1.busname
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.systemd1.busname
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-system/systemd/main.c b/src/grp-system/systemd/main.c
index 042cce49dd..5ed8c3d3f5 100644
--- a/src/grp-system/systemd/main.c
+++ b/src/grp-system/systemd/main.c
@@ -35,8 +35,8 @@
#include <valgrind/valgrind.h>
#endif
-#include <systemd/sd-bus.h>
-#include <systemd/sd-daemon.h>
+#include "sd-bus.h"
+#include "sd-daemon.h"
#include "alloc-util.h"
#include "architecture.h"
diff --git a/src/grp-timedate/Makefile b/src/grp-timedate/Makefile
new file mode 100644
index 0000000000..bb8be753da
--- /dev/null
+++ b/src/grp-timedate/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += timedatectl systemd-timedated
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-timedate/systemd-timedated/Makefile b/src/grp-timedate/systemd-timedated/Makefile
new file mode 100644
index 0000000000..798e3ba5a4
--- /dev/null
+++ b/src/grp-timedate/systemd-timedated/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_TIMEDATED),)
+systemd_timedated_SOURCES = \
+ src/timedate/timedated.c
+
+systemd_timedated_LDADD = \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-timedated
+
+dist_dbussystemservice_DATA += \
+ src/timedate/org.freedesktop.timedate1.service
+
+dist_dbuspolicy_DATA += \
+ src/timedate/org.freedesktop.timedate1.conf
+
+nodist_systemunit_DATA += \
+ units/systemd-timedated.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.timedate1.busname
+
+polkitpolicy_files += \
+ src/timedate/org.freedesktop.timedate1.policy
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-timedated.service dbus-org.freedesktop.timedate1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.timedate1.busname
+
+endif # ENABLE_TIMEDATED
+
+polkitpolicy_in_files += \
+ src/timedate/org.freedesktop.timedate1.policy.in
+
+EXTRA_DIST += \
+ units/systemd-timedated.service.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-timedate/systemd-timedated/timedated.c b/src/grp-timedate/systemd-timedated/timedated.c
index 51a13fcf49..aad94024b8 100644
--- a/src/grp-timedate/systemd-timedated/timedated.c
+++ b/src/grp-timedate/systemd-timedated/timedated.c
@@ -25,19 +25,19 @@
#include <systemd/sd-event.h>
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "clock-util.h"
-#include "def.h"
-#include "fileio-label.h"
-#include "fs-util.h"
-#include "path-util.h"
-#include "selinux-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/clock-util.h"
+#include "basic/def.h"
+#include "basic/fileio-label.h"
+#include "basic/fs-util.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-common-errors.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
#define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
#define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
diff --git a/src/grp-timedate/timedatectl/Makefile b/src/grp-timedate/timedatectl/Makefile
new file mode 100644
index 0000000000..c1be945443
--- /dev/null
+++ b/src/grp-timedate/timedatectl/Makefile
@@ -0,0 +1,42 @@
+# -*- 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_TIMEDATED),)
+timedatectl_SOURCES = \
+ src/timedate/timedatectl.c
+
+timedatectl_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ timedatectl
+
+dist_bashcompletion_data += \
+ shell-completion/bash/timedatectl
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_timedatectl
+endif # ENABLE_TIMEDATED
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-timedate/timedatectl/timedatectl.c b/src/grp-timedate/timedatectl/timedatectl.c
index 1fd542fb49..b85d2fdb80 100644
--- a/src/grp-timedate/timedatectl/timedatectl.c
+++ b/src/grp-timedate/timedatectl/timedatectl.c
@@ -25,14 +25,14 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
-#include "bus-util.h"
-#include "pager.h"
-#include "parse-util.h"
-#include "spawn-polkit-agent.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/parse-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/pager.h"
+#include "shared/spawn-polkit-agent.h"
static bool arg_no_pager = false;
static bool arg_ask_password = true;
diff --git a/src/grp-udev/Makefile b/src/grp-udev/Makefile
new file mode 100644
index 0000000000..cc85f0317f
--- /dev/null
+++ b/src/grp-udev/Makefile
@@ -0,0 +1,72 @@
+# -*- 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
+
+INSTALL_DIRS += \
+ $(sysconfdir)/udev/rules.d
+
+dist_udevrules_DATA += \
+ rules/50-udev-default.rules \
+ rules/60-block.rules \
+ rules/60-drm.rules \
+ rules/60-evdev.rules \
+ rules/60-persistent-storage-tape.rules \
+ rules/60-persistent-input.rules \
+ rules/60-persistent-alsa.rules \
+ rules/60-persistent-storage.rules \
+ rules/60-serial.rules \
+ rules/64-btrfs.rules \
+ rules/70-mouse.rules \
+ rules/75-net-description.rules \
+ rules/78-sound-card.rules \
+ rules/80-net-setup-link.rules
+
+nodist_udevrules_DATA += \
+ rules/99-systemd.rules
+
+udevconfdir = $(sysconfdir)/udev
+dist_udevconf_DATA = \
+ src/udev/udev.conf
+
+pkgconfigdata_DATA += \
+ src/udev/udev.pc
+
+EXTRA_DIST += \
+ rules/99-systemd.rules.in \
+ src/udev/udev.pc.in
+
+EXTRA_DIST += \
+ units/systemd-udevd.service.in \
+ units/systemd-udev-trigger.service.in \
+ units/systemd-udev-settle.service.in
+
+SOCKETS_TARGET_WANTS += \
+ systemd-udevd-control.socket \
+ systemd-udevd-kernel.socket
+
+SYSINIT_TARGET_WANTS += \
+ systemd-udevd.service \
+ systemd-udev-trigger.service
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/ata_id/Makefile b/src/grp-udev/ata_id/Makefile
new file mode 100644
index 0000000000..00a8c37ac2
--- /dev/null
+++ b/src/grp-udev/ata_id/Makefile
@@ -0,0 +1,35 @@
+# -*- 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
+
+ata_id_SOURCES = \
+ src/udev/ata_id/ata_id.c
+
+ata_id_LDADD = \
+ libshared.la
+
+udevlibexec_PROGRAMS += \
+ ata_id
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/ata_id/ata_id.c b/src/grp-udev/ata_id/ata_id.c
index 1e414664ce..4728d72a57 100644
--- a/src/grp-udev/ata_id/ata_id.c
+++ b/src/grp-udev/ata_id/ata_id.c
@@ -23,8 +23,6 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
-#include <linux/bsg.h>
-#include <linux/hdreg.h>
#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/sg.h>
@@ -37,12 +35,15 @@
#include <sys/types.h>
#include <unistd.h>
-#include "libudev.h"
+#include <linux/bsg.h>
+#include <linux/hdreg.h>
+
+#include <libudev.h>
-#include "fd-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
#include "libudev-private.h"
-#include "log.h"
-#include "udev-util.h"
+#include "shared/udev-util.h"
#define COMMAND_TIMEOUT_MSEC (30 * 1000)
diff --git a/src/grp-udev/cdrom_id/Makefile b/src/grp-udev/cdrom_id/Makefile
new file mode 100644
index 0000000000..a9297413d3
--- /dev/null
+++ b/src/grp-udev/cdrom_id/Makefile
@@ -0,0 +1,38 @@
+# -*- 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
+
+cdrom_id_SOURCES = \
+ src/udev/cdrom_id/cdrom_id.c
+
+cdrom_id_LDADD = \
+ libshared.la
+
+udevlibexec_PROGRAMS += \
+ cdrom_id
+
+dist_udevrules_DATA += \
+ rules/60-cdrom_id.rules
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/cdrom_id/cdrom_id.c b/src/grp-udev/cdrom_id/cdrom_id.c
index 72f284f710..9a5af6d614 100644
--- a/src/grp-udev/cdrom_id/cdrom_id.c
+++ b/src/grp-udev/cdrom_id/cdrom_id.c
@@ -21,7 +21,6 @@
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
-#include <linux/cdrom.h>
#include <scsi/sg.h>
#include <stddef.h>
#include <stdio.h>
@@ -34,10 +33,12 @@
#include <time.h>
#include <unistd.h>
-#include "libudev.h"
+#include <linux/cdrom.h>
+
+#include <libudev.h>
+#include "basic/random-util.h"
#include "libudev-private.h"
-#include "random-util.h"
/* device info */
static unsigned int cd_cd_rom;
diff --git a/src/grp-udev/collect/Makefile b/src/grp-udev/collect/Makefile
new file mode 100644
index 0000000000..60af3b7627
--- /dev/null
+++ b/src/grp-udev/collect/Makefile
@@ -0,0 +1,35 @@
+# -*- 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
+
+collect_SOURCES = \
+ src/udev/collect/collect.c
+
+collect_LDADD = \
+ libshared.la
+
+udevlibexec_PROGRAMS += \
+ collect
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/collect/collect.c b/src/grp-udev/collect/collect.c
index 349585b634..0e8f6b97fe 100644
--- a/src/grp-udev/collect/collect.c
+++ b/src/grp-udev/collect/collect.c
@@ -24,11 +24,11 @@
#include <stddef.h>
#include <stdio.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
#include "libudev-private.h"
-#include "macro.h"
-#include "stdio-util.h"
-#include "string-util.h"
#define BUFSIZE 16
#define UDEV_ALARM_TIMEOUT 180
diff --git a/src/grp-udev/hwdb/Makefile b/src/grp-udev/hwdb/Makefile
new file mode 100644
index 0000000000..e3e51d5c74
--- /dev/null
+++ b/src/grp-udev/hwdb/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
+
+.PHONY: hwdb-update
+hwdb-update:
+ ( cd $(top_srcdir)/hwdb && \
+ wget -O usb.ids 'http://www.linux-usb.org/usb.ids' && \
+ wget -O pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' && \
+ wget -O ma-large.txt 'http://standards.ieee.org/develop/regauth/oui/oui.txt' && \
+ wget -O ma-medium.txt 'http://standards.ieee.org/develop/regauth/oui28/mam.txt' && \
+ wget -O ma-small.txt 'http://standards.ieee.org/develop/regauth/oui36/oui36.txt' && \
+ ./ids-update.pl )
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/Makefile b/src/grp-udev/libudev-core/Makefile
new file mode 100644
index 0000000000..bc889eac2b
--- /dev/null
+++ b/src/grp-udev/libudev-core/Makefile
@@ -0,0 +1,101 @@
+# -*- 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 += \
+ libudev-core.la
+
+$(outdir)/keyboard-keys-list.txt:
+ $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($$2 != "KEY_MAX") { print $$2 } }' > $@
+
+$(outdir)/keyboard-keys-from-name.gperf: $(outdir)/keyboard-keys-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
+
+$(outdir)/keyboard-keys-from-name.h: $(outdir)/keyboard-keys-from-name.gperf
+ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
+
+gperf_txt_sources += \
+ src/udev/keyboard-keys-list.txt
+
+libudev_core_la_SOURCES = \
+ src/udev/udev.h \
+ src/udev/udev-event.c \
+ src/udev/udev-watch.c \
+ src/udev/udev-node.c \
+ src/udev/udev-rules.c \
+ src/udev/udev-ctrl.c \
+ src/udev/udev-builtin.c \
+ src/udev/udev-builtin-btrfs.c \
+ src/udev/udev-builtin-hwdb.c \
+ src/udev/udev-builtin-input_id.c \
+ src/udev/udev-builtin-keyboard.c \
+ src/udev/udev-builtin-net_id.c \
+ src/udev/udev-builtin-net_setup_link.c \
+ src/udev/udev-builtin-path_id.c \
+ src/udev/udev-builtin-usb_id.c \
+ src/udev/net/link-config.h \
+ src/udev/net/link-config.c \
+ src/udev/net/ethtool-util.h \
+ src/udev/net/ethtool-util.c
+
+nodist_libudev_core_la_SOURCES = \
+ src/udev/keyboard-keys-from-name.h \
+ src/udev/net/link-config-gperf.c
+
+gperf_gperf_sources += \
+ src/udev/net/link-config-gperf.gperf
+
+libudev_core_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(BLKID_CFLAGS) \
+ $(KMOD_CFLAGS)
+
+libudev_core_la_LIBADD = \
+ libsystemd-network.la \
+ libshared.la \
+ $(BLKID_LIBS) \
+ $(KMOD_LIBS)
+
+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),)
+libudev_core_la_SOURCES += \
+ src/udev/udev-builtin-blkid.c
+endif # HAVE_BLKID
+
+ifneq ($(HAVE_ACL),)
+libudev_core_la_SOURCES += \
+ src/udev/udev-builtin-uaccess.c \
+ src/login/logind-acl.c \
+ src/libsystemd/sd-login/sd-login.c \
+ src/systemd/sd-login.h
+endif # HAVE_ACL
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/net/ethtool-util.c b/src/grp-udev/libudev-core/net/ethtool-util.c
index c00ff79123..b381284a6b 100644
--- a/src/grp-udev/libudev-core/net/ethtool-util.c
+++ b/src/grp-udev/libudev-core/net/ethtool-util.c
@@ -19,15 +19,17 @@
#include <net/if.h>
#include <sys/ioctl.h>
+
#include <linux/ethtool.h>
#include <linux/sockios.h>
-#include "conf-parser.h"
+#include "basic/log.h"
+#include "basic/string-table.h"
+#include "basic/strxcpyx.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
+
#include "ethtool-util.h"
-#include "log.h"
-#include "string-table.h"
-#include "strxcpyx.h"
-#include "util.h"
static const char* const duplex_table[_DUP_MAX] = {
[DUP_FULL] = "full",
diff --git a/src/grp-udev/libudev-core/net/ethtool-util.h b/src/grp-udev/libudev-core/net/ethtool-util.h
index 7716516e76..7d103d9f2f 100644
--- a/src/grp-udev/libudev-core/net/ethtool-util.h
+++ b/src/grp-udev/libudev-core/net/ethtool-util.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <macro.h>
+#include "basic/macro.h"
/* we can't use DUPLEX_ prefix, as it
* clashes with <linux/ethtool.h> */
diff --git a/src/grp-udev/libudev-core/net/link-config.c b/src/grp-udev/libudev-core/net/link-config.c
index 350cd24e9c..f6803e00df 100644
--- a/src/grp-udev/libudev-core/net/link-config.c
+++ b/src/grp-udev/libudev-core/net/link-config.c
@@ -19,28 +19,28 @@
#include <netinet/ether.h>
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/random-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "libudev-private.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/network-internal.h"
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
#include "ethtool-util.h"
-#include "fd-util.h"
-#include "libudev-private.h"
#include "link-config.h"
-#include "log.h"
-#include "missing.h"
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "random-util.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
struct link_config_ctx {
LIST_HEAD(link_config, links);
diff --git a/src/grp-udev/libudev-core/net/link-config.h b/src/grp-udev/libudev-core/net/link-config.h
index 9df5529d05..ad5211610a 100644
--- a/src/grp-udev/libudev-core/net/link-config.h
+++ b/src/grp-udev/libudev-core/net/link-config.h
@@ -19,11 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/list.h"
+#include "shared/condition.h"
-#include "condition.h"
#include "ethtool-util.h"
-#include "list.h"
typedef struct link_config_ctx link_config_ctx;
typedef struct link_config link_config;
diff --git a/src/grp-udev/libudev-core/udev-builtin-blkid.c b/src/grp-udev/libudev-core/udev-builtin-blkid.c
index 62cd93264b..89fa75fa73 100644
--- a/src/grp-udev/libudev-core/udev-builtin-blkid.c
+++ b/src/grp-udev/libudev-core/udev-builtin-blkid.c
@@ -29,11 +29,11 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "efivars.h"
-#include "fd-util.h"
-#include "gpt.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
+#include "shared/efivars.h"
+#include "shared/gpt.h"
#include "udev.h"
static void print_property(struct udev_device *dev, bool test, const char *name, const char *value) {
diff --git a/src/grp-udev/libudev-core/udev-builtin-hwdb.c b/src/grp-udev/libudev-core/udev-builtin-hwdb.c
index b96f39ba20..d2d95bf394 100644
--- a/src/grp-udev/libudev-core/udev-builtin-hwdb.c
+++ b/src/grp-udev/libudev-core/udev-builtin-hwdb.c
@@ -22,12 +22,11 @@
#include <stdio.h>
#include <stdlib.h>
-#include <systemd/sd-hwdb.h>
-
-#include "alloc-util.h"
-#include "hwdb-util.h"
-#include "string-util.h"
-#include "udev-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "sd-hwdb/hwdb-util.h"
+#include "sd-hwdb/sd-hwdb.h"
+#include "shared/udev-util.h"
#include "udev.h"
static sd_hwdb *hwdb;
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 51a55cdbc4..bc2cab1cb8 100644
--- a/src/grp-udev/libudev-core/udev-builtin-input_id.c
+++ b/src/grp-udev/libudev-core/udev-builtin-input_id.c
@@ -27,14 +27,15 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+
#include <linux/limits.h>
#include <linux/input.h>
-#include "fd-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
+#include "basic/fd-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "udev.h"
-#include "util.h"
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(unsigned long) * 8)
diff --git a/src/grp-udev/libudev-core/udev-builtin-keyboard.c b/src/grp-udev/libudev-core/udev-builtin-keyboard.c
index aa10beafb0..d07eff08d6 100644
--- a/src/grp-udev/libudev-core/udev-builtin-keyboard.c
+++ b/src/grp-udev/libudev-core/udev-builtin-keyboard.c
@@ -21,12 +21,13 @@
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
+
#include <linux/input.h>
-#include "fd-util.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
+#include "basic/fd-util.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static const struct key *keyboard_lookup_key(const char *str, unsigned len);
diff --git a/src/grp-udev/libudev-core/udev-builtin-kmod.c b/src/grp-udev/libudev-core/udev-builtin-kmod.c
index 9665f678fd..15d23c0f0e 100644
--- a/src/grp-udev/libudev-core/udev-builtin-kmod.c
+++ b/src/grp-udev/libudev-core/udev-builtin-kmod.c
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "string-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static struct kmod_ctx *ctx = NULL;
diff --git a/src/grp-udev/libudev-core/udev-builtin-net_id.c b/src/grp-udev/libudev-core/udev-builtin-net_id.c
index a7be2a4eed..51f734d2c1 100644
--- a/src/grp-udev/libudev-core/udev-builtin-net_id.c
+++ b/src/grp-udev/libudev-core/udev-builtin-net_id.c
@@ -96,12 +96,13 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+
#include <linux/pci_regs.h>
-#include "fd-util.h"
-#include "fileio.h"
-#include "stdio-util.h"
-#include "string-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
#include "udev.h"
#define ONBOARD_INDEX_MAX (16*1024-1)
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 8e47775135..bf36b42957 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
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
#include "link-config.h"
-#include "log.h"
#include "udev.h"
static link_config_ctx *ctx = NULL;
diff --git a/src/grp-udev/libudev-core/udev-builtin-path_id.c b/src/grp-udev/libudev-core/udev-builtin-path_id.c
index 6e9adc6e96..4476b90c72 100644
--- a/src/grp-udev/libudev-core/udev-builtin-path_id.c
+++ b/src/grp-udev/libudev-core/udev-builtin-path_id.c
@@ -30,8 +30,8 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
#include "udev.h"
_printf_(2,3)
diff --git a/src/grp-udev/libudev-core/udev-builtin-uaccess.c b/src/grp-udev/libudev-core/udev-builtin-uaccess.c
index 2c27116ae9..91bd843f80 100644
--- a/src/grp-udev/libudev-core/udev-builtin-uaccess.c
+++ b/src/grp-udev/libudev-core/udev-builtin-uaccess.c
@@ -24,10 +24,10 @@
#include <systemd/sd-login.h>
-#include "login-util.h"
+#include "basic/login-util.h"
+#include "basic/util.h"
#include "logind-acl.h"
#include "udev.h"
-#include "util.h"
static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool test) {
int r;
diff --git a/src/grp-udev/libudev-core/udev-builtin-usb_id.c b/src/grp-udev/libudev-core/udev-builtin-usb_id.c
index 587649eff0..fcaf8551d8 100644
--- a/src/grp-udev/libudev-core/udev-builtin-usb_id.c
+++ b/src/grp-udev/libudev-core/udev-builtin-usb_id.c
@@ -29,9 +29,9 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static void set_usb_iftype(char *to, int if_class_num, size_t len) {
diff --git a/src/grp-udev/libudev-core/udev-builtin.c b/src/grp-udev/libudev-core/udev-builtin.c
index e6b36f124f..13d3cd4ee0 100644
--- a/src/grp-udev/libudev-core/udev-builtin.c
+++ b/src/grp-udev/libudev-core/udev-builtin.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <string.h>
-#include "string-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static bool initialized;
diff --git a/src/grp-udev/libudev-core/udev-ctrl.c b/src/grp-udev/libudev-core/udev-ctrl.c
index f68a09d7a8..4336aa58ab 100644
--- a/src/grp-udev/libudev-core/udev-ctrl.c
+++ b/src/grp-udev/libudev-core/udev-ctrl.c
@@ -18,10 +18,10 @@
#include <sys/un.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "socket-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/socket-util.h"
#include "udev.h"
/* wire protocol magic must match */
diff --git a/src/grp-udev/libudev-core/udev-event.c b/src/grp-udev/libudev-core/udev-event.c
index 8d601c9c2c..59f4e1fb35 100644
--- a/src/grp-udev/libudev-core/udev-event.c
+++ b/src/grp-udev/libudev-core/udev-event.c
@@ -30,13 +30,13 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "netlink-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "sd-netlink/netlink-util.h"
#include "udev.h"
typedef struct Spawn {
diff --git a/src/grp-udev/libudev-core/udev-node.c b/src/grp-udev/libudev-core/udev-node.c
index 5d2997fd8f..3a2daa89ad 100644
--- a/src/grp-udev/libudev-core/udev-node.c
+++ b/src/grp-udev/libudev-core/udev-node.c
@@ -25,12 +25,12 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "formats-util.h"
-#include "fs-util.h"
-#include "selinux-util.h"
-#include "smack-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static int node_symlink(struct udev_device *dev, const char *node, const char *slink) {
diff --git a/src/grp-udev/libudev-core/udev-rules.c b/src/grp-udev/libudev-core/udev-rules.c
index 26fa52cf6c..134d269fd8 100644
--- a/src/grp-udev/libudev-core/udev-rules.c
+++ b/src/grp-udev/libudev-core/udev-rules.c
@@ -29,22 +29,22 @@
#include <time.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "glob-util.h"
-#include "path-util.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "strbuf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "sysctl-util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/glob-util.h"
+#include "basic/path-util.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/strbuf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/sysctl-util.h"
#include "udev.h"
-#include "user-util.h"
-#include "util.h"
#define PREALLOC_TOKEN 2048
diff --git a/src/grp-udev/libudev-core/udev-watch.c b/src/grp-udev/libudev-core/udev-watch.c
index 9ce5e975de..7dcc71556e 100644
--- a/src/grp-udev/libudev-core/udev-watch.c
+++ b/src/grp-udev/libudev-core/udev-watch.c
@@ -24,7 +24,7 @@
#include <sys/inotify.h>
#include <unistd.h>
-#include "stdio-util.h"
+#include "basic/stdio-util.h"
#include "udev.h"
static int inotify_fd = -1;
diff --git a/src/grp-udev/mtd_probe/Makefile b/src/grp-udev/mtd_probe/Makefile
new file mode 100644
index 0000000000..d7392a8a3b
--- /dev/null
+++ b/src/grp-udev/mtd_probe/Makefile
@@ -0,0 +1,37 @@
+# -*- 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
+
+mtd_probe_SOURCES = \
+ src/udev/mtd_probe/mtd_probe.c \
+ src/udev/mtd_probe/mtd_probe.h \
+ src/udev/mtd_probe/probe_smartmedia.c
+
+dist_udevrules_DATA += \
+ rules/75-probe_mtd.rules
+
+udevlibexec_PROGRAMS += \
+ mtd_probe
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/mtd_probe/mtd_probe.h b/src/grp-udev/mtd_probe/mtd_probe.h
index 68e4954537..83f241ac94 100644
--- a/src/grp-udev/mtd_probe/mtd_probe.h
+++ b/src/grp-udev/mtd_probe/mtd_probe.h
@@ -21,7 +21,7 @@
#include <mtd/mtd-user.h>
-#include "macro.h"
+#include "basic/macro.h"
/* Full oob structure as written on the flash */
struct sm_oob {
diff --git a/src/grp-udev/scsi_id/Makefile b/src/grp-udev/scsi_id/Makefile
new file mode 100644
index 0000000000..7064a864f7
--- /dev/null
+++ b/src/grp-udev/scsi_id/Makefile
@@ -0,0 +1,41 @@
+# -*- 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
+
+scsi_id_SOURCES =\
+ src/udev/scsi_id/scsi_id.c \
+ src/udev/scsi_id/scsi_serial.c \
+ src/udev/scsi_id/scsi.h \
+ src/udev/scsi_id/scsi_id.h
+
+scsi_id_LDADD = \
+ libshared.la
+
+udevlibexec_PROGRAMS += \
+ scsi_id
+
+EXTRA_DIST += \
+ src/udev/scsi_id/README
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/scsi_id/scsi_id.c b/src/grp-udev/scsi_id/scsi_id.c
index 4655691642..83011e918e 100644
--- a/src/grp-udev/scsi_id/scsi_id.c
+++ b/src/grp-udev/scsi_id/scsi_id.c
@@ -29,13 +29,14 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
-#include "fd-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
#include "libudev-private.h"
+#include "shared/udev-util.h"
+
#include "scsi_id.h"
-#include "string-util.h"
-#include "udev-util.h"
static const struct option options[] = {
{ "device", required_argument, NULL, 'd' },
diff --git a/src/grp-udev/scsi_id/scsi_serial.c b/src/grp-udev/scsi_id/scsi_serial.c
index e079e28698..544fcde108 100644
--- a/src/grp-udev/scsi_id/scsi_serial.c
+++ b/src/grp-udev/scsi_id/scsi_serial.c
@@ -20,8 +20,6 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <linux/bsg.h>
-#include <linux/types.h>
#include <scsi/scsi.h>
#include <scsi/sg.h>
#include <stdio.h>
@@ -33,13 +31,17 @@
#include <time.h>
#include <unistd.h>
-#include "libudev.h"
+#include <linux/bsg.h>
+#include <linux/types.h>
+
+#include <libudev.h>
+#include "basic/random-util.h"
+#include "basic/string-util.h"
#include "libudev-private.h"
-#include "random-util.h"
+
#include "scsi.h"
#include "scsi_id.h"
-#include "string-util.h"
/*
* A priority based list of id, naa, and binary/ascii for the identifier
diff --git a/src/grp-udev/systemd-hwdb/Makefile b/src/grp-udev/systemd-hwdb/Makefile
new file mode 100644
index 0000000000..03e7c283f2
--- /dev/null
+++ b/src/grp-udev/systemd-hwdb/Makefile
@@ -0,0 +1,76 @@
+# -*- 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_HWDB),)
+INSTALL_DIRS += \
+ $(sysconfdir)/udev/hwdb.d
+
+systemd_hwdb_SOURCES = \
+ src/libsystemd/sd-hwdb/hwdb-internal.h \
+ src/hwdb/hwdb.c
+
+systemd_hwdb_LDADD = \
+ libshared.la
+
+rootbin_PROGRAMS += \
+ systemd-hwdb
+
+dist_udevhwdb_DATA = \
+ hwdb/20-pci-vendor-model.hwdb \
+ hwdb/20-pci-classes.hwdb \
+ hwdb/20-usb-vendor-model.hwdb \
+ hwdb/20-usb-classes.hwdb \
+ hwdb/20-sdio-vendor-model.hwdb \
+ hwdb/20-sdio-classes.hwdb \
+ hwdb/20-bluetooth-vendor-product.hwdb \
+ hwdb/20-acpi-vendor.hwdb \
+ hwdb/20-OUI.hwdb \
+ hwdb/20-net-ifname.hwdb \
+ hwdb/60-evdev.hwdb \
+ hwdb/60-keyboard.hwdb \
+ hwdb/70-mouse.hwdb \
+ hwdb/70-pointingstick.hwdb
+
+SYSINIT_TARGET_WANTS += \
+ systemd-hwdb-update.service
+
+# Update hwdb on installation. Do not bother if installing
+# in DESTDIR, since this is likely for packaging purposes.
+hwdb-update-hook:
+ -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update
+
+INSTALL_DATA_HOOKS += \
+ hwdb-update-hook
+
+hwdb-remove-hook:
+ -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
+endif # ENABLE_HWDB
+
+EXTRA_DIST += \
+ units/systemd-hwdb-update.service.in \
+ hwdb/ids-update.pl \
+ hwdb/sdio.ids
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/systemd-hwdb/hwdb.c b/src/grp-udev/systemd-hwdb/hwdb.c
index 1160dacdf1..0e96716b0f 100644
--- a/src/grp-udev/systemd-hwdb/hwdb.c
+++ b/src/grp-udev/systemd-hwdb/hwdb.c
@@ -22,19 +22,19 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hwdb-internal.h"
-#include "hwdb-util.h"
-#include "mkdir.h"
-#include "strbuf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
-#include "verbs.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/mkdir.h"
+#include "basic/strbuf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "basic/verbs.h"
+#include "sd-hwdb/hwdb-internal.h"
+#include "sd-hwdb/hwdb-util.h"
/*
* Generic udev properties, key/value database based on modalias strings.
diff --git a/src/grp-udev/systemd-udevd/Makefile b/src/grp-udev/systemd-udevd/Makefile
new file mode 100644
index 0000000000..5bbc548cfe
--- /dev/null
+++ b/src/grp-udev/systemd-udevd/Makefile
@@ -0,0 +1,35 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += \
+ systemd-udevd
+
+systemd_udevd_SOURCES = \
+ src/udev/udevd.c
+
+systemd_udevd_LDADD = \
+ libudev-core.la
+
+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 89006e6e3a..4915a285a5 100644
--- a/src/grp-udev/systemd-udevd/udevd.c
+++ b/src/grp-udev/systemd-udevd/udevd.c
@@ -43,28 +43,28 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "cpu-set-util.h"
-#include "dev-setup.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "io-util.h"
-#include "netlink-util.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "udev-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/cpu-set-util.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/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#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"
-#include "user-util.h"
static bool arg_debug = false;
static int arg_daemonize = false;
diff --git a/src/grp-udev/udevadm/Makefile b/src/grp-udev/udevadm/Makefile
new file mode 100644
index 0000000000..ba3b466935
--- /dev/null
+++ b/src/grp-udev/udevadm/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
+
+rootbin_PROGRAMS += \
+ udevadm
+
+udevadm_SOURCES = \
+ src/udev/udevadm.c \
+ src/udev/udevadm-info.c \
+ src/udev/udevadm-control.c \
+ src/udev/udevadm-monitor.c \
+ src/udev/udevadm-hwdb.c \
+ src/udev/udevadm-settle.c \
+ src/udev/udevadm-trigger.c \
+ src/udev/udevadm-test.c \
+ src/udev/udevadm-test-builtin.c \
+ src/udev/udevadm-util.c \
+ src/udev/udevadm-util.h
+
+udevadm_LDADD = \
+ libudev-core.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/udevadm/udevadm-control.c b/src/grp-udev/udevadm/udevadm-control.c
index 989decbe95..8aaef5fa14 100644
--- a/src/grp-udev/udevadm/udevadm-control.c
+++ b/src/grp-udev/udevadm/udevadm-control.c
@@ -20,7 +20,7 @@
#include <string.h>
#include <unistd.h>
-#include "udev-util.h"
+#include "shared/udev-util.h"
#include "udev.h"
static void print_help(void) {
diff --git a/src/grp-udev/udevadm/udevadm-hwdb.c b/src/grp-udev/udevadm/udevadm-hwdb.c
index 948ad0f5a5..3446de358c 100644
--- a/src/grp-udev/udevadm/udevadm-hwdb.c
+++ b/src/grp-udev/udevadm/udevadm-hwdb.c
@@ -22,16 +22,16 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hwdb-internal.h"
-#include "hwdb-util.h"
-#include "strbuf.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/strbuf.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-hwdb/hwdb-internal.h"
+#include "sd-hwdb/hwdb-util.h"
#include "udev.h"
-#include "util.h"
/*
* Generic udev properties, key/value database based on modalias strings.
diff --git a/src/grp-udev/udevadm/udevadm-info.c b/src/grp-udev/udevadm/udevadm-info.c
index 7182668f23..f8b2d915a4 100644
--- a/src/grp-udev/udevadm/udevadm-info.c
+++ b/src/grp-udev/udevadm/udevadm-info.c
@@ -26,10 +26,11 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "string-util.h"
-#include "udev-util.h"
+#include "basic/fd-util.h"
+#include "basic/string-util.h"
+#include "shared/udev-util.h"
#include "udev.h"
+
#include "udevadm-util.h"
static bool skip_attribute(const char *name) {
diff --git a/src/grp-udev/udevadm/udevadm-monitor.c b/src/grp-udev/udevadm/udevadm-monitor.c
index c0ef073476..01f322f721 100644
--- a/src/grp-udev/udevadm/udevadm-monitor.c
+++ b/src/grp-udev/udevadm/udevadm-monitor.c
@@ -25,9 +25,9 @@
#include <sys/time.h>
#include <time.h>
-#include "fd-util.h"
-#include "formats-util.h"
-#include "udev-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "shared/udev-util.h"
#include "udev.h"
static bool udev_exit;
diff --git a/src/grp-udev/udevadm/udevadm-settle.c b/src/grp-udev/udevadm/udevadm-settle.c
index 6a5dc6e9e4..2a7a150517 100644
--- a/src/grp-udev/udevadm/udevadm-settle.c
+++ b/src/grp-udev/udevadm/udevadm-settle.c
@@ -26,9 +26,9 @@
#include <string.h>
#include <unistd.h>
-#include "parse-util.h"
+#include "basic/parse-util.h"
+#include "basic/util.h"
#include "udev.h"
-#include "util.h"
static void help(void) {
printf("%s settle OPTIONS\n\n"
diff --git a/src/grp-udev/udevadm/udevadm-test-builtin.c b/src/grp-udev/udevadm/udevadm-test-builtin.c
index 0b180d03eb..a3a66e05d7 100644
--- a/src/grp-udev/udevadm/udevadm-test-builtin.c
+++ b/src/grp-udev/udevadm/udevadm-test-builtin.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "string-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static void help(struct udev *udev) {
diff --git a/src/grp-udev/udevadm/udevadm-test.c b/src/grp-udev/udevadm/udevadm-test.c
index 702dbe5282..ed919ec244 100644
--- a/src/grp-udev/udevadm/udevadm-test.c
+++ b/src/grp-udev/udevadm/udevadm-test.c
@@ -25,8 +25,8 @@
#include <sys/signalfd.h>
#include <unistd.h>
-#include "string-util.h"
-#include "udev-util.h"
+#include "basic/string-util.h"
+#include "shared/udev-util.h"
#include "udev.h"
static void help(void) {
diff --git a/src/grp-udev/udevadm/udevadm-trigger.c b/src/grp-udev/udevadm/udevadm-trigger.c
index 9d52345d92..280f348fae 100644
--- a/src/grp-udev/udevadm/udevadm-trigger.c
+++ b/src/grp-udev/udevadm/udevadm-trigger.c
@@ -23,11 +23,12 @@
#include <string.h>
#include <unistd.h>
-#include "string-util.h"
-#include "udev-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/udev-util.h"
#include "udev.h"
+
#include "udevadm-util.h"
-#include "util.h"
static int verbose;
static int dry_run;
diff --git a/src/grp-udev/udevadm/udevadm-util.c b/src/grp-udev/udevadm/udevadm-util.c
index 3539c1d6ab..8dc871cb10 100644
--- a/src/grp-udev/udevadm/udevadm-util.c
+++ b/src/grp-udev/udevadm/udevadm-util.c
@@ -15,7 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "string-util.h"
+#include "basic/string-util.h"
+
#include "udevadm-util.h"
struct udev_device *find_device(struct udev *udev,
diff --git a/src/grp-udev/udevadm/udevadm.c b/src/grp-udev/udevadm/udevadm.c
index a6a873e5de..555d269275 100644
--- a/src/grp-udev/udevadm/udevadm.c
+++ b/src/grp-udev/udevadm/udevadm.c
@@ -20,8 +20,8 @@
#include <stddef.h>
#include <stdio.h>
-#include "selinux-util.h"
-#include "string-util.h"
+#include "basic/selinux-util.h"
+#include "basic/string-util.h"
#include "udev.h"
static int adm_version(struct udev *udev, int argc, char *argv[]) {
diff --git a/src/grp-udev/v4l_id/Makefile b/src/grp-udev/v4l_id/Makefile
new file mode 100644
index 0000000000..0641af8065
--- /dev/null
+++ b/src/grp-udev/v4l_id/Makefile
@@ -0,0 +1,38 @@
+# -*- 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
+
+v4l_id_SOURCES = \
+ src/udev/v4l_id/v4l_id.c
+
+v4l_id_LDADD = \
+ libshared.la
+
+udevlibexec_PROGRAMS += \
+ v4l_id
+
+dist_udevrules_DATA += \
+ rules/60-persistent-v4l.rules
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/v4l_id/v4l_id.c b/src/grp-udev/v4l_id/v4l_id.c
index aec6676a33..d1aad403b9 100644
--- a/src/grp-udev/v4l_id/v4l_id.c
+++ b/src/grp-udev/v4l_id/v4l_id.c
@@ -24,10 +24,11 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <linux/videodev2.h>
-#include "fd-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
static const struct option options[] = {
diff --git a/src/grp-utils/systemd-ac-power/Makefile b/src/grp-utils/systemd-ac-power/Makefile
new file mode 100644
index 0000000000..ec35048162
--- /dev/null
+++ b/src/grp-utils/systemd-ac-power/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-ac-power
+systemd_ac_power_SOURCES = \
+ src/ac-power/ac-power.c
+
+systemd_ac_power_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-ac-power/ac-power.c b/src/grp-utils/systemd-ac-power/ac-power.c
index c5277884a8..945c318f66 100644
--- a/src/grp-utils/systemd-ac-power/ac-power.c
+++ b/src/grp-utils/systemd-ac-power/ac-power.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
int r;
diff --git a/src/grp-utils/systemd-escape/Makefile b/src/grp-utils/systemd-escape/Makefile
new file mode 100644
index 0000000000..4eb2fe356a
--- /dev/null
+++ b/src/grp-utils/systemd-escape/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemd-escape
+
+systemd_escape_SOURCES = \
+ src/escape/escape.c
+
+systemd_escape_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-escape/escape.c b/src/grp-utils/systemd-escape/escape.c
index 9f39049577..479ea0e87c 100644
--- a/src/grp-utils/systemd-escape/escape.c
+++ b/src/grp-utils/systemd-escape/escape.c
@@ -21,11 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "log.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
static enum {
ACTION_ESCAPE,
diff --git a/src/grp-utils/systemd-notify/Makefile b/src/grp-utils/systemd-notify/Makefile
new file mode 100644
index 0000000000..60e1336e72
--- /dev/null
+++ b/src/grp-utils/systemd-notify/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemd-notify
+systemd_notify_SOURCES = \
+ src/notify/notify.c
+
+systemd_notify_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-notify/notify.c b/src/grp-utils/systemd-notify/notify.c
index b18fb5938f..4db49508b3 100644
--- a/src/grp-utils/systemd-notify/notify.c
+++ b/src/grp-utils/systemd-notify/notify.c
@@ -25,14 +25,14 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "env-util.h"
-#include "formats-util.h"
-#include "log.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/env-util.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static bool arg_ready = false;
static pid_t arg_pid = 0;
diff --git a/src/grp-utils/systemd-path/Makefile b/src/grp-utils/systemd-path/Makefile
new file mode 100644
index 0000000000..442dbf00b4
--- /dev/null
+++ b/src/grp-utils/systemd-path/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-path
+
+systemd_path_SOURCES = \
+ src/path/path.c
+
+systemd_path_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-path/path.c b/src/grp-utils/systemd-path/path.c
index 80268ed874..ed824fa857 100644
--- a/src/grp-utils/systemd-path/path.c
+++ b/src/grp-utils/systemd-path/path.c
@@ -22,13 +22,13 @@
#include <stdio.h>
#include <stdlib.h>
-#include <systemd/sd-path.h>
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
-#include "alloc-util.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "sd-path.h"
static const char *arg_suffix = NULL;
diff --git a/src/grp-utils/systemd-path/sd-path.c b/src/grp-utils/systemd-path/sd-path.c
index 6d9f3e2a61..2e0a0a7cfd 100644
--- a/src/grp-utils/systemd-path/sd-path.c
+++ b/src/grp-utils/systemd-path/sd-path.c
@@ -17,18 +17,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-path.h>
-
-#include "alloc-util.h"
-#include "architecture.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "missing.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/missing.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
+#include "sd-path.h"
static int from_environment(const char *envname, const char *fallback, const char **ret) {
assert(ret);
diff --git a/src/grp-utils/systemd-path/sd-path.h b/src/grp-utils/systemd-path/sd-path.h
index be6abdcd03..cac5ce761d 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 "_sd-common.h"
+#include <systemd/_sd-common.h>
_SD_BEGIN_DECLARATIONS;
diff --git a/src/grp-utils/systemd-socket-activate/Makefile b/src/grp-utils/systemd-socket-activate/Makefile
new file mode 100644
index 0000000000..7d69a80d36
--- /dev/null
+++ b/src/grp-utils/systemd-socket-activate/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
+
+
+bin_PROGRAMS += \
+ systemd-socket-activate
+
+systemd_socket_activate_SOURCES = \
+ src/activate/activate.c
+
+systemd_socket_activate_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-socket-activate/activate.c b/src/grp-utils/systemd-socket-activate/activate.c
index 89cc1ee813..2ad205af17 100644
--- a/src/grp-utils/systemd-socket-activate/activate.c
+++ b/src/grp-utils/systemd-socket-activate/activate.c
@@ -26,15 +26,15 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
static char** arg_listen = NULL;
static bool arg_accept = false;
diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile
new file mode 100644
index 0000000000..45d408fa19
--- /dev/null
+++ b/src/libbasic/Makefile
@@ -0,0 +1,27 @@
+# -*- 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
+
+at.subdirs += src include
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/Makefile b/src/libbasic/include/Makefile
new file mode 100644
index 0000000000..0aa8325a7e
--- /dev/null
+++ b/src/libbasic/include/Makefile
@@ -0,0 +1,27 @@
+# -*- 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
+
+at.subdirs += basic
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/basic/Makefile b/src/libbasic/include/basic/Makefile
new file mode 100644
index 0000000000..eb8483fe8f
--- /dev/null
+++ b/src/libbasic/include/basic/Makefile
@@ -0,0 +1,62 @@
+# -*- 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)/errno-list.txt:
+ $(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
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
+
+
+$(outdir)/af-list.txt:
+ $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@
+
+$(outdir)/af-to-name.h: $(outdir)/af-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
+
+
+$(outdir)/arphrd-list.txt:
+ $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@
+
+$(outdir)/arphrd-to-name.h: $(outdir)/arphrd-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
+
+$(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-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 "};"}' <$< >$@
+
+$(outdir)/cap-from-name.gperf: $(outdir)/cap-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
+
+$(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 <$< >$@
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/include/basic/escape.h b/src/libbasic/include/basic/escape.h
index deaa4def28..6e58f61e19 100644
--- a/src/libbasic/include/basic/escape.h
+++ b/src/libbasic/include/basic/escape.h
@@ -25,8 +25,8 @@
#include <sys/types.h>
#include <uchar.h>
-#include "string-util.h"
#include "missing.h"
+#include "string-util.h"
/* What characters are special in the shell? */
/* must be escaped outside and inside double-quotes */
diff --git a/src/libbasic/include/basic/missing.h b/src/libbasic/include/basic/missing.h
index 651e414395..168d8cdb0a 100644
--- a/src/libbasic/include/basic/missing.h
+++ b/src/libbasic/include/basic/missing.h
@@ -23,6 +23,13 @@
#include <errno.h>
#include <fcntl.h>
+#include <net/ethernet.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include <sys/syscall.h>
+#include <uchar.h>
+#include <unistd.h>
+
#include <linux/audit.h>
#include <linux/capability.h>
#include <linux/if_link.h>
@@ -31,12 +38,6 @@
#include <linux/neighbour.h>
#include <linux/oom.h>
#include <linux/rtnetlink.h>
-#include <net/ethernet.h>
-#include <stdlib.h>
-#include <sys/resource.h>
-#include <sys/syscall.h>
-#include <uchar.h>
-#include <unistd.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
diff --git a/src/libbasic/include/basic/socket-util.h b/src/libbasic/include/basic/socket-util.h
index e9230e4a9f..bad1f32e09 100644
--- a/src/libbasic/include/basic/socket-util.h
+++ b/src/libbasic/include/basic/socket-util.h
@@ -26,6 +26,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
+
#include <linux/netlink.h>
#include <linux/if_packet.h>
diff --git a/src/libbasic/src/Makefile b/src/libbasic/src/Makefile
new file mode 100644
index 0000000000..2fc52e91f5
--- /dev/null
+++ b/src/libbasic/src/Makefile
@@ -0,0 +1,243 @@
+# -*- 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 += \
+ libbasic.la
+
+libbasic_la_SOURCES = \
+ src/basic/missing.h \
+ src/basic/missing_syscall.h \
+ src/basic/capability-util.c \
+ src/basic/capability-util.h \
+ src/basic/conf-files.c \
+ src/basic/conf-files.h \
+ src/basic/stdio-util.h \
+ src/basic/hostname-util.h \
+ src/basic/hostname-util.c \
+ src/basic/unit-name.c \
+ src/basic/unit-name.h \
+ src/basic/ioprio.h \
+ src/basic/securebits.h \
+ src/basic/special.h \
+ src/basic/list.h \
+ src/basic/unaligned.h \
+ src/basic/macro.h \
+ src/basic/def.h \
+ src/basic/sparse-endian.h \
+ src/basic/refcnt.h \
+ src/basic/util.c \
+ src/basic/util.h \
+ src/basic/io-util.c \
+ src/basic/io-util.h \
+ src/basic/string-util.c \
+ src/basic/string-util.h \
+ src/basic/fd-util.c \
+ src/basic/fd-util.h \
+ src/basic/parse-util.c \
+ src/basic/parse-util.h \
+ src/basic/user-util.c \
+ src/basic/user-util.h \
+ src/basic/rlimit-util.c \
+ src/basic/rlimit-util.h \
+ src/basic/dirent-util.c \
+ src/basic/dirent-util.h \
+ src/basic/xattr-util.c \
+ src/basic/xattr-util.h \
+ src/basic/chattr-util.c \
+ src/basic/chattr-util.h \
+ src/basic/proc-cmdline.c \
+ src/basic/proc-cmdline.h \
+ src/basic/fs-util.c \
+ src/basic/fs-util.h \
+ src/basic/syslog-util.c \
+ src/basic/syslog-util.h \
+ src/basic/stat-util.c \
+ src/basic/stat-util.h \
+ src/basic/mount-util.c \
+ src/basic/mount-util.h \
+ src/basic/hexdecoct.c \
+ src/basic/hexdecoct.h \
+ src/basic/glob-util.h \
+ src/basic/glob-util.c \
+ src/basic/extract-word.c \
+ src/basic/extract-word.h \
+ src/basic/escape.c \
+ src/basic/escape.h \
+ src/basic/cpu-set-util.c \
+ src/basic/cpu-set-util.h \
+ src/basic/lockfile-util.c \
+ src/basic/lockfile-util.h \
+ src/basic/path-util.c \
+ src/basic/path-util.h \
+ src/basic/time-util.c \
+ src/basic/time-util.h \
+ src/basic/locale-util.c \
+ src/basic/locale-util.h \
+ src/basic/umask-util.h \
+ src/basic/signal-util.c \
+ src/basic/signal-util.h \
+ src/basic/string-table.c \
+ src/basic/string-table.h \
+ src/basic/mempool.c \
+ src/basic/mempool.h \
+ src/basic/hashmap.c \
+ src/basic/hashmap.h \
+ src/basic/hash-funcs.c \
+ src/basic/hash-funcs.h \
+ src/basic/siphash24.c \
+ src/basic/siphash24.h \
+ src/basic/set.h \
+ src/basic/ordered-set.h \
+ src/basic/ordered-set.c \
+ src/basic/bitmap.c \
+ src/basic/bitmap.h \
+ src/basic/fdset.c \
+ src/basic/fdset.h \
+ src/basic/prioq.c \
+ src/basic/prioq.h \
+ src/basic/web-util.c \
+ src/basic/web-util.h \
+ src/basic/strv.c \
+ src/basic/strv.h \
+ src/basic/env-util.c \
+ src/basic/env-util.h \
+ src/basic/strbuf.c \
+ src/basic/strbuf.h \
+ src/basic/strxcpyx.c \
+ src/basic/strxcpyx.h \
+ src/basic/log.c \
+ src/basic/log.h \
+ src/basic/bus-label.c \
+ src/basic/bus-label.h \
+ src/basic/ratelimit.h \
+ src/basic/ratelimit.c \
+ src/basic/exit-status.c \
+ src/basic/exit-status.h \
+ src/basic/virt.c \
+ src/basic/virt.h \
+ src/basic/architecture.c \
+ src/basic/architecture.h \
+ src/basic/smack-util.c \
+ src/basic/smack-util.h \
+ src/basic/device-nodes.c \
+ src/basic/device-nodes.h \
+ src/basic/utf8.c \
+ src/basic/utf8.h \
+ src/basic/gunicode.c \
+ src/basic/gunicode.h \
+ src/basic/socket-util.c \
+ src/basic/socket-util.h \
+ src/basic/in-addr-util.c \
+ src/basic/in-addr-util.h \
+ src/basic/ether-addr-util.h \
+ src/basic/ether-addr-util.c \
+ src/basic/replace-var.c \
+ src/basic/replace-var.h \
+ src/basic/clock-util.c \
+ src/basic/clock-util.h \
+ src/basic/calendarspec.c \
+ src/basic/calendarspec.h \
+ src/basic/fileio.c \
+ src/basic/fileio.h \
+ src/basic/MurmurHash2.c \
+ src/basic/MurmurHash2.h \
+ src/basic/mkdir.c \
+ src/basic/mkdir.h \
+ src/basic/cgroup-util.c \
+ src/basic/cgroup-util.h \
+ src/basic/errno-list.c \
+ src/basic/errno-list.h \
+ src/basic/af-list.c \
+ src/basic/af-list.h \
+ src/basic/arphrd-list.c \
+ src/basic/arphrd-list.h \
+ src/basic/terminal-util.c \
+ src/basic/terminal-util.h \
+ src/basic/login-util.h \
+ src/basic/login-util.c \
+ src/basic/cap-list.c \
+ src/basic/cap-list.h \
+ src/basic/audit-util.c \
+ src/basic/audit-util.h \
+ src/basic/xml.c \
+ src/basic/xml.h \
+ src/basic/barrier.c \
+ src/basic/barrier.h \
+ src/basic/async.c \
+ src/basic/async.h \
+ src/basic/memfd-util.c \
+ src/basic/memfd-util.h \
+ src/basic/process-util.c \
+ src/basic/process-util.h \
+ src/basic/random-util.c \
+ src/basic/random-util.h \
+ src/basic/verbs.c \
+ src/basic/verbs.h \
+ src/basic/sigbus.c \
+ src/basic/sigbus.h \
+ src/basic/build.h \
+ src/basic/socket-label.c \
+ src/basic/label.c \
+ src/basic/label.h \
+ src/basic/btrfs-util.c \
+ src/basic/btrfs-util.h \
+ src/basic/btrfs-ctree.h \
+ src/basic/selinux-util.c \
+ src/basic/selinux-util.h \
+ src/basic/mkdir-label.c \
+ src/basic/fileio-label.c \
+ src/basic/fileio-label.h \
+ src/basic/rm-rf.c \
+ src/basic/rm-rf.h \
+ src/basic/copy.c \
+ src/basic/copy.h \
+ src/basic/alloc-util.h \
+ src/basic/alloc-util.c \
+ src/basic/formats-util.h \
+ src/basic/nss-util.h
+
+nodist_libbasic_la_SOURCES = \
+ src/basic/errno-from-name.h \
+ src/basic/errno-to-name.h \
+ src/basic/af-from-name.h \
+ src/basic/af-to-name.h \
+ src/basic/arphrd-from-name.h \
+ src/basic/arphrd-to-name.h \
+ src/basic/cap-from-name.h \
+ src/basic/cap-to-name.h
+
+libbasic_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(SELINUX_CFLAGS) \
+ $(CAP_CFLAGS) \
+ -pthread
+
+libbasic_la_LIBADD = \
+ $(SELINUX_LIBS) \
+ $(CAP_LIBS) \
+ -lrt \
+ -lm
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/src/MurmurHash2.c b/src/libbasic/src/MurmurHash2.c
index 9020793930..7d43f18f61 100644
--- a/src/libbasic/src/MurmurHash2.c
+++ b/src/libbasic/src/MurmurHash2.c
@@ -13,7 +13,7 @@
// 2. It will not produce the same results on little-endian and big-endian
// machines.
-#include "MurmurHash2.h"
+#include "basic/MurmurHash2.h"
//-----------------------------------------------------------------------------
// Platform-specific functions and macros
diff --git a/src/libbasic/src/af-list.c b/src/libbasic/src/af-list.c
index 3fac9c508b..434af37851 100644
--- a/src/libbasic/src/af-list.c
+++ b/src/libbasic/src/af-list.c
@@ -20,8 +20,8 @@
#include <string.h>
#include <sys/socket.h>
-#include "af-list.h"
-#include "macro.h"
+#include "basic/af-list.h"
+#include "basic/macro.h"
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
diff --git a/src/libbasic/src/alloc-util.c b/src/libbasic/src/alloc-util.c
index b540dcddf5..4e88a3a3bc 100644
--- a/src/libbasic/src/alloc-util.c
+++ b/src/libbasic/src/alloc-util.c
@@ -20,9 +20,9 @@
#include <stdint.h>
#include <string.h>
-#include "alloc-util.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
void* memdup(const void *p, size_t l) {
void *r;
diff --git a/src/libbasic/src/architecture.c b/src/libbasic/src/architecture.c
index b1c8e91f50..22815f5353 100644
--- a/src/libbasic/src/architecture.c
+++ b/src/libbasic/src/architecture.c
@@ -19,10 +19,10 @@
#include <sys/utsname.h>
-#include "architecture.h"
-#include "macro.h"
-#include "string-table.h"
-#include "string-util.h"
+#include "basic/architecture.h"
+#include "basic/macro.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
int uname_architecture(void) {
diff --git a/src/libbasic/src/arphrd-list.c b/src/libbasic/src/arphrd-list.c
index 6792d1ee3f..fbebe8ca09 100644
--- a/src/libbasic/src/arphrd-list.c
+++ b/src/libbasic/src/arphrd-list.c
@@ -20,8 +20,8 @@
#include <net/if_arp.h>
#include <string.h>
-#include "arphrd-list.h"
-#include "macro.h"
+#include "basic/arphrd-list.h"
+#include "basic/macro.h"
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
diff --git a/src/libbasic/src/async.c b/src/libbasic/src/async.c
index a1f163f27b..0e2fce6850 100644
--- a/src/libbasic/src/async.c
+++ b/src/libbasic/src/async.c
@@ -22,11 +22,11 @@
#include <stddef.h>
#include <unistd.h>
-#include "async.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/async.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/util.h"
int asynchronous_job(void* (*func)(void *p), void *arg) {
pthread_attr_t a;
diff --git a/src/libbasic/src/audit-util.c b/src/libbasic/src/audit-util.c
index 5741fecdd6..0cd8543374 100644
--- a/src/libbasic/src/audit-util.c
+++ b/src/libbasic/src/audit-util.c
@@ -18,18 +18,19 @@
***/
#include <errno.h>
-#include <linux/netlink.h>
#include <stdio.h>
#include <sys/socket.h>
-#include "alloc-util.h"
-#include "audit-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "user-util.h"
+#include <linux/netlink.h>
+
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/user-util.h"
int audit_session_from_pid(pid_t pid, uint32_t *id) {
_cleanup_free_ char *s = NULL;
diff --git a/src/libbasic/src/barrier.c b/src/libbasic/src/barrier.c
index 2da633b311..ad685bb3c1 100644
--- a/src/libbasic/src/barrier.c
+++ b/src/libbasic/src/barrier.c
@@ -27,9 +27,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include "barrier.h"
-#include "fd-util.h"
-#include "macro.h"
+#include "basic/barrier.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
/**
* Barriers
diff --git a/src/libbasic/src/bitmap.c b/src/libbasic/src/bitmap.c
index ad1fda0198..8645134022 100644
--- a/src/libbasic/src/bitmap.c
+++ b/src/libbasic/src/bitmap.c
@@ -23,10 +23,10 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "bitmap.h"
-#include "hashmap.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/bitmap.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
struct Bitmap {
uint64_t *bitmaps;
diff --git a/src/libbasic/src/btrfs-util.c b/src/libbasic/src/btrfs-util.c
index 359d85f2e8..7a5f6b7e76 100644
--- a/src/libbasic/src/btrfs-util.c
+++ b/src/libbasic/src/btrfs-util.c
@@ -20,7 +20,6 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <linux/loop.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -31,6 +30,8 @@
#include <sys/sysmacros.h>
#include <unistd.h>
+#include <linux/loop.h>
+
#ifdef HAVE_LINUX_BTRFS_H
#include <linux/btrfs.h>
#endif
diff --git a/src/libbasic/src/bus-label.c b/src/libbasic/src/bus-label.c
index d4531c7947..a7fd5a227e 100644
--- a/src/libbasic/src/bus-label.c
+++ b/src/libbasic/src/bus-label.c
@@ -19,10 +19,10 @@
#include <stdlib.h>
-#include "alloc-util.h"
-#include "bus-label.h"
-#include "hexdecoct.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
char *bus_label_escape(const char *s) {
char *r, *t;
diff --git a/src/libbasic/src/calendarspec.c b/src/libbasic/src/calendarspec.c
index 6e0bab9b94..a70eb078c6 100644
--- a/src/libbasic/src/calendarspec.c
+++ b/src/libbasic/src/calendarspec.c
@@ -25,12 +25,12 @@
#include <string.h>
#include <time.h>
-#include "alloc-util.h"
-#include "calendarspec.h"
-#include "fileio.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/calendarspec.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
#define BITS_WEEKDAYS 127
diff --git a/src/libbasic/src/cap-list.c b/src/libbasic/src/cap-list.c
index 3e773a06f5..9821644444 100644
--- a/src/libbasic/src/cap-list.c
+++ b/src/libbasic/src/cap-list.c
@@ -20,11 +20,11 @@
#include <errno.h>
#include <string.h>
-#include "cap-list.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "util.h"
+#include "basic/cap-list.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/util.h"
static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
diff --git a/src/libbasic/src/capability-util.c b/src/libbasic/src/capability-util.c
index d4c5bd6937..6c35ad09e5 100644
--- a/src/libbasic/src/capability-util.c
+++ b/src/libbasic/src/capability-util.c
@@ -25,13 +25,13 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "capability-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/capability-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/util.h"
int have_effective_cap(int value) {
_cleanup_cap_free_ cap_t cap;
diff --git a/src/libbasic/src/cgroup-util.c b/src/libbasic/src/cgroup-util.c
index 7cdc97ee3c..68c8aae540 100644
--- a/src/libbasic/src/cgroup-util.c
+++ b/src/libbasic/src/cgroup-util.c
@@ -30,32 +30,32 @@
#include <sys/types.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "def.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 "log.h"
-#include "login-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "set.h"
-#include "special.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "unit-name.h"
-#include "user-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/def.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/log.h"
+#include "basic/login-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
int cg_enumerate_processes(const char *controller, const char *path, FILE **_f) {
_cleanup_free_ char *fs = NULL;
diff --git a/src/libbasic/src/chattr-util.c b/src/libbasic/src/chattr-util.c
index 2896a729af..4d349431c8 100644
--- a/src/libbasic/src/chattr-util.c
+++ b/src/libbasic/src/chattr-util.c
@@ -21,11 +21,12 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+
#include <linux/fs.h>
-#include "chattr-util.h"
-#include "fd-util.h"
-#include "macro.h"
+#include "basic/chattr-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
int chattr_fd(int fd, unsigned value, unsigned mask) {
unsigned old_attr, new_attr;
diff --git a/src/libbasic/src/clock-util.c b/src/libbasic/src/clock-util.c
index 7fe8d35ea5..b1d0d2e432 100644
--- a/src/libbasic/src/clock-util.c
+++ b/src/libbasic/src/clock-util.c
@@ -21,17 +21,18 @@
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
-#include <time.h>
-#include <linux/rtc.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+#include <time.h>
+
+#include <linux/rtc.h>
-#include "clock-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/clock-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
int clock_get_hwclock(struct tm *tm) {
_cleanup_close_ int fd = -1;
diff --git a/src/libbasic/src/conf-files.c b/src/libbasic/src/conf-files.c
index c781610e14..2bb794e256 100644
--- a/src/libbasic/src/conf-files.c
+++ b/src/libbasic/src/conf-files.c
@@ -24,17 +24,17 @@
#include <stdlib.h>
#include <string.h>
-#include "conf-files.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/conf-files.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static int files_add(Hashmap *h, const char *root, const char *path, const char *suffix) {
_cleanup_closedir_ DIR *dir = NULL;
diff --git a/src/libbasic/src/copy.c b/src/libbasic/src/copy.c
index c3586728d0..4053ac9c16 100644
--- a/src/libbasic/src/copy.c
+++ b/src/libbasic/src/copy.c
@@ -30,22 +30,22 @@
#include <time.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "chattr-util.h"
-#include "copy.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "io-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "umask-util.h"
-#include "xattr-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/chattr-util.h"
+#include "basic/copy.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/io-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/umask-util.h"
+#include "basic/xattr-util.h"
#define COPY_BUFFER_SIZE (16*1024u)
diff --git a/src/libbasic/src/cpu-set-util.c b/src/libbasic/src/cpu-set-util.c
index 95ed6928ff..89e012d6e2 100644
--- a/src/libbasic/src/cpu-set-util.c
+++ b/src/libbasic/src/cpu-set-util.c
@@ -22,13 +22,13 @@
#include <stddef.h>
#include <syslog.h>
-#include "alloc-util.h"
-#include "cpu-set-util.h"
-#include "extract-word.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cpu-set-util.h"
+#include "basic/extract-word.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
cpu_set_t* cpu_set_malloc(unsigned *ncpus) {
cpu_set_t *c;
diff --git a/src/libbasic/src/device-nodes.c b/src/libbasic/src/device-nodes.c
index 38c0628a90..e5b2eb637c 100644
--- a/src/libbasic/src/device-nodes.c
+++ b/src/libbasic/src/device-nodes.c
@@ -21,8 +21,8 @@
#include <stdio.h>
#include <string.h>
-#include "device-nodes.h"
-#include "utf8.h"
+#include "basic/device-nodes.h"
+#include "basic/utf8.h"
int whitelisted_char_for_devnode(char c, const char *white) {
diff --git a/src/libbasic/src/dirent-util.c b/src/libbasic/src/dirent-util.c
index 59067121b7..5bc740b189 100644
--- a/src/libbasic/src/dirent-util.c
+++ b/src/libbasic/src/dirent-util.c
@@ -20,9 +20,9 @@
#include <fcntl.h>
#include <sys/stat.h>
-#include "dirent-util.h"
-#include "path-util.h"
-#include "string-util.h"
+#include "basic/dirent-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
int dirent_ensure_type(DIR *d, struct dirent *de) {
struct stat st;
diff --git a/src/libbasic/src/env-util.c b/src/libbasic/src/env-util.c
index 7f5fddb700..67d8261c87 100644
--- a/src/libbasic/src/env-util.c
+++ b/src/libbasic/src/env-util.c
@@ -24,14 +24,14 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "env-util.h"
-#include "extract-word.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/env-util.h"
+#include "basic/extract-word.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
diff --git a/src/libbasic/src/errno-list.c b/src/libbasic/src/errno-list.c
index 31b66bad5e..2d39044b50 100644
--- a/src/libbasic/src/errno-list.c
+++ b/src/libbasic/src/errno-list.c
@@ -19,8 +19,8 @@
#include <string.h>
-#include "errno-list.h"
-#include "macro.h"
+#include "basic/errno-list.h"
+#include "basic/macro.h"
static const struct errno_name* lookup_errno(register const char *str,
register unsigned int len);
diff --git a/src/libbasic/src/escape.c b/src/libbasic/src/escape.c
index 01daf11ce7..609b68ae53 100644
--- a/src/libbasic/src/escape.c
+++ b/src/libbasic/src/escape.c
@@ -21,11 +21,11 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/utf8.h"
size_t cescape_char(char c, char *buf) {
char * buf_old = buf;
diff --git a/src/libbasic/src/ether-addr-util.c b/src/libbasic/src/ether-addr-util.c
index 5697e8d132..933b7c9dc7 100644
--- a/src/libbasic/src/ether-addr-util.c
+++ b/src/libbasic/src/ether-addr-util.c
@@ -21,9 +21,9 @@
#include <stdio.h>
#include <sys/types.h>
-#include "ether-addr-util.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/ether-addr-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]) {
assert(addr);
diff --git a/src/libbasic/src/exit-status.c b/src/libbasic/src/exit-status.c
index 92fa5ace61..c7af63e052 100644
--- a/src/libbasic/src/exit-status.c
+++ b/src/libbasic/src/exit-status.c
@@ -20,9 +20,9 @@
#include <signal.h>
#include <stdlib.h>
-#include "exit-status.h"
-#include "macro.h"
-#include "set.h"
+#include "basic/exit-status.h"
+#include "basic/macro.h"
+#include "basic/set.h"
const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) {
diff --git a/src/libbasic/src/extract-word.c b/src/libbasic/src/extract-word.c
index d6c1228463..c38a815592 100644
--- a/src/libbasic/src/extract-word.c
+++ b/src/libbasic/src/extract-word.c
@@ -26,13 +26,13 @@
#include <string.h>
#include <syslog.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "extract-word.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/extract-word.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags) {
_cleanup_free_ char *s = NULL;
diff --git a/src/libbasic/src/fd-util.c b/src/libbasic/src/fd-util.c
index 8b466cff15..277a4c1075 100644
--- a/src/libbasic/src/fd-util.c
+++ b/src/libbasic/src/fd-util.c
@@ -24,15 +24,15 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "fs-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/socket-util.h"
+#include "basic/stdio-util.h"
+#include "basic/util.h"
int close_nointr(int fd) {
assert(fd >= 0);
diff --git a/src/libbasic/src/fdset.c b/src/libbasic/src/fdset.c
index b52bf1ad05..71e920d08e 100644
--- a/src/libbasic/src/fdset.c
+++ b/src/libbasic/src/fdset.c
@@ -25,13 +25,13 @@
#include <systemd/sd-daemon.h>
-#include "fd-util.h"
-#include "fdset.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "set.h"
+#include "basic/fd-util.h"
+#include "basic/fdset.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
#define MAKE_SET(s) ((Set*) s)
#define MAKE_FDSET(s) ((FDSet*) s)
diff --git a/src/libbasic/src/fileio-label.c b/src/libbasic/src/fileio-label.c
index 66dbc0fe1e..3e0cab1b38 100644
--- a/src/libbasic/src/fileio-label.c
+++ b/src/libbasic/src/fileio-label.c
@@ -20,9 +20,9 @@
#include <sys/stat.h>
-#include "fileio-label.h"
-#include "fileio.h"
-#include "selinux-util.h"
+#include "basic/fileio-label.h"
+#include "basic/fileio.h"
+#include "basic/selinux-util.h"
int write_string_file_atomic_label(const char *fn, const char *line) {
int r;
diff --git a/src/libbasic/src/fileio.c b/src/libbasic/src/fileio.c
index 29f5374222..c784aaac54 100644
--- a/src/libbasic/src/fileio.c
+++ b/src/libbasic/src/fileio.c
@@ -17,6 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@ -28,24 +29,23 @@
#include <sys/types.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "ctype.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hexdecoct.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "random-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "umask-util.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/random-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/umask-util.h"
+#include "basic/utf8.h"
int write_string_stream(FILE *f, const char *line, bool enforce_newline) {
diff --git a/src/libbasic/src/fs-util.c b/src/libbasic/src/fs-util.c
index e24e7036f7..03b06fd2d8 100644
--- a/src/libbasic/src/fs-util.c
+++ b/src/libbasic/src/fs-util.c
@@ -27,23 +27,23 @@
#include <time.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
int unlink_noerrno(const char *path) {
PROTECT_ERRNO;
diff --git a/src/libbasic/src/glob-util.c b/src/libbasic/src/glob-util.c
index 007198c269..8762a59bd9 100644
--- a/src/libbasic/src/glob-util.c
+++ b/src/libbasic/src/glob-util.c
@@ -20,9 +20,9 @@
#include <errno.h>
#include <glob.h>
-#include "glob-util.h"
-#include "macro.h"
-#include "strv.h"
+#include "basic/glob-util.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
int glob_exists(const char *path) {
_cleanup_globfree_ glob_t g = {};
diff --git a/src/libbasic/src/gunicode.c b/src/libbasic/src/gunicode.c
index 542110503f..4862021fbb 100644
--- a/src/libbasic/src/gunicode.c
+++ b/src/libbasic/src/gunicode.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
-#include "gunicode.h"
+#include "basic/gunicode.h"
#define unichar uint32_t
diff --git a/src/libbasic/src/hash-funcs.c b/src/libbasic/src/hash-funcs.c
index c3a4a011b5..e82a342063 100644
--- a/src/libbasic/src/hash-funcs.c
+++ b/src/libbasic/src/hash-funcs.c
@@ -18,7 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hash-funcs.h"
+#include "basic/hash-funcs.h"
void string_hash_func(const void *p, struct siphash *state) {
siphash24_compress(p, strlen(p) + 1, state);
diff --git a/src/libbasic/src/hashmap.c b/src/libbasic/src/hashmap.c
index 49a0479592..38a4bb3feb 100644
--- a/src/libbasic/src/hashmap.c
+++ b/src/libbasic/src/hashmap.c
@@ -23,16 +23,16 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "hashmap.h"
-#include "macro.h"
-#include "mempool.h"
-#include "process-util.h"
-#include "random-util.h"
-#include "set.h"
-#include "siphash24.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/mempool.h"
+#include "basic/process-util.h"
+#include "basic/random-util.h"
+#include "basic/set.h"
+#include "basic/siphash24.h"
+#include "basic/strv.h"
+#include "basic/util.h"
#ifdef ENABLE_DEBUG_HASHMAP
#include <pthread.h>
diff --git a/src/libbasic/src/hexdecoct.c b/src/libbasic/src/hexdecoct.c
index c5bda6c4d6..060a95b616 100644
--- a/src/libbasic/src/hexdecoct.c
+++ b/src/libbasic/src/hexdecoct.c
@@ -22,10 +22,10 @@
#include <stdint.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/util.h"
char octchar(int x) {
return '0' + (x & 7);
diff --git a/src/libbasic/src/hostname-util.c b/src/libbasic/src/hostname-util.c
index 13c3bb6446..e66f9a2250 100644
--- a/src/libbasic/src/hostname-util.c
+++ b/src/libbasic/src/hostname-util.c
@@ -24,11 +24,11 @@
#include <sys/utsname.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
bool hostname_is_set(void) {
struct utsname u;
diff --git a/src/libbasic/src/in-addr-util.c b/src/libbasic/src/in-addr-util.c
index 245107ebb8..7d648ce354 100644
--- a/src/libbasic/src/in-addr-util.c
+++ b/src/libbasic/src/in-addr-util.c
@@ -23,10 +23,10 @@
#include <stdint.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
int in_addr_is_null(int family, const union in_addr_union *u) {
assert(u);
diff --git a/src/libbasic/src/io-util.c b/src/libbasic/src/io-util.c
index cc6dfa8c1b..800a7044f6 100644
--- a/src/libbasic/src/io-util.c
+++ b/src/libbasic/src/io-util.c
@@ -24,8 +24,8 @@
#include <time.h>
#include <unistd.h>
-#include "io-util.h"
-#include "time-util.h"
+#include "basic/io-util.h"
+#include "basic/time-util.h"
int flush_fd(int fd) {
struct pollfd pollfd = {
diff --git a/src/libbasic/src/label.c b/src/libbasic/src/label.c
index f5ab855d32..cea374198a 100644
--- a/src/libbasic/src/label.c
+++ b/src/libbasic/src/label.c
@@ -21,10 +21,10 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "label.h"
-#include "macro.h"
-#include "selinux-util.h"
-#include "smack-util.h"
+#include "basic/label.h"
+#include "basic/macro.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
int r, q;
diff --git a/src/libbasic/src/locale-util.c b/src/libbasic/src/locale-util.c
index ada0a28cd8..7cedaae319 100644
--- a/src/libbasic/src/locale-util.c
+++ b/src/libbasic/src/locale-util.c
@@ -30,16 +30,16 @@
#include <sys/mman.h>
#include <sys/stat.h>
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "locale-util.h"
-#include "path-util.h"
-#include "set.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/locale-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
static int add_locales_from_archive(Set *locales) {
/* Stolen from glibc... */
diff --git a/src/libbasic/src/lockfile-util.c b/src/libbasic/src/lockfile-util.c
index 3ee4191e4d..233627c1a4 100644
--- a/src/libbasic/src/lockfile-util.c
+++ b/src/libbasic/src/lockfile-util.c
@@ -24,12 +24,12 @@
#include <sys/file.h>
#include <sys/stat.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "lockfile-util.h"
-#include "macro.h"
-#include "path-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/lockfile-util.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
int make_lock_file(const char *p, int operation, LockFile *ret) {
_cleanup_close_ int fd = -1;
diff --git a/src/libbasic/src/log.c b/src/libbasic/src/log.c
index 05c4896f55..6028cc7a27 100644
--- a/src/libbasic/src/log.c
+++ b/src/libbasic/src/log.c
@@ -35,25 +35,25 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "io-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "syslog-util.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-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/syslog-util.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
#define SNDBUF_SIZE (8*1024*1024)
diff --git a/src/libbasic/src/login-util.c b/src/libbasic/src/login-util.c
index 339e94f12d..fe97f66392 100644
--- a/src/libbasic/src/login-util.c
+++ b/src/libbasic/src/login-util.c
@@ -19,8 +19,8 @@
#include <string.h>
-#include "login-util.h"
-#include "string-util.h"
+#include "basic/login-util.h"
+#include "basic/string-util.h"
bool session_id_valid(const char *id) {
diff --git a/src/libbasic/src/mempool.c b/src/libbasic/src/mempool.c
index f95e2beb0f..0a64c1b29c 100644
--- a/src/libbasic/src/mempool.c
+++ b/src/libbasic/src/mempool.c
@@ -21,9 +21,9 @@
#include <stdint.h>
#include <stdlib.h>
-#include "macro.h"
-#include "mempool.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/mempool.h"
+#include "basic/util.h"
struct pool {
struct pool *next;
diff --git a/src/libbasic/src/mkdir-label.c b/src/libbasic/src/mkdir-label.c
index aa6878cdf0..83a1e925c6 100644
--- a/src/libbasic/src/mkdir-label.c
+++ b/src/libbasic/src/mkdir-label.c
@@ -22,8 +22,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include "label.h"
-#include "mkdir.h"
+#include "basic/label.h"
+#include "basic/mkdir.h"
int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) {
return mkdir_safe_internal(path, mode, uid, gid, mkdir_label);
diff --git a/src/libbasic/src/mkdir.c b/src/libbasic/src/mkdir.c
index 6b1a98402c..0a7f432f3e 100644
--- a/src/libbasic/src/mkdir.c
+++ b/src/libbasic/src/mkdir.c
@@ -22,12 +22,12 @@
#include <string.h>
#include <sys/stat.h>
-#include "fs-util.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "stat-util.h"
-#include "user-util.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/stat-util.h"
+#include "basic/user-util.h"
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) {
struct stat st;
diff --git a/src/libbasic/src/mount-util.c b/src/libbasic/src/mount-util.c
index ba698959b7..274ec9d29c 100644
--- a/src/libbasic/src/mount-util.c
+++ b/src/libbasic/src/mount-util.c
@@ -25,17 +25,17 @@
#include <sys/statvfs.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "set.h"
-#include "stdio-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
diff --git a/src/libbasic/src/ordered-set.c b/src/libbasic/src/ordered-set.c
index 2e0bdf6488..fc6c3c018c 100644
--- a/src/libbasic/src/ordered-set.c
+++ b/src/libbasic/src/ordered-set.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "ordered-set.h"
-#include "strv.h"
+#include "basic/ordered-set.h"
+#include "basic/strv.h"
int ordered_set_consume(OrderedSet *s, void *p) {
int r;
diff --git a/src/libbasic/src/parse-util.c b/src/libbasic/src/parse-util.c
index 6c11b605a9..b6a99c7cdb 100644
--- a/src/libbasic/src/parse-util.c
+++ b/src/libbasic/src/parse-util.c
@@ -25,11 +25,11 @@
#include <string.h>
#include <xlocale.h>
-#include "alloc-util.h"
-#include "extract-word.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
int parse_boolean(const char *v) {
assert(v);
diff --git a/src/libbasic/src/prioq.c b/src/libbasic/src/prioq.c
index d2ec516d29..f29c80b5fc 100644
--- a/src/libbasic/src/prioq.c
+++ b/src/libbasic/src/prioq.c
@@ -30,9 +30,9 @@
#include <errno.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "hashmap.h"
-#include "prioq.h"
+#include "basic/alloc-util.h"
+#include "basic/hashmap.h"
+#include "basic/prioq.h"
struct prioq_item {
void *data;
diff --git a/src/libbasic/src/proc-cmdline.c b/src/libbasic/src/proc-cmdline.c
index 3505fa9c9a..e35a21ac0d 100644
--- a/src/libbasic/src/proc-cmdline.c
+++ b/src/libbasic/src/proc-cmdline.c
@@ -21,17 +21,17 @@
#include <stddef.h>
#include <string.h>
-#include "alloc-util.h"
-#include "extract-word.h"
-#include "fileio.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "process-util.h"
-#include "special.h"
-#include "string-util.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/process-util.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
int proc_cmdline(char **ret) {
assert(ret);
diff --git a/src/libbasic/src/process-util.c b/src/libbasic/src/process-util.c
index 1ad8816206..02d6f3cca3 100644
--- a/src/libbasic/src/process-util.c
+++ b/src/libbasic/src/process-util.c
@@ -20,7 +20,6 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
-#include <linux/oom.h>
#include <sched.h>
#include <signal.h>
#include <stdbool.h>
@@ -33,6 +32,8 @@
#include <sys/wait.h>
#include <syslog.h>
#include <unistd.h>
+
+#include <linux/oom.h>
#ifdef HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
#endif
diff --git a/src/libbasic/src/random-util.c b/src/libbasic/src/random-util.c
index 2f468db770..6f797879eb 100644
--- a/src/libbasic/src/random-util.c
+++ b/src/libbasic/src/random-util.c
@@ -21,10 +21,11 @@
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
+#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
+
#include <linux/random.h>
-#include <stdint.h>
#ifdef HAVE_SYS_AUXV_H
#include <sys/auxv.h>
diff --git a/src/libbasic/src/ratelimit.c b/src/libbasic/src/ratelimit.c
index 3ca5625e4d..366aeb6d9a 100644
--- a/src/libbasic/src/ratelimit.c
+++ b/src/libbasic/src/ratelimit.c
@@ -20,8 +20,8 @@
#include <sys/time.h>
-#include "macro.h"
-#include "ratelimit.h"
+#include "basic/macro.h"
+#include "basic/ratelimit.h"
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
diff --git a/src/libbasic/src/replace-var.c b/src/libbasic/src/replace-var.c
index 6a204b9ec3..50e60221ad 100644
--- a/src/libbasic/src/replace-var.c
+++ b/src/libbasic/src/replace-var.c
@@ -22,10 +22,10 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "macro.h"
-#include "replace-var.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/replace-var.h"
+#include "basic/string-util.h"
/*
* Generic infrastructure for replacing @FOO@ style variables in
diff --git a/src/libbasic/src/rlimit-util.c b/src/libbasic/src/rlimit-util.c
index ee063720ed..3a8196d9c1 100644
--- a/src/libbasic/src/rlimit-util.c
+++ b/src/libbasic/src/rlimit-util.c
@@ -20,14 +20,14 @@
#include <errno.h>
#include <sys/resource.h>
-#include "alloc-util.h"
-#include "extract-word.h"
-#include "formats-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "rlimit-util.h"
-#include "string-table.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/extract-word.h"
+#include "basic/formats-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/rlimit-util.h"
+#include "basic/string-table.h"
+#include "basic/time-util.h"
int setrlimit_closest(int resource, const struct rlimit *rlim) {
struct rlimit highest, fixed;
diff --git a/src/libbasic/src/rm-rf.c b/src/libbasic/src/rm-rf.c
index 43816fd1bb..b05b512aee 100644
--- a/src/libbasic/src/rm-rf.c
+++ b/src/libbasic/src/rm-rf.c
@@ -26,15 +26,15 @@
#include <sys/statfs.h>
#include <unistd.h>
-#include "btrfs-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "mount-util.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "stat-util.h"
-#include "string-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) {
_cleanup_closedir_ DIR *d = NULL;
diff --git a/src/libbasic/src/sigbus.c b/src/libbasic/src/sigbus.c
index 0ce4f75684..7249f812d7 100644
--- a/src/libbasic/src/sigbus.c
+++ b/src/libbasic/src/sigbus.c
@@ -22,9 +22,9 @@
#include <stddef.h>
#include <sys/mman.h>
-#include "macro.h"
-#include "sigbus.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/sigbus.h"
+#include "basic/util.h"
#define SIGBUS_QUEUE_MAX 64
diff --git a/src/libbasic/src/signal-util.c b/src/libbasic/src/signal-util.c
index 280b5c3251..ade7bff364 100644
--- a/src/libbasic/src/signal-util.c
+++ b/src/libbasic/src/signal-util.c
@@ -21,12 +21,12 @@
#include <stdarg.h>
#include <stdio.h>
-#include "macro.h"
-#include "parse-util.h"
-#include "signal-util.h"
-#include "stdio-util.h"
-#include "string-table.h"
-#include "string-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/signal-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
int reset_all_signal_handlers(void) {
static const struct sigaction sa = {
diff --git a/src/libbasic/src/siphash24.c b/src/libbasic/src/siphash24.c
index 060e8ba387..8fbc05b435 100644
--- a/src/libbasic/src/siphash24.c
+++ b/src/libbasic/src/siphash24.c
@@ -17,9 +17,9 @@
coding style)
*/
-#include "macro.h"
-#include "siphash24.h"
-#include "unaligned.h"
+#include "basic/macro.h"
+#include "basic/siphash24.h"
+#include "basic/unaligned.h"
static inline uint64_t rotate_left(uint64_t x, uint8_t b) {
assert(b < 64);
diff --git a/src/libbasic/src/smack-util.c b/src/libbasic/src/smack-util.c
index 3a3df987df..c3ce6bd4ac 100644
--- a/src/libbasic/src/smack-util.c
+++ b/src/libbasic/src/smack-util.c
@@ -25,15 +25,15 @@
#include <sys/xattr.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "smack-util.h"
-#include "string-table.h"
-#include "xattr-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/smack-util.h"
+#include "basic/string-table.h"
+#include "basic/xattr-util.h"
#ifdef HAVE_SMACK
bool mac_smack_use(void) {
diff --git a/src/libbasic/src/socket-label.c b/src/libbasic/src/socket-label.c
index 6d1dc83874..75036f451f 100644
--- a/src/libbasic/src/socket-label.c
+++ b/src/libbasic/src/socket-label.c
@@ -26,15 +26,15 @@
#include <sys/un.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "selinux-util.h"
-#include "socket-util.h"
-#include "umask-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/selinux-util.h"
+#include "basic/socket-util.h"
+#include "basic/umask-util.h"
int socket_address_listen(
const SocketAddress *a,
diff --git a/src/libbasic/src/socket-util.c b/src/libbasic/src/socket-util.c
index c8769a54f4..9e1bf1d91d 100644
--- a/src/libbasic/src/socket-util.c
+++ b/src/libbasic/src/socket-util.c
@@ -31,22 +31,22 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
int socket_address_parse(SocketAddress *a, const char *s) {
char *e, *n;
diff --git a/src/libbasic/src/stat-util.c b/src/libbasic/src/stat-util.c
index 309e84b93d..9ddede98c9 100644
--- a/src/libbasic/src/stat-util.c
+++ b/src/libbasic/src/stat-util.c
@@ -21,17 +21,18 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include <linux/magic.h>
#include <sys/statvfs.h>
+#include <sys/types.h>
#include <unistd.h>
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "stat-util.h"
-#include "string-util.h"
+#include <linux/magic.h>
+
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
int is_symlink(const char *path) {
struct stat info;
diff --git a/src/libbasic/src/strbuf.c b/src/libbasic/src/strbuf.c
index 4bef87d3c2..3b6fafeb30 100644
--- a/src/libbasic/src/strbuf.c
+++ b/src/libbasic/src/strbuf.c
@@ -21,8 +21,8 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "strbuf.h"
+#include "basic/alloc-util.h"
+#include "basic/strbuf.h"
/*
* Strbuf stores given strings in a single continuous allocated memory
diff --git a/src/libbasic/src/string-table.c b/src/libbasic/src/string-table.c
index a1499ab126..fae5e944b5 100644
--- a/src/libbasic/src/string-table.c
+++ b/src/libbasic/src/string-table.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "string-table.h"
-#include "string-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
size_t i;
diff --git a/src/libbasic/src/string-util.c b/src/libbasic/src/string-util.c
index 293a15f9c0..003a20a41d 100644
--- a/src/libbasic/src/string-util.c
+++ b/src/libbasic/src/string-util.c
@@ -23,12 +23,12 @@
#include <stdio.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "gunicode.h"
-#include "macro.h"
-#include "string-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/gunicode.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
int strcmp_ptr(const char *a, const char *b) {
diff --git a/src/libbasic/src/strv.c b/src/libbasic/src/strv.c
index 97a96e5762..aadbef953c 100644
--- a/src/libbasic/src/strv.c
+++ b/src/libbasic/src/strv.c
@@ -24,13 +24,13 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "escape.h"
-#include "extract-word.h"
-#include "fileio.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/extract-word.h"
+#include "basic/fileio.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
char *strv_find(char **l, const char *name) {
char **i;
diff --git a/src/libbasic/src/strxcpyx.c b/src/libbasic/src/strxcpyx.c
index aaf11d21f6..b6225f0e12 100644
--- a/src/libbasic/src/strxcpyx.c
+++ b/src/libbasic/src/strxcpyx.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#include "strxcpyx.h"
+#include "basic/strxcpyx.h"
size_t strpcpy(char **dest, size_t size, const char *src) {
size_t len;
diff --git a/src/libbasic/src/syslog-util.c b/src/libbasic/src/syslog-util.c
index db3405154e..8647f2a2d6 100644
--- a/src/libbasic/src/syslog-util.c
+++ b/src/libbasic/src/syslog-util.c
@@ -20,10 +20,10 @@
#include <string.h>
#include <syslog.h>
-#include "hexdecoct.h"
-#include "macro.h"
-#include "string-table.h"
-#include "syslog-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/string-table.h"
+#include "basic/syslog-util.h"
int syslog_parse_priority(const char **p, int *priority, bool with_facility) {
int a = 0, b = 0, c = 0;
diff --git a/src/libbasic/src/terminal-util.c b/src/libbasic/src/terminal-util.c
index 9521b79daa..45b7864a2f 100644
--- a/src/libbasic/src/terminal-util.c
+++ b/src/libbasic/src/terminal-util.c
@@ -20,39 +20,40 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
+#include <poll.h>
+#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/inotify.h>
+#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysmacros.h>
#include <sys/time.h>
-#include <linux/kd.h>
-#include <linux/tiocl.h>
-#include <linux/vt.h>
-#include <poll.h>
-#include <signal.h>
-#include <sys/ioctl.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "io-util.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "socket-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "util.h"
+#include <linux/kd.h>
+#include <linux/tiocl.h>
+#include <linux/vt.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/socket-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
static volatile unsigned cached_columns = 0;
static volatile unsigned cached_lines = 0;
diff --git a/src/libbasic/src/time-util.c b/src/libbasic/src/time-util.c
index edd9179cb8..05f5ad7dc7 100644
--- a/src/libbasic/src/time-util.c
+++ b/src/libbasic/src/time-util.c
@@ -28,17 +28,17 @@
#include <sys/types.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
static nsec_t timespec_load_nsec(const struct timespec *ts);
diff --git a/src/libbasic/src/unit-name.c b/src/libbasic/src/unit-name.c
index fe883b95c7..42c79da536 100644
--- a/src/libbasic/src/unit-name.c
+++ b/src/libbasic/src/unit-name.c
@@ -23,16 +23,16 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "bus-label.h"
-#include "glob-util.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "path-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/glob-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
/* Characters valid in a unit name. */
#define VALID_CHARS \
diff --git a/src/libbasic/src/user-util.c b/src/libbasic/src/user-util.c
index f65ca3edaa..c85eb06491 100644
--- a/src/libbasic/src/user-util.c
+++ b/src/libbasic/src/user-util.c
@@ -30,15 +30,15 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "missing.h"
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "user-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
bool uid_is_valid(uid_t uid) {
diff --git a/src/libbasic/src/utf8.c b/src/libbasic/src/utf8.c
index 6eae2b983d..b5144b7312 100644
--- a/src/libbasic/src/utf8.c
+++ b/src/libbasic/src/utf8.c
@@ -46,10 +46,10 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/utf8.h"
bool unichar_is_valid(char32_t ch) {
diff --git a/src/libbasic/src/util.c b/src/libbasic/src/util.c
index 756c663be4..d0db8a28fb 100644
--- a/src/libbasic/src/util.c
+++ b/src/libbasic/src/util.c
@@ -34,30 +34,30 @@
#include <sys/types.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "build.h"
-#include "def.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "hashmap.h"
-#include "hostname-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "set.h"
-#include "signal-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/build.h"
+#include "basic/def.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/hashmap.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/signal-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
/* Put this test here for a lack of better place */
assert_cc(EAGAIN == EWOULDBLOCK);
diff --git a/src/libbasic/src/verbs.c b/src/libbasic/src/verbs.c
index d9cdb38d65..526e0fc338 100644
--- a/src/libbasic/src/verbs.c
+++ b/src/libbasic/src/verbs.c
@@ -22,11 +22,11 @@
#include <stdbool.h>
#include <stddef.h>
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "verbs.h"
-#include "virt.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/verbs.h"
+#include "basic/virt.h"
int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) {
const Verb *verb;
diff --git a/src/libbasic/src/virt.c b/src/libbasic/src/virt.c
index dace1f4328..33a74f16cf 100644
--- a/src/libbasic/src/virt.c
+++ b/src/libbasic/src/virt.c
@@ -23,16 +23,16 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
-#include "process-util.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/process-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/virt.h"
static int detect_vm_cpuid(void) {
diff --git a/src/libbasic/src/web-util.c b/src/libbasic/src/web-util.c
index 595688ed93..a68813ffb8 100644
--- a/src/libbasic/src/web-util.c
+++ b/src/libbasic/src/web-util.c
@@ -19,9 +19,9 @@
#include <stdbool.h>
-#include "string-util.h"
-#include "utf8.h"
-#include "web-util.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
+#include "basic/web-util.h"
bool http_etag_is_valid(const char *etag) {
if (isempty(etag))
diff --git a/src/libbasic/src/xattr-util.c b/src/libbasic/src/xattr-util.c
index 8256899eda..07f063e10b 100644
--- a/src/libbasic/src/xattr-util.c
+++ b/src/libbasic/src/xattr-util.c
@@ -25,13 +25,13 @@
#include <sys/time.h>
#include <sys/xattr.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "sparse-endian.h"
-#include "stdio-util.h"
-#include "time-util.h"
-#include "xattr-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
+#include "basic/stdio-util.h"
+#include "basic/time-util.h"
+#include "basic/xattr-util.h"
int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink) {
char *v;
diff --git a/src/libbasic/src/xml.c b/src/libbasic/src/xml.c
index 1dbeac7324..273fe51fa9 100644
--- a/src/libbasic/src/xml.c
+++ b/src/libbasic/src/xml.c
@@ -21,9 +21,9 @@
#include <stddef.h>
#include <string.h>
-#include "macro.h"
-#include "string-util.h"
-#include "xml.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/xml.h"
enum {
STATE_NULL,
diff --git a/src/libfirewall/Makefile b/src/libfirewall/Makefile
new file mode 100644
index 0000000000..ced0f7e476
--- /dev/null
+++ b/src/libfirewall/Makefile
@@ -0,0 +1,42 @@
+# -*- 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 ($(HAVE_LIBIPTC),)
+noinst_LTLIBRARIES += \
+ libfirewall.la
+
+libfirewall_la_SOURCES = \
+ src/shared/firewall-util.h \
+ src/shared/firewall-util.c
+
+libfirewall_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBIPTC_CFLAGS)
+
+libfirewall_la_LIBADD = \
+ $(LIBIPTC_LIBS)
+endif # HAVE_LIBIPTC
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libfirewall/firewall-util.c b/src/libfirewall/firewall-util.c
index f73108eaa3..aa924c406e 100644
--- a/src/libfirewall/firewall-util.c
+++ b/src/libfirewall/firewall-util.c
@@ -25,10 +25,10 @@
#include <arpa/inet.h>
#include <endian.h>
#include <errno.h>
+#include <net/if.h>
#include <stddef.h>
#include <string.h>
#include <sys/socket.h>
-#include <net/if.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
diff --git a/src/libfirewall/firewall-util.h b/src/libfirewall/firewall-util.h
index c39b34cf8f..1e54dc0ceb 100644
--- a/src/libfirewall/firewall-util.h
+++ b/src/libfirewall/firewall-util.h
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include "in-addr-util.h"
+#include "basic/in-addr-util.h"
#ifdef HAVE_LIBIPTC
diff --git a/src/libshared/Makefile b/src/libshared/Makefile
new file mode 100644
index 0000000000..7ed2706100
--- /dev/null
+++ b/src/libshared/Makefile
@@ -0,0 +1,27 @@
+# -*- 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
+
+at.subdirs += src
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/include/shared/acl-util.h b/src/libshared/include/shared/acl-util.h
index 396e9e067e..af5bcb5b4f 100644
--- a/src/libshared/include/shared/acl-util.h
+++ b/src/libshared/include/shared/acl-util.h
@@ -25,7 +25,7 @@
#include <stdbool.h>
#include <sys/acl.h>
-#include "macro.h"
+#include "basic/macro.h"
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
int calc_acl_mask_if_needed(acl_t *acl_p);
diff --git a/src/libshared/include/shared/acpi-fpdt.h b/src/libshared/include/shared/acpi-fpdt.h
index fc28175d0a..3da32c08ad 100644
--- a/src/libshared/include/shared/acpi-fpdt.h
+++ b/src/libshared/include/shared/acpi-fpdt.h
@@ -19,6 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <time-util.h>
+#include "basic/time-util.h"
int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit);
diff --git a/src/libshared/include/shared/ask-password-api.h b/src/libshared/include/shared/ask-password-api.h
index 9d7f65130c..770ab1f5c0 100644
--- a/src/libshared/include/shared/ask-password-api.h
+++ b/src/libshared/include/shared/ask-password-api.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "time-util.h"
+#include "basic/time-util.h"
typedef enum AskPasswordFlags {
ASK_PASSWORD_ACCEPT_CACHED = 1,
diff --git a/src/libshared/include/shared/boot-timestamps.h b/src/libshared/include/shared/boot-timestamps.h
index 6f691026be..00ea7e3009 100644
--- a/src/libshared/include/shared/boot-timestamps.h
+++ b/src/libshared/include/shared/boot-timestamps.h
@@ -20,6 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <time-util.h>
+#include "basic/time-util.h"
int boot_timestamps(const dual_timestamp *n, dual_timestamp *firmware, dual_timestamp *loader);
diff --git a/src/libshared/include/shared/bus-unit-util.h b/src/libshared/include/shared/bus-unit-util.h
index 8327189a63..b4b68cc5d2 100644
--- a/src/libshared/include/shared/bus-unit-util.h
+++ b/src/libshared/include/shared/bus-unit-util.h
@@ -21,8 +21,8 @@
#include <systemd/sd-bus.h>
-#include "output-mode.h"
#include "install.h"
+#include "output-mode.h"
typedef struct UnitInfo {
const char *machine;
diff --git a/src/libshared/include/shared/bus-util.h b/src/libshared/include/shared/bus-util.h
index f2b46530ba..73f2ea0749 100644
--- a/src/libshared/include/shared/bus-util.h
+++ b/src/libshared/include/shared/bus-util.h
@@ -27,9 +27,9 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "hashmap.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
typedef enum BusTransport {
BUS_TRANSPORT_LOCAL,
diff --git a/src/libshared/include/shared/condition.h b/src/libshared/include/shared/condition.h
index bdda04b770..fd798460d1 100644
--- a/src/libshared/include/shared/condition.h
+++ b/src/libshared/include/shared/condition.h
@@ -22,8 +22,8 @@
#include <stdbool.h>
#include <stdio.h>
-#include "list.h"
-#include "macro.h"
+#include "basic/list.h"
+#include "basic/macro.h"
typedef enum ConditionType {
CONDITION_ARCHITECTURE,
diff --git a/src/libshared/include/shared/conf-parser.h b/src/libshared/include/shared/conf-parser.h
index f6964e3fd4..f7423d45e7 100644
--- a/src/libshared/include/shared/conf-parser.h
+++ b/src/libshared/include/shared/conf-parser.h
@@ -25,9 +25,9 @@
#include <stdio.h>
#include <syslog.h>
-#include "alloc-util.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
/* An abstract parser for simple, line based, shallow configuration
* files consisting of variable assignments only. */
diff --git a/src/libshared/include/shared/dns-domain.h b/src/libshared/include/shared/dns-domain.h
index af780f0b8b..72e4cb0104 100644
--- a/src/libshared/include/shared/dns-domain.h
+++ b/src/libshared/include/shared/dns-domain.h
@@ -24,8 +24,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "hashmap.h"
-#include "in-addr-util.h"
+#include "basic/hashmap.h"
+#include "basic/in-addr-util.h"
/* Length of a single label, with all escaping removed, excluding any trailing dot or NUL byte */
#define DNS_LABEL_MAX 63
diff --git a/src/libshared/include/shared/dropin.h b/src/libshared/include/shared/dropin.h
index c1936f397b..44235405f6 100644
--- a/src/libshared/include/shared/dropin.h
+++ b/src/libshared/include/shared/dropin.h
@@ -19,10 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
-#include "macro.h"
-#include "set.h"
-#include "unit-name.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/set.h"
+#include "basic/unit-name.h"
int drop_in_file(const char *dir, const char *unit, unsigned level,
const char *name, char **_p, char **_q);
diff --git a/src/libshared/include/shared/efivars.h b/src/libshared/include/shared/efivars.h
index 243151f922..547b161367 100644
--- a/src/libshared/include/shared/efivars.h
+++ b/src/libshared/include/shared/efivars.h
@@ -25,7 +25,7 @@
#include <systemd/sd-id128.h>
-#include "time-util.h"
+#include "basic/time-util.h"
#define EFI_VENDOR_LOADER SD_ID128_MAKE(4a,67,b0,82,0a,4c,41,cf,b6,c7,44,0b,29,bb,8c,4f)
#define EFI_VENDOR_GLOBAL SD_ID128_MAKE(8b,e4,df,61,93,ca,11,d2,aa,0d,00,e0,98,03,2b,8c)
diff --git a/src/libshared/include/shared/fstab-util.h b/src/libshared/include/shared/fstab-util.h
index 679f6902f7..3d9e7ab907 100644
--- a/src/libshared/include/shared/fstab-util.h
+++ b/src/libshared/include/shared/fstab-util.h
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <stddef.h>
-#include "macro.h"
+#include "basic/macro.h"
bool fstab_is_mount_point(const char *mount);
diff --git a/src/libshared/include/shared/import-util.h b/src/libshared/include/shared/import-util.h
index 77b17d91f3..353fa9045c 100644
--- a/src/libshared/include/shared/import-util.h
+++ b/src/libshared/include/shared/import-util.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "macro.h"
+#include "basic/macro.h"
typedef enum ImportVerify {
IMPORT_VERIFY_NO,
diff --git a/src/libshared/include/shared/install.h b/src/libshared/include/shared/install.h
index c6aa4f6ef1..e056d374b6 100644
--- a/src/libshared/include/shared/install.h
+++ b/src/libshared/include/shared/install.h
@@ -19,22 +19,23 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <stdbool.h>
+
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#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 UnitFilePresetMode UnitFilePresetMode;
-typedef enum UnitFileChangeType UnitFileChangeType;
typedef enum UnitFileType UnitFileType;
typedef struct UnitFileChange UnitFileChange;
-typedef struct UnitFileList UnitFileList;
typedef struct UnitFileInstallInfo UnitFileInstallInfo;
+typedef struct UnitFileList UnitFileList;
-#include <stdbool.h>
-
-#include "hashmap.h"
-#include "macro.h"
#include "path-lookup.h"
-#include "strv.h"
-#include "unit-name.h"
enum UnitFileScope {
UNIT_FILE_SYSTEM,
diff --git a/src/libshared/include/shared/logs-show.h b/src/libshared/include/shared/logs-show.h
index 15fe5b6e5c..f16cb64838 100644
--- a/src/libshared/include/shared/logs-show.h
+++ b/src/libshared/include/shared/logs-show.h
@@ -26,10 +26,11 @@
#include <systemd/sd-journal.h>
-#include "macro.h"
+#include "basic/macro.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
+
#include "output-mode.h"
-#include "time-util.h"
-#include "util.h"
int output_journal(
FILE *f,
diff --git a/src/libshared/include/shared/machine-image.h b/src/libshared/include/shared/machine-image.h
index 7410168c4f..30a005e114 100644
--- a/src/libshared/include/shared/machine-image.h
+++ b/src/libshared/include/shared/machine-image.h
@@ -22,12 +22,12 @@
#include <stdbool.h>
#include <stdint.h>
-#include "hashmap.h"
-#include "lockfile-util.h"
-#include "macro.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "time-util.h"
+#include "basic/hashmap.h"
+#include "basic/lockfile-util.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
typedef enum ImageType {
IMAGE_DIRECTORY,
diff --git a/src/libshared/include/shared/output-mode.h b/src/libshared/include/shared/output-mode.h
index f37189e57f..9a8d8127d3 100644
--- a/src/libshared/include/shared/output-mode.h
+++ b/src/libshared/include/shared/output-mode.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
typedef enum OutputMode {
OUTPUT_SHORT,
diff --git a/src/libshared/include/shared/pager.h b/src/libshared/include/shared/pager.h
index 893e1d2bb6..2a3cbe1721 100644
--- a/src/libshared/include/shared/pager.h
+++ b/src/libshared/include/shared/pager.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "macro.h"
+#include "basic/macro.h"
int pager_open(bool no_pager, bool jump_to_end);
void pager_close(void);
diff --git a/src/libshared/include/shared/path-lookup.h b/src/libshared/include/shared/path-lookup.h
index f9bb2fe237..ab14bdc267 100644
--- a/src/libshared/include/shared/path-lookup.h
+++ b/src/libshared/include/shared/path-lookup.h
@@ -21,10 +21,11 @@
#include <stdbool.h>
+#include "basic/macro.h"
+
typedef struct LookupPaths LookupPaths;
#include "install.h"
-#include "macro.h"
typedef enum LookupPathsFlags {
LOOKUP_PATHS_EXCLUDE_GENERATED = 1,
diff --git a/src/libshared/include/shared/ptyfwd.h b/src/libshared/include/shared/ptyfwd.h
index 83c1f60970..8f32184433 100644
--- a/src/libshared/include/shared/ptyfwd.h
+++ b/src/libshared/include/shared/ptyfwd.h
@@ -23,7 +23,7 @@
#include <systemd/sd-event.h>
-#include "macro.h"
+#include "basic/macro.h"
typedef struct PTYForward PTYForward;
diff --git a/src/libshared/include/shared/resolve-util.h b/src/libshared/include/shared/resolve-util.h
index 8636a6c134..8df46599ad 100644
--- a/src/libshared/include/shared/resolve-util.h
+++ b/src/libshared/include/shared/resolve-util.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
typedef enum ResolveSupport ResolveSupport;
typedef enum DnssecMode DnssecMode;
diff --git a/src/libshared/include/shared/udev-util.h b/src/libshared/include/shared/udev-util.h
index ca0889f8a6..c3db8ab30e 100644
--- a/src/libshared/include/shared/udev-util.h
+++ b/src/libshared/include/shared/udev-util.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/util.h"
#include "udev.h"
-#include "util.h"
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref);
diff --git a/src/libshared/include/shared/utmp-wtmp.h b/src/libshared/include/shared/utmp-wtmp.h
index 438e270a26..50dde37b16 100644
--- a/src/libshared/include/shared/utmp-wtmp.h
+++ b/src/libshared/include/shared/utmp-wtmp.h
@@ -22,8 +22,8 @@
#include <stdbool.h>
#include <sys/types.h>
-#include "time-util.h"
-#include "util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
#ifdef HAVE_UTMP
int utmp_get_runlevel(int *runlevel, int *previous);
diff --git a/src/libshared/include/shared/watchdog.h b/src/libshared/include/shared/watchdog.h
index f6ec178ea1..78e1406f5d 100644
--- a/src/libshared/include/shared/watchdog.h
+++ b/src/libshared/include/shared/watchdog.h
@@ -21,8 +21,8 @@
#include <stdbool.h>
-#include "time-util.h"
-#include "util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
int watchdog_set_timeout(usec_t *usec);
int watchdog_ping(void);
diff --git a/src/libshared/src/Makefile b/src/libshared/src/Makefile
new file mode 100644
index 0000000000..d808b55361
--- /dev/null
+++ b/src/libshared/src/Makefile
@@ -0,0 +1,143 @@
+# -*- 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 += \
+ libshared.la
+
+libshared_la_SOURCES = \
+ src/shared/output-mode.h \
+ src/shared/output-mode.c \
+ src/shared/gpt.h \
+ src/shared/udev-util.h \
+ src/shared/linux/auto_dev-ioctl.h \
+ src/shared/initreq.h \
+ src/shared/dns-domain.c \
+ src/shared/dns-domain.h \
+ src/shared/efivars.c \
+ src/shared/efivars.h \
+ src/shared/fstab-util.c \
+ src/shared/fstab-util.h \
+ src/shared/sleep-config.c \
+ src/shared/sleep-config.h \
+ src/shared/conf-parser.c \
+ src/shared/conf-parser.h \
+ src/shared/pager.c \
+ src/shared/pager.h \
+ src/shared/spawn-polkit-agent.c \
+ src/shared/spawn-polkit-agent.h \
+ src/shared/apparmor-util.c \
+ src/shared/apparmor-util.h \
+ src/shared/ima-util.c \
+ src/shared/ima-util.h \
+ src/shared/ptyfwd.c \
+ src/shared/ptyfwd.h \
+ src/shared/base-filesystem.c \
+ src/shared/base-filesystem.h \
+ src/shared/uid-range.c \
+ src/shared/uid-range.h \
+ src/shared/install.c \
+ src/shared/install.h \
+ src/shared/install-printf.c \
+ src/shared/install-printf.h \
+ src/shared/path-lookup.c \
+ src/shared/path-lookup.h \
+ src/shared/specifier.c \
+ src/shared/specifier.h \
+ src/shared/dev-setup.c \
+ src/shared/dev-setup.h \
+ src/shared/dropin.c \
+ src/shared/dropin.h \
+ src/shared/condition.c \
+ src/shared/condition.h \
+ src/shared/clean-ipc.c \
+ src/shared/clean-ipc.h \
+ src/shared/generator.h \
+ src/shared/generator.c \
+ src/shared/acpi-fpdt.h \
+ src/shared/acpi-fpdt.c \
+ src/shared/boot-timestamps.h \
+ src/shared/boot-timestamps.c \
+ src/shared/cgroup-show.c \
+ src/shared/cgroup-show.h \
+ src/shared/utmp-wtmp.h \
+ src/shared/watchdog.c \
+ src/shared/watchdog.h \
+ src/shared/spawn-ask-password-agent.c \
+ src/shared/spawn-ask-password-agent.h \
+ src/shared/ask-password-api.c \
+ src/shared/ask-password-api.h \
+ src/shared/switch-root.h \
+ src/shared/switch-root.c \
+ src/shared/import-util.c \
+ src/shared/import-util.h \
+ src/shared/sysctl-util.c \
+ src/shared/sysctl-util.h \
+ src/shared/bus-util.c \
+ src/shared/bus-util.h \
+ src/shared/logs-show.c \
+ src/shared/logs-show.h \
+ src/shared/machine-image.c \
+ src/shared/machine-image.h \
+ src/shared/machine-pool.c \
+ src/shared/machine-pool.h \
+ src/shared/resolve-util.c \
+ src/shared/resolve-util.h \
+ src/shared/bus-unit-util.c \
+ src/shared/bus-unit-util.h \
+ src/shared/tests.h \
+ src/shared/tests.c
+
+ifneq ($(HAVE_UTMP),)
+libshared_la_SOURCES += \
+ src/shared/utmp-wtmp.c
+endif # HAVE_UTMP
+
+ifneq ($(HAVE_SECCOMP),)
+libshared_la_SOURCES += \
+ src/shared/seccomp-util.h \
+ src/shared/seccomp-util.c
+endif # HAVE_SECCOMP
+
+ifneq ($(HAVE_ACL),)
+libshared_la_SOURCES += \
+ src/shared/acl-util.c \
+ src/shared/acl-util.h
+endif # HAVE_ACL
+
+libshared_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(ACL_CFLAGS) \
+ $(LIBIDN_CFLAGS) \
+ $(SECCOMP_CFLAGS)
+
+libshared_la_LIBADD = \
+ libsystemd-internal.la \
+ libsystemd-journal-internal.la \
+ libudev-internal.la \
+ $(ACL_LIBS) \
+ $(LIBIDN_LIBS) \
+ $(SECCOMP_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/src/acl-util.c b/src/libshared/src/acl-util.c
index 2aa951fce9..b9af6aca5c 100644
--- a/src/libshared/src/acl-util.c
+++ b/src/libshared/src/acl-util.c
@@ -20,12 +20,12 @@
#include <errno.h>
#include <stdbool.h>
-#include "acl-util.h"
-#include "alloc-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/acl-util.h"
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
acl_entry_t i;
diff --git a/src/libshared/src/acpi-fpdt.c b/src/libshared/src/acpi-fpdt.c
index 6779691c28..d3a744acbd 100644
--- a/src/libshared/src/acpi-fpdt.c
+++ b/src/libshared/src/acpi-fpdt.c
@@ -24,11 +24,11 @@
#include <string.h>
#include <unistd.h>
-#include "acpi-fpdt.h"
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/time-util.h"
+#include "shared/acpi-fpdt.h"
struct acpi_table_header {
char signature[4];
diff --git a/src/libshared/src/apparmor-util.c b/src/libshared/src/apparmor-util.c
index edd695fd23..af5498e05e 100644
--- a/src/libshared/src/apparmor-util.c
+++ b/src/libshared/src/apparmor-util.c
@@ -19,10 +19,10 @@
#include <stddef.h>
-#include "alloc-util.h"
-#include "apparmor-util.h"
-#include "fileio.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/parse-util.h"
+#include "shared/apparmor-util.h"
bool mac_apparmor_use(void) {
static int cached_use = -1;
diff --git a/src/libshared/src/ask-password-api.c b/src/libshared/src/ask-password-api.c
index 4a4bd8d3b8..9be47256aa 100644
--- a/src/libshared/src/ask-password-api.c
+++ b/src/libshared/src/ask-password-api.c
@@ -39,26 +39,26 @@
#include <termios.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "ask-password-api.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "io-util.h"
-#include "log.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "random-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "umask-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/random-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/umask-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "shared/ask-password-api.h"
#define KEYRING_TIMEOUT_USEC ((5 * USEC_PER_MINUTE) / 2)
diff --git a/src/libshared/src/base-filesystem.c b/src/libshared/src/base-filesystem.c
index 59a34a9d11..881bfb061c 100644
--- a/src/libshared/src/base-filesystem.c
+++ b/src/libshared/src/base-filesystem.c
@@ -25,15 +25,15 @@
#include <syslog.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "base-filesystem.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "umask-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/umask-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/base-filesystem.h"
typedef struct BaseFilesystem {
const char *dir;
diff --git a/src/libshared/src/boot-timestamps.c b/src/libshared/src/boot-timestamps.c
index 7e0152761c..3e3034f032 100644
--- a/src/libshared/src/boot-timestamps.c
+++ b/src/libshared/src/boot-timestamps.c
@@ -18,11 +18,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "acpi-fpdt.h"
-#include "boot-timestamps.h"
-#include "efivars.h"
-#include "macro.h"
-#include "time-util.h"
+#include "basic/macro.h"
+#include "basic/time-util.h"
+#include "shared/acpi-fpdt.h"
+#include "shared/boot-timestamps.h"
+#include "shared/efivars.h"
int boot_timestamps(const dual_timestamp *n, dual_timestamp *firmware, dual_timestamp *loader) {
usec_t x = 0, y = 0, a;
diff --git a/src/libshared/src/bus-unit-util.c b/src/libshared/src/bus-unit-util.c
index f68c4a41ac..08c495aae5 100644
--- a/src/libshared/src/bus-unit-util.c
+++ b/src/libshared/src/bus-unit-util.c
@@ -17,26 +17,26 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-internal.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "env-util.h"
-#include "escape.h"
-#include "hashmap.h"
-#include "list.h"
-#include "locale-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "rlimit-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "syslog-util.h"
-#include "terminal-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/env-util.h"
+#include "basic/escape.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/locale-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/rlimit-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/syslog-util.h"
+#include "basic/terminal-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
assert(message);
diff --git a/src/libshared/src/bus-util.c b/src/libshared/src/bus-util.c
index 62b5585e84..b303509f34 100644
--- a/src/libshared/src/bus-util.c
+++ b/src/libshared/src/bus-util.c
@@ -34,21 +34,21 @@
#include <systemd/sd-event.h>
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "bus-internal.h"
-#include "bus-label.h"
-#include "bus-message.h"
-#include "bus-util.h"
-#include "def.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "rlimit-util.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "user-util.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/def.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/rlimit-util.h"
+#include "basic/stdio-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "sd-bus/bus-internal.h"
+#include "sd-bus/bus-message.h"
+#include "shared/bus-util.h"
static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
sd_event *e = userdata;
diff --git a/src/libshared/src/cgroup-show.c b/src/libshared/src/cgroup-show.c
index 3e451db715..e8dae923f5 100644
--- a/src/libshared/src/cgroup-show.c
+++ b/src/libshared/src/cgroup-show.c
@@ -24,18 +24,18 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "locale-util.h"
-#include "macro.h"
-#include "output-mode.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/locale-util.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "shared/cgroup-show.h"
+#include "shared/output-mode.h"
static void show_pid_array(
pid_t pids[],
diff --git a/src/libshared/src/clean-ipc.c b/src/libshared/src/clean-ipc.c
index a3ac7aeb82..b9c60c48ae 100644
--- a/src/libshared/src/clean-ipc.c
+++ b/src/libshared/src/clean-ipc.c
@@ -32,15 +32,15 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "clean-ipc.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/clean-ipc.h"
static int clean_sysvipc_shm(uid_t delete_uid) {
_cleanup_fclose_ FILE *f = NULL;
diff --git a/src/libshared/src/condition.c b/src/libshared/src/condition.c
index 33ca6e029e..fdfa3b0941 100644
--- a/src/libshared/src/condition.c
+++ b/src/libshared/src/condition.c
@@ -29,30 +29,30 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "apparmor-util.h"
-#include "architecture.h"
-#include "audit-util.h"
-#include "cap-list.h"
-#include "condition.h"
-#include "extract-word.h"
-#include "fd-util.h"
-#include "glob-util.h"
-#include "hostname-util.h"
-#include "ima-util.h"
-#include "list.h"
-#include "macro.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "selinux-util.h"
-#include "smack-util.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/audit-util.h"
+#include "basic/cap-list.h"
+#include "basic/extract-word.h"
+#include "basic/fd-util.h"
+#include "basic/glob-util.h"
+#include "basic/hostname-util.h"
+#include "basic/list.h"
+#include "basic/macro.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "shared/apparmor-util.h"
+#include "shared/condition.h"
+#include "shared/ima-util.h"
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) {
Condition *c;
diff --git a/src/libshared/src/conf-parser.c b/src/libshared/src/conf-parser.c
index 83be79a4f5..6631ff966f 100644
--- a/src/libshared/src/conf-parser.c
+++ b/src/libshared/src/conf-parser.c
@@ -25,24 +25,24 @@
#include <string.h>
#include <sys/types.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
-#include "extract-word.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "time-util.h"
-#include "utf8.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/extract-word.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/syslog-util.h"
+#include "basic/time-util.h"
+#include "basic/utf8.h"
+#include "shared/conf-parser.h"
int config_item_table_lookup(
const void *table,
diff --git a/src/libshared/src/dev-setup.c b/src/libshared/src/dev-setup.c
index b2d464c117..495099dc28 100644
--- a/src/libshared/src/dev-setup.c
+++ b/src/libshared/src/dev-setup.c
@@ -21,13 +21,13 @@
#include <stdlib.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dev-setup.h"
-#include "label.h"
-#include "log.h"
-#include "path-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/label.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/dev-setup.h"
int dev_setup(const char *prefix, uid_t uid, gid_t gid) {
static const char symlinks[] =
diff --git a/src/libshared/src/dropin.c b/src/libshared/src/dropin.c
index b9cd952ac8..ed044e0ba4 100644
--- a/src/libshared/src/dropin.c
+++ b/src/libshared/src/dropin.c
@@ -23,21 +23,21 @@
#include <stdio.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "dropin.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "hashmap.h"
-#include "log.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "set.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "shared/dropin.h"
int drop_in_file(const char *dir, const char *unit, unsigned level,
const char *name, char **_p, char **_q) {
diff --git a/src/libshared/src/efivars.c b/src/libshared/src/efivars.c
index 5073c61740..41247eac03 100644
--- a/src/libshared/src/efivars.c
+++ b/src/libshared/src/efivars.c
@@ -29,18 +29,18 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "efivars.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "time-util.h"
-#include "utf8.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/time-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "shared/efivars.h"
#ifdef ENABLE_EFI
diff --git a/src/libshared/src/fstab-util.c b/src/libshared/src/fstab-util.c
index a4e0cd3267..3f301c6fe3 100644
--- a/src/libshared/src/fstab-util.c
+++ b/src/libshared/src/fstab-util.c
@@ -23,16 +23,16 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "device-nodes.h"
-#include "fstab-util.h"
-#include "macro.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/device-nodes.h"
+#include "basic/macro.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/fstab-util.h"
bool fstab_is_mount_point(const char *mount) {
_cleanup_endmntent_ FILE *f = NULL;
diff --git a/src/libshared/src/gcrypt-util.c b/src/libshared/src/gcrypt-util.c
index 39b544b6f0..069134a4be 100644
--- a/src/libshared/src/gcrypt-util.c
+++ b/src/libshared/src/gcrypt-util.c
@@ -22,8 +22,8 @@
#ifdef HAVE_GCRYPT
#include <gcrypt.h>
-#include "gcrypt-util.h"
-#include "hexdecoct.h"
+#include "basic/hexdecoct.h"
+#include "shared/gcrypt-util.h"
void initialize_libgcrypt(bool secmem) {
const char *p;
diff --git a/src/libshared/src/generator.c b/src/libshared/src/generator.c
index 70afc6a285..7e7c3fd78b 100644
--- a/src/libshared/src/generator.c
+++ b/src/libshared/src/generator.c
@@ -20,22 +20,22 @@
#include <errno.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "dropin.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fstab-util.h"
-#include "generator.h"
-#include "log.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "special.h"
-#include "string-util.h"
-#include "time-util.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "shared/dropin.h"
+#include "shared/fstab-util.h"
+#include "shared/generator.h"
static int write_fsck_sysroot_service(const char *dir, const char *what) {
_cleanup_free_ char *device = NULL, *escaped = NULL;
diff --git a/src/libshared/src/ima-util.c b/src/libshared/src/ima-util.c
index 789064d653..74fa5e280d 100644
--- a/src/libshared/src/ima-util.c
+++ b/src/libshared/src/ima-util.c
@@ -19,7 +19,7 @@
#include <unistd.h>
-#include "ima-util.h"
+#include "shared/ima-util.h"
static int use_ima_cached = -1;
diff --git a/src/libshared/src/import-util.c b/src/libshared/src/import-util.c
index ab701ad8b2..286cc1398a 100644
--- a/src/libshared/src/import-util.c
+++ b/src/libshared/src/import-util.c
@@ -20,15 +20,15 @@
#include <errno.h>
#include <string.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "import-util.h"
-#include "log.h"
-#include "macro.h"
-#include "path-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/import-util.h"
int import_url_last_component(const char *url, char **ret) {
const char *e, *p;
diff --git a/src/libshared/src/install-printf.c b/src/libshared/src/install-printf.c
index 88143361da..2d62e3dfd2 100644
--- a/src/libshared/src/install-printf.c
+++ b/src/libshared/src/install-printf.c
@@ -22,13 +22,13 @@
#include <string.h>
#include <unistd.h>
-#include "formats-util.h"
-#include "install-printf.h"
-#include "install.h"
-#include "macro.h"
-#include "specifier.h"
-#include "unit-name.h"
-#include "user-util.h"
+#include "basic/formats-util.h"
+#include "basic/macro.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "shared/install-printf.h"
+#include "shared/install.h"
+#include "shared/specifier.h"
static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
UnitFileInstallInfo *i = userdata;
diff --git a/src/libshared/src/install.c b/src/libshared/src/install.c
index 64d66a45d3..bd360abcee 100644
--- a/src/libshared/src/install.c
+++ b/src/libshared/src/install.c
@@ -29,31 +29,31 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
-#include "dirent-util.h"
-#include "extract-word.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "install-printf.h"
-#include "install.h"
-#include "locale-util.h"
-#include "log.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-lookup.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "set.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/dirent-util.h"
+#include "basic/extract-word.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/set.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/unit-name.h"
+#include "shared/conf-parser.h"
+#include "shared/install-printf.h"
+#include "shared/install.h"
+#include "shared/path-lookup.h"
#define UNIT_FILE_FOLLOW_SYMLINK_MAX 64
diff --git a/src/libshared/src/logs-show.c b/src/libshared/src/logs-show.c
index 294fa3bede..1e5a7c6f01 100644
--- a/src/libshared/src/logs-show.c
+++ b/src/libshared/src/logs-show.c
@@ -31,26 +31,26 @@
#include <systemd/sd-id128.h>
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "hashmap.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "journal-internal.h"
-#include "log.h"
-#include "logs-show.h"
-#include "macro.h"
-#include "output-mode.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "sparse-endian.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/hashmap.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "sd-journal/journal-internal.h"
+#include "shared/logs-show.h"
+#include "shared/output-mode.h"
/* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
#define PRINT_LINE_THRESHOLD 3
diff --git a/src/libshared/src/machine-image.c b/src/libshared/src/machine-image.c
index 529d89ee2a..28b096f538 100644
--- a/src/libshared/src/machine-image.c
+++ b/src/libshared/src/machine-image.c
@@ -26,29 +26,31 @@
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
+
#include <linux/fs.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "chattr-util.h"
-#include "copy.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "lockfile-util.h"
-#include "log.h"
-#include "macro.h"
-#include "machine-image.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "utf8.h"
-#include "util.h"
-#include "xattr-util.h"
+
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/chattr-util.h"
+#include "basic/copy.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/lockfile-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "basic/xattr-util.h"
+#include "shared/machine-image.h"
static const char image_search_path[] =
"/var/lib/machines\0"
diff --git a/src/libshared/src/machine-pool.c b/src/libshared/src/machine-pool.c
index c36efa0102..176bc24890 100644
--- a/src/libshared/src/machine-pool.c
+++ b/src/libshared/src/machine-pool.c
@@ -19,7 +19,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/loop.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
@@ -33,27 +32,29 @@
#include <sys/statvfs.h>
#include <unistd.h>
+#include <linux/loop.h>
+
#include <systemd/sd-bus-protocol.h>
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "lockfile-util.h"
-#include "log.h"
-#include "machine-pool.h"
-#include "macro.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "stat-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/lockfile-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "shared/machine-pool.h"
#define VAR_LIB_MACHINES_SIZE_START (1024UL*1024UL*500UL)
#define VAR_LIB_MACHINES_FREE_MIN (1024UL*1024UL*750UL)
diff --git a/src/libshared/src/output-mode.c b/src/libshared/src/output-mode.c
index bec53ee0ae..f482b0fa06 100644
--- a/src/libshared/src/output-mode.c
+++ b/src/libshared/src/output-mode.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "output-mode.h"
-#include "string-table.h"
+#include "basic/string-table.h"
+#include "shared/output-mode.h"
static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
[OUTPUT_SHORT] = "short",
diff --git a/src/libshared/src/pager.c b/src/libshared/src/pager.c
index c16bc027be..8598d8e51a 100644
--- a/src/libshared/src/pager.c
+++ b/src/libshared/src/pager.c
@@ -27,16 +27,16 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "copy.h"
-#include "fd-util.h"
-#include "locale-util.h"
-#include "log.h"
-#include "macro.h"
-#include "pager.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "shared/pager.h"
static pid_t pager_pid = 0;
diff --git a/src/libshared/src/path-lookup.c b/src/libshared/src/path-lookup.c
index ca593b6963..6ce89f4ed4 100644
--- a/src/libshared/src/path-lookup.c
+++ b/src/libshared/src/path-lookup.c
@@ -22,18 +22,18 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "install.h"
-#include "log.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-lookup.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/install.h"
+#include "shared/path-lookup.h"
static int user_runtime_dir(char **ret, const char *suffix) {
const char *e;
diff --git a/src/libshared/src/ptyfwd.c b/src/libshared/src/ptyfwd.c
index 9629b50ed9..cd6a360ae4 100644
--- a/src/libshared/src/ptyfwd.c
+++ b/src/libshared/src/ptyfwd.c
@@ -32,12 +32,12 @@
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "ptyfwd.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/time-util.h"
+#include "shared/ptyfwd.h"
struct PTYForward {
sd_event *event;
diff --git a/src/libshared/src/resolve-util.c b/src/libshared/src/resolve-util.c
index e2da81bab7..1f031e566d 100644
--- a/src/libshared/src/resolve-util.c
+++ b/src/libshared/src/resolve-util.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "conf-parser.h"
-#include "resolve-util.h"
-#include "string-table.h"
+#include "basic/string-table.h"
+#include "shared/conf-parser.h"
+#include "shared/resolve-util.h"
DEFINE_CONFIG_PARSE_ENUM(config_parse_resolve_support, resolve_support, ResolveSupport, "Failed to parse resolve support setting");
DEFINE_CONFIG_PARSE_ENUM(config_parse_dnssec_mode, dnssec_mode, DnssecMode, "Failed to parse DNSSEC mode setting");
diff --git a/src/libshared/src/seccomp-util.c b/src/libshared/src/seccomp-util.c
index cebe0fce2a..a7063539fb 100644
--- a/src/libshared/src/seccomp-util.c
+++ b/src/libshared/src/seccomp-util.c
@@ -21,9 +21,9 @@
#include <seccomp.h>
#include <stddef.h>
-#include "macro.h"
-#include "seccomp-util.h"
-#include "string-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "shared/seccomp-util.h"
const char* seccomp_arch_to_string(uint32_t c) {
diff --git a/src/libshared/src/sleep-config.c b/src/libshared/src/sleep-config.c
index f00624d0f2..fd33763f68 100644
--- a/src/libshared/src/sleep-config.c
+++ b/src/libshared/src/sleep-config.c
@@ -25,18 +25,18 @@
#include <syslog.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "sleep-config.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/conf-parser.h"
+#include "shared/sleep-config.h"
#define USE(x, y) do { (x) = (y); (y) = NULL; } while (0)
diff --git a/src/libshared/src/spawn-ask-password-agent.c b/src/libshared/src/spawn-ask-password-agent.c
index a46b7525f0..6c8aafcfb1 100644
--- a/src/libshared/src/spawn-ask-password-agent.c
+++ b/src/libshared/src/spawn-ask-password-agent.c
@@ -21,10 +21,10 @@
#include <stdlib.h>
#include <unistd.h>
-#include "log.h"
-#include "process-util.h"
-#include "spawn-ask-password-agent.h"
-#include "util.h"
+#include "basic/log.h"
+#include "basic/process-util.h"
+#include "basic/util.h"
+#include "shared/spawn-ask-password-agent.h"
static pid_t agent_pid = 0;
diff --git a/src/libshared/src/spawn-polkit-agent.c b/src/libshared/src/spawn-polkit-agent.c
index 7dae4d14fe..cb191fb6c5 100644
--- a/src/libshared/src/spawn-polkit-agent.c
+++ b/src/libshared/src/spawn-polkit-agent.c
@@ -23,15 +23,15 @@
#include <stdlib.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "io-util.h"
-#include "log.h"
-#include "macro.h"
-#include "process-util.h"
-#include "spawn-polkit-agent.h"
-#include "stdio-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/process-util.h"
+#include "basic/stdio-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
+#include "shared/spawn-polkit-agent.h"
#ifdef ENABLE_POLKIT
static pid_t agent_pid = 0;
diff --git a/src/libshared/src/specifier.c b/src/libshared/src/specifier.c
index 303ddf0401..42bd306e00 100644
--- a/src/libshared/src/specifier.c
+++ b/src/libshared/src/specifier.c
@@ -26,11 +26,11 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "hostname-util.h"
-#include "macro.h"
-#include "specifier.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "shared/specifier.h"
/*
* Generic infrastructure for replacing %x style specifiers in
diff --git a/src/libshared/src/switch-root.c b/src/libshared/src/switch-root.c
index 47d3a5a1fa..d41a114ae1 100644
--- a/src/libshared/src/switch-root.c
+++ b/src/libshared/src/switch-root.c
@@ -26,18 +26,18 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "base-filesystem.h"
-#include "fd-util.h"
-#include "log.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "switch-root.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/base-filesystem.h"
+#include "shared/switch-root.h"
int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, unsigned long mountflags) {
diff --git a/src/libshared/src/sysctl-util.c b/src/libshared/src/sysctl-util.c
index e1ccb3294c..5dfe32a16b 100644
--- a/src/libshared/src/sysctl-util.c
+++ b/src/libshared/src/sysctl-util.c
@@ -20,11 +20,11 @@
#include <stdio.h>
#include <string.h>
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "sysctl-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "shared/sysctl-util.h"
char *sysctl_normalize(char *s) {
char *n;
diff --git a/src/libshared/src/tests.c b/src/libshared/src/tests.c
index 409116290d..37f57ca18c 100644
--- a/src/libshared/src/tests.c
+++ b/src/libshared/src/tests.c
@@ -18,9 +18,9 @@
***/
#include <stdlib.h>
-#include <util.h>
-#include "tests.h"
+#include "basic/util.h"
+#include "shared/tests.h"
char* setup_fake_runtime_dir(void) {
char t[] = "/tmp/fake-xdg-runtime-XXXXXX", *p;
diff --git a/src/libshared/src/uid-range.c b/src/libshared/src/uid-range.c
index b6ec474390..22cac34c6e 100644
--- a/src/libshared/src/uid-range.c
+++ b/src/libshared/src/uid-range.c
@@ -21,9 +21,9 @@
#include <stdlib.h>
#include <string.h>
-#include "macro.h"
-#include "uid-range.h"
-#include "user-util.h"
+#include "basic/macro.h"
+#include "basic/user-util.h"
+#include "shared/uid-range.h"
static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
assert(range);
diff --git a/src/libshared/src/utmp-wtmp.c b/src/libshared/src/utmp-wtmp.c
index 9750dcd817..f10d7e9008 100644
--- a/src/libshared/src/utmp-wtmp.c
+++ b/src/libshared/src/utmp-wtmp.c
@@ -29,17 +29,17 @@
#include <unistd.h>
#include <utmpx.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "macro.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "time-util.h"
-#include "user-util.h"
-#include "util.h"
-#include "utmp-wtmp.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/time-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/utmp-wtmp.h"
int utmp_get_runlevel(int *runlevel, int *previous) {
struct utmpx *found, lookup = { .ut_type = RUN_LVL };
diff --git a/src/libshared/src/watchdog.c b/src/libshared/src/watchdog.c
index 4f3e0125f3..c4e58c9577 100644
--- a/src/libshared/src/watchdog.c
+++ b/src/libshared/src/watchdog.c
@@ -22,12 +22,13 @@
#include <sys/ioctl.h>
#include <syslog.h>
#include <unistd.h>
+
#include <linux/watchdog.h>
-#include "fd-util.h"
-#include "log.h"
-#include "time-util.h"
-#include "watchdog.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/time-util.h"
+#include "shared/watchdog.h"
static int watchdog_fd = -1;
static usec_t watchdog_timeout = USEC_INFINITY;
diff --git a/src/libsystemd-network/Makefile b/src/libsystemd-network/Makefile
new file mode 100644
index 0000000000..96f14f58f2
--- /dev/null
+++ b/src/libsystemd-network/Makefile
@@ -0,0 +1,27 @@
+# -*- 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
+
+at.subdirs += src test
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd-network/include/systemd-network/arp-util.h b/src/libsystemd-network/include/systemd-network/arp-util.h
index 3ef56b002a..7540cce95f 100644
--- a/src/libsystemd-network/include/systemd-network/arp-util.h
+++ b/src/libsystemd-network/include/systemd-network/arp-util.h
@@ -21,8 +21,8 @@
#include <netinet/if_ether.h>
-#include "socket-util.h"
-#include "sparse-endian.h"
+#include "basic/socket-util.h"
+#include "basic/sparse-endian.h"
int arp_network_bind_raw_socket(int index, be32_t address, const struct ether_addr *eth_mac);
diff --git a/src/libsystemd-network/include/systemd-network/dhcp-identifier.h b/src/libsystemd-network/include/systemd-network/dhcp-identifier.h
index 802a0d6bc2..5045dd9b3d 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp-identifier.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp-identifier.h
@@ -21,9 +21,9 @@
#include <systemd/sd-id128.h>
-#include "macro.h"
-#include "sparse-endian.h"
-#include "unaligned.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
+#include "basic/unaligned.h"
typedef enum DUIDType {
DUID_TYPE_LLT = 1,
diff --git a/src/libsystemd-network/include/systemd-network/dhcp-internal.h b/src/libsystemd-network/include/systemd-network/dhcp-internal.h
index dda4c13919..63c85b853c 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp-internal.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp-internal.h
@@ -20,15 +20,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/if_packet.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <stdint.h>
-#include <systemd/sd-dhcp-client.h>
+#include <linux/if_packet.h>
+
+#include "basic/socket-util.h"
#include "dhcp-protocol.h"
-#include "socket-util.h"
+#include "sd-dhcp-client.h"
int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link,
uint32_t xid, const uint8_t *mac_addr,
diff --git a/src/libsystemd-network/include/systemd-network/dhcp-lease-internal.h b/src/libsystemd-network/include/systemd-network/dhcp-lease-internal.h
index 646e612cee..af66781ac7 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp-lease-internal.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp-lease-internal.h
@@ -21,13 +21,14 @@
***/
#include <stdint.h>
+
#include <linux/if_packet.h>
-#include <systemd/sd-dhcp-client.h>
+#include "basic/list.h"
+#include "basic/util.h"
#include "dhcp-protocol.h"
-#include "list.h"
-#include "util.h"
+#include "sd-dhcp-client.h"
struct sd_dhcp_route {
struct in_addr dst_addr;
diff --git a/src/libsystemd-network/include/systemd-network/dhcp-protocol.h b/src/libsystemd-network/include/systemd-network/dhcp-protocol.h
index 3e32484c1d..b4ca0b73a0 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp-protocol.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp-protocol.h
@@ -23,8 +23,8 @@
#include <netinet/udp.h>
#include <stdint.h>
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
struct DHCPMessage {
uint8_t op;
diff --git a/src/libsystemd-network/include/systemd-network/dhcp-server-internal.h b/src/libsystemd-network/include/systemd-network/dhcp-server-internal.h
index 7ba1e72155..45f5946e59 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp-server-internal.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp-server-internal.h
@@ -20,13 +20,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-dhcp-server.h>
#include <systemd/sd-event.h>
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/util.h"
+
#include "dhcp-internal.h"
-#include "hashmap.h"
-#include "log.h"
-#include "util.h"
+#include "sd-dhcp-server.h"
typedef struct DHCPClientId {
size_t length;
diff --git a/src/libsystemd-network/include/systemd-network/dhcp6-internal.h b/src/libsystemd-network/include/systemd-network/dhcp6-internal.h
index 4228053ade..34cdbed57a 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp6-internal.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp6-internal.h
@@ -24,9 +24,9 @@
#include <systemd/sd-event.h>
-#include "list.h"
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/list.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
typedef struct DHCP6Address DHCP6Address;
diff --git a/src/libsystemd-network/include/systemd-network/dhcp6-lease-internal.h b/src/libsystemd-network/include/systemd-network/dhcp6-lease-internal.h
index 8e9a6f8e8c..9da270e9a9 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp6-lease-internal.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp6-lease-internal.h
@@ -22,9 +22,8 @@
#include <stdint.h>
-#include <systemd/sd-dhcp6-lease.h>
-
#include "dhcp6-internal.h"
+#include "sd-dhcp6-lease.h"
struct sd_dhcp6_lease {
unsigned n_ref;
diff --git a/src/libsystemd-network/include/systemd-network/dhcp6-protocol.h b/src/libsystemd-network/include/systemd-network/dhcp6-protocol.h
index 2487c470ab..f54f4ad618 100644
--- a/src/libsystemd-network/include/systemd-network/dhcp6-protocol.h
+++ b/src/libsystemd-network/include/systemd-network/dhcp6-protocol.h
@@ -22,8 +22,8 @@
#include <netinet/ip6.h>
#include <netinet/udp.h>
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
struct DHCP6Message {
union {
diff --git a/src/libsystemd-network/include/systemd-network/lldp-internal.h b/src/libsystemd-network/include/systemd-network/lldp-internal.h
index a6be995e3b..f657a1d0af 100644
--- a/src/libsystemd-network/include/systemd-network/lldp-internal.h
+++ b/src/libsystemd-network/include/systemd-network/lldp-internal.h
@@ -21,11 +21,12 @@
***/
#include <systemd/sd-event.h>
-#include <systemd/sd-lldp.h>
-#include "hashmap.h"
-#include "log.h"
-#include "prioq.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/prioq.h"
+
+#include "sd-lldp.h"
struct sd_lldp {
int ifindex;
diff --git a/src/libsystemd-network/include/systemd-network/lldp-neighbor.h b/src/libsystemd-network/include/systemd-network/lldp-neighbor.h
index 050159ab73..b5944164fc 100644
--- a/src/libsystemd-network/include/systemd-network/lldp-neighbor.h
+++ b/src/libsystemd-network/include/systemd-network/lldp-neighbor.h
@@ -23,11 +23,11 @@
#include <stdbool.h>
#include <sys/types.h>
-#include <systemd/sd-lldp.h>
+#include "basic/hash-funcs.h"
+#include "basic/time-util.h"
-#include "hash-funcs.h"
#include "lldp-internal.h"
-#include "time-util.h"
+#include "sd-lldp.h"
typedef struct LLDPNeighborID {
/* The spec calls this an "MSAP identifier" */
diff --git a/src/libsystemd-network/include/systemd-network/network-internal.h b/src/libsystemd-network/include/systemd-network/network-internal.h
index 1cafb0747f..a5cf8e4f1c 100644
--- a/src/libsystemd-network/include/systemd-network/network-internal.h
+++ b/src/libsystemd-network/include/systemd-network/network-internal.h
@@ -21,11 +21,11 @@
#include <stdbool.h>
-#include <systemd/sd-dhcp-lease.h>
-
-#include "condition.h"
+#include "shared/condition.h"
#include "udev.h"
+#include "sd-dhcp-lease.h"
+
bool net_match_config(const struct ether_addr *match_mac,
char * const *match_path,
char * const *match_driver,
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 f7bd5c4b7a..4fd418ed35 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h
@@ -25,10 +25,10 @@
#include <netinet/in.h>
#include <sys/types.h>
-#include <systemd/sd-dhcp-lease.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 2f565ca825..014288b8c1 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 "_sd-common.h"
+#include <systemd/_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 bbb2bb203c..8f0cbaefad 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h
@@ -24,10 +24,9 @@
#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 6bcd9862c9..fd30f0cd03 100644
--- a/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h
+++ b/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h
@@ -24,10 +24,10 @@
#include <net/ethernet.h>
#include <sys/types.h>
-#include <systemd/sd-dhcp6-lease.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 184fbb8e0d..3e633548d0 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 "_sd-common.h"
+#include <systemd/_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 93db7a4a6c..b6ba392921 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h
@@ -24,10 +24,9 @@
#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 9167623167..9314360b6f 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h
@@ -23,10 +23,9 @@
#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 391e7c2a2e..6559df44b6 100644
--- a/src/libsystemd-network/include/systemd-network/sd-lldp.h
+++ b/src/libsystemd-network/include/systemd-network/sd-lldp.h
@@ -24,10 +24,9 @@
#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 c77a435d17..e918fef71e 100644
--- a/src/libsystemd-network/include/systemd-network/sd-ndisc.h
+++ b/src/libsystemd-network/include/systemd-network/sd-ndisc.h
@@ -23,10 +23,9 @@
#include <inttypes.h>
#include <net/ethernet.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
new file mode 100644
index 0000000000..69a415c2bb
--- /dev/null
+++ b/src/libsystemd-network/src/Makefile
@@ -0,0 +1,81 @@
+# -*- 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 += \
+ libsystemd-network.la
+
+libsystemd_network_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(KMOD_CFLAGS)
+
+libsystemd_network_la_SOURCES = \
+ src/systemd/sd-dhcp-client.h \
+ src/systemd/sd-dhcp-server.h \
+ src/systemd/sd-dhcp-lease.h \
+ src/systemd/sd-ipv4ll.h \
+ src/systemd/sd-ipv4acd.h \
+ src/systemd/sd-ndisc.h \
+ src/systemd/sd-dhcp6-client.h \
+ src/systemd/sd-dhcp6-lease.h \
+ src/systemd/sd-lldp.h \
+ src/libsystemd-network/sd-dhcp-client.c \
+ src/libsystemd-network/sd-dhcp-server.c \
+ src/libsystemd-network/dhcp-network.c \
+ src/libsystemd-network/dhcp-option.c \
+ src/libsystemd-network/dhcp-packet.c \
+ src/libsystemd-network/dhcp-internal.h \
+ src/libsystemd-network/dhcp-server-internal.h \
+ src/libsystemd-network/dhcp-protocol.h \
+ src/libsystemd-network/dhcp-lease-internal.h \
+ src/libsystemd-network/sd-dhcp-lease.c \
+ src/libsystemd-network/sd-ipv4ll.c \
+ src/libsystemd-network/sd-ipv4acd.c \
+ src/libsystemd-network/arp-util.h \
+ src/libsystemd-network/arp-util.c \
+ src/libsystemd-network/network-internal.c \
+ src/libsystemd-network/network-internal.h \
+ src/libsystemd-network/sd-ndisc.c \
+ src/libsystemd-network/icmp6-util.h \
+ src/libsystemd-network/icmp6-util.c \
+ src/libsystemd-network/sd-dhcp6-client.c \
+ src/libsystemd-network/dhcp6-internal.h \
+ src/libsystemd-network/dhcp6-protocol.h \
+ src/libsystemd-network/dhcp6-network.c \
+ src/libsystemd-network/dhcp6-option.c \
+ src/libsystemd-network/dhcp6-lease-internal.h \
+ src/libsystemd-network/sd-dhcp6-lease.c \
+ src/libsystemd-network/dhcp-identifier.h \
+ src/libsystemd-network/dhcp-identifier.c \
+ src/libsystemd-network/lldp-internal.h \
+ src/libsystemd-network/lldp-network.h \
+ src/libsystemd-network/lldp-network.c \
+ src/libsystemd-network/lldp-neighbor.h \
+ src/libsystemd-network/lldp-neighbor.c \
+ src/libsystemd-network/sd-lldp.c
+
+libsystemd_network_la_LIBADD = \
+ $(KMOD_LIBS)
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd-network/src/arp-util.c b/src/libsystemd-network/src/arp-util.c
index 4660c7ea09..1299269672 100644
--- a/src/libsystemd-network/src/arp-util.c
+++ b/src/libsystemd-network/src/arp-util.c
@@ -18,12 +18,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/filter.h>
#include <arpa/inet.h>
-#include "arp-util.h"
-#include "fd-util.h"
-#include "util.h"
+#include <linux/filter.h>
+
+#include "basic/fd-util.h"
+#include "basic/util.h"
+#include "systemd-network/arp-util.h"
int arp_network_bind_raw_socket(int ifindex, be32_t address, const struct ether_addr *eth_mac) {
struct sock_filter filter[] = {
diff --git a/src/libsystemd-network/src/dhcp-identifier.c b/src/libsystemd-network/src/dhcp-identifier.c
index 906d960171..3edba38bd8 100644
--- a/src/libsystemd-network/src/dhcp-identifier.c
+++ b/src/libsystemd-network/src/dhcp-identifier.c
@@ -17,16 +17,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
+#include <libudev.h>
#include <systemd/sd-id128.h>
-#include "dhcp-identifier.h"
-#include "dhcp6-protocol.h"
-#include "network-internal.h"
-#include "siphash24.h"
-#include "sparse-endian.h"
-#include "udev-util.h"
-#include "virt.h"
+#include "basic/siphash24.h"
+#include "basic/sparse-endian.h"
+#include "basic/virt.h"
+#include "shared/udev-util.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "systemd-network/dhcp6-protocol.h"
+#include "systemd-network/network-internal.h"
#define SYSTEMD_PEN 43793
#define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09)
diff --git a/src/libsystemd-network/src/dhcp-network.c b/src/libsystemd-network/src/dhcp-network.c
index fac25e0fa2..242d61a05c 100644
--- a/src/libsystemd-network/src/dhcp-network.c
+++ b/src/libsystemd-network/src/dhcp-network.c
@@ -23,13 +23,14 @@
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
+
#include <linux/filter.h>
#include <linux/if_infiniband.h>
#include <linux/if_packet.h>
-#include "dhcp-internal.h"
-#include "fd-util.h"
-#include "socket-util.h"
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/dhcp-internal.h"
static int _bind_raw_socket(int ifindex, union sockaddr_union *link,
uint32_t xid, const uint8_t *mac_addr,
diff --git a/src/libsystemd-network/src/dhcp-option.c b/src/libsystemd-network/src/dhcp-option.c
index c105196334..f47b2ae9e7 100644
--- a/src/libsystemd-network/src/dhcp-option.c
+++ b/src/libsystemd-network/src/dhcp-option.c
@@ -22,10 +22,9 @@
#include <stdio.h>
#include <string.h>
-#include "alloc-util.h"
-#include "utf8.h"
-
-#include "dhcp-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/utf8.h"
+#include "systemd-network/dhcp-internal.h"
static int option_append(uint8_t options[], size_t size, size_t *offset,
uint8_t code, size_t optlen, const void *optval) {
diff --git a/src/libsystemd-network/src/dhcp-packet.c b/src/libsystemd-network/src/dhcp-packet.c
index 8be774061d..cdb54caedc 100644
--- a/src/libsystemd-network/src/dhcp-packet.c
+++ b/src/libsystemd-network/src/dhcp-packet.c
@@ -23,8 +23,8 @@
#include <net/if_arp.h>
#include <string.h>
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
+#include "systemd-network/dhcp-internal.h"
+#include "systemd-network/dhcp-protocol.h"
#define DHCP_CLIENT_MIN_OPTIONS_SIZE 312
diff --git a/src/libsystemd-network/src/dhcp6-network.c b/src/libsystemd-network/src/dhcp6-network.c
index fd2d60c9d5..0f7c281ad3 100644
--- a/src/libsystemd-network/src/dhcp6-network.c
+++ b/src/libsystemd-network/src/dhcp6-network.c
@@ -25,12 +25,13 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <linux/if_packet.h>
-#include "dhcp6-internal.h"
-#include "dhcp6-protocol.h"
-#include "fd-util.h"
-#include "socket-util.h"
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/dhcp6-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
int dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
union sockaddr_union src = {
diff --git a/src/libsystemd-network/src/dhcp6-option.c b/src/libsystemd-network/src/dhcp6-option.c
index 0ae381ad22..060a822834 100644
--- a/src/libsystemd-network/src/dhcp6-option.c
+++ b/src/libsystemd-network/src/dhcp6-option.c
@@ -21,16 +21,15 @@
#include <netinet/in.h>
#include <string.h>
-#include <systemd/sd-dhcp6-client.h>
-
-#include "alloc-util.h"
-#include "dhcp6-internal.h"
-#include "dhcp6-protocol.h"
-#include "dns-domain.h"
-#include "sparse-endian.h"
-#include "strv.h"
-#include "unaligned.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/strv.h"
+#include "basic/unaligned.h"
+#include "basic/util.h"
+#include "shared/dns-domain.h"
+#include "systemd-network/dhcp6-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
+#include "systemd-network/sd-dhcp6-client.h"
#define DHCP6_OPTION_IA_NA_LEN 12
#define DHCP6_OPTION_IA_TA_LEN 4
diff --git a/src/libsystemd-network/src/icmp6-util.c b/src/libsystemd-network/src/icmp6-util.c
index acad9d7d6a..0e78e58444 100644
--- a/src/libsystemd-network/src/icmp6-util.c
+++ b/src/libsystemd-network/src/icmp6-util.c
@@ -26,11 +26,12 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <linux/if_packet.h>
-#include "fd-util.h"
-#include "icmp6-util.h"
-#include "socket-util.h"
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/icmp6-util.h"
#define IN6ADDR_ALL_ROUTERS_MULTICAST_INIT \
{ { { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
diff --git a/src/libsystemd-network/src/lldp-neighbor.c b/src/libsystemd-network/src/lldp-neighbor.c
index 6a716430e3..406af019f5 100644
--- a/src/libsystemd-network/src/lldp-neighbor.c
+++ b/src/libsystemd-network/src/lldp-neighbor.c
@@ -17,14 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "escape.h"
-#include "ether-addr-util.h"
-#include "hexdecoct.h"
-#include "in-addr-util.h"
-#include "lldp-internal.h"
-#include "lldp-neighbor.h"
-#include "unaligned.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/ether-addr-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/in-addr-util.h"
+#include "basic/unaligned.h"
+#include "systemd-network/lldp-internal.h"
+#include "systemd-network/lldp-neighbor.h"
static void lldp_neighbor_id_hash_func(const void *p, struct siphash *state) {
const LLDPNeighborID *id = p;
diff --git a/src/libsystemd-network/src/lldp-network.c b/src/libsystemd-network/src/lldp-network.c
index f031760351..6a525e7089 100644
--- a/src/libsystemd-network/src/lldp-network.c
+++ b/src/libsystemd-network/src/lldp-network.c
@@ -18,12 +18,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/filter.h>
#include <netinet/if_ether.h>
-#include "fd-util.h"
-#include "lldp-network.h"
-#include "socket-util.h"
+#include <linux/filter.h>
+
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/lldp-network.h"
int lldp_network_bind_raw_socket(int ifindex) {
diff --git a/src/libsystemd-network/src/network-internal.c b/src/libsystemd-network/src/network-internal.c
index d57baf8fff..d9f7603104 100644
--- a/src/libsystemd-network/src/network-internal.c
+++ b/src/libsystemd-network/src/network-internal.c
@@ -18,26 +18,26 @@
***/
#include <arpa/inet.h>
-#include <linux/if.h>
#include <netinet/ether.h>
-#include <systemd/sd-ndisc.h>
+#include <linux/if.h>
-#include "alloc-util.h"
-#include "condition.h"
-#include "conf-parser.h"
-#include "dhcp-lease-internal.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/siphash24.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
#include "ether-addr-util.c"
-#include "hexdecoct.h"
-#include "log.h"
-#include "network-internal.h"
-#include "parse-util.h"
-#include "siphash24.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
-#include "util.h"
+#include "shared/condition.h"
+#include "shared/conf-parser.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/network-internal.h"
+#include "systemd-network/sd-ndisc.h"
const char *net_get_name(struct udev_device *device) {
const char *name, *field;
diff --git a/src/libsystemd-network/src/sd-dhcp-client.c b/src/libsystemd-network/src/sd-dhcp-client.c
index 193f31880f..5bf04ed028 100644
--- a/src/libsystemd-network/src/sd-dhcp-client.c
+++ b/src/libsystemd-network/src/sd-dhcp-client.c
@@ -24,21 +24,21 @@
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
+
#include <linux/if_infiniband.h>
-#include <systemd/sd-dhcp-client.h>
-
-#include "alloc-util.h"
-#include "async.h"
-#include "dhcp-identifier.h"
-#include "dhcp-internal.h"
-#include "dhcp-lease-internal.h"
-#include "dhcp-protocol.h"
-#include "dns-domain.h"
-#include "hostname-util.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/hostname-util.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/dns-domain.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "systemd-network/dhcp-internal.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/dhcp-protocol.h"
+#include "systemd-network/sd-dhcp-client.h"
#define MAX_CLIENT_ID_LEN (sizeof(uint32_t) + MAX_DUID_LEN) /* Arbitrary limit */
#define MAX_MAC_ADDR_LEN CONST_MAX(INFINIBAND_ALEN, ETH_ALEN)
diff --git a/src/libsystemd-network/src/sd-dhcp-lease.c b/src/libsystemd-network/src/sd-dhcp-lease.c
index d4c680d485..0edc075b58 100644
--- a/src/libsystemd-network/src/sd-dhcp-lease.c
+++ b/src/libsystemd-network/src/sd-dhcp-lease.c
@@ -24,22 +24,21 @@
#include <stdlib.h>
#include <string.h>
-#include <systemd/sd-dhcp-lease.h>
-
-#include "alloc-util.h"
-#include "dhcp-lease-internal.h"
-#include "dhcp-protocol.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hexdecoct.h"
-#include "hostname-util.h"
-#include "in-addr-util.h"
-#include "network-internal.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "unaligned.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hexdecoct.h"
+#include "basic/hostname-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/unaligned.h"
+#include "shared/dns-domain.h"
+#include "systemd-network/dhcp-lease-internal.h"
+#include "systemd-network/dhcp-protocol.h"
+#include "systemd-network/network-internal.h"
+#include "systemd-network/sd-dhcp-lease.h"
int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) {
assert_return(lease, -EINVAL);
diff --git a/src/libsystemd-network/src/sd-dhcp-server.c b/src/libsystemd-network/src/sd-dhcp-server.c
index 5e8b4e4823..5abc923d92 100644
--- a/src/libsystemd-network/src/sd-dhcp-server.c
+++ b/src/libsystemd-network/src/sd-dhcp-server.c
@@ -20,15 +20,14 @@
#include <sys/ioctl.h>
-#include <systemd/sd-dhcp-server.h>
-
-#include "alloc-util.h"
-#include "dhcp-internal.h"
-#include "dhcp-server-internal.h"
-#include "fd-util.h"
-#include "in-addr-util.h"
-#include "siphash24.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/siphash24.h"
+#include "basic/string-util.h"
+#include "systemd-network/dhcp-internal.h"
+#include "systemd-network/dhcp-server-internal.h"
+#include "systemd-network/sd-dhcp-server.h"
#define DHCP_DEFAULT_LEASE_TIME_USEC USEC_PER_HOUR
#define DHCP_MAX_LEASE_TIME_USEC (USEC_PER_HOUR*12)
diff --git a/src/libsystemd-network/src/sd-dhcp6-client.c b/src/libsystemd-network/src/sd-dhcp6-client.c
index 2760b039ba..ec652d4625 100644
--- a/src/libsystemd-network/src/sd-dhcp6-client.c
+++ b/src/libsystemd-network/src/sd-dhcp6-client.c
@@ -20,22 +20,22 @@
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
+
#include <linux/if_infiniband.h>
-#include <systemd/sd-dhcp6-client.h>
-
-#include "alloc-util.h"
-#include "dhcp-identifier.h"
-#include "dhcp6-internal.h"
-#include "dhcp6-lease-internal.h"
-#include "dhcp6-protocol.h"
-#include "fd-util.h"
-#include "in-addr-util.h"
-#include "network-internal.h"
-#include "random-util.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-table.h"
+#include "basic/util.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "systemd-network/dhcp6-internal.h"
+#include "systemd-network/dhcp6-lease-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
+#include "systemd-network/network-internal.h"
+#include "systemd-network/sd-dhcp6-client.h"
#define MAX_MAC_ADDR_LEN INFINIBAND_ALEN
diff --git a/src/libsystemd-network/src/sd-dhcp6-lease.c b/src/libsystemd-network/src/sd-dhcp6-lease.c
index 5c10a6326a..cb53533492 100644
--- a/src/libsystemd-network/src/sd-dhcp6-lease.c
+++ b/src/libsystemd-network/src/sd-dhcp6-lease.c
@@ -20,11 +20,11 @@
#include <errno.h>
-#include "alloc-util.h"
-#include "dhcp6-lease-internal.h"
-#include "dhcp6-protocol.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "systemd-network/dhcp6-lease-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
int dhcp6_lease_clear_timers(DHCP6IA *ia) {
assert_return(ia, -EINVAL);
diff --git a/src/libsystemd-network/src/sd-ipv4acd.c b/src/libsystemd-network/src/sd-ipv4acd.c
index f1ed7ca747..b361b16e7f 100644
--- a/src/libsystemd-network/src/sd-ipv4acd.c
+++ b/src/libsystemd-network/src/sd-ipv4acd.c
@@ -24,17 +24,16 @@
#include <stdlib.h>
#include <string.h>
-#include <systemd/sd-ipv4acd.h>
-
-#include "alloc-util.h"
-#include "arp-util.h"
-#include "fd-util.h"
-#include "in-addr-util.h"
-#include "list.h"
-#include "random-util.h"
-#include "refcnt.h"
-#include "siphash24.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "basic/random-util.h"
+#include "basic/refcnt.h"
+#include "basic/siphash24.h"
+#include "basic/util.h"
+#include "systemd-network/arp-util.h"
+#include "systemd-network/sd-ipv4acd.h"
/* Constants from the RFC */
#define PROBE_WAIT 1
diff --git a/src/libsystemd-network/src/sd-ipv4ll.c b/src/libsystemd-network/src/sd-ipv4ll.c
index fc27408989..c8428ba489 100644
--- a/src/libsystemd-network/src/sd-ipv4ll.c
+++ b/src/libsystemd-network/src/sd-ipv4ll.c
@@ -24,17 +24,16 @@
#include <stdlib.h>
#include <string.h>
-#include <systemd/sd-ipv4acd.h>
-#include <systemd/sd-ipv4ll.h>
-
-#include "alloc-util.h"
-#include "in-addr-util.h"
-#include "list.h"
-#include "random-util.h"
-#include "refcnt.h"
-#include "siphash24.h"
-#include "sparse-endian.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "basic/random-util.h"
+#include "basic/refcnt.h"
+#include "basic/siphash24.h"
+#include "basic/sparse-endian.h"
+#include "basic/util.h"
+#include "systemd-network/sd-ipv4acd.h"
+#include "systemd-network/sd-ipv4ll.h"
#define IPV4LL_NETWORK 0xA9FE0000L
#define IPV4LL_NETMASK 0xFFFF0000L
diff --git a/src/libsystemd-network/src/sd-lldp.c b/src/libsystemd-network/src/sd-lldp.c
index 5a7380cd3f..412c070ebb 100644
--- a/src/libsystemd-network/src/sd-lldp.c
+++ b/src/libsystemd-network/src/sd-lldp.c
@@ -20,15 +20,14 @@
#include <arpa/inet.h>
-#include <systemd/sd-lldp.h>
-
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "lldp-internal.h"
-#include "lldp-neighbor.h"
-#include "lldp-network.h"
-#include "socket-util.h"
-#include "ether-addr-util.h"
+#include "basic/alloc-util.h"
+#include "basic/ether-addr-util.h"
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/lldp-internal.h"
+#include "systemd-network/lldp-neighbor.h"
+#include "systemd-network/lldp-network.h"
+#include "systemd-network/sd-lldp.h"
#define LLDP_DEFAULT_NEIGHBORS_MAX 128U
diff --git a/src/libsystemd-network/src/sd-ndisc.c b/src/libsystemd-network/src/sd-ndisc.c
index 1c0d300cb3..7d19373f18 100644
--- a/src/libsystemd-network/src/sd-ndisc.c
+++ b/src/libsystemd-network/src/sd-ndisc.c
@@ -24,15 +24,14 @@
#include <string.h>
#include <sys/ioctl.h>
-#include <systemd/sd-ndisc.h>
-
-#include "alloc-util.h"
-#include "async.h"
-#include "icmp6-util.h"
-#include "in-addr-util.h"
-#include "list.h"
-#include "socket-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "systemd-network/icmp6-util.h"
+#include "systemd-network/sd-ndisc.h"
#define NDISC_ROUTER_SOLICITATION_INTERVAL 4 * USEC_PER_SEC
#define NDISC_MAX_ROUTER_SOLICITATIONS 3
diff --git a/src/libsystemd-network/test/Makefile b/src/libsystemd-network/test/Makefile
new file mode 100644
index 0000000000..dab8ee0beb
--- /dev/null
+++ b/src/libsystemd-network/test/Makefile
@@ -0,0 +1,118 @@
+# -*- 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
+
+test_dhcp_option_SOURCES = \
+ src/libsystemd-network/dhcp-protocol.h \
+ src/libsystemd-network/dhcp-internal.h \
+ src/libsystemd-network/test-dhcp-option.c
+
+test_dhcp_option_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_dhcp_client_SOURCES = \
+ src/systemd/sd-dhcp-client.h \
+ src/libsystemd-network/dhcp-protocol.h \
+ src/libsystemd-network/dhcp-internal.h \
+ src/libsystemd-network/test-dhcp-client.c
+
+test_dhcp_client_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_dhcp_server_SOURCES = \
+ src/libsystemd-network/test-dhcp-server.c
+
+test_dhcp_server_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_ipv4ll_SOURCES = \
+ src/systemd/sd-ipv4ll.h \
+ src/libsystemd-network/arp-util.h \
+ src/libsystemd-network/test-ipv4ll.c
+
+test_ipv4ll_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_ipv4ll_manual_SOURCES = \
+ src/systemd/sd-ipv4ll.h \
+ src/libsystemd-network/test-ipv4ll-manual.c
+
+test_ipv4ll_manual_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_acd_SOURCES = \
+ src/systemd/sd-ipv4acd.h \
+ src/libsystemd-network/test-acd.c
+
+test_acd_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+test_ndisc_rs_SOURCES = \
+ src/systemd/sd-dhcp6-client.h \
+ src/systemd/sd-ndisc.h \
+ src/libsystemd-network/icmp6-util.h \
+ src/libsystemd-network/test-ndisc-rs.c \
+ src/libsystemd-network/dhcp-identifier.h \
+ src/libsystemd-network/dhcp-identifier.c
+
+test_ndisc_rs_LDADD = \
+ libsystemd-network.la \
+ libudev.la \
+ libshared.la
+
+test_dhcp6_client_SOURCES = \
+ src/systemd/sd-dhcp6-client.h \
+ src/libsystemd-network/dhcp6-internal.h \
+ src/libsystemd-network/test-dhcp6-client.c \
+ src/libsystemd-network/dhcp-identifier.h \
+ src/libsystemd-network/dhcp-identifier.c
+
+test_dhcp6_client_LDADD = \
+ libsystemd-network.la \
+ libudev.la \
+ libshared.la
+
+test_lldp_SOURCES = \
+ src/libsystemd-network/test-lldp.c
+
+test_lldp_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+tests += \
+ test-dhcp-option \
+ test-dhcp-client \
+ test-dhcp-server \
+ test-ipv4ll \
+ test-ndisc-rs \
+ test-dhcp6-client \
+ test-lldp
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd-network/test/test-acd.c b/src/libsystemd-network/test/test-acd.c
index 53ddfc3b62..850c2cb2a4 100644
--- a/src/libsystemd-network/test/test-acd.c
+++ b/src/libsystemd-network/test/test-acd.c
@@ -18,19 +18,19 @@
***/
#include <errno.h>
+#include <net/if.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/veth.h>
-#include <net/if.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-ipv4acd.h>
-#include <systemd/sd-netlink.h>
-#include "in-addr-util.h"
-#include "netlink-util.h"
-#include "util.h"
+#include "basic/in-addr-util.h"
+#include "basic/util.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "systemd-network/sd-ipv4acd.h"
static void acd_handler(sd_ipv4acd *acd, int event, void *userdata) {
assert_se(acd);
diff --git a/src/libsystemd-network/test/test-dhcp-client.c b/src/libsystemd-network/test/test-dhcp-client.c
index 478b370c4c..c116696c8d 100644
--- a/src/libsystemd-network/test/test-dhcp-client.c
+++ b/src/libsystemd-network/test/test-dhcp-client.c
@@ -22,15 +22,15 @@
#include <sys/socket.h>
#include <unistd.h>
-#include <systemd/sd-dhcp-client.h>
#include <systemd/sd-event.h>
-#include "alloc-util.h"
-#include "dhcp-identifier.h"
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
-#include "fd-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/util.h"
+#include "systemd-network/dhcp-identifier.h"
+#include "systemd-network/dhcp-internal.h"
+#include "systemd-network/dhcp-protocol.h"
+#include "systemd-network/sd-dhcp-client.h"
static uint8_t mac_addr[] = {'A', 'B', 'C', '1', '2', '3'};
diff --git a/src/libsystemd-network/test/test-dhcp-option.c b/src/libsystemd-network/test/test-dhcp-option.c
index d84859c053..eda42b0ba5 100644
--- a/src/libsystemd-network/test/test-dhcp-option.c
+++ b/src/libsystemd-network/test/test-dhcp-option.c
@@ -3,11 +3,11 @@
#include <stdio.h>
#include <string.h>
-#include "alloc-util.h"
-#include "dhcp-internal.h"
-#include "dhcp-protocol.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "systemd-network/dhcp-internal.h"
+#include "systemd-network/dhcp-protocol.h"
struct option_desc {
uint8_t sname[64];
diff --git a/src/libsystemd-network/test/test-dhcp-server.c b/src/libsystemd-network/test/test-dhcp-server.c
index 7dc315c07f..0796a98707 100644
--- a/src/libsystemd-network/test/test-dhcp-server.c
+++ b/src/libsystemd-network/test/test-dhcp-server.c
@@ -20,10 +20,10 @@
#include <errno.h>
-#include <systemd/sd-dhcp-server.h>
#include <systemd/sd-event.h>
-#include "dhcp-server-internal.h"
+#include "systemd-network/dhcp-server-internal.h"
+#include "systemd-network/sd-dhcp-server.h"
static void test_pool(struct in_addr *address, unsigned size, int ret) {
_cleanup_(sd_dhcp_server_unrefp) sd_dhcp_server *server = NULL;
diff --git a/src/libsystemd-network/test/test-dhcp6-client.c b/src/libsystemd-network/test/test-dhcp6-client.c
index 0548e8381e..66424bc624 100644
--- a/src/libsystemd-network/test/test-dhcp6-client.c
+++ b/src/libsystemd-network/test/test-dhcp6-client.c
@@ -24,16 +24,16 @@
#include <sys/types.h>
#include <unistd.h>
-#include <systemd/sd-dhcp6-client.h>
#include <systemd/sd-event.h>
-#include "dhcp6-internal.h"
-#include "dhcp6-lease-internal.h"
-#include "dhcp6-protocol.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "socket-util.h"
-#include "virt.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/socket-util.h"
+#include "basic/virt.h"
+#include "systemd-network/dhcp6-internal.h"
+#include "systemd-network/dhcp6-lease-internal.h"
+#include "systemd-network/dhcp6-protocol.h"
+#include "systemd-network/sd-dhcp6-client.h"
static struct ether_addr mac_addr = {
.ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
diff --git a/src/libsystemd-network/test/test-ipv4ll-manual.c b/src/libsystemd-network/test/test-ipv4ll-manual.c
index caa315b210..83c2b46124 100644
--- a/src/libsystemd-network/test/test-ipv4ll-manual.c
+++ b/src/libsystemd-network/test/test-ipv4ll-manual.c
@@ -21,18 +21,19 @@
#include <net/if.h>
#include <stdlib.h>
#include <unistd.h>
+
#include <linux/veth.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-ipv4ll.h>
-#include <systemd/sd-netlink.h>
-
-#include "alloc-util.h"
-#include "in-addr-util.h"
-#include "netlink-util.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "util.h"
+
+#include "basic/alloc-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-netlink/netlink-util.h"
+#include "sd-netlink/sd-netlink.h"
+#include "systemd-network/sd-ipv4ll.h"
static void ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
_cleanup_free_ char *address = NULL;
diff --git a/src/libsystemd-network/test/test-ipv4ll.c b/src/libsystemd-network/test/test-ipv4ll.c
index b7278834f2..af259cf0de 100644
--- a/src/libsystemd-network/test/test-ipv4ll.c
+++ b/src/libsystemd-network/test/test-ipv4ll.c
@@ -25,12 +25,11 @@
#include <sys/types.h>
#include <unistd.h>
-#include <systemd/sd-ipv4ll.h>
-
-#include "arp-util.h"
-#include "fd-util.h"
-#include "socket-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
+#include "systemd-network/arp-util.h"
+#include "systemd-network/sd-ipv4ll.h"
static bool verbose = false;
static bool extended = false;
diff --git a/src/libsystemd-network/test/test-lldp.c b/src/libsystemd-network/test/test-lldp.c
index 8c6d214d6f..858c7789d7 100644
--- a/src/libsystemd-network/test/test-lldp.c
+++ b/src/libsystemd-network/test/test-lldp.c
@@ -25,13 +25,13 @@
#include <unistd.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-lldp.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "lldp-network.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "systemd-network/lldp-network.h"
+#include "systemd-network/sd-lldp.h"
#define TEST_LLDP_PORT "em1"
#define TEST_LLDP_TYPE_SYSTEM_NAME "systemd-lldp"
diff --git a/src/libsystemd-network/test/test-ndisc-rs.c b/src/libsystemd-network/test/test-ndisc-rs.c
index 863a76637c..92445eff5d 100644
--- a/src/libsystemd-network/test/test-ndisc-rs.c
+++ b/src/libsystemd-network/test/test-ndisc-rs.c
@@ -19,10 +19,9 @@
#include <netinet/icmp6.h>
-#include <systemd/sd-ndisc.h>
-
-#include "icmp6-util.h"
-#include "socket-util.h"
+#include "basic/socket-util.h"
+#include "systemd-network/icmp6-util.h"
+#include "systemd-network/sd-ndisc.h"
static struct ether_addr mac_addr = {
.ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile
new file mode 100644
index 0000000000..2c6505918b
--- /dev/null
+++ b/src/libsystemd/Makefile
@@ -0,0 +1,110 @@
+# -*- 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
+
+LIBSYSTEMD_CURRENT=15
+LIBSYSTEMD_REVISION=0
+LIBSYSTEMD_AGE=15
+
+EXTRA_DIST += \
+ src/libsystemd/libsystemd.pc.in \
+ src/libsystemd/sd-bus/DIFFERENCES \
+ src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
+
+libsystemd_la_SOURCES = \
+ $(libsystemd_internal_la_SOURCES) \
+ $(libsystemd_journal_internal_la_SOURCES)
+
+nodist_libsystemd_la_SOURCES = \
+ $(nodist_libsystemd_internal_la_SOURCES)
+
+libsystemd_la_CFLAGS = \
+ $(libsystemd_internal_la_CFLAGS) \
+ $(libsystemd_journal_internal_la_CFLAGS)
+
+libsystemd_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
+ -Wl,--version-script=$(srcdir)/libsystemd.sym
+
+libsystemd_la_LIBADD = \
+ $(libsystemd_internal_la_LIBADD) \
+ $(libsystemd_journal_internal_la_LIBADD)
+
+pkgconfiglib_DATA += \
+ src/libsystemd/libsystemd.pc
+
+pkginclude_HEADERS += \
+ src/systemd/sd-bus.h \
+ src/systemd/sd-bus-protocol.h \
+ src/systemd/sd-bus-vtable.h \
+ src/systemd/sd-event.h \
+ src/systemd/sd-login.h \
+ src/systemd/sd-id128.h \
+ src/systemd/sd-daemon.h
+
+lib_LTLIBRARIES += \
+ libsystemd.la
+
+# ------------------------------------------------------------------------------
+
+tests += \
+ test-bus-marshal \
+ test-bus-signature \
+ test-bus-benchmark \
+ test-bus-chat \
+ test-bus-cleanup \
+ test-bus-server \
+ test-bus-match \
+ test-bus-kernel \
+ test-bus-kernel-bloom \
+ test-bus-zero-copy \
+ test-bus-introspect \
+ test-bus-objects \
+ test-bus-error \
+ test-bus-creds \
+ test-bus-gvariant \
+ test-event \
+ test-netlink \
+ 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)
+
+nodist_test_libsystemd_sym_SOURCES = \
+ test-libsystemd-sym.c
+test_libsystemd_sym_LDADD = \
+ libsystemd.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/include/systemd/sd-bus-vtable.h b/src/libsystemd/include/systemd/sd-bus-vtable.h
index 2b684b5678..e8f84eb545 100644
--- a/src/libsystemd/include/systemd/sd-bus-vtable.h
+++ b/src/libsystemd/include/systemd/sd-bus-vtable.h
@@ -26,7 +26,7 @@ _SD_BEGIN_DECLARATIONS;
typedef struct sd_bus_vtable sd_bus_vtable;
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
enum {
_SD_BUS_VTABLE_START = '<',
diff --git a/src/libsystemd/include/systemd/sd-bus.h b/src/libsystemd/include/systemd/sd-bus.h
index 3c1b4b97a4..779c4b07d3 100644
--- a/src/libsystemd/include/systemd/sd-bus.h
+++ b/src/libsystemd/include/systemd/sd-bus.h
@@ -25,10 +25,9 @@
#include <sys/types.h>
#include <sys/uio.h>
-#include <systemd/sd-event.h>
-#include <systemd/sd-id128.h>
-
#include "_sd-common.h"
+#include "sd-event.h"
+#include "sd-id128.h"
_SD_BEGIN_DECLARATIONS;
@@ -107,8 +106,8 @@ typedef int (*sd_bus_object_find_t) (sd_bus *bus, const char *path, const char *
typedef int (*sd_bus_node_enumerator_t) (sd_bus *bus, const char *prefix, void *userdata, char ***ret_nodes, sd_bus_error *ret_error);
typedef int (*sd_bus_track_handler_t) (sd_bus_track *track, void *userdata);
-#include <systemd/sd-bus-protocol.h>
-#include <systemd/sd-bus-vtable.h>
+#include "sd-bus-protocol.h"
+#include "sd-bus-vtable.h"
/* Connections */
diff --git a/src/libsystemd/include/systemd/sd-journal.h b/src/libsystemd/include/systemd/sd-journal.h
index 3e61feb81f..b684cf073c 100644
--- a/src/libsystemd/include/systemd/sd-journal.h
+++ b/src/libsystemd/include/systemd/sd-journal.h
@@ -26,9 +26,8 @@
#include <sys/uio.h>
#include <syslog.h>
-#include <systemd/sd-id128.h>
-
#include "_sd-common.h"
+#include "sd-id128.h"
/* Journal APIs. See sd-journal(3) for more information. */
diff --git a/src/libsystemd/include/systemd/sd-messages.h b/src/libsystemd/include/systemd/sd-messages.h
index 1865e0492f..c8599c596d 100644
--- a/src/libsystemd/include/systemd/sd-messages.h
+++ b/src/libsystemd/include/systemd/sd-messages.h
@@ -20,9 +20,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-id128.h>
-
#include "_sd-common.h"
+#include "sd-id128.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd/src/Makefile b/src/libsystemd/src/Makefile
new file mode 100644
index 0000000000..dceadf81da
--- /dev/null
+++ b/src/libsystemd/src/Makefile
@@ -0,0 +1,329 @@
+# -*- 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
+
+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 \
+ src/libsystemd/libsystemd.sym \
+ src/libsystemd/sd-bus/sd-bus.c \
+ src/libsystemd/sd-bus/bus-control.c \
+ src/libsystemd/sd-bus/bus-control.h \
+ src/libsystemd/sd-bus/bus-error.c \
+ src/libsystemd/sd-bus/bus-error.h \
+ src/libsystemd/sd-bus/bus-common-errors.h \
+ src/libsystemd/sd-bus/bus-common-errors.c \
+ src/libsystemd/sd-bus/bus-internal.c \
+ src/libsystemd/sd-bus/bus-internal.h \
+ src/libsystemd/sd-bus/bus-socket.c \
+ src/libsystemd/sd-bus/bus-socket.h \
+ src/libsystemd/sd-bus/bus-kernel.c \
+ src/libsystemd/sd-bus/bus-kernel.h \
+ src/libsystemd/sd-bus/bus-container.c \
+ src/libsystemd/sd-bus/bus-container.h \
+ src/libsystemd/sd-bus/bus-message.c \
+ src/libsystemd/sd-bus/bus-message.h \
+ src/libsystemd/sd-bus/bus-creds.c \
+ src/libsystemd/sd-bus/bus-creds.h \
+ src/libsystemd/sd-bus/bus-signature.c \
+ src/libsystemd/sd-bus/bus-signature.h \
+ src/libsystemd/sd-bus/bus-type.c \
+ src/libsystemd/sd-bus/bus-type.h \
+ src/libsystemd/sd-bus/bus-match.c \
+ src/libsystemd/sd-bus/bus-match.h \
+ src/libsystemd/sd-bus/bus-bloom.c \
+ src/libsystemd/sd-bus/bus-bloom.h \
+ src/libsystemd/sd-bus/bus-introspect.c \
+ src/libsystemd/sd-bus/bus-introspect.h \
+ src/libsystemd/sd-bus/bus-objects.c \
+ src/libsystemd/sd-bus/bus-objects.h \
+ src/libsystemd/sd-bus/bus-gvariant.c \
+ src/libsystemd/sd-bus/bus-gvariant.h \
+ src/libsystemd/sd-bus/bus-convenience.c \
+ src/libsystemd/sd-bus/bus-track.c \
+ src/libsystemd/sd-bus/bus-track.h \
+ src/libsystemd/sd-bus/bus-slot.c \
+ src/libsystemd/sd-bus/bus-slot.h \
+ src/libsystemd/sd-bus/bus-protocol.h \
+ 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 \
+ src/libsystemd/sd-netlink/netlink-message.c \
+ src/libsystemd/sd-netlink/netlink-socket.c \
+ src/libsystemd/sd-netlink/rtnl-message.c \
+ src/libsystemd/sd-netlink/netlink-types.h \
+ src/libsystemd/sd-netlink/netlink-types.c \
+ src/libsystemd/sd-netlink/netlink-util.h \
+ src/libsystemd/sd-netlink/netlink-util.c \
+ src/libsystemd/sd-netlink/local-addresses.h \
+ src/libsystemd/sd-netlink/local-addresses.c \
+ 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 \
+ src/libsystemd/sd-hwdb/sd-hwdb.c \
+ src/libsystemd/sd-hwdb/hwdb-util.h \
+ src/libsystemd/sd-hwdb/hwdb-internal.h \
+ src/libsystemd/sd-device/device-internal.h \
+ src/libsystemd/sd-device/device-util.h \
+ src/libsystemd/sd-device/device-enumerator.c \
+ src/libsystemd/sd-device/device-enumerator-private.h \
+ src/libsystemd/sd-device/sd-device.c \
+ src/libsystemd/sd-device/device-private.c \
+ src/libsystemd/sd-device/device-private.h \
+ src/libsystemd/sd-resolve/sd-resolve.c
+
+libsystemd_internal_la_LIBADD = \
+ libbasic.la \
+ -lresolv
+
+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 = \
+ src/journal/sd-journal.c \
+ src/systemd/sd-journal.h \
+ src/systemd/_sd-common.h \
+ src/journal/journal-file.c \
+ src/journal/journal-file.h \
+ src/journal/journal-vacuum.c \
+ src/journal/journal-vacuum.h \
+ src/journal/journal-verify.c \
+ src/journal/journal-verify.h \
+ src/journal/lookup3.c \
+ src/journal/lookup3.h \
+ src/journal/journal-send.c \
+ src/journal/journal-def.h \
+ src/journal/compress.h \
+ src/journal/catalog.c \
+ src/journal/catalog.h \
+ src/journal/mmap-cache.c \
+ src/journal/mmap-cache.h \
+ src/journal/compress.c \
+ src/journal/audit-type.h \
+ src/journal/audit-type.c \
+ src/shared/gcrypt-util.h \
+ src/shared/gcrypt-util.c
+
+nodist_libsystemd_journal_internal_la_SOURCES = \
+ src/journal/audit_type-to-name.h
+
+gperf_txt_sources += \
+ src/journal/audit_type-list.txt
+
+# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
+libsystemd_journal_internal_la_CFLAGS = \
+ $(AM_CFLAGS)
+
+libsystemd_journal_internal_la_LIBADD =
+
+ifneq ($(HAVE_XZ),)
+libsystemd_journal_internal_la_CFLAGS += \
+ $(XZ_CFLAGS)
+
+libsystemd_journal_internal_la_LIBADD += \
+ $(XZ_LIBS)
+endif # HAVE_XZ
+
+ifneq ($(HAVE_LZ4),)
+libsystemd_journal_internal_la_CFLAGS += \
+ $(LZ4_CFLAGS)
+
+libsystemd_journal_internal_la_LIBADD += \
+ $(LZ4_LIBS)
+endif # HAVE_LZ4
+
+ifneq ($(HAVE_GCRYPT),)
+libsystemd_journal_internal_la_SOURCES += \
+ src/journal/journal-authenticate.c \
+ src/journal/journal-authenticate.h \
+ src/journal/fsprg.c \
+ src/journal/fsprg.h
+
+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
+endif # HAVE_GCRYPT
+
+noinst_LTLIBRARIES += \
+ libsystemd-journal-internal.la
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/src/sd-bus/bus-bloom.c b/src/libsystemd/src/sd-bus/bus-bloom.c
index 112769fcb6..9327fb40c7 100644
--- a/src/libsystemd/src/sd-bus/bus-bloom.c
+++ b/src/libsystemd/src/sd-bus/bus-bloom.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/siphash24.h"
+#include "basic/util.h"
+
#include "bus-bloom.h"
-#include "siphash24.h"
-#include "util.h"
static inline void set_bit(uint64_t filter[], unsigned long b) {
filter[b >> 6] |= 1ULL << (b & 63);
diff --git a/src/libsystemd/src/sd-bus/bus-container.c b/src/libsystemd/src/sd-bus/bus-container.c
index 3191d27ded..43b9d03aa9 100644
--- a/src/libsystemd/src/sd-bus/bus-container.c
+++ b/src/libsystemd/src/sd-bus/bus-container.c
@@ -20,12 +20,13 @@
#include <fcntl.h>
#include <unistd.h>
+#include "basic/fd-util.h"
+#include "basic/process-util.h"
+#include "basic/util.h"
+
#include "bus-container.h"
#include "bus-internal.h"
#include "bus-socket.h"
-#include "fd-util.h"
-#include "process-util.h"
-#include "util.h"
int bus_container_connect_socket(sd_bus *b) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
diff --git a/src/libsystemd/src/sd-bus/bus-control.c b/src/libsystemd/src/sd-bus/bus-control.c
index 00de530d58..52128e7b5c 100644
--- a/src/libsystemd/src/sd-bus/bus-control.c
+++ b/src/libsystemd/src/sd-bus/bus-control.c
@@ -24,7 +24,7 @@
#include <errno.h>
#include <stddef.h>
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-bloom.h"
diff --git a/src/libsystemd/src/sd-bus/bus-convenience.c b/src/libsystemd/src/sd-bus/bus-convenience.c
index 2d06bf541f..f76cbaf3d3 100644
--- a/src/libsystemd/src/sd-bus/bus-convenience.c
+++ b/src/libsystemd/src/sd-bus/bus-convenience.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-signature.h"
#include "bus-type.h"
-#include "bus-util.h"
-#include "string-util.h"
_public_ int sd_bus_emit_signal(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-creds.c b/src/libsystemd/src/sd-bus/bus-creds.c
index c4f693dee9..bc5a82fac4 100644
--- a/src/libsystemd/src/sd-bus/bus-creds.c
+++ b/src/libsystemd/src/sd-bus/bus-creds.c
@@ -17,28 +17,30 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/capability.h>
#include <stdlib.h>
-#include "alloc-util.h"
-#include "audit-util.h"
+#include <linux/capability.h>
+
+#include "basic/alloc-util.h"
+#include "basic/audit-util.h"
+#include "basic/bus-label.h"
+#include "basic/capability-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-creds.h"
-#include "bus-label.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "capability-util.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "hexdecoct.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "user-util.h"
-#include "util.h"
enum {
CAP_OFFSET_INHERITABLE = 0,
diff --git a/src/libsystemd/src/sd-bus/bus-dump.c b/src/libsystemd/src/sd-bus/bus-dump.c
index 21a6b20a11..cec53d75e5 100644
--- a/src/libsystemd/src/sd-bus/bus-dump.c
+++ b/src/libsystemd/src/sd-bus/bus-dump.c
@@ -17,21 +17,22 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cap-list.h"
+#include "basic/capability-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/locale-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
#include "bus-dump.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-type.h"
-#include "cap-list.h"
-#include "capability-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "locale-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "util.h"
static char *indent(unsigned level, unsigned flags) {
char *p;
diff --git a/src/libsystemd/src/sd-bus/bus-error.c b/src/libsystemd/src/sd-bus/bus-error.c
index b6bb0c4a83..616d784590 100644
--- a/src/libsystemd/src/sd-bus/bus-error.c
+++ b/src/libsystemd/src/sd-bus/bus-error.c
@@ -26,11 +26,12 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/errno-list.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "bus-error.h"
-#include "errno-list.h"
-#include "string-util.h"
-#include "util.h"
BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.Failed", EACCES),
diff --git a/src/libsystemd/src/sd-bus/bus-error.h b/src/libsystemd/src/sd-bus/bus-error.h
index b7aedf406d..0693d9c68c 100644
--- a/src/libsystemd/src/sd-bus/bus-error.h
+++ b/src/libsystemd/src/sd-bus/bus-error.h
@@ -23,7 +23,7 @@
#include <systemd/sd-bus.h>
-#include "macro.h"
+#include "basic/macro.h"
bool bus_error_is_dirty(sd_bus_error *e);
diff --git a/src/libsystemd/src/sd-bus/bus-gvariant.h b/src/libsystemd/src/sd-bus/bus-gvariant.h
index 6da637fb05..d9468ee9a8 100644
--- a/src/libsystemd/src/sd-bus/bus-gvariant.h
+++ b/src/libsystemd/src/sd-bus/bus-gvariant.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
int bus_gvariant_get_size(const char *signature) _pure_;
int bus_gvariant_get_alignment(const char *signature) _pure_;
diff --git a/src/libsystemd/src/sd-bus/bus-internal.c b/src/libsystemd/src/sd-bus/bus-internal.c
index caca679086..8dc441227a 100644
--- a/src/libsystemd/src/sd-bus/bus-internal.c
+++ b/src/libsystemd/src/sd-bus/bus-internal.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
-#include "hexdecoct.h"
-#include "string-util.h"
bool object_path_is_valid(const char *p) {
const char *q;
diff --git a/src/libsystemd/src/sd-bus/bus-internal.h b/src/libsystemd/src/sd-bus/bus-internal.h
index 8c4c6fa772..e02df7981d 100644
--- a/src/libsystemd/src/sd-bus/bus-internal.h
+++ b/src/libsystemd/src/sd-bus/bus-internal.h
@@ -24,16 +24,17 @@
#include <systemd/sd-bus.h>
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/prioq.h"
+#include "basic/refcnt.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
+
#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-match.h"
-#include "hashmap.h"
#include "kdbus.h"
-#include "list.h"
-#include "prioq.h"
-#include "refcnt.h"
-#include "socket-util.h"
-#include "util.h"
struct reply_callback {
sd_bus_message_handler_t callback;
diff --git a/src/libsystemd/src/sd-bus/bus-introspect.c b/src/libsystemd/src/sd-bus/bus-introspect.c
index 8f93edb8da..835b5e3909 100644
--- a/src/libsystemd/src/sd-bus/bus-introspect.c
+++ b/src/libsystemd/src/sd-bus/bus-introspect.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "bus-internal.h"
#include "bus-introspect.h"
#include "bus-protocol.h"
#include "bus-signature.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "string-util.h"
-#include "util.h"
int introspect_begin(struct introspect *i, bool trusted) {
assert(i);
diff --git a/src/libsystemd/src/sd-bus/bus-introspect.h b/src/libsystemd/src/sd-bus/bus-introspect.h
index 87ac03b26a..af4ae10682 100644
--- a/src/libsystemd/src/sd-bus/bus-introspect.h
+++ b/src/libsystemd/src/sd-bus/bus-introspect.h
@@ -23,7 +23,7 @@
#include <systemd/sd-bus.h>
-#include "set.h"
+#include "basic/set.h"
struct introspect {
FILE *f;
diff --git a/src/libsystemd/src/sd-bus/bus-match.c b/src/libsystemd/src/sd-bus/bus-match.c
index 397baf6f33..0dc5e45288 100644
--- a/src/libsystemd/src/sd-bus/bus-match.c
+++ b/src/libsystemd/src/sd-bus/bus-match.c
@@ -17,16 +17,17 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-match.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hexdecoct.h"
-#include "string-util.h"
-#include "strv.h"
/* Example:
*
diff --git a/src/libsystemd/src/sd-bus/bus-match.h b/src/libsystemd/src/sd-bus/bus-match.h
index 3f71720185..a85abcb377 100644
--- a/src/libsystemd/src/sd-bus/bus-match.h
+++ b/src/libsystemd/src/sd-bus/bus-match.h
@@ -21,7 +21,7 @@
#include <systemd/sd-bus.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
enum bus_match_node_type {
BUS_MATCH_ROOT,
diff --git a/src/libsystemd/src/sd-bus/bus-message.c b/src/libsystemd/src/sd-bus/bus-message.c
index a9359c1528..a34a4a1619 100644
--- a/src/libsystemd/src/sd-bus/bus-message.c
+++ b/src/libsystemd/src/sd-bus/bus-message.c
@@ -23,21 +23,22 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/memfd-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-gvariant.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-signature.h"
#include "bus-type.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "memfd-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
-#include "utf8.h"
-#include "util.h"
static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
diff --git a/src/libsystemd/src/sd-bus/bus-message.h b/src/libsystemd/src/sd-bus/bus-message.h
index 6a2c2d533c..35116c3803 100644
--- a/src/libsystemd/src/sd-bus/bus-message.h
+++ b/src/libsystemd/src/sd-bus/bus-message.h
@@ -25,10 +25,11 @@
#include <systemd/sd-bus.h>
+#include "basic/macro.h"
+#include "basic/time-util.h"
+
#include "bus-creds.h"
#include "bus-protocol.h"
-#include "macro.h"
-#include "time-util.h"
struct bus_container {
char enclosing;
diff --git a/src/libsystemd/src/sd-bus/bus-objects.c b/src/libsystemd/src/sd-bus/bus-objects.c
index 9bd07ffcab..a56b7e8d7e 100644
--- a/src/libsystemd/src/sd-bus/bus-objects.c
+++ b/src/libsystemd/src/sd-bus/bus-objects.c
@@ -17,7 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-introspect.h"
#include "bus-message.h"
@@ -25,10 +30,6 @@
#include "bus-signature.h"
#include "bus-slot.h"
#include "bus-type.h"
-#include "bus-util.h"
-#include "set.h"
-#include "string-util.h"
-#include "strv.h"
static int node_vtable_get_userdata(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-protocol.h b/src/libsystemd/src/sd-bus/bus-protocol.h
index 9d180cb284..931dc21c46 100644
--- a/src/libsystemd/src/sd-bus/bus-protocol.h
+++ b/src/libsystemd/src/sd-bus/bus-protocol.h
@@ -21,7 +21,7 @@
#include <endian.h>
-#include "macro.h"
+#include "basic/macro.h"
/* Packet header */
diff --git a/src/libsystemd/src/sd-bus/bus-signature.c b/src/libsystemd/src/sd-bus/bus-signature.c
index 7bc243494a..c11b113186 100644
--- a/src/libsystemd/src/sd-bus/bus-signature.c
+++ b/src/libsystemd/src/sd-bus/bus-signature.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <util.h>
+#include "basic/util.h"
#include "bus-signature.h"
#include "bus-type.h"
diff --git a/src/libsystemd/src/sd-bus/bus-slot.c b/src/libsystemd/src/sd-bus/bus-slot.c
index 75c1692bf5..ebac784433 100644
--- a/src/libsystemd/src/sd-bus/bus-slot.c
+++ b/src/libsystemd/src/sd-bus/bus-slot.c
@@ -19,11 +19,12 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+
#include "bus-control.h"
#include "bus-objects.h"
#include "bus-slot.h"
-#include "string-util.h"
sd_bus_slot *bus_slot_allocate(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-socket.c b/src/libsystemd/src/sd-bus/bus-socket.c
index 1486d7cd55..4d6e21f977 100644
--- a/src/libsystemd/src/sd-bus/bus-socket.c
+++ b/src/libsystemd/src/sd-bus/bus-socket.c
@@ -25,22 +25,23 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-socket.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "missing.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "utf8.h"
-#include "util.h"
#define SNDBUF_SIZE (8*1024*1024)
diff --git a/src/libsystemd/src/sd-bus/bus-track.c b/src/libsystemd/src/sd-bus/bus-track.c
index 81e6d22816..24c3a7050d 100644
--- a/src/libsystemd/src/sd-bus/bus-track.c
+++ b/src/libsystemd/src/sd-bus/bus-track.c
@@ -19,10 +19,11 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-track.h"
-#include "bus-util.h"
struct sd_bus_track {
unsigned n_ref;
diff --git a/src/libsystemd/src/sd-bus/bus-type.h b/src/libsystemd/src/sd-bus/bus-type.h
index 7169b0f765..d81aa20df3 100644
--- a/src/libsystemd/src/sd-bus/bus-type.h
+++ b/src/libsystemd/src/sd-bus/bus-type.h
@@ -23,7 +23,7 @@
#include <systemd/sd-bus.h>
-#include "macro.h"
+#include "basic/macro.h"
bool bus_type_is_valid(char c) _const_;
bool bus_type_is_valid_in_signature(char c) _const_;
diff --git a/src/libsystemd/src/sd-bus/sd-bus.c b/src/libsystemd/src/sd-bus/sd-bus.c
index d3c194e135..83a021e2f5 100644
--- a/src/libsystemd/src/sd-bus/sd-bus.c
+++ b/src/libsystemd/src/sd-bus/sd-bus.c
@@ -27,12 +27,25 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/bus-label.h"
+#include "basic/cgroup-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-container.h"
#include "bus-control.h"
#include "bus-internal.h"
#include "bus-kernel.h"
-#include "bus-label.h"
#include "bus-message.h"
#include "bus-objects.h"
#include "bus-protocol.h"
@@ -40,18 +53,6 @@
#include "bus-socket.h"
#include "bus-track.h"
#include "bus-type.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "hexdecoct.h"
-#include "hostname-util.h"
-#include "macro.h"
-#include "missing.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
#define log_debug_bus_message(m) \
do { \
diff --git a/src/libsystemd/src/sd-bus/test-bus-benchmark.c b/src/libsystemd/src/sd-bus/test-bus-benchmark.c
index a222d36bb4..c8f0d11b84 100644
--- a/src/libsystemd/src/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/src/sd-bus/test-bus-benchmark.c
@@ -21,14 +21,15 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-kernel.h"
-#include "bus-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "time-util.h"
-#include "util.h"
#define MAX_SIZE (2*1024*1024)
diff --git a/src/libsystemd/src/sd-bus/test-bus-chat.c b/src/libsystemd/src/sd-bus/test-bus-chat.c
index 1f028d2b23..8f3e88a7c0 100644
--- a/src/libsystemd/src/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/src/sd-bus/test-bus-chat.c
@@ -24,16 +24,17 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-error.h"
#include "bus-internal.h"
#include "bus-match.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "log.h"
-#include "macro.h"
-#include "util.h"
static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
log_info("Match triggered! interface=%s member=%s", strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)));
diff --git a/src/libsystemd/src/sd-bus/test-bus-cleanup.c b/src/libsystemd/src/sd-bus/test-bus-cleanup.c
index bd4a3fbf34..f4b9f96c03 100644
--- a/src/libsystemd/src/sd-bus/test-bus-cleanup.c
+++ b/src/libsystemd/src/sd-bus/test-bus-cleanup.c
@@ -21,10 +21,11 @@
#include <systemd/sd-bus.h>
+#include "basic/refcnt.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "refcnt.h"
static void test_bus_new(void) {
_cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-creds.c b/src/libsystemd/src/sd-bus/test-bus-creds.c
index c58b76c258..125d7db810 100644
--- a/src/libsystemd/src/sd-bus/test-bus-creds.c
+++ b/src/libsystemd/src/sd-bus/test-bus-creds.c
@@ -19,9 +19,10 @@
#include <systemd/sd-bus.h>
+#include "basic/cgroup-util.h"
+#include "shared/bus-util.h"
+
#include "bus-dump.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
int main(int argc, char *argv[]) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-error.c b/src/libsystemd/src/sd-bus/test-bus-error.c
index bce3cc31c9..2d0aa92c6c 100644
--- a/src/libsystemd/src/sd-bus/test-bus-error.c
+++ b/src/libsystemd/src/sd-bus/test-bus-error.c
@@ -19,10 +19,11 @@
#include <systemd/sd-bus.h>
+#include "basic/errno-list.h"
+#include "shared/bus-util.h"
+
#include "bus-common-errors.h"
#include "bus-error.h"
-#include "bus-util.h"
-#include "errno-list.h"
static void test_error(void) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL, second = SD_BUS_ERROR_NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-gvariant.c b/src/libsystemd/src/sd-bus/test-bus-gvariant.c
index 3c9ec9fef0..83f114a0fe 100644
--- a/src/libsystemd/src/sd-bus/test-bus-gvariant.c
+++ b/src/libsystemd/src/sd-bus/test-bus-gvariant.c
@@ -21,7 +21,7 @@
#include <glib.h>
#endif
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-dump.h"
diff --git a/src/libsystemd/src/sd-bus/test-bus-introspect.c b/src/libsystemd/src/sd-bus/test-bus-introspect.c
index 4425cfae26..517e3668ae 100644
--- a/src/libsystemd/src/sd-bus/test-bus-introspect.c
+++ b/src/libsystemd/src/sd-bus/test-bus-introspect.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
+
#include "bus-introspect.h"
-#include "log.h"
static int prop_get(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error) {
return -EINVAL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c b/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
index f16e14a310..cb8c41b792 100644
--- a/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
@@ -19,12 +19,13 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-kernel.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "util.h"
static int test_match(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
int *found = userdata;
diff --git a/src/libsystemd/src/sd-bus/test-bus-kernel.c b/src/libsystemd/src/sd-bus/test-bus-kernel.c
index 2a5ba60cc9..871bf2e62c 100644
--- a/src/libsystemd/src/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/src/sd-bus/test-bus-kernel.c
@@ -21,13 +21,14 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-dump.h"
#include "bus-kernel.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "util.h"
int main(int argc, char *argv[]) {
_cleanup_close_ int bus_ref = -1;
diff --git a/src/libsystemd/src/sd-bus/test-bus-marshal.c b/src/libsystemd/src/sd-bus/test-bus-marshal.c
index 45db4764a0..a28cc5b79e 100644
--- a/src/libsystemd/src/sd-bus/test-bus-marshal.c
+++ b/src/libsystemd/src/sd-bus/test-bus-marshal.c
@@ -28,7 +28,7 @@
#include <dbus/dbus.h>
#endif
-#include <systemd/sd-bus.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-dump.h"
diff --git a/src/libsystemd/src/sd-bus/test-bus-match.c b/src/libsystemd/src/sd-bus/test-bus-match.c
index 29c4529f95..e50cebcdc6 100644
--- a/src/libsystemd/src/sd-bus/test-bus-match.c
+++ b/src/libsystemd/src/sd-bus/test-bus-match.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "shared/bus-util.h"
+
#include "bus-match.h"
#include "bus-message.h"
#include "bus-slot.h"
-#include "bus-util.h"
-#include "log.h"
-#include "macro.h"
static bool mask[32];
diff --git a/src/libsystemd/src/sd-bus/test-bus-objects.c b/src/libsystemd/src/sd-bus/test-bus-objects.c
index e9bb655665..1c6e28e76e 100644
--- a/src/libsystemd/src/sd-bus/test-bus-objects.c
+++ b/src/libsystemd/src/sd-bus/test-bus-objects.c
@@ -22,15 +22,16 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-dump.h"
#include "bus-internal.h"
#include "bus-message.h"
-#include "bus-util.h"
-#include "log.h"
-#include "macro.h"
-#include "strv.h"
-#include "util.h"
struct context {
int fds[2];
diff --git a/src/libsystemd/src/sd-bus/test-bus-server.c b/src/libsystemd/src/sd-bus/test-bus-server.c
index 190410674b..9ffefa6cd0 100644
--- a/src/libsystemd/src/sd-bus/test-bus-server.c
+++ b/src/libsystemd/src/sd-bus/test-bus-server.c
@@ -22,11 +22,12 @@
#include <systemd/sd-bus.h>
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
-#include "bus-util.h"
-#include "log.h"
-#include "macro.h"
-#include "util.h"
struct context {
int fds[2];
diff --git a/src/libsystemd/src/sd-bus/test-bus-signature.c b/src/libsystemd/src/sd-bus/test-bus-signature.c
index 4f4fd093bf..c08999b8e1 100644
--- a/src/libsystemd/src/sd-bus/test-bus-signature.c
+++ b/src/libsystemd/src/sd-bus/test-bus-signature.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
+#include "basic/string-util.h"
+
#include "bus-internal.h"
#include "bus-signature.h"
-#include "log.h"
-#include "string-util.h"
int main(int argc, char *argv[]) {
char prefix[256];
diff --git a/src/libsystemd/src/sd-bus/test-bus-zero-copy.c b/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
index 9e20d67670..ac453e5887 100644
--- a/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
+++ b/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
@@ -21,15 +21,16 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/memfd-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+
#include "bus-dump.h"
#include "bus-kernel.h"
#include "bus-message.h"
-#include "fd-util.h"
-#include "log.h"
-#include "memfd-util.h"
-#include "string-util.h"
-#include "util.h"
#define FIRST_ARRAY 17
#define SECOND_ARRAY 33
diff --git a/src/libsystemd/src/sd-daemon/sd-daemon.c b/src/libsystemd/src/sd-daemon/sd-daemon.c
index fa92199c43..863c47d2ba 100644
--- a/src/libsystemd/src/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/src/sd-daemon/sd-daemon.c
@@ -33,14 +33,14 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "socket-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/socket-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
#define SNDBUF_SIZE (8*1024*1024)
diff --git a/src/libsystemd/src/sd-device/device-enumerator-private.h b/src/libsystemd/src/sd-device/device-enumerator-private.h
index d46e26b56e..eb06f9542d 100644
--- a/src/libsystemd/src/sd-device/device-enumerator-private.h
+++ b/src/libsystemd/src/sd-device/device-enumerator-private.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-device.h>
+#include "sd-device.h"
int device_enumerator_scan_devices(sd_device_enumerator *enumeartor);
int device_enumerator_scan_subsystems(sd_device_enumerator *enumeartor);
diff --git a/src/libsystemd/src/sd-device/device-enumerator.c b/src/libsystemd/src/sd-device/device-enumerator.c
index 796728ee0e..6378f9c93c 100644
--- a/src/libsystemd/src/sd-device/device-enumerator.c
+++ b/src/libsystemd/src/sd-device/device-enumerator.c
@@ -18,18 +18,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-device.h>
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/prioq.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
-#include "alloc-util.h"
#include "device-enumerator-private.h"
#include "device-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "prioq.h"
-#include "set.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "sd-device.h"
#define DEVICE_ENUMERATE_MAX_DEPTH 256
diff --git a/src/libsystemd/src/sd-device/device-internal.h b/src/libsystemd/src/sd-device/device-internal.h
index ab222e27de..5e5ae47339 100644
--- a/src/libsystemd/src/sd-device/device-internal.h
+++ b/src/libsystemd/src/sd-device/device-internal.h
@@ -20,8 +20,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
-#include "set.h"
+#include "basic/hashmap.h"
+#include "basic/set.h"
struct sd_device {
uint64_t n_ref;
diff --git a/src/libsystemd/src/sd-device/device-private.c b/src/libsystemd/src/sd-device/device-private.c
index 51cabcb048..bf028fbbc6 100644
--- a/src/libsystemd/src/sd-device/device-private.c
+++ b/src/libsystemd/src/sd-device/device-private.c
@@ -22,28 +22,28 @@
#include <net/if.h>
#include <sys/types.h>
-#include <systemd/sd-device.h>
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/refcnt.h"
+#include "basic/set.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/strxcpyx.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
-#include "alloc-util.h"
#include "device-internal.h"
#include "device-private.h"
#include "device-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "refcnt.h"
-#include "set.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "strxcpyx.h"
-#include "user-util.h"
-#include "util.h"
+#include "sd-device.h"
int device_add_property(sd_device *device, const char *key, const char *value) {
int r;
diff --git a/src/libsystemd/src/sd-device/device-private.h b/src/libsystemd/src/sd-device/device-private.h
index d6add2f7b2..29b3e155fb 100644
--- a/src/libsystemd/src/sd-device/device-private.h
+++ b/src/libsystemd/src/sd-device/device-private.h
@@ -23,7 +23,7 @@
#include <stdbool.h>
#include <sys/types.h>
-#include <systemd/sd-device.h>
+#include "sd-device.h"
int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len);
int device_new_from_strv(sd_device **ret, char **strv);
diff --git a/src/libsystemd/src/sd-device/device-util.h b/src/libsystemd/src/sd-device/device-util.h
index 5b42e11de6..a8aca6d8f4 100644
--- a/src/libsystemd/src/sd-device/device-util.h
+++ b/src/libsystemd/src/sd-device/device-util.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
+#include "basic/util.h"
#define FOREACH_DEVICE_PROPERTY(device, key, value) \
for (key = sd_device_get_property_first(device, &(value)); \
diff --git a/src/libsystemd/src/sd-device/sd-device.c b/src/libsystemd/src/sd-device/sd-device.c
index d21a67cd4c..b8e6f8580e 100644
--- a/src/libsystemd/src/sd-device/sd-device.c
+++ b/src/libsystemd/src/sd-device/sd-device.c
@@ -22,25 +22,25 @@
#include <net/if.h>
#include <sys/types.h>
-#include <systemd/sd-device.h>
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/strxcpyx.h"
+#include "basic/util.h"
-#include "alloc-util.h"
#include "device-internal.h"
#include "device-private.h"
#include "device-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hashmap.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "set.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "strxcpyx.h"
-#include "util.h"
+#include "sd-device.h"
int device_new_aux(sd_device **ret) {
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
diff --git a/src/libsystemd/src/sd-device/sd-device.h b/src/libsystemd/src/sd-device/sd-device.h
index c1d07561d7..5e32fc6110 100644
--- a/src/libsystemd/src/sd-device/sd-device.h
+++ b/src/libsystemd/src/sd-device/sd-device.h
@@ -25,7 +25,7 @@
#include <sys/sysmacros.h>
#include <sys/types.h>
-#include "_sd-common.h"
+#include <systemd/_sd-common.h>
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd/src/sd-event/sd-event.c b/src/libsystemd/src/sd-event/sd-event.c
index 7f6f485353..daa1f55717 100644
--- a/src/libsystemd/src/sd-event/sd-event.c
+++ b/src/libsystemd/src/sd-event/sd-event.c
@@ -25,20 +25,20 @@
#include <systemd/sd-event.h>
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "list.h"
-#include "macro.h"
-#include "missing.h"
-#include "prioq.h"
-#include "process-util.h"
-#include "set.h"
-#include "signal-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/prioq.h"
+#include "basic/process-util.h"
+#include "basic/set.h"
+#include "basic/signal-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
#define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC)
diff --git a/src/libsystemd/src/sd-event/test-event.c b/src/libsystemd/src/sd-event/test-event.c
index 324ad7ee02..10395f155f 100644
--- a/src/libsystemd/src/sd-event/test-event.c
+++ b/src/libsystemd/src/sd-event/test-event.c
@@ -19,11 +19,11 @@
#include <systemd/sd-event.h>
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "signal-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/signal-util.h"
+#include "basic/util.h"
static int prepare_handler(sd_event_source *s, void *userdata) {
log_info("preparing %c", PTR_TO_INT(userdata));
diff --git a/src/libsystemd/src/sd-hwdb/hwdb-internal.h b/src/libsystemd/src/sd-hwdb/hwdb-internal.h
index 8ffb5e5c74..7b32bbd11d 100644
--- a/src/libsystemd/src/sd-hwdb/hwdb-internal.h
+++ b/src/libsystemd/src/sd-hwdb/hwdb-internal.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sparse-endian.h"
-#include "util.h"
+#include "basic/sparse-endian.h"
+#include "basic/util.h"
#define HWDB_SIG { 'K', 'S', 'L', 'P', 'H', 'H', 'R', 'H' }
diff --git a/src/libsystemd/src/sd-hwdb/hwdb-util.h b/src/libsystemd/src/sd-hwdb/hwdb-util.h
index 05dc47962b..c8c0a4938e 100644
--- a/src/libsystemd/src/sd-hwdb/hwdb-util.h
+++ b/src/libsystemd/src/sd-hwdb/hwdb-util.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-hwdb.h>
+#include "basic/util.h"
-#include "util.h"
+#include "sd-hwdb.h"
bool hwdb_validate(sd_hwdb *hwdb);
diff --git a/src/libsystemd/src/sd-hwdb/sd-hwdb.c b/src/libsystemd/src/sd-hwdb/sd-hwdb.c
index 7dcfe95b87..a48c7af124 100644
--- a/src/libsystemd/src/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/src/sd-hwdb/sd-hwdb.c
@@ -27,15 +27,15 @@
#include <string.h>
#include <sys/mman.h>
-#include <systemd/sd-hwdb.h>
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/refcnt.h"
+#include "basic/string-util.h"
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
#include "hwdb-internal.h"
#include "hwdb-util.h"
-#include "refcnt.h"
-#include "string-util.h"
+#include "sd-hwdb.h"
struct sd_hwdb {
RefCount n_ref;
diff --git a/src/libsystemd/src/sd-hwdb/sd-hwdb.h b/src/libsystemd/src/sd-hwdb/sd-hwdb.h
index 7105920492..f46d7ad561 100644
--- a/src/libsystemd/src/sd-hwdb/sd-hwdb.h
+++ b/src/libsystemd/src/sd-hwdb/sd-hwdb.h
@@ -21,7 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "_sd-common.h"
+#include <systemd/_sd-common.h>
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd/src/sd-id128/sd-id128.c b/src/libsystemd/src/sd-id128/sd-id128.c
index cda3e9f0df..4a227ab6c0 100644
--- a/src/libsystemd/src/sd-id128/sd-id128.c
+++ b/src/libsystemd/src/sd-id128/sd-id128.c
@@ -23,12 +23,12 @@
#include <systemd/sd-id128.h>
-#include "fd-util.h"
-#include "hexdecoct.h"
-#include "io-util.h"
-#include "macro.h"
-#include "random-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/io-util.h"
+#include "basic/macro.h"
+#include "basic/random-util.h"
+#include "basic/util.h"
_public_ char *sd_id128_to_string(sd_id128_t id, char s[SD_ID128_STRING_MAX]) {
unsigned n;
diff --git a/src/libsystemd/src/sd-journal/Makefile b/src/libsystemd/src/sd-journal/Makefile
new file mode 100644
index 0000000000..6d1ff3c0a5
--- /dev/null
+++ b/src/libsystemd/src/sd-journal/Makefile
@@ -0,0 +1,37 @@
+# -*- 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
+
+audit_list_includes = -include linux/audit.h -include missing.h
+ifneq ($(HAVE_AUDIT),)
+audit_list_includes += -include libaudit.h
+endif # HAVE_AUDIT
+
+$(outdir)/audit_type-list.txt:
+ $(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" }' <$< >$@
+
+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 71e8790ca8..1dde7f414e 100644
--- a/src/libsystemd/src/sd-journal/audit-type.c
+++ b/src/libsystemd/src/sd-journal/audit-type.c
@@ -18,6 +18,7 @@
***/
#include <stdio.h>
+
#include <linux/audit.h>
#ifdef HAVE_AUDIT
# include <libaudit.h>
diff --git a/src/libsystemd/src/sd-journal/audit-type.h b/src/libsystemd/src/sd-journal/audit-type.h
index 1dd2163707..8b96e2e466 100644
--- a/src/libsystemd/src/sd-journal/audit-type.h
+++ b/src/libsystemd/src/sd-journal/audit-type.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
const char *audit_type_to_string(int type);
int audit_type_from_string(const char *s);
diff --git a/src/libsystemd/src/sd-journal/catalog.c b/src/libsystemd/src/sd-journal/catalog.c
index 70838d958c..7dc02deb49 100644
--- a/src/libsystemd/src/sd-journal/catalog.c
+++ b/src/libsystemd/src/sd-journal/catalog.c
@@ -27,21 +27,22 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/siphash24.h"
+#include "basic/sparse-endian.h"
+#include "basic/strbuf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+
#include "catalog.h"
-#include "conf-files.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "log.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "siphash24.h"
-#include "sparse-endian.h"
-#include "strbuf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
const char * const catalog_file_dirs[] = {
"/usr/local/lib/systemd/catalog/",
diff --git a/src/libsystemd/src/sd-journal/catalog.h b/src/libsystemd/src/sd-journal/catalog.h
index b621de3068..fa60757723 100644
--- a/src/libsystemd/src/sd-journal/catalog.h
+++ b/src/libsystemd/src/sd-journal/catalog.h
@@ -23,8 +23,8 @@
#include <systemd/sd-id128.h>
-#include "hashmap.h"
-#include "strbuf.h"
+#include "basic/hashmap.h"
+#include "basic/strbuf.h"
int catalog_import_file(Hashmap *h, const char *path);
int catalog_update(const char* database, const char* root, const char* const* dirs);
diff --git a/src/libsystemd/src/sd-journal/fsprg.c b/src/libsystemd/src/sd-journal/fsprg.c
index 612b10f3a9..acb8263151 100644
--- a/src/libsystemd/src/sd-journal/fsprg.c
+++ b/src/libsystemd/src/sd-journal/fsprg.c
@@ -29,8 +29,9 @@
#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/fsprg.h b/src/libsystemd/src/sd-journal/fsprg.h
index 829b56e240..ef6d34fb4e 100644
--- a/src/libsystemd/src/sd-journal/fsprg.h
+++ b/src/libsystemd/src/sd-journal/fsprg.h
@@ -26,8 +26,8 @@
#include <inttypes.h>
#include <sys/types.h>
-#include "macro.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/libsystemd/src/sd-journal/journal-authenticate.c b/src/libsystemd/src/sd-journal/journal-authenticate.c
index d8af113d3f..8e983f7e8f 100644
--- a/src/libsystemd/src/sd-journal/journal-authenticate.c
+++ b/src/libsystemd/src/sd-journal/journal-authenticate.c
@@ -20,10 +20,11 @@
#include <fcntl.h>
#include <sys/mman.h>
-#include "fd-util.h"
+#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+#include "shared/gcrypt-util.h"
+
#include "fsprg.h"
-#include "gcrypt-util.h"
-#include "hexdecoct.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
diff --git a/src/libsystemd/src/sd-journal/journal-def.h b/src/libsystemd/src/sd-journal/journal-def.h
index a0a052ce4f..86c843905a 100644
--- a/src/libsystemd/src/sd-journal/journal-def.h
+++ b/src/libsystemd/src/sd-journal/journal-def.h
@@ -21,8 +21,8 @@
#include <systemd/sd-id128.h>
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
/*
* If you change this file you probably should also change its documentation:
diff --git a/src/libsystemd/src/sd-journal/journal-file.c b/src/libsystemd/src/sd-journal/journal-file.c
index 13db5c53de..d8f4671617 100644
--- a/src/libsystemd/src/sd-journal/journal-file.c
+++ b/src/libsystemd/src/sd-journal/journal-file.c
@@ -19,7 +19,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/fs.h>
#include <pthread.h>
#include <stddef.h>
#include <sys/mman.h>
@@ -27,22 +26,26 @@
#include <sys/uio.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "btrfs-util.h"
-#include "chattr-util.h"
+#include <linux/fs.h>
+
+#include <systemd/sd-event.h>
+
+#include "basic/alloc-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/chattr-util.h"
+#include "basic/fd-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/random-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/xattr-util.h"
+
#include "compress.h"
-#include "fd-util.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
#include "lookup3.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "random-util.h"
-#include <systemd/sd-event.h>
-#include "set.h"
-#include "string-util.h"
-#include "xattr-util.h"
#define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
#define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
diff --git a/src/libsystemd/src/sd-journal/journal-file.h b/src/libsystemd/src/sd-journal/journal-file.h
index e48e98f424..564e1a8179 100644
--- a/src/libsystemd/src/sd-journal/journal-file.h
+++ b/src/libsystemd/src/sd-journal/journal-file.h
@@ -25,13 +25,13 @@
#include <gcrypt.h>
#endif
-#include <systemd/sd-id128.h>
+#include "sd-id128.h"
#include "hashmap.h"
#include "journal-def.h"
#include "macro.h"
#include "mmap-cache.h"
-#include <systemd/sd-event.h>
+#include "sd-event.h"
#include "sparse-endian.h"
typedef struct JournalMetrics {
diff --git a/src/libsystemd/src/sd-journal/journal-internal.h b/src/libsystemd/src/sd-journal/journal-internal.h
index d8eb11ad06..e249a8b979 100644
--- a/src/libsystemd/src/sd-journal/journal-internal.h
+++ b/src/libsystemd/src/sd-journal/journal-internal.h
@@ -26,11 +26,12 @@
#include <systemd/sd-id128.h>
#include <systemd/sd-journal.h>
-#include "hashmap.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/set.h"
+
#include "journal-def.h"
#include "journal-file.h"
-#include "list.h"
-#include "set.h"
typedef struct Match Match;
typedef struct Location Location;
diff --git a/src/libsystemd/src/sd-journal/journal-send.c b/src/libsystemd/src/sd-journal/journal-send.c
index 5a49211f85..5e8a3e3200 100644
--- a/src/libsystemd/src/sd-journal/journal-send.c
+++ b/src/libsystemd/src/sd-journal/journal-send.c
@@ -27,7 +27,7 @@
#define SD_JOURNAL_SUPPRESS_LOCATION
-#include <systemd/sd-journal.h>
+#include "sd-journal.h"
#include "alloc-util.h"
#include "fd-util.h"
diff --git a/src/libsystemd/src/sd-journal/journal-vacuum.c b/src/libsystemd/src/sd-journal/journal-vacuum.c
index cd2676ab63..a3ebf9b029 100644
--- a/src/libsystemd/src/sd-journal/journal-vacuum.c
+++ b/src/libsystemd/src/sd-journal/journal-vacuum.c
@@ -23,16 +23,17 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/xattr-util.h"
+
#include "journal-def.h"
#include "journal-file.h"
#include "journal-vacuum.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "util.h"
-#include "xattr-util.h"
struct vacuum_info {
uint64_t usage;
diff --git a/src/libsystemd/src/sd-journal/journal-vacuum.h b/src/libsystemd/src/sd-journal/journal-vacuum.h
index 1e750a2170..c7b38e2da9 100644
--- a/src/libsystemd/src/sd-journal/journal-vacuum.h
+++ b/src/libsystemd/src/sd-journal/journal-vacuum.h
@@ -22,6 +22,6 @@
#include <inttypes.h>
#include <stdbool.h>
-#include "time-util.h"
+#include "basic/time-util.h"
int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t n_max_files, usec_t max_retention_usec, usec_t *oldest_usec, bool verbose);
diff --git a/src/libsystemd/src/sd-journal/journal-verify.c b/src/libsystemd/src/sd-journal/journal-verify.c
index 26572ddd76..f82bdf8518 100644
--- a/src/libsystemd/src/sd-journal/journal-verify.c
+++ b/src/libsystemd/src/sd-journal/journal-verify.c
@@ -22,18 +22,19 @@
#include <sys/mman.h>
#include <unistd.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
#include "compress.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
#include "journal-verify.h"
#include "lookup3.h"
-#include "macro.h"
-#include "terminal-util.h"
-#include "util.h"
static void draw_progress(uint64_t p, usec_t *last_usec) {
unsigned n, i, j, k;
diff --git a/src/libsystemd/src/sd-journal/lookup3.h b/src/libsystemd/src/sd-journal/lookup3.h
index 787921ffbf..28ab5ca4f5 100644
--- a/src/libsystemd/src/sd-journal/lookup3.h
+++ b/src/libsystemd/src/sd-journal/lookup3.h
@@ -3,7 +3,7 @@
#include <inttypes.h>
#include <sys/types.h>
-#include "macro.h"
+#include "basic/macro.h"
uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval) _pure_;
void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb);
diff --git a/src/libsystemd/src/sd-journal/mmap-cache.c b/src/libsystemd/src/sd-journal/mmap-cache.c
index 6bcd9b6ac8..7f4aa78308 100644
--- a/src/libsystemd/src/sd-journal/mmap-cache.c
+++ b/src/libsystemd/src/sd-journal/mmap-cache.c
@@ -21,15 +21,16 @@
#include <stdlib.h>
#include <sys/mman.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "list.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/sigbus.h"
+#include "basic/util.h"
+
#include "mmap-cache.h"
-#include "sigbus.h"
-#include "util.h"
typedef struct Window Window;
typedef struct Context Context;
diff --git a/src/libsystemd/src/sd-journal/sd-journal.c b/src/libsystemd/src/sd-journal/sd-journal.c
index 930486d65f..18ca37d58f 100644
--- a/src/libsystemd/src/sd-journal/sd-journal.c
+++ b/src/libsystemd/src/sd-journal/sd-journal.c
@@ -20,38 +20,40 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <linux/magic.h>
#include <poll.h>
#include <stddef.h>
#include <sys/inotify.h>
#include <sys/vfs.h>
#include <unistd.h>
+#include <linux/magic.h>
+
#include <systemd/sd-journal.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/dirent-util.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/list.h"
+#include "basic/missing.h"
+#include "basic/path-util.h"
+#include "basic/replace-var.h"
+#include "basic/stat-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+
#include "catalog.h"
#include "compress.h"
-#include "dirent-util.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-def.h"
#include "journal-file.h"
#include "journal-internal.h"
-#include "list.h"
#include "lookup3.h"
-#include "missing.h"
-#include "path-util.h"
-#include "replace-var.h"
-#include "stat-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
#define JOURNAL_FILES_MAX 7168
diff --git a/src/libsystemd/src/sd-login/sd-login.c b/src/libsystemd/src/sd-login/sd-login.c
index 84831d5e95..11686bc90d 100644
--- a/src/libsystemd/src/sd-login/sd-login.c
+++ b/src/libsystemd/src/sd-login/sd-login.c
@@ -25,25 +25,25 @@
#include <systemd/sd-login.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "dirent-util.h"
-#include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "login-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/dirent-util.h"
+#include "basic/escape.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/login-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
/* Error codes:
*
diff --git a/src/libsystemd/src/sd-login/test-login.c b/src/libsystemd/src/sd-login/test-login.c
index 994c76df4a..bec645242a 100644
--- a/src/libsystemd/src/sd-login/test-login.c
+++ b/src/libsystemd/src/sd-login/test-login.c
@@ -22,12 +22,12 @@
#include <systemd/sd-login.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static void test_login(void) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
diff --git a/src/libsystemd/src/sd-netlink/local-addresses.c b/src/libsystemd/src/sd-netlink/local-addresses.c
index 1abce75b01..81e99e0e5d 100644
--- a/src/libsystemd/src/sd-netlink/local-addresses.c
+++ b/src/libsystemd/src/sd-netlink/local-addresses.c
@@ -18,12 +18,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
-#include "alloc-util.h"
#include "local-addresses.h"
-#include "macro.h"
#include "netlink-util.h"
+#include "sd-netlink.h"
static int address_compare(const void *_a, const void *_b) {
const struct local_address *a = _a, *b = _b;
diff --git a/src/libsystemd/src/sd-netlink/local-addresses.h b/src/libsystemd/src/sd-netlink/local-addresses.h
index 1ddc50ace5..5eb0683131 100644
--- a/src/libsystemd/src/sd-netlink/local-addresses.h
+++ b/src/libsystemd/src/sd-netlink/local-addresses.h
@@ -20,9 +20,9 @@
***/
-#include <systemd/sd-netlink.h>
+#include "basic/in-addr-util.h"
-#include "in-addr-util.h"
+#include "sd-netlink.h"
struct local_address {
int family, ifindex;
diff --git a/src/libsystemd/src/sd-netlink/netlink-internal.h b/src/libsystemd/src/sd-netlink/netlink-internal.h
index 1d29c3a369..69511f87ad 100644
--- a/src/libsystemd/src/sd-netlink/netlink-internal.h
+++ b/src/libsystemd/src/sd-netlink/netlink-internal.h
@@ -21,12 +21,12 @@
#include <linux/netlink.h>
-#include <systemd/sd-netlink.h>
+#include "basic/list.h"
+#include "basic/prioq.h"
+#include "basic/refcnt.h"
-#include "list.h"
#include "netlink-types.h"
-#include "prioq.h"
-#include "refcnt.h"
+#include "sd-netlink.h"
#define RTNL_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
diff --git a/src/libsystemd/src/sd-netlink/netlink-message.c b/src/libsystemd/src/sd-netlink/netlink-message.c
index c00785ea41..fd32776a19 100644
--- a/src/libsystemd/src/sd-netlink/netlink-message.c
+++ b/src/libsystemd/src/sd-netlink/netlink-message.c
@@ -21,17 +21,17 @@
#include <stdbool.h>
#include <unistd.h>
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/formats-util.h"
+#include "basic/missing.h"
+#include "basic/refcnt.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
-#include "alloc-util.h"
-#include "formats-util.h"
-#include "missing.h"
#include "netlink-internal.h"
#include "netlink-types.h"
#include "netlink-util.h"
-#include "refcnt.h"
-#include "socket-util.h"
-#include "util.h"
+#include "sd-netlink.h"
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
diff --git a/src/libsystemd/src/sd-netlink/netlink-socket.c b/src/libsystemd/src/sd-netlink/netlink-socket.c
index d28a413c65..ec3513bcf8 100644
--- a/src/libsystemd/src/sd-netlink/netlink-socket.c
+++ b/src/libsystemd/src/sd-netlink/netlink-socket.c
@@ -21,17 +21,17 @@
#include <stdbool.h>
#include <unistd.h>
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/formats-util.h"
+#include "basic/missing.h"
+#include "basic/refcnt.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
-#include "alloc-util.h"
-#include "formats-util.h"
-#include "missing.h"
#include "netlink-internal.h"
#include "netlink-types.h"
#include "netlink-util.h"
-#include "refcnt.h"
-#include "socket-util.h"
-#include "util.h"
+#include "sd-netlink.h"
int socket_open(int family) {
int fd;
diff --git a/src/libsystemd/src/sd-netlink/netlink-types.c b/src/libsystemd/src/sd-netlink/netlink-types.c
index 3a4bac2ced..3bd7777b88 100644
--- a/src/libsystemd/src/sd-netlink/netlink-types.c
+++ b/src/libsystemd/src/sd-netlink/netlink-types.c
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <sys/socket.h>
+
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/in6.h>
@@ -30,11 +31,12 @@
#include <linux/if_link.h>
#include <linux/if_tunnel.h>
-#include "macro.h"
-#include "missing.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/string-table.h"
+#include "basic/util.h"
+
#include "netlink-types.h"
-#include "string-table.h"
-#include "util.h"
/* Maximum ARP IP target defined in kernel */
#define BOND_MAX_ARP_TARGETS 16
diff --git a/src/libsystemd/src/sd-netlink/netlink-types.h b/src/libsystemd/src/sd-netlink/netlink-types.h
index ecb20bfcdc..53363cdbfa 100644
--- a/src/libsystemd/src/sd-netlink/netlink-types.h
+++ b/src/libsystemd/src/sd-netlink/netlink-types.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
enum {
NETLINK_TYPE_UNSPEC,
diff --git a/src/libsystemd/src/sd-netlink/netlink-util.c b/src/libsystemd/src/sd-netlink/netlink-util.c
index 828ae7db7f..9248aa0b18 100644
--- a/src/libsystemd/src/sd-netlink/netlink-util.c
+++ b/src/libsystemd/src/sd-netlink/netlink-util.c
@@ -17,10 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-netlink.h>
-
#include "netlink-internal.h"
#include "netlink-util.h"
+#include "sd-netlink.h"
int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL;
diff --git a/src/libsystemd/src/sd-netlink/netlink-util.h b/src/libsystemd/src/sd-netlink/netlink-util.h
index e8f932549f..c9b932f994 100644
--- a/src/libsystemd/src/sd-netlink/netlink-util.h
+++ b/src/libsystemd/src/sd-netlink/netlink-util.h
@@ -19,9 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-netlink.h>
+#include "basic/util.h"
-#include "util.h"
+#include "sd-netlink.h"
int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_netlink_message **ret);
uint32_t rtnl_message_get_serial(sd_netlink_message *m);
diff --git a/src/libsystemd/src/sd-netlink/rtnl-message.c b/src/libsystemd/src/sd-netlink/rtnl-message.c
index f6482a6157..42178e5706 100644
--- a/src/libsystemd/src/sd-netlink/rtnl-message.c
+++ b/src/libsystemd/src/sd-netlink/rtnl-message.c
@@ -21,16 +21,16 @@
#include <stdbool.h>
#include <unistd.h>
-#include <systemd/sd-netlink.h>
+#include "basic/formats-util.h"
+#include "basic/missing.h"
+#include "basic/refcnt.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
-#include "formats-util.h"
-#include "missing.h"
#include "netlink-internal.h"
#include "netlink-types.h"
#include "netlink-util.h"
-#include "refcnt.h"
-#include "socket-util.h"
-#include "util.h"
+#include "sd-netlink.h"
int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen) {
struct rtmsg *rtm;
diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.c b/src/libsystemd/src/sd-netlink/sd-netlink.c
index 3c7488463c..1329c56bbd 100644
--- a/src/libsystemd/src/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/src/sd-netlink/sd-netlink.c
@@ -20,17 +20,17 @@
#include <poll.h>
#include <sys/socket.h>
-#include <systemd/sd-netlink.h>
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hashmap.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "hashmap.h"
-#include "macro.h"
-#include "missing.h"
#include "netlink-internal.h"
#include "netlink-util.h"
-#include "socket-util.h"
-#include "util.h"
+#include "sd-netlink.h"
static int sd_netlink_new(sd_netlink **ret) {
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.h b/src/libsystemd/src/sd-netlink/sd-netlink.h
index c4cefe4e30..d88506a9d7 100644
--- a/src/libsystemd/src/sd-netlink/sd-netlink.h
+++ b/src/libsystemd/src/sd-netlink/sd-netlink.h
@@ -23,13 +23,13 @@
#include <inttypes.h>
#include <netinet/ether.h>
#include <netinet/in.h>
+
#include <linux/rtnetlink.h>
#include <linux/neighbour.h>
+#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
-#include "_sd-common.h"
-
_SD_BEGIN_DECLARATIONS;
typedef struct sd_netlink sd_netlink;
diff --git a/src/libsystemd/src/sd-netlink/test-local-addresses.c b/src/libsystemd/src/sd-netlink/test-local-addresses.c
index e0e28cc0cc..8755a27182 100644
--- a/src/libsystemd/src/sd-netlink/test-local-addresses.c
+++ b/src/libsystemd/src/sd-netlink/test-local-addresses.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "af-list.h"
-#include "alloc-util.h"
-#include "in-addr-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/in-addr-util.h"
+
#include "local-addresses.h"
static void print_local_addresses(struct local_address *a, unsigned n) {
diff --git a/src/libsystemd/src/sd-netlink/test-netlink.c b/src/libsystemd/src/sd-netlink/test-netlink.c
index aadd0f06a8..1fde81778e 100644
--- a/src/libsystemd/src/sd-netlink/test-netlink.c
+++ b/src/libsystemd/src/sd-netlink/test-netlink.c
@@ -20,15 +20,15 @@
#include <net/if.h>
#include <netinet/ether.h>
-#include <systemd/sd-netlink.h>
+#include "basic/ether-addr-util.h"
+#include "basic/macro.h"
+#include "basic/missing.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
-#include "ether-addr-util.h"
-#include "macro.h"
-#include "missing.h"
#include "netlink-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "sd-netlink.h"
static void test_message_link_bridge(sd_netlink *rtnl) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL;
diff --git a/src/libsystemd/src/sd-network/network-util.c b/src/libsystemd/src/sd-network/network-util.c
index a0d9b5f1a4..ae3e51ae77 100644
--- a/src/libsystemd/src/sd-network/network-util.c
+++ b/src/libsystemd/src/sd-network/network-util.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/strv.h"
+
#include "network-util.h"
-#include "strv.h"
bool network_is_online(void) {
_cleanup_free_ char *state = NULL;
diff --git a/src/libsystemd/src/sd-network/network-util.h b/src/libsystemd/src/sd-network/network-util.h
index 8c4dbc68b1..26780dce28 100644
--- a/src/libsystemd/src/sd-network/network-util.h
+++ b/src/libsystemd/src/sd-network/network-util.h
@@ -19,6 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-network.h>
+#include "sd-network.h"
bool network_is_online(void);
diff --git a/src/libsystemd/src/sd-network/sd-network.c b/src/libsystemd/src/sd-network/sd-network.c
index 70083213f9..c3755371ff 100644
--- a/src/libsystemd/src/sd-network/sd-network.c
+++ b/src/libsystemd/src/sd-network/sd-network.c
@@ -23,18 +23,18 @@
#include <string.h>
#include <sys/inotify.h>
-#include <systemd/sd-network.h>
-
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+
+#include "sd-network.h"
_public_ int sd_network_get_operational_state(char **state) {
_cleanup_free_ char *s = NULL;
diff --git a/src/libsystemd/src/sd-network/sd-network.h b/src/libsystemd/src/sd-network/sd-network.h
index 0f13e2bae7..ac2660de45 100644
--- a/src/libsystemd/src/sd-network/sd-network.h
+++ b/src/libsystemd/src/sd-network/sd-network.h
@@ -24,7 +24,7 @@
#include <inttypes.h>
#include <sys/types.h>
-#include "_sd-common.h"
+#include <systemd/_sd-common.h>
/*
* A few points:
diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.c b/src/libsystemd/src/sd-resolve/sd-resolve.c
index 6eacf2b69a..d10204cde9 100644
--- a/src/libsystemd/src/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/src/sd-resolve/sd-resolve.c
@@ -29,15 +29,15 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include <systemd/sd-resolve.h>
-
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "list.h"
-#include "missing.h"
-#include "socket-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/list.h"
+#include "basic/missing.h"
+#include "basic/socket-util.h"
+#include "basic/util.h"
+
+#include "sd-resolve.h"
#define WORKERS_MIN 1U
#define WORKERS_MAX 16U
diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.h b/src/libsystemd/src/sd-resolve/sd-resolve.h
index fe3b910671..1996ae401a 100644
--- a/src/libsystemd/src/sd-resolve/sd-resolve.h
+++ b/src/libsystemd/src/sd-resolve/sd-resolve.h
@@ -25,10 +25,9 @@
#include <sys/socket.h>
#include <sys/types.h>
+#include <systemd/_sd-common.h>
#include <systemd/sd-event.h>
-#include "_sd-common.h"
-
_SD_BEGIN_DECLARATIONS;
/* An opaque sd-resolve session structure */
diff --git a/src/libsystemd/src/sd-resolve/test-resolve.c b/src/libsystemd/src/sd-resolve/test-resolve.c
index 0209cc77e7..d552a48da8 100644
--- a/src/libsystemd/src/sd-resolve/test-resolve.c
+++ b/src/libsystemd/src/sd-resolve/test-resolve.c
@@ -26,12 +26,12 @@
#include <string.h>
#include <sys/socket.h>
-#include <systemd/sd-resolve.h>
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
-#include "alloc-util.h"
-#include "macro.h"
-#include "socket-util.h"
-#include "string-util.h"
+#include "sd-resolve.h"
static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata) {
const struct addrinfo *i;
diff --git a/src/libsystemd/src/sd-utf8/sd-utf8.c b/src/libsystemd/src/sd-utf8/sd-utf8.c
index 77be8e1996..58e4a88f07 100644
--- a/src/libsystemd/src/sd-utf8/sd-utf8.c
+++ b/src/libsystemd/src/sd-utf8/sd-utf8.c
@@ -19,8 +19,8 @@
#include <systemd/sd-utf8.h>
-#include "utf8.h"
-#include "util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
_public_ const char *sd_utf8_is_valid(const char *s) {
assert_return(s, NULL);
diff --git a/src/libsystemd/src/subdir.mk b/src/libsystemd/src/subdir.mk
new file mode 100644
index 0000000000..35def00fdc
--- /dev/null
+++ b/src/libsystemd/src/subdir.mk
@@ -0,0 +1,29 @@
+# -*- 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.CPPFLAGS += -DLIBDIR=\"$(libdir)\"
+systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libudev/Makefile b/src/libudev/Makefile
new file mode 100644
index 0000000000..8d9fecb1fb
--- /dev/null
+++ b/src/libudev/Makefile
@@ -0,0 +1,28 @@
+# -*- 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
+
+at.subdirs += src
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libudev/src/Makefile b/src/libudev/src/Makefile
new file mode 100644
index 0000000000..ed606315e1
--- /dev/null
+++ b/src/libudev/src/Makefile
@@ -0,0 +1,83 @@
+# -*- 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
+
+LIBUDEV_CURRENT=7
+LIBUDEV_REVISION=4
+LIBUDEV_AGE=6
+
+include_HEADERS += \
+ src/libudev/libudev.h
+
+lib_LTLIBRARIES += \
+ libudev.la
+
+libudev_la_SOURCES =\
+ src/libudev/libudev.sym \
+ src/libudev/libudev-private.h \
+ src/libudev/libudev-device-internal.h \
+ src/libudev/libudev.c \
+ src/libudev/libudev-list.c \
+ src/libudev/libudev-util.c \
+ src/libudev/libudev-device.c \
+ src/libudev/libudev-device-private.c \
+ src/libudev/libudev-enumerate.c \
+ src/libudev/libudev-monitor.c \
+ 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 = \
+ 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/libudev/src/libudev-device-internal.h b/src/libudev/src/libudev-device-internal.h
index f76da09407..07a73e6b9c 100644
--- a/src/libudev/src/libudev-device-internal.h
+++ b/src/libudev/src/libudev-device-internal.h
@@ -20,8 +20,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
-#include <systemd/sd-device.h>
+#include <libudev.h>
+
+#include "sd-device/sd-device.h"
#include "libudev-private.h"
diff --git a/src/libudev/src/libudev-device-private.c b/src/libudev/src/libudev-device-private.c
index 2aae0726c1..97b60da3f1 100644
--- a/src/libudev/src/libudev-device-private.c
+++ b/src/libudev/src/libudev-device-private.c
@@ -18,9 +18,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "libudev.h"
+#include <libudev.h>
+
+#include "sd-device/device-private.h"
-#include "device-private.h"
#include "libudev-device-internal.h"
#include "libudev-private.h"
diff --git a/src/libudev/src/libudev-device.c b/src/libudev/src/libudev-device.c
index 6536f4cfbb..2cb20aa557 100644
--- a/src/libudev/src/libudev-device.c
+++ b/src/libudev/src/libudev-device.c
@@ -22,7 +22,6 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <linux/sockios.h>
#include <net/if.h>
#include <stdbool.h>
#include <stddef.h>
@@ -34,15 +33,18 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "libudev.h"
-#include <systemd/sd-device.h>
+#include <linux/sockios.h>
+
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/parse-util.h"
+#include "sd-device/device-private.h"
+#include "sd-device/device-util.h"
+#include "sd-device/sd-device.h"
-#include "alloc-util.h"
-#include "device-private.h"
-#include "device-util.h"
#include "libudev-device-internal.h"
#include "libudev-private.h"
-#include "parse-util.h"
/**
* SECTION:libudev-device
diff --git a/src/libudev/src/libudev-enumerate.c b/src/libudev/src/libudev-enumerate.c
index 9910cea957..52b2ccff0b 100644
--- a/src/libudev/src/libudev-enumerate.c
+++ b/src/libudev/src/libudev-enumerate.c
@@ -28,12 +28,13 @@
#include <string.h>
#include <sys/stat.h>
-#include "libudev.h"
-#include <systemd/sd-device.h>
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "sd-device/device-enumerator-private.h"
+#include "sd-device/device-util.h"
+#include "sd-device/sd-device.h"
-#include "alloc-util.h"
-#include "device-enumerator-private.h"
-#include "device-util.h"
#include "libudev-device-internal.h"
/**
diff --git a/src/libudev/src/libudev-hwdb.c b/src/libudev/src/libudev-hwdb.c
index 8c4b488086..1d47cfaa4e 100644
--- a/src/libudev/src/libudev-hwdb.c
+++ b/src/libudev/src/libudev-hwdb.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-hwdb.h>
+#include "basic/alloc-util.h"
+#include "sd-hwdb/hwdb-util.h"
+#include "sd-hwdb/sd-hwdb.h"
-#include "alloc-util.h"
-#include "hwdb-util.h"
#include "libudev-private.h"
/**
diff --git a/src/libudev/src/libudev-list.c b/src/libudev/src/libudev-list.c
index da496ed456..a943dc0cd1 100644
--- a/src/libudev/src/libudev-list.c
+++ b/src/libudev/src/libudev-list.c
@@ -22,7 +22,8 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+
#include "libudev-private.h"
/**
diff --git a/src/libudev/src/libudev-monitor.c b/src/libudev/src/libudev-monitor.c
index f870eba9eb..be8e280336 100644
--- a/src/libudev/src/libudev-monitor.c
+++ b/src/libudev/src/libudev-monitor.c
@@ -18,8 +18,6 @@
***/
#include <errno.h>
-#include <linux/filter.h>
-#include <linux/netlink.h>
#include <poll.h>
#include <stddef.h>
#include <stdio.h>
@@ -28,17 +26,21 @@
#include <sys/socket.h>
#include <unistd.h>
-#include "libudev.h"
+#include <linux/filter.h>
+#include <linux/netlink.h>
+
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/missing.h"
+#include "basic/mount-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
#include "libudev-private.h"
-#include "missing.h"
-#include "mount-util.h"
-#include "socket-util.h"
-#include "string-util.h"
/**
* SECTION:libudev-monitor
diff --git a/src/libudev/src/libudev-private.h b/src/libudev/src/libudev-private.h
index 52c5075110..8dfc8d6fe7 100644
--- a/src/libudev/src/libudev-private.h
+++ b/src/libudev/src/libudev-private.h
@@ -24,12 +24,12 @@
#include <stdbool.h>
#include <stdint.h>
-#include "libudev.h"
+#include <libudev.h>
-#include "macro.h"
-#include "mkdir.h"
-#include "strxcpyx.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/strxcpyx.h"
+#include "basic/util.h"
#define READ_END 0
#define WRITE_END 1
diff --git a/src/libudev/src/libudev-queue.c b/src/libudev/src/libudev-queue.c
index e3dffa6925..bc89252096 100644
--- a/src/libudev/src/libudev-queue.c
+++ b/src/libudev/src/libudev-queue.c
@@ -24,9 +24,10 @@
#include <sys/inotify.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+
#include "libudev-private.h"
/**
diff --git a/src/libudev/src/libudev-util.c b/src/libudev/src/libudev-util.c
index 574cfeac85..661039ecea 100644
--- a/src/libudev/src/libudev-util.c
+++ b/src/libudev/src/libudev-util.c
@@ -24,13 +24,14 @@
#include <string.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/MurmurHash2.h"
+#include "basic/device-nodes.h"
+#include "basic/syslog-util.h"
+#include "basic/utf8.h"
-#include "MurmurHash2.h"
-#include "device-nodes.h"
#include "libudev-private.h"
-#include "syslog-util.h"
-#include "utf8.h"
/**
* SECTION:libudev-util
diff --git a/src/libudev/src/libudev.c b/src/libudev/src/libudev.c
index 63fb05547d..c1af43e3ca 100644
--- a/src/libudev/src/libudev.c
+++ b/src/libudev/src/libudev.c
@@ -24,13 +24,14 @@
#include <stdlib.h>
#include <string.h>
-#include "libudev.h"
+#include <libudev.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/missing.h"
+#include "basic/string-util.h"
-#include "alloc-util.h"
-#include "fd-util.h"
#include "libudev-private.h"
-#include "missing.h"
-#include "string-util.h"
/**
* SECTION:libudev
diff --git a/src/libudev/src/udev.h b/src/libudev/src/udev.h
index 00de88972a..26afe63b55 100644
--- a/src/libudev/src/udev.h
+++ b/src/libudev/src/udev.h
@@ -22,14 +22,15 @@
#include <sys/sysmacros.h>
#include <sys/types.h>
-#include "libudev.h"
-#include <systemd/sd-netlink.h>
+#include <libudev.h>
+
+#include "basic/label.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "sd-netlink/sd-netlink.h"
-#include "label.h"
#include "libudev-private.h"
-#include "macro.h"
-#include "strv.h"
-#include "util.h"
struct udev_event {
struct udev *udev;
diff --git a/src/nss-myhostname/Makefile b/src/nss-myhostname/Makefile
new file mode 100644
index 0000000000..b5f6ff62aa
--- /dev/null
+++ b/src/nss-myhostname/Makefile
@@ -0,0 +1,47 @@
+# -*- 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 ($(HAVE_MYHOSTNAME),)
+libnss_myhostname_la_SOURCES = \
+ src/nss-myhostname/nss-myhostname.sym \
+ src/nss-myhostname/nss-myhostname.c
+
+libnss_myhostname_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -module \
+ -export-dynamic \
+ -avoid-version \
+ -shared \
+ -shrext .so.2 \
+ -Wl,--version-script=$(srcdir)/nss-myhostname.sym
+
+libnss_myhostname_la_LIBADD = \
+ libsystemd-internal.la
+
+lib_LTLIBRARIES += \
+ libnss_myhostname.la
+endif # HAVE_MYHOSTNAME
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index 2b83d127b7..e31b959584 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -24,14 +24,14 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
-#include "macro.h"
-#include "nss-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/nss-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-netlink/local-addresses.h"
/* We use 127.0.0.2 as IPv4 address. This has the advantage over
* 127.0.0.1 that it can be translated back to the local hostname. For
diff --git a/src/systemd-ask-password/Makefile b/src/systemd-ask-password/Makefile
new file mode 100644
index 0000000000..4a79cd838a
--- /dev/null
+++ b/src/systemd-ask-password/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemd-ask-password
+systemd_ask_password_SOURCES = \
+ src/ask-password/ask-password.c
+
+systemd_ask_password_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-ask-password/ask-password.c b/src/systemd-ask-password/ask-password.c
index 6d53dd982c..a30833b6b3 100644
--- a/src/systemd-ask-password/ask-password.c
+++ b/src/systemd-ask-password/ask-password.c
@@ -22,11 +22,11 @@
#include <stddef.h>
#include <unistd.h>
-#include "ask-password-api.h"
-#include "def.h"
-#include "log.h"
-#include "macro.h"
-#include "strv.h"
+#include "basic/def.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
+#include "shared/ask-password-api.h"
static const char *arg_icon = NULL;
static const char *arg_id = NULL;
diff --git a/src/systemd-cgls/Makefile b/src/systemd-cgls/Makefile
new file mode 100644
index 0000000000..40a7811632
--- /dev/null
+++ b/src/systemd-cgls/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-cgls
+systemd_cgls_SOURCES = \
+ src/cgls/cgls.c
+
+systemd_cgls_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cgls/cgls.c b/src/systemd-cgls/cgls.c
index ed2846ee57..0d2459133d 100644
--- a/src/systemd-cgls/cgls.c
+++ b/src/systemd-cgls/cgls.c
@@ -25,18 +25,18 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "output-mode.h"
-#include "pager.h"
-#include "path-util.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/cgroup-show.h"
+#include "shared/output-mode.h"
+#include "shared/pager.h"
static bool arg_no_pager = false;
static bool arg_kernel_threads = false;
diff --git a/src/systemd-cgroups-agent/Makefile b/src/systemd-cgroups-agent/Makefile
new file mode 100644
index 0000000000..05ff1f6b49
--- /dev/null
+++ b/src/systemd-cgroups-agent/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-cgroups-agent
+systemd_cgroups_agent_SOURCES = \
+ src/cgroups-agent/cgroups-agent.c
+
+systemd_cgroups_agent_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cgroups-agent/cgroups-agent.c b/src/systemd-cgroups-agent/cgroups-agent.c
index d7c722ac3d..a09333d82c 100644
--- a/src/systemd-cgroups-agent/cgroups-agent.c
+++ b/src/systemd-cgroups-agent/cgroups-agent.c
@@ -20,9 +20,9 @@
#include <stdlib.h>
#include <sys/socket.h>
-#include "fd-util.h"
-#include "log.h"
-#include "socket-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/socket-util.h"
int main(int argc, char *argv[]) {
diff --git a/src/systemd-cgtop/Makefile b/src/systemd-cgtop/Makefile
new file mode 100644
index 0000000000..4980eed15b
--- /dev/null
+++ b/src/systemd-cgtop/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-cgtop
+systemd_cgtop_SOURCES = \
+ src/cgtop/cgtop.c
+
+systemd_cgtop_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cgtop/cgtop.c b/src/systemd-cgtop/cgtop.c
index 6cbea86070..91cab3f6b1 100644
--- a/src/systemd-cgtop/cgtop.c
+++ b/src/systemd-cgtop/cgtop.c
@@ -28,20 +28,20 @@
#include <systemd/sd-bus.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "stdio-util.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/stdio-util.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
typedef struct Group {
char *path;
diff --git a/src/systemd-cryptsetup/Makefile b/src/systemd-cryptsetup/Makefile
new file mode 100644
index 0000000000..73a46bf6da
--- /dev/null
+++ b/src/systemd-cryptsetup/Makefile
@@ -0,0 +1,59 @@
+# -*- 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 ($(HAVE_LIBCRYPTSETUP),)
+rootlibexec_PROGRAMS += \
+ systemd-cryptsetup
+
+systemgenerator_PROGRAMS += \
+ systemd-cryptsetup-generator
+
+dist_systemunit_DATA += \
+ units/cryptsetup.target \
+ units/cryptsetup-pre.target
+
+systemd_cryptsetup_SOURCES = \
+ src/cryptsetup/cryptsetup.c
+
+systemd_cryptsetup_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBCRYPTSETUP_CFLAGS)
+
+systemd_cryptsetup_LDADD = \
+ libshared.la \
+ $(LIBCRYPTSETUP_LIBS)
+
+systemd_cryptsetup_generator_SOURCES = \
+ src/cryptsetup/cryptsetup-generator.c
+
+systemd_cryptsetup_generator_LDADD = \
+ libshared.la
+
+SYSINIT_TARGET_WANTS += \
+ cryptsetup.target
+
+endif # HAVE_LIBCRYPTSETUP
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cryptsetup/cryptsetup-generator.c b/src/systemd-cryptsetup/cryptsetup-generator.c
index 8ac5ab730a..3ad6d34a98 100644
--- a/src/systemd-cryptsetup/cryptsetup-generator.c
+++ b/src/systemd-cryptsetup/cryptsetup-generator.c
@@ -19,22 +19,22 @@
#include <errno.h>
-#include "alloc-util.h"
-#include "dropin.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fstab-util.h"
-#include "generator.h"
-#include "hashmap.h"
-#include "log.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "shared/dropin.h"
+#include "shared/fstab-util.h"
+#include "shared/generator.h"
typedef struct crypto_device {
char *uuid;
diff --git a/src/systemd-cryptsetup/cryptsetup.c b/src/systemd-cryptsetup/cryptsetup.c
index 8024f80e36..eef2b1954c 100644
--- a/src/systemd-cryptsetup/cryptsetup.c
+++ b/src/systemd-cryptsetup/cryptsetup.c
@@ -23,20 +23,19 @@
#include <string.h>
#include <sys/mman.h>
-#include <systemd/sd-device.h>
-
-#include "alloc-util.h"
-#include "ask-password-api.h"
-#include "device-util.h"
-#include "escape.h"
-#include "fileio.h"
-#include "log.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "sd-device/device-util.h"
+#include "sd-device/sd-device.h"
+#include "shared/ask-password-api.h"
static const char *arg_type = NULL; /* CRYPT_LUKS1, CRYPT_TCRYPT or CRYPT_PLAIN */
static char *arg_cipher = NULL;
diff --git a/src/systemd-dbus1-generator/Makefile b/src/systemd-dbus1-generator/Makefile
new file mode 100644
index 0000000000..1d7f0d1a81
--- /dev/null
+++ b/src/systemd-dbus1-generator/Makefile
@@ -0,0 +1,49 @@
+# -*- 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
+
+systemgenerator_PROGRAMS += \
+ systemd-dbus1-generator
+
+systemd_dbus1_generator_SOURCES = \
+ src/dbus1-generator/dbus1-generator.c
+
+systemd_dbus1_generator_LDADD = \
+ libshared.la
+
+dbus1-generator-install-hook:
+ $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
+ $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+ $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+
+dbus1-generator-uninstall-hook:
+ rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+
+dist_xinitrc_SCRIPTS = \
+ xorg/50-systemd-user.sh
+
+INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
+UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-dbus1-generator/dbus1-generator.c b/src/systemd-dbus1-generator/dbus1-generator.c
index 717cb9558e..762a374fe4 100644
--- a/src/systemd-dbus1-generator/dbus1-generator.c
+++ b/src/systemd-dbus1-generator/dbus1-generator.c
@@ -17,18 +17,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-internal.h"
-#include "bus-util.h"
-#include "cgroup-util.h"
-#include "conf-parser.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "mkdir.h"
-#include "special.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/mkdir.h"
+#include "basic/special.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-util.h"
+#include "shared/conf-parser.h"
static const char *arg_dest_late = "/tmp", *arg_dest = "/tmp";
diff --git a/src/systemd-debug-generator/Makefile b/src/systemd-debug-generator/Makefile
new file mode 100644
index 0000000000..bba46c2905
--- /dev/null
+++ b/src/systemd-debug-generator/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+systemgenerator_PROGRAMS += systemd-debug-generator
+
+systemd_debug_generator_SOURCES = \
+ src/debug-generator/debug-generator.c
+
+systemd_debug_generator_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-debug-generator/debug-generator.c b/src/systemd-debug-generator/debug-generator.c
index 7e80af78e7..2db31e5de6 100644
--- a/src/systemd-debug-generator/debug-generator.c
+++ b/src/systemd-debug-generator/debug-generator.c
@@ -17,15 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "mkdir.h"
-#include "parse-util.h"
-#include "proc-cmdline.h"
-#include "special.h"
-#include "string-util.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/mkdir.h"
+#include "basic/parse-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
static char *arg_default_unit = NULL;
static const char *arg_dest = "/tmp";
diff --git a/src/systemd-getty-generator/Makefile b/src/systemd-getty-generator/Makefile
new file mode 100644
index 0000000000..14f7d02a86
--- /dev/null
+++ b/src/systemd-getty-generator/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+systemgenerator_PROGRAMS += systemd-getty-generator
+systemd_getty_generator_SOURCES = \
+ src/getty-generator/getty-generator.c
+
+systemd_getty_generator_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-getty-generator/getty-generator.c b/src/systemd-getty-generator/getty-generator.c
index b15c76b5b8..c78fac7694 100644
--- a/src/systemd-getty-generator/getty-generator.c
+++ b/src/systemd-getty-generator/getty-generator.c
@@ -22,18 +22,18 @@
#include <string.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "unit-name.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "basic/virt.h"
static const char *arg_dest = "/tmp";
diff --git a/src/systemd-gpt-auto-generator/Makefile b/src/systemd-gpt-auto-generator/Makefile
new file mode 100644
index 0000000000..177db8da7c
--- /dev/null
+++ b/src/systemd-gpt-auto-generator/Makefile
@@ -0,0 +1,43 @@
+# -*- 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 ($(HAVE_BLKID),)
+systemgenerator_PROGRAMS += \
+ systemd-gpt-auto-generator
+
+systemd_gpt_auto_generator_SOURCES = \
+ src/gpt-auto-generator/gpt-auto-generator.c \
+ src/basic/blkid-util.h
+
+systemd_gpt_auto_generator_LDADD = \
+ libshared.la \
+ $(BLKID_LIBS)
+
+systemd_gpt_auto_generator_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(BLKID_CFLAGS)
+endif # HAVE_BLKID
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-gpt-auto-generator/gpt-auto-generator.c b/src/systemd-gpt-auto-generator/gpt-auto-generator.c
index 73e32da751..4edcd42239 100644
--- a/src/systemd-gpt-auto-generator/gpt-auto-generator.c
+++ b/src/systemd-gpt-auto-generator/gpt-auto-generator.c
@@ -22,32 +22,32 @@
#include <sys/statfs.h>
#include <unistd.h>
-#include "libudev.h"
+#include <libudev.h>
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "blkid-util.h"
-#include "btrfs-util.h"
-#include "dirent-util.h"
-#include "efivars.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fstab-util.h"
-#include "generator.h"
-#include "gpt.h"
-#include "missing.h"
-#include "mkdir.h"
-#include "mount-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "proc-cmdline.h"
-#include "special.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "unit-name.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/blkid-util.h"
+#include "basic/btrfs-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/missing.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/proc-cmdline.h"
+#include "basic/special.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
+#include "basic/virt.h"
+#include "shared/efivars.h"
+#include "shared/fstab-util.h"
+#include "shared/generator.h"
+#include "shared/gpt.h"
+#include "shared/udev-util.h"
static const char *arg_dest = "/tmp";
static bool arg_enabled = true;
diff --git a/src/systemd-initctl/Makefile b/src/systemd-initctl/Makefile
new file mode 100644
index 0000000000..bd19b4a090
--- /dev/null
+++ b/src/systemd-initctl/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-initctl
+systemd_initctl_SOURCES = \
+ src/initctl/initctl.c
+
+systemd_initctl_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-initctl/initctl.c b/src/systemd-initctl/initctl.c
index 05285e3846..66b40ce6f8 100644
--- a/src/systemd-initctl/initctl.c
+++ b/src/systemd-initctl/initctl.c
@@ -26,17 +26,17 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "def.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "initreq.h"
-#include "list.h"
-#include "log.h"
-#include "special.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/list.h"
+#include "basic/log.h"
+#include "basic/special.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/initreq.h"
#define SERVER_FD_MAX 16
#define TIMEOUT_MSEC ((int) (DEFAULT_EXIT_USEC/USEC_PER_MSEC))
diff --git a/src/systemd-machine-id-setup/Makefile b/src/systemd-machine-id-setup/Makefile
new file mode 100644
index 0000000000..8f210b3cdf
--- /dev/null
+++ b/src/systemd-machine-id-setup/Makefile
@@ -0,0 +1,38 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemd-machine-id-setup
+systemd_machine_id_setup_SOURCES = \
+ src/machine-id-setup/machine-id-setup-main.c \
+ src/core/machine-id-setup.c \
+ src/core/machine-id-setup.h
+
+systemd_machine_id_setup_LDADD = \
+ libshared.la
+
+SYSINIT_TARGET_WANTS += \
+ systemd-machine-id-commit.service
+
+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 1d55fa04af..fdc009b225 100644
--- a/src/systemd-machine-id-setup/machine-id-setup-main.c
+++ b/src/systemd-machine-id-setup/machine-id-setup-main.c
@@ -22,10 +22,10 @@
#include <stdio.h>
#include <stdlib.h>
-#include "log.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/util.h"
#include "machine-id-setup.h"
-#include "path-util.h"
-#include "util.h"
static char *arg_root = NULL;
static bool arg_commit = false;
diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile
new file mode 100644
index 0000000000..d6f928ebd6
--- /dev/null
+++ b/src/systemd-nspawn/Makefile
@@ -0,0 +1,85 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-nspawn
+systemd_nspawn_SOURCES = \
+ src/nspawn/nspawn.c \
+ src/nspawn/nspawn-settings.c \
+ src/nspawn/nspawn-settings.h \
+ src/nspawn/nspawn-mount.c \
+ src/nspawn/nspawn-mount.h \
+ src/nspawn/nspawn-network.c \
+ src/nspawn/nspawn-network.h \
+ src/nspawn/nspawn-expose-ports.c \
+ src/nspawn/nspawn-expose-ports.h \
+ src/nspawn/nspawn-cgroup.c \
+ src/nspawn/nspawn-cgroup.h \
+ src/nspawn/nspawn-register.c \
+ src/nspawn/nspawn-register.h \
+ src/nspawn/nspawn-setuid.c \
+ src/nspawn/nspawn-setuid.h \
+ src/nspawn/nspawn-stub-pid1.c \
+ src/nspawn/nspawn-stub-pid1.h \
+ src/nspawn/nspawn-patch-uid.c \
+ src/nspawn/nspawn-patch-uid.h \
+ src/core/mount-setup.c \
+ src/core/mount-setup.h \
+ src/core/loopback-setup.c \
+ src/core/loopback-setup.h \
+ src/core/machine-id-setup.c \
+ src/core/machine-id-setup.h
+
+nodist_systemd_nspawn_SOURCES = \
+ src/nspawn/nspawn-gperf.c
+
+gperf_gperf_sources += \
+ src/nspawn/nspawn-gperf.gperf
+
+systemd_nspawn_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(BLKID_CFLAGS) \
+ $(SECCOMP_CFLAGS)
+
+systemd_nspawn_LDADD = \
+ libshared.la \
+ $(BLKID_LIBS)
+
+ifneq ($(HAVE_LIBIPTC),)
+systemd_nspawn_LDADD += \
+ libfirewall.la
+endif # HAVE_LIBIPTC
+
+test_patch_uid_SOURCES = \
+ src/nspawn/nspawn-patch-uid.c \
+ src/nspawn/nspawn-patch-uid.h \
+ src/nspawn/test-patch-uid.c
+
+test_patch_uid_LDADD = \
+ libshared.la
+
+manual_tests += \
+ test-patch-uid
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/nspawn-cgroup.c b/src/systemd-nspawn/nspawn-cgroup.c
index f50f1ad6c2..d0e2de2345 100644
--- a/src/systemd-nspawn/nspawn-cgroup.c
+++ b/src/systemd-nspawn/nspawn-cgroup.c
@@ -19,15 +19,16 @@
#include <sys/mount.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "mkdir.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/mkdir.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+
#include "nspawn-cgroup.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
int chown_cgroup(pid_t pid, uid_t uid_shift) {
_cleanup_free_ char *path = NULL, *fs = NULL;
diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c
index 8122a14f7b..6c9dbf4508 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.c
+++ b/src/systemd-nspawn/nspawn-expose-ports.c
@@ -17,19 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <systemd/sd-netlink.h>
-
-#include "alloc-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/parse-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "firewall-util.h"
-#include "in-addr-util.h"
-#include "local-addresses.h"
-#include "netlink-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"
-#include "parse-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "util.h"
int expose_port_parse(ExposePort **l, const char *s) {
diff --git a/src/systemd-nspawn/nspawn-expose-ports.h b/src/systemd-nspawn/nspawn-expose-ports.h
index 0e9f8f7e88..2c0a5ecc88 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.h
+++ b/src/systemd-nspawn/nspawn-expose-ports.h
@@ -22,10 +22,10 @@
#include <inttypes.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-netlink.h>
-#include "in-addr-util.h"
-#include "list.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "sd-netlink/sd-netlink.h"
typedef struct ExposePort {
int protocol;
diff --git a/src/systemd-nspawn/nspawn-mount.c b/src/systemd-nspawn/nspawn-mount.c
index 8e2d2d543c..d8ca696f21 100644
--- a/src/systemd-nspawn/nspawn-mount.c
+++ b/src/systemd-nspawn/nspawn-mount.c
@@ -18,25 +18,27 @@
***/
#include <sys/mount.h>
+
#include <linux/magic.h>
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "escape.h"
-#include "fs-util.h"
-#include "label.h"
-#include "mkdir.h"
-#include "mount-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/escape.h"
+#include "basic/fs-util.h"
+#include "basic/label.h"
+#include "basic/mkdir.h"
+#include "basic/mount-util.h"
+#include "basic/parse-util.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/set.h"
+#include "basic/stat-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "nspawn-mount.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "set.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
CustomMount* custom_mount_add(CustomMount **l, unsigned *n, CustomMountType t) {
CustomMount *c, *ret;
diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c
index 7052fb5804..f27b6c4105 100644
--- a/src/systemd-nspawn/nspawn-network.c
+++ b/src/systemd-nspawn/nspawn-network.c
@@ -17,24 +17,26 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/veth.h>
#include <net/if.h>
-#include "libudev.h"
+#include <linux/veth.h>
+
+#include <libudev.h>
#include <systemd/sd-id128.h>
-#include <systemd/sd-netlink.h>
-#include "alloc-util.h"
-#include "ether-addr-util.h"
-#include "lockfile-util.h"
-#include "netlink-util.h"
+#include "basic/alloc-util.h"
+#include "basic/ether-addr-util.h"
+#include "basic/lockfile-util.h"
+#include "basic/siphash24.h"
+#include "basic/socket-util.h"
+#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"
+
#include "nspawn-network.h"
-#include "siphash24.h"
-#include "socket-util.h"
-#include "stat-util.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "util.h"
#define HOST_HASH_KEY SD_ID128_MAKE(1a,37,6f,c7,46,ec,45,0b,ad,a3,d5,31,06,60,5d,b1)
#define CONTAINER_HASH_KEY SD_ID128_MAKE(c3,c4,f9,19,b5,57,b2,1c,e6,cf,14,27,03,9c,ee,a2)
diff --git a/src/systemd-nspawn/nspawn-patch-uid.c b/src/systemd-nspawn/nspawn-patch-uid.c
index c7382d412d..998bd9725d 100644
--- a/src/systemd-nspawn/nspawn-patch-uid.c
+++ b/src/systemd-nspawn/nspawn-patch-uid.c
@@ -18,6 +18,7 @@
***/
#include <fcntl.h>
+
#include <linux/magic.h>
#ifdef HAVE_ACL
#include <sys/acl.h>
diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c
index adef200cb5..f1ed51e8b8 100644
--- a/src/systemd-nspawn/nspawn-register.c
+++ b/src/systemd-nspawn/nspawn-register.c
@@ -19,13 +19,14 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
-#include "bus-unit-util.h"
-#include "bus-util.h"
+#include "basic/stat-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-unit-util.h"
+#include "shared/bus-util.h"
+
#include "nspawn-register.h"
-#include "stat-util.h"
-#include "strv.h"
-#include "util.h"
int register_machine(
const char *machine_name,
diff --git a/src/systemd-nspawn/nspawn-settings.c b/src/systemd-nspawn/nspawn-settings.c
index 5f1522cfb6..f05c671946 100644
--- a/src/systemd-nspawn/nspawn-settings.c
+++ b/src/systemd-nspawn/nspawn-settings.c
@@ -17,18 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "cap-list.h"
-#include "conf-parser.h"
+#include "basic/alloc-util.h"
+#include "basic/cap-list.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
+
#include "nspawn-network.h"
#include "nspawn-settings.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
int settings_load(FILE *f, const char *path, Settings **ret) {
_cleanup_(settings_freep) Settings *s = NULL;
diff --git a/src/systemd-nspawn/nspawn-settings.h b/src/systemd-nspawn/nspawn-settings.h
index 1c47e37912..95e70d5fa4 100644
--- a/src/systemd-nspawn/nspawn-settings.h
+++ b/src/systemd-nspawn/nspawn-settings.h
@@ -21,7 +21,8 @@
#include <stdio.h>
-#include "macro.h"
+#include "basic/macro.h"
+
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"
diff --git a/src/systemd-nspawn/nspawn-setuid.c b/src/systemd-nspawn/nspawn-setuid.c
index ee15a47e93..38ca9e2e24 100644
--- a/src/systemd-nspawn/nspawn-setuid.c
+++ b/src/systemd-nspawn/nspawn-setuid.c
@@ -21,15 +21,16 @@
#include <sys/types.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "mkdir.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/mkdir.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "nspawn-setuid.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "util.h"
static int spawn_getent(const char *database, const char *key, pid_t *rpid) {
int pipe_fds[2];
diff --git a/src/systemd-nspawn/nspawn-stub-pid1.c b/src/systemd-nspawn/nspawn-stub-pid1.c
index 2de87e3c63..86783b6136 100644
--- a/src/systemd-nspawn/nspawn-stub-pid1.c
+++ b/src/systemd-nspawn/nspawn-stub-pid1.c
@@ -21,13 +21,14 @@
#include <sys/unistd.h>
#include <sys/wait.h>
-#include "fd-util.h"
-#include "log.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/time-util.h"
+
#include "nspawn-stub-pid1.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "time-util.h"
-#include "def.h"
int stub_pid1(void) {
enum {
diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c
index bdf054e5c6..8ec058431b 100644
--- a/src/systemd-nspawn/nspawn.c
+++ b/src/systemd-nspawn/nspawn.c
@@ -43,8 +43,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include <systemd/sd-daemon.h>
-#include <systemd/sd-id128.h>
+#include "sd-daemon.h"
+#include "sd-id128.h"
#include "alloc-util.h"
#include "barrier.h"
diff --git a/src/systemd-nspawn/test-patch-uid.c b/src/systemd-nspawn/test-patch-uid.c
index 11c5321788..e751e0ec95 100644
--- a/src/systemd-nspawn/test-patch-uid.c
+++ b/src/systemd-nspawn/test-patch-uid.c
@@ -19,10 +19,11 @@
#include <stdlib.h>
-#include "log.h"
+#include "basic/log.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "nspawn-patch-uid.h"
-#include "user-util.h"
-#include "util.h"
int main(int argc, char *argv[]) {
uid_t shift, range;
diff --git a/src/systemd-rc-local-generator/Makefile b/src/systemd-rc-local-generator/Makefile
new file mode 100644
index 0000000000..2e9b3e7a64
--- /dev/null
+++ b/src/systemd-rc-local-generator/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
+
+systemd_rc_local_generator_SOURCES = \
+ src/rc-local-generator/rc-local-generator.c
+
+systemd_rc_local_generator_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-rc-local-generator/rc-local-generator.c b/src/systemd-rc-local-generator/rc-local-generator.c
index 618bbe428d..2c2fbd21e1 100644
--- a/src/systemd-rc-local-generator/rc-local-generator.c
+++ b/src/systemd-rc-local-generator/rc-local-generator.c
@@ -22,11 +22,11 @@
#include <stdio.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "log.h"
-#include "mkdir.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/mkdir.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#ifndef RC_LOCAL_SCRIPT_PATH_START
#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
diff --git a/src/systemd-remount-fs/Makefile b/src/systemd-remount-fs/Makefile
new file mode 100644
index 0000000000..49b10a879a
--- /dev/null
+++ b/src/systemd-remount-fs/Makefile
@@ -0,0 +1,35 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-remount-fs
+systemd_remount_fs_SOURCES = \
+ src/remount-fs/remount-fs.c \
+ src/core/mount-setup.c \
+ src/core/mount-setup.h
+
+systemd_remount_fs_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-remount-fs/remount-fs.c b/src/systemd-remount-fs/remount-fs.c
index 6468d1eecd..936b5f11b3 100644
--- a/src/systemd-remount-fs/remount-fs.c
+++ b/src/systemd-remount-fs/remount-fs.c
@@ -25,15 +25,15 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "exit-status.h"
-#include "log.h"
+#include "basic/exit-status.h"
+#include "basic/log.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
#include "mount-setup.h"
-#include "mount-util.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "strv.h"
-#include "util.h"
/* Goes through /etc/fstab and remounts all API file systems, applying
* options that are in /etc/fstab that systemd might not have
diff --git a/src/systemd-reply-password/Makefile b/src/systemd-reply-password/Makefile
new file mode 100644
index 0000000000..b5c4698fd8
--- /dev/null
+++ b/src/systemd-reply-password/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-reply-password
+systemd_reply_password_SOURCES = \
+ src/reply-password/reply-password.c
+
+systemd_reply_password_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-reply-password/reply-password.c b/src/systemd-reply-password/reply-password.c
index 17eab9772e..7a5cea0e1e 100644
--- a/src/systemd-reply-password/reply-password.c
+++ b/src/systemd-reply-password/reply-password.c
@@ -23,12 +23,12 @@
#include <sys/socket.h>
#include <sys/un.h>
-#include "fd-util.h"
-#include "log.h"
-#include "macro.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static int send_on_socket(int fd, const char *socket_name, const void *packet, size_t size) {
union sockaddr_union sa = {
diff --git a/src/systemd-socket-proxyd/Makefile b/src/systemd-socket-proxyd/Makefile
new file mode 100644
index 0000000000..e3d354bd30
--- /dev/null
+++ b/src/systemd-socket-proxyd/Makefile
@@ -0,0 +1,34 @@
+# -*- 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
+
+rootlibexec_PROGRAMS += systemd-socket-proxyd
+
+systemd_socket_proxyd_SOURCES = \
+ src/socket-proxy/socket-proxyd.c
+
+systemd_socket_proxyd_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-socket-proxyd/socket-proxyd.c b/src/systemd-socket-proxyd/socket-proxyd.c
index ce226c4d66..888850595b 100644
--- a/src/systemd-socket-proxyd/socket-proxyd.c
+++ b/src/systemd-socket-proxyd/socket-proxyd.c
@@ -30,16 +30,16 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-resolve.h>
-
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "path-util.h"
-#include "set.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "util.h"
+
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/path-util.h"
+#include "basic/set.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-resolve/sd-resolve.h"
#define BUFFER_SIZE (256 * 1024)
#define CONNECTIONS_MAX 256
diff --git a/src/systemd-stdio-bridge/Makefile b/src/systemd-stdio-bridge/Makefile
new file mode 100644
index 0000000000..8aeb20b41a
--- /dev/null
+++ b/src/systemd-stdio-bridge/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+bin_PROGRAMS += systemd-stdio-bridge
+systemd_stdio_bridge_SOURCES = \
+ src/stdio-bridge/stdio-bridge.c
+
+systemd_stdio_bridge_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-stdio-bridge/stdio-bridge.c b/src/systemd-stdio-bridge/stdio-bridge.c
index dce959cae3..33fe2f7e28 100644
--- a/src/systemd-stdio-bridge/stdio-bridge.c
+++ b/src/systemd-stdio-bridge/stdio-bridge.c
@@ -27,11 +27,11 @@
#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
-#include "bus-internal.h"
-#include "bus-util.h"
-#include "build.h"
-#include "log.h"
-#include "util.h"
+#include "basic/build.h"
+#include "basic/log.h"
+#include "basic/util.h"
+#include "sd-bus/bus-internal.h"
+#include "shared/bus-util.h"
#define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket"
diff --git a/src/systemd-system-update-generator/Makefile b/src/systemd-system-update-generator/Makefile
new file mode 100644
index 0000000000..fd44aef359
--- /dev/null
+++ b/src/systemd-system-update-generator/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+systemgenerator_PROGRAMS += systemd-system-update-generator
+systemd_system_update_generator_SOURCES = \
+ src/system-update-generator/system-update-generator.c
+
+systemd_system_update_generator_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-system-update-generator/system-update-generator.c b/src/systemd-system-update-generator/system-update-generator.c
index a3d677f068..e95ab39bb5 100644
--- a/src/systemd-system-update-generator/system-update-generator.c
+++ b/src/systemd-system-update-generator/system-update-generator.c
@@ -20,10 +20,10 @@
#include <errno.h>
#include <unistd.h>
-#include "fs-util.h"
-#include "log.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
/*
* Implements the logic described in
diff --git a/src/systemd-timesyncd/Makefile b/src/systemd-timesyncd/Makefile
new file mode 100644
index 0000000000..c9289846c4
--- /dev/null
+++ b/src/systemd-timesyncd/Makefile
@@ -0,0 +1,64 @@
+# -*- 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_TIMESYNCD),)
+systemd_timesyncd_SOURCES = \
+ src/timesync/timesyncd.c \
+ src/timesync/timesyncd-manager.c \
+ src/timesync/timesyncd-manager.h \
+ src/timesync/timesyncd-conf.c \
+ src/timesync/timesyncd-conf.h \
+ src/timesync/timesyncd-server.c \
+ src/timesync/timesyncd-server.h
+
+nodist_systemd_timesyncd_SOURCES = \
+ src/timesync/timesyncd-gperf.c
+
+systemd_timesyncd_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-timesyncd
+
+nodist_systemunit_DATA += \
+ units/systemd-timesyncd.service
+
+GENERAL_ALIASES += \
+ $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/sysinit.target.wants/systemd-timesyncd.service
+
+nodist_pkgsysconf_DATA += \
+ src/timesync/timesyncd.conf
+
+endif # ENABLE_TIMESYNCD
+
+gperf_gperf_sources += \
+ src/timesync/timesyncd-gperf.gperf
+
+EXTRA_DIST += \
+ units/systemd-timesyncd.service.in \
+ src/timesync/timesyncd.conf.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-timesyncd/timesyncd-conf.c b/src/systemd-timesyncd/timesyncd-conf.c
index 20c64a3354..f2c6efd8e2 100644
--- a/src/systemd-timesyncd/timesyncd-conf.c
+++ b/src/systemd-timesyncd/timesyncd-conf.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "def.h"
-#include "extract-word.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/extract-word.h"
+#include "basic/string-util.h"
+
#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
#include "timesyncd-server.h"
diff --git a/src/systemd-timesyncd/timesyncd-conf.h b/src/systemd-timesyncd/timesyncd-conf.h
index cba0724b1b..c24d54a1e3 100644
--- a/src/systemd-timesyncd/timesyncd-conf.h
+++ b/src/systemd-timesyncd/timesyncd-conf.h
@@ -19,7 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "conf-parser.h"
+#include "shared/conf-parser.h"
+
#include "timesyncd-manager.h"
const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, unsigned length);
diff --git a/src/systemd-timesyncd/timesyncd-manager.c b/src/systemd-timesyncd/timesyncd-manager.c
index 6a4b52af69..9b10081961 100644
--- a/src/systemd-timesyncd/timesyncd-manager.c
+++ b/src/systemd-timesyncd/timesyncd-manager.c
@@ -31,22 +31,23 @@
#include <systemd/sd-daemon.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "list.h"
-#include "log.h"
-#include "missing.h"
-#include "network-util.h"
-#include "ratelimit.h"
-#include "socket-util.h"
-#include "sparse-endian.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/list.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/ratelimit.h"
+#include "basic/socket-util.h"
+#include "basic/sparse-endian.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
+#include "sd-network/network-util.h"
+
#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
-#include "util.h"
#ifndef ADJ_SETOFFSET
#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
diff --git a/src/systemd-timesyncd/timesyncd-manager.h b/src/systemd-timesyncd/timesyncd-manager.h
index fd25647725..a70b187089 100644
--- a/src/systemd-timesyncd/timesyncd-manager.h
+++ b/src/systemd-timesyncd/timesyncd-manager.h
@@ -20,11 +20,11 @@
***/
#include <systemd/sd-event.h>
-#include <systemd/sd-network.h>
-#include <systemd/sd-resolve.h>
-#include "list.h"
-#include "ratelimit.h"
+#include "basic/list.h"
+#include "basic/ratelimit.h"
+#include "sd-network/sd-network.h"
+#include "sd-resolve/sd-resolve.h"
typedef struct Manager Manager;
diff --git a/src/systemd-timesyncd/timesyncd-server.c b/src/systemd-timesyncd/timesyncd-server.c
index 6bda86fe6e..42e5c8e429 100644
--- a/src/systemd-timesyncd/timesyncd-server.c
+++ b/src/systemd-timesyncd/timesyncd-server.c
@@ -17,7 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+
#include "timesyncd-server.h"
int server_address_new(
diff --git a/src/systemd-timesyncd/timesyncd-server.h b/src/systemd-timesyncd/timesyncd-server.h
index 8a19e41d67..438146c8f7 100644
--- a/src/systemd-timesyncd/timesyncd-server.h
+++ b/src/systemd-timesyncd/timesyncd-server.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
-#include "socket-util.h"
+#include "basic/list.h"
+#include "basic/socket-util.h"
typedef struct ServerAddress ServerAddress;
typedef struct ServerName ServerName;
diff --git a/src/systemd-timesyncd/timesyncd.c b/src/systemd-timesyncd/timesyncd.c
index 9e538a82f2..7a357c2296 100644
--- a/src/systemd-timesyncd/timesyncd.c
+++ b/src/systemd-timesyncd/timesyncd.c
@@ -20,15 +20,16 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "capability-util.h"
-#include "clock-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "network-util.h"
-#include "signal-util.h"
+#include "basic/capability-util.h"
+#include "basic/clock-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/signal-util.h"
+#include "basic/user-util.h"
+#include "sd-network/network-util.h"
+
#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
-#include "user-util.h"
static int load_clock_timestamp(uid_t uid, gid_t gid) {
_cleanup_close_ int fd = -1;
diff --git a/src/systemd-tty-ask-password-agent/Makefile b/src/systemd-tty-ask-password-agent/Makefile
new file mode 100644
index 0000000000..b5119b5066
--- /dev/null
+++ b/src/systemd-tty-ask-password-agent/Makefile
@@ -0,0 +1,33 @@
+# -*- 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
+
+rootbin_PROGRAMS += systemd-tty-ask-password-agent
+systemd_tty_ask_password_agent_SOURCES = \
+ src/tty-ask-password-agent/tty-ask-password-agent.c
+
+systemd_tty_ask_password_agent_LDADD = \
+ libshared.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-tty-ask-password-agent/tty-ask-password-agent.c b/src/systemd-tty-ask-password-agent/tty-ask-password-agent.c
index ee879c7b89..0db27e27cd 100644
--- a/src/systemd-tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/systemd-tty-ask-password-agent/tty-ask-password-agent.c
@@ -30,23 +30,23 @@
#include <sys/un.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "ask-password-api.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "process-util.h"
-#include "signal-util.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
-#include "util.h"
-#include "utmp-wtmp.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/process-util.h"
+#include "basic/signal-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "shared/ask-password-api.h"
+#include "shared/conf-parser.h"
+#include "shared/utmp-wtmp.h"
static enum {
ACTION_LIST,
diff --git a/src/test/Makefile b/src/test/Makefile
new file mode 100644
index 0000000000..f416b4aadf
--- /dev/null
+++ b/src/test/Makefile
@@ -0,0 +1,35 @@
+# -*- 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
+
+test_id128_SOURCES = \
+ src/test/test-id128.c
+
+test_id128_LDADD = \
+ libshared.la
+
+tests += \
+ test-id128
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/test/test-acl-util.c b/src/test/test-acl-util.c
index 430dda8e78..1417d596e4 100644
--- a/src/test/test-acl-util.c
+++ b/src/test/test-acl-util.c
@@ -22,11 +22,11 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "acl-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "string-util.h"
-#include "user-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "shared/acl-util.h"
static void test_add_acls_for_user(void) {
char fn[] = "/tmp/test-empty.XXXXXX";
diff --git a/src/test/test-af-list.c b/src/test/test-af-list.c
index aeaa0929b1..8139df55b3 100644
--- a/src/test/test-af-list.c
+++ b/src/test/test-af-list.c
@@ -20,9 +20,9 @@
#include <string.h>
#include <sys/socket.h>
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
diff --git a/src/test/test-alloc-util.c b/src/test/test-alloc-util.c
index cc4821eaf5..520951495d 100644
--- a/src/test/test-alloc-util.c
+++ b/src/test/test-alloc-util.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
static void test_alloca(void) {
static const uint8_t zero[997] = { };
diff --git a/src/test/test-architecture.c b/src/test/test-architecture.c
index f41e488d99..6373b798b0 100644
--- a/src/test/test-architecture.c
+++ b/src/test/test-architecture.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "architecture.h"
-#include "log.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/architecture.h"
+#include "basic/log.h"
+#include "basic/util.h"
+#include "basic/virt.h"
int main(int argc, char *argv[]) {
int a, v;
diff --git a/src/test/test-arphrd-list.c b/src/test/test-arphrd-list.c
index f3989ad201..3755a3e3d0 100644
--- a/src/test/test-arphrd-list.c
+++ b/src/test/test-arphrd-list.c
@@ -20,9 +20,9 @@
#include <net/if_arp.h>
#include <string.h>
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
diff --git a/src/test/test-ask-password-api.c b/src/test/test-ask-password-api.c
index 86666597c7..a93e821c7d 100644
--- a/src/test/test-ask-password-api.c
+++ b/src/test/test-ask-password-api.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "ask-password-api.h"
-#include "log.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "shared/ask-password-api.h"
static void ask_password(void) {
int r;
diff --git a/src/test/test-async.c b/src/test/test-async.c
index ada6d67c42..627768b392 100644
--- a/src/test/test-async.c
+++ b/src/test/test-async.c
@@ -19,10 +19,10 @@
#include <unistd.h>
-#include "async.h"
-#include "fileio.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/async.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/util.h"
static bool test_async = false;
diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c
index e6aa3b5cfe..1123f33f16 100644
--- a/src/test/test-barrier.c
+++ b/src/test/test-barrier.c
@@ -31,8 +31,8 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "barrier.h"
-#include "util.h"
+#include "basic/barrier.h"
+#include "basic/util.h"
/* 20ms to test deadlocks; All timings use multiples of this constant as
* alarm/sleep timers. If this timeout is too small for slow machines to perform
diff --git a/src/test/test-bitmap.c b/src/test/test-bitmap.c
index ff22117745..b18bcef9ae 100644
--- a/src/test/test-bitmap.c
+++ b/src/test/test-bitmap.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bitmap.h"
+#include "basic/bitmap.h"
int main(int argc, const char *argv[]) {
_cleanup_bitmap_free_ Bitmap *b = NULL, *b2 = NULL;
diff --git a/src/test/test-boot-timestamps.c b/src/test/test-boot-timestamps.c
index 8e68d6510d..022d101957 100644
--- a/src/test/test-boot-timestamps.c
+++ b/src/test/test-boot-timestamps.c
@@ -18,11 +18,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "acpi-fpdt.h"
-#include "boot-timestamps.h"
-#include "efivars.h"
-#include "log.h"
-#include "util.h"
+#include "basic/log.h"
+#include "basic/util.h"
+#include "shared/acpi-fpdt.h"
+#include "shared/boot-timestamps.h"
+#include "shared/efivars.h"
static int test_acpi_fpdt(void) {
usec_t loader_start;
diff --git a/src/test/test-btrfs.c b/src/test/test-btrfs.c
index ce29d88412..eb33a3937f 100644
--- a/src/test/test-btrfs.c
+++ b/src/test/test-btrfs.c
@@ -19,13 +19,13 @@
#include <fcntl.h>
-#include "btrfs-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "parse-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/btrfs-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
BtrfsQuotaInfo quota;
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index 5a8c6cbfb6..afa9b4e362 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -19,10 +19,10 @@
#include <string.h>
-#include "alloc-util.h"
-#include "calendarspec.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/calendarspec.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_one(const char *input, const char *output) {
CalendarSpec *c;
diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c
index 4132ec56fd..6af0a45b66 100644
--- a/src/test/test-cap-list.c
+++ b/src/test/test-cap-list.c
@@ -19,12 +19,12 @@
#include <sys/prctl.h>
-#include "alloc-util.h"
-#include "cap-list.h"
-#include "capability-util.h"
-#include "fileio.h"
-#include "parse-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/cap-list.h"
+#include "basic/capability-util.h"
+#include "basic/fileio.h"
+#include "basic/parse-util.h"
+#include "basic/util.h"
/* verify the capability parser */
static void test_cap_list(void) {
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
index 629bb63c81..07e52c2ba8 100644
--- a/src/test/test-capability.c
+++ b/src/test/test-capability.c
@@ -25,10 +25,10 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "capability-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/capability-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
static uid_t test_uid = -1;
static gid_t test_gid = -1;
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
index a027eb0fd2..6d889c98d2 100644
--- a/src/test/test-cgroup-mask.c
+++ b/src/test/test-cgroup-mask.c
@@ -19,13 +19,14 @@
#include <stdio.h>
-#include "macro.h"
+#include "basic/macro.h"
+#include "basic/rm-rf.h"
#include "manager.h"
-#include "rm-rf.h"
-#include "test-helper.h"
-#include "tests.h"
+#include "shared/tests.h"
#include "unit.h"
+#include "test-helper.h"
+
static int test_cgroup_mask(void) {
Manager *m = NULL;
Unit *son, *daughter, *parent, *root, *grandchild, *parent_deep;
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index 43f8906172..394839bc83 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -17,17 +17,18 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "cgroup-util.h"
-#include "dirent-util.h"
-#include "fd-util.h"
-#include "formats-util.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/cgroup-util.h"
+#include "basic/dirent-util.h"
+#include "basic/fd-util.h"
+#include "basic/formats-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+
#include "test-helper.h"
-#include "user-util.h"
-#include "util.h"
static void check_p_d_u(const char *path, int code, const char *result) {
_cleanup_free_ char *unit = NULL;
diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
index 72c32d9c8f..970b9a5f13 100644
--- a/src/test/test-cgroup.c
+++ b/src/test/test-cgroup.c
@@ -20,10 +20,10 @@
#include <string.h>
#include <unistd.h>
-#include "cgroup-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/cgroup-util.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
int main(int argc, char*argv[]) {
char *path;
diff --git a/src/test/test-clock.c b/src/test/test-clock.c
index 84f775e5bc..c6a8e7aa1c 100644
--- a/src/test/test-clock.c
+++ b/src/test/test-clock.c
@@ -17,14 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <fcntl.h>
+#include <unistd.h>
-#include "clock-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
+#include "basic/clock-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
static void test_clock_is_localtime(void) {
char adjtime[] = "/tmp/test-adjtime.XXXXXX";
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index c4ff41dd0e..00a86dedda 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -19,18 +19,18 @@
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "apparmor-util.h"
-#include "architecture.h"
-#include "audit-util.h"
-#include "condition.h"
-#include "hostname-util.h"
-#include "ima-util.h"
-#include "log.h"
-#include "macro.h"
-#include "selinux-util.h"
-#include "smack-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/audit-util.h"
+#include "basic/hostname-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/selinux-util.h"
+#include "basic/smack-util.h"
+#include "basic/util.h"
+#include "shared/apparmor-util.h"
+#include "shared/condition.h"
+#include "shared/ima-util.h"
static void test_condition_test_path(void) {
Condition *condition;
diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c
index 03b3a9fa5c..336e980e07 100644
--- a/src/test/test-conf-files.c
+++ b/src/test/test-conf-files.c
@@ -20,16 +20,16 @@
#include <stdarg.h>
#include <stdio.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "fs-util.h"
-#include "macro.h"
-#include "parse-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/parse-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
static void setup_test_dir(char *tmp_dir, const char *files, ...) {
va_list ap;
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index be5d2611f8..1536e7937d 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -17,12 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "conf-parser.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/conf-parser.h"
static void test_config_parse_path_one(const char *rvalue, const char *expected) {
char *path = NULL;
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index 68154fc4e8..cd9def191c 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -19,19 +19,19 @@
#include <unistd.h>
-#include "alloc-util.h"
-#include "copy.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/copy.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static void test_copy_file(void) {
_cleanup_free_ char *buf = NULL;
diff --git a/src/test/test-cpu-set-util.c b/src/test/test-cpu-set-util.c
index 8818d1ffb7..0558f323ea 100644
--- a/src/test/test-cpu-set-util.c
+++ b/src/test/test-cpu-set-util.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "cpu-set-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/cpu-set-util.h"
+#include "basic/macro.h"
static void test_parse_cpu_set(void) {
cpu_set_t *c = NULL;
diff --git a/src/test/test-daemon.c b/src/test/test-daemon.c
index b2cd3c7663..98988e1e31 100644
--- a/src/test/test-daemon.c
+++ b/src/test/test-daemon.c
@@ -21,7 +21,7 @@
#include <systemd/sd-daemon.h>
-#include "strv.h"
+#include "basic/strv.h"
int main(int argc, char*argv[]) {
_cleanup_strv_free_ char **l = NULL;
diff --git a/src/test/test-date.c b/src/test/test-date.c
index 7f497bb7d5..a7a2e9087c 100644
--- a/src/test/test-date.c
+++ b/src/test/test-date.c
@@ -19,9 +19,9 @@
#include <string.h>
-#include "alloc-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_should_pass(const char *p) {
usec_t t, q;
diff --git a/src/test/test-device-nodes.c b/src/test/test-device-nodes.c
index af75b38948..2310fbb9c3 100644
--- a/src/test/test-device-nodes.c
+++ b/src/test/test-device-nodes.c
@@ -19,10 +19,10 @@
#include <sys/types.h>
-#include "alloc-util.h"
-#include "device-nodes.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/device-nodes.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
/* helpers for test_encode_devnode_name */
static char *do_encode_string(const char *in) {
diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c
index a9d09f59bc..930bd5dd62 100644
--- a/src/test/test-dns-domain.c
+++ b/src/test/test-dns-domain.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "shared/dns-domain.h"
static void test_dns_label_unescape_one(const char *what, const char *expect, size_t buffer_sz, int ret) {
char buffer[buffer_sz];
diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c
index d4f09b08a5..45e95fe597 100644
--- a/src/test/test-ellipsize.c
+++ b/src/test/test-ellipsize.c
@@ -19,11 +19,11 @@
#include <stdio.h>
-#include "alloc-util.h"
-#include "def.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
static void test_one(const char *p) {
_cleanup_free_ char *t;
diff --git a/src/test/test-engine.c b/src/test/test-engine.c
index 23da10fa1a..9d21bb5723 100644
--- a/src/test/test-engine.c
+++ b/src/test/test-engine.c
@@ -21,11 +21,12 @@
#include <stdio.h>
#include <string.h>
-#include "bus-util.h"
+#include "basic/rm-rf.h"
#include "manager.h"
-#include "rm-rf.h"
+#include "shared/bus-util.h"
+#include "shared/tests.h"
+
#include "test-helper.h"
-#include "tests.h"
int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
diff --git a/src/test/test-env-util.c b/src/test/test-env-util.c
index 35bb62906e..30d99fcd51 100644
--- a/src/test/test-env-util.c
+++ b/src/test/test-env-util.c
@@ -20,10 +20,10 @@
#include <string.h>
-#include "env-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/env-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static void test_strv_env_delete(void) {
_cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL, **d = NULL;
diff --git a/src/test/test-escape.c b/src/test/test-escape.c
index 6cbb8443fe..874647541c 100644
--- a/src/test/test-escape.c
+++ b/src/test/test-escape.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "escape.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/macro.h"
static void test_cescape(void) {
_cleanup_free_ char *escaped;
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 77ef4e8b2a..7cd63168c8 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -23,16 +23,17 @@
#include <sys/prctl.h>
#include <sys/types.h>
-#include "fileio.h"
-#include "fs-util.h"
-#include "macro.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/util.h"
#include "manager.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "test-helper.h"
#include "unit.h"
-#include "util.h"
+
+#include "test-helper.h"
typedef void (*test_function_t)(Manager *m);
diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c
index 7a23fa7b7b..3d6548b7c7 100644
--- a/src/test/test-extract-word.c
+++ b/src/test/test-extract-word.c
@@ -21,9 +21,9 @@
#include <stdlib.h>
#include <string.h>
-#include "extract-word.h"
-#include "log.h"
-#include "string-util.h"
+#include "basic/extract-word.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
static void test_extract_first_word(void) {
const char *p, *original;
diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c
index 421d3bdeb3..f6c1f302c1 100644
--- a/src/test/test-fd-util.c
+++ b/src/test/test-fd-util.c
@@ -20,10 +20,10 @@
#include <fcntl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
static void test_close_many(void) {
int fds[3];
diff --git a/src/test/test-fdset.c b/src/test/test-fdset.c
index 282aab1246..9ad122f628 100644
--- a/src/test/test-fdset.c
+++ b/src/test/test-fdset.c
@@ -20,11 +20,11 @@
#include <fcntl.h>
#include <unistd.h>
-#include "fd-util.h"
-#include "fdset.h"
-#include "fileio.h"
-#include "macro.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/fdset.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/util.h"
static void test_fdset_new_fill(void) {
int fd = -1;
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index 79609765e0..f5a99d668d 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -17,22 +17,22 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <ctype.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "ctype.h"
-#include "def.h"
-#include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "io-util.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/env-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/io-util.h"
+#include "basic/parse-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static void test_parse_env_file(void) {
char t[] = "/tmp/test-fileio-in-XXXXXX",
diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c
index 77e809c5bf..28ab25dd78 100644
--- a/src/test/test-firewall-util.c
+++ b/src/test/test-firewall-util.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
#include "firewall-util.h"
-#include "log.h"
#define MAKE_IN_ADDR_UNION(a,b,c,d) (union in_addr_union) { .in.s_addr = htobe32((uint32_t) (a) << 24 | (uint32_t) (b) << 16 | (uint32_t) (c) << 8 | (uint32_t) (d))}
diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c
index 6db2c2b6f1..7002eb841a 100644
--- a/src/test/test-fs-util.c
+++ b/src/test/test-fs-util.c
@@ -19,16 +19,16 @@
#include <unistd.h>
-#include "alloc-util.h"
-#include "fileio.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "macro.h"
-#include "mkdir.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static void test_unlink_noerrno(void) {
char name[] = "/tmp/test-close_nointr.XXXXXX";
diff --git a/src/test/test-fstab-util.c b/src/test/test-fstab-util.c
index 63a4b8c243..181ff230e0 100644
--- a/src/test/test-fstab-util.c
+++ b/src/test/test-fstab-util.c
@@ -17,11 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fstab-util.h"
-#include "log.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/fstab-util.h"
/*
int fstab_filter_options(const char *opts, const char *names,
diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
index 227d4290f0..fd6dde113a 100644
--- a/src/test/test-glob-util.c
+++ b/src/test/test-glob-util.c
@@ -20,10 +20,10 @@
#include <fcntl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fileio.h"
-#include "glob-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/glob-util.h"
+#include "basic/macro.h"
static void test_glob_exists(void) {
char name[] = "/tmp/test-glob_exists.XXXXXX";
diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c
index 1bd5c02f87..bbb24d885e 100644
--- a/src/test/test-hashmap-plain.c
+++ b/src/test/test-hashmap-plain.c
@@ -17,11 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "hashmap.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/hashmap.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
void test_hashmap_funcs(void);
diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c
index 83cea360e6..c927d99079 100644
--- a/src/test/test-hashmap.c
+++ b/src/test/test-hashmap.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
-#include "util.h"
+#include "basic/hashmap.h"
+#include "basic/util.h"
void test_hashmap_funcs(void);
void test_ordered_hashmap_funcs(void);
diff --git a/src/test/test-helper.h b/src/test/test-helper.h
index 01068da347..0b1acde587 100644
--- a/src/test/test-helper.h
+++ b/src/test/test-helper.h
@@ -21,7 +21,7 @@
#include <systemd/sd-daemon.h>
-#include "macro.h"
+#include "basic/macro.h"
#define TEST_REQ_RUNNING_SYSTEMD(x) \
if (sd_booted() > 0) { \
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
index 276f25d091..f56035d84a 100644
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "hexdecoct.h"
-#include "macro.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
static void test_hexchar(void) {
assert_se(hexchar(0xa) == 'a');
diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c
index 17fde9f27e..a8e598c58e 100644
--- a/src/test/test-hostname-util.c
+++ b/src/test/test-hostname-util.c
@@ -19,11 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_hostname_is_valid(void) {
assert_se(hostname_is_valid("foobar", false));
diff --git a/src/test/test-hostname.c b/src/test/test-hostname.c
index b38507df5d..7408d51725 100644
--- a/src/test/test-hostname.c
+++ b/src/test/test-hostname.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/util.h"
#include "hostname-setup.h"
-#include "util.h"
int main(int argc, char* argv[]) {
int r;
diff --git a/src/test/test-id128.c b/src/test/test-id128.c
index 90c4860e2a..aa41068530 100644
--- a/src/test/test-id128.c
+++ b/src/test/test-id128.c
@@ -22,10 +22,10 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-id128.h>
-#include "alloc-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#define ID128_WALDI SD_ID128_MAKE(01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10)
#define STR_WALDI "0102030405060708090a0b0c0d0e0f10"
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
index 4b9a74fca4..c0d696dcdc 100644
--- a/src/test/test-install-root.c
+++ b/src/test/test-install-root.c
@@ -17,12 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "fileio.h"
-#include "install.h"
-#include "mkdir.h"
-#include "rm-rf.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/mkdir.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "shared/install.h"
static void test_basic_mask_and_enable(const char *root) {
const char *p;
diff --git a/src/test/test-install.c b/src/test/test-install.c
index 0ac85f040a..784bcfdd5f 100644
--- a/src/test/test-install.c
+++ b/src/test/test-install.c
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
-#include "install.h"
+#include "shared/install.h"
static void dump_changes(UnitFileChange *c, unsigned n) {
unsigned i;
diff --git a/src/test/test-io-util.c b/src/test/test-io-util.c
index 10bd3833bc..496b58eb95 100644
--- a/src/test/test-io-util.c
+++ b/src/test/test-io-util.c
@@ -21,10 +21,10 @@
#include <stdlib.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/macro.h"
static void test_sparse_write_one(int fd, const char *buffer, size_t n) {
char check[n];
diff --git a/src/test/test-ipcrm.c b/src/test/test-ipcrm.c
index c5bcaf47bb..a37aa4a10d 100644
--- a/src/test/test-ipcrm.c
+++ b/src/test/test-ipcrm.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "clean-ipc.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/clean-ipc.h"
int main(int argc, char *argv[]) {
uid_t uid;
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index e28de9b37b..83c8b81690 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -22,14 +22,14 @@
#include <sys/epoll.h>
#include <unistd.h>
-#include "libudev.h"
-
-#include "fd-util.h"
-#include "log.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "udev-util.h"
-#include "util.h"
+#include <libudev.h>
+
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "shared/udev-util.h"
static void print_device(struct udev_device *device) {
const char *str;
diff --git a/src/test/test-list.c b/src/test/test-list.c
index 160064d06a..ec32684d78 100644
--- a/src/test/test-list.c
+++ b/src/test/test-list.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
-#include "util.h"
+#include "basic/list.h"
+#include "basic/util.h"
int main(int argc, const char *argv[]) {
size_t i;
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 427c698d1d..702134ca46 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -18,9 +18,9 @@
***/
-#include "locale-util.h"
-#include "macro.h"
-#include "strv.h"
+#include "basic/locale-util.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
static void test_get_locales(void) {
_cleanup_strv_free_ char **locales = NULL;
diff --git a/src/test/test-log.c b/src/test/test-log.c
index 55a2f9d23b..7a5f78a3d6 100644
--- a/src/test/test-log.c
+++ b/src/test/test-log.c
@@ -20,9 +20,9 @@
#include <stddef.h>
#include <unistd.h>
-#include "formats-util.h"
-#include "log.h"
-#include "util.h"
+#include "basic/formats-util.h"
+#include "basic/log.h"
+#include "basic/util.h"
int main(int argc, char* argv[]) {
diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c
index 7b67337331..479f74862f 100644
--- a/src/test/test-loopback.c
+++ b/src/test/test-loopback.c
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
-#include "log.h"
+#include "basic/log.h"
#include "loopback-setup.h"
int main(int argc, char* argv[]) {
diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c
index ff9f35cecd..d877c61756 100644
--- a/src/test/test-namespace.c
+++ b/src/test/test-namespace.c
@@ -19,12 +19,12 @@
#include <sys/socket.h>
-#include "alloc-util.h"
-#include "fd-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
#include "namespace.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "util.h"
static void test_tmpdir(const char *id, const char *A, const char *B) {
_cleanup_free_ char *a, *b;
diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c
index 57e244eb79..49b659b3a9 100644
--- a/src/test/test-netlink-manual.c
+++ b/src/test/test-netlink-manual.c
@@ -19,14 +19,14 @@
#include <arpa/inet.h>
#include <libkmod.h>
-#include <linux/ip.h>
#include <net/if.h>
-#include <linux/if_tunnel.h>
-#include <systemd/sd-netlink.h>
+#include <linux/ip.h>
+#include <linux/if_tunnel.h>
-#include "macro.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/util.h"
+#include "sd-netlink/sd-netlink.h"
static int load_module(const char *mod_name) {
struct kmod_ctx *ctx;
diff --git a/src/test/test-ns.c b/src/test/test-ns.c
index 9248f2987c..43cbbb69b0 100644
--- a/src/test/test-ns.c
+++ b/src/test/test-ns.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include "log.h"
+#include "basic/log.h"
#include "namespace.h"
int main(int argc, char *argv[]) {
diff --git a/src/test/test-nss.c b/src/test/test-nss.c
index 55af592287..876e978d22 100644
--- a/src/test/test-nss.c
+++ b/src/test/test-nss.c
@@ -18,22 +18,22 @@
***/
#include <dlfcn.h>
-#include <stdlib.h>
#include <net/if.h>
+#include <stdlib.h>
-#include "log.h"
-#include "nss-util.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "alloc-util.h"
-#include "in-addr-util.h"
-#include "hexdecoct.h"
-#include "af-list.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "errno-list.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/errno-list.h"
+#include "basic/hexdecoct.h"
+#include "basic/hostname-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/log.h"
+#include "basic/nss-util.h"
+#include "basic/path-util.h"
+#include "basic/stdio-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "sd-netlink/local-addresses.h"
static const char* nss_status_to_string(enum nss_status status, char *buf, size_t buf_len) {
switch (status) {
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
index 7d8677e17c..423bf8a78c 100644
--- a/src/test/test-parse-util.c
+++ b/src/test/test-parse-util.c
@@ -21,8 +21,8 @@
#include <locale.h>
#include <math.h>
-#include "log.h"
-#include "parse-util.h"
+#include "basic/log.h"
+#include "basic/parse-util.h"
static void test_parse_boolean(void) {
assert_se(parse_boolean("1") == 1);
diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c
index 096326d176..6c6315bf2d 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -20,11 +20,11 @@
#include <stdlib.h>
#include <sys/stat.h>
-#include "log.h"
-#include "path-lookup.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/log.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/path-lookup.h"
static void test_paths(UnitFileScope scope) {
char template[] = "/tmp/test-path-lookup.XXXXXXX";
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index b53324b5e6..8dbac28d7b 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -21,15 +21,15 @@
#include <sys/mount.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "macro.h"
-#include "mount-util.h"
-#include "path-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/macro.h"
+#include "basic/mount-util.h"
+#include "basic/path-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
#define test_path_compare(a, b, result) { \
assert_se(path_compare(a, b) == result); \
diff --git a/src/test/test-path.c b/src/test/test-path.c
index 62181e22a0..1cd09c89d8 100644
--- a/src/test/test-path.c
+++ b/src/test/test-path.c
@@ -20,19 +20,20 @@
#include <stdbool.h>
#include <stdio.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/mkdir.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
#include "manager.h"
-#include "mkdir.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "test-helper.h"
-#include "tests.h"
+#include "shared/tests.h"
#include "unit.h"
-#include "util.h"
+
+#include "test-helper.h"
typedef void (*test_function_t)(Manager *m);
diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c
index d81880a655..c0917d2187 100644
--- a/src/test/test-prioq.c
+++ b/src/test/test-prioq.c
@@ -19,11 +19,11 @@
#include <stdlib.h>
-#include "alloc-util.h"
-#include "prioq.h"
-#include "set.h"
-#include "siphash24.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/prioq.h"
+#include "basic/set.h"
+#include "basic/siphash24.h"
+#include "basic/util.h"
#define SET_SIZE 1024*4
diff --git a/src/test/test-proc-cmdline.c b/src/test/test-proc-cmdline.c
index a7a8f621a2..e85c6bbf7d 100644
--- a/src/test/test-proc-cmdline.c
+++ b/src/test/test-proc-cmdline.c
@@ -17,12 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "log.h"
-#include "macro.h"
-#include "proc-cmdline.h"
-#include "special.h"
-#include "string-util.h"
+#include "basic/alloc-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/proc-cmdline.h"
+#include "basic/special.h"
+#include "basic/string-util.h"
static int parse_item(const char *key, const char *value) {
assert_se(key);
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index 4616314200..6a0a5b46c2 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -24,15 +24,15 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "architecture.h"
-#include "log.h"
-#include "macro.h"
-#include "process-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
-#include "virt.h"
+#include "basic/alloc-util.h"
+#include "basic/architecture.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/process-util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+#include "basic/virt.h"
static void test_get_process_comm(void) {
struct stat st;
diff --git a/src/test/test-ratelimit.c b/src/test/test-ratelimit.c
index 990b834c79..76bd254694 100644
--- a/src/test/test-ratelimit.c
+++ b/src/test/test-ratelimit.c
@@ -19,9 +19,9 @@
#include <unistd.h>
-#include "macro.h"
-#include "ratelimit.h"
-#include "time-util.h"
+#include "basic/macro.h"
+#include "basic/ratelimit.h"
+#include "basic/time-util.h"
static void test_ratelimit_test(void) {
int i;
diff --git a/src/test/test-replace-var.c b/src/test/test-replace-var.c
index 297effce79..5dce1d81d7 100644
--- a/src/test/test-replace-var.c
+++ b/src/test/test-replace-var.c
@@ -19,10 +19,10 @@
#include <string.h>
-#include "macro.h"
-#include "replace-var.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/macro.h"
+#include "basic/replace-var.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static char *lookup(const char *variable, void *userdata) {
return strjoin("<<<", variable, ">>>", NULL);
diff --git a/src/test/test-rlimit-util.c b/src/test/test-rlimit-util.c
index 62afd2de5e..7a3ed8354d 100644
--- a/src/test/test-rlimit-util.c
+++ b/src/test/test-rlimit-util.c
@@ -17,12 +17,12 @@
#include <sys/resource.h>
-#include "alloc-util.h"
-#include "capability-util.h"
-#include "macro.h"
-#include "rlimit-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/capability-util.h"
+#include "basic/macro.h"
+#include "basic/rlimit-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_rlimit_parse_format(int resource, const char *string, rlim_t soft, rlim_t hard, int ret, const char *formatted) {
_cleanup_free_ char *f = NULL;
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c
index c068f5c39e..a0f46ad1c9 100644
--- a/src/test/test-sched-prio.c
+++ b/src/test/test-sched-prio.c
@@ -19,11 +19,12 @@
#include <sched.h>
-#include "macro.h"
+#include "basic/macro.h"
+#include "basic/rm-rf.h"
#include "manager.h"
-#include "rm-rf.h"
+#include "shared/tests.h"
+
#include "test-helper.h"
-#include "tests.h"
int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
diff --git a/src/test/test-selinux.c b/src/test/test-selinux.c
index 7545ad3764..326c24e6c4 100644
--- a/src/test/test-selinux.c
+++ b/src/test/test-selinux.c
@@ -19,13 +19,13 @@
#include <sys/stat.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "selinux-util.h"
-#include "string-util.h"
-#include "time-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/log.h"
+#include "basic/selinux-util.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "basic/util.h"
static void test_testing(void) {
bool b;
diff --git a/src/test/test-set.c b/src/test/test-set.c
index 0ee5ddcc9f..59f3366b44 100644
--- a/src/test/test-set.c
+++ b/src/test/test-set.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "set.h"
+#include "basic/set.h"
static void test_set_steal_first(void) {
_cleanup_set_free_ Set *m = NULL;
diff --git a/src/test/test-sigbus.c b/src/test/test-sigbus.c
index 17b81747be..ecbb0f87ea 100644
--- a/src/test/test-sigbus.c
+++ b/src/test/test-sigbus.c
@@ -19,9 +19,9 @@
#include <sys/mman.h>
-#include "fd-util.h"
-#include "sigbus.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/sigbus.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
_cleanup_close_ int fd = -1;
diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c
index 671eb869cb..74e34394ab 100644
--- a/src/test/test-signal-util.c
+++ b/src/test/test-signal-util.c
@@ -20,8 +20,8 @@
#include <signal.h>
#include <unistd.h>
-#include "macro.h"
-#include "signal-util.h"
+#include "basic/macro.h"
+#include "basic/signal-util.h"
static void test_block_signals(void) {
sigset_t ss;
diff --git a/src/test/test-siphash24.c b/src/test/test-siphash24.c
index b74b7ad2dd..2c40776dd0 100644
--- a/src/test/test-siphash24.c
+++ b/src/test/test-siphash24.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "siphash24.h"
-#include "util.h"
+#include "basic/siphash24.h"
+#include "basic/util.h"
#define ITERATIONS 10000000ULL
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index 8f99a13772..6869846e98 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "log.h"
-#include "time-util.h"
+#include "basic/log.h"
+#include "basic/time-util.h"
/* Print information about various types. Useful when diagnosing
* gcc diagnostics on an unfamiliar architecture. */
diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c
index 97b6f3015d..b8ddc53ed0 100644
--- a/src/test/test-sleep.c
+++ b/src/test/test-sleep.c
@@ -19,10 +19,10 @@
#include <stdio.h>
-#include "log.h"
-#include "sleep-config.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/log.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/sleep-config.h"
static void test_sleep(void) {
_cleanup_strv_free_ char
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index b480fdaa9c..c7b5384ab8 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -17,15 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "async.h"
-#include "fd-util.h"
-#include "in-addr-util.h"
-#include "log.h"
-#include "macro.h"
-#include "socket-util.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/async.h"
+#include "basic/fd-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/socket-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_ifname_valid(void) {
assert(ifname_valid("foo"));
diff --git a/src/test/test-stat-util.c b/src/test/test-stat-util.c
index a10227f823..941a38b1fb 100644
--- a/src/test/test-stat-util.c
+++ b/src/test/test-stat-util.c
@@ -20,11 +20,11 @@
#include <fcntl.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "macro.h"
-#include "stat-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/stat-util.h"
static void test_files_same(void) {
_cleanup_close_ int fd = -1;
diff --git a/src/test/test-strbuf.c b/src/test/test-strbuf.c
index 513218c397..74b5c03f7b 100644
--- a/src/test/test-strbuf.c
+++ b/src/test/test-strbuf.c
@@ -20,10 +20,10 @@
#include <stdlib.h>
#include <string.h>
-#include "strbuf.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/strbuf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
static ssize_t add_string(struct strbuf *sb, const char *s) {
return strbuf_add_string(sb, s, strlen(s));
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c
index d0f84d70bc..7f867a2ced 100644
--- a/src/test/test-string-util.c
+++ b/src/test/test-string-util.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "strv.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
static void test_string_erase(void) {
char *x;
diff --git a/src/test/test-strip-tab-ansi.c b/src/test/test-strip-tab-ansi.c
index 72b0f6fc11..a9569e527b 100644
--- a/src/test/test-strip-tab-ansi.c
+++ b/src/test/test-strip-tab-ansi.c
@@ -19,9 +19,9 @@
#include <stdio.h>
-#include "string-util.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/string-util.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
int main(int argc, char *argv[]) {
char *p;
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index fc01dcfaf1..3ecca8cfee 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -20,11 +20,11 @@
#include <string.h>
-#include "alloc-util.h"
-#include "specifier.h"
-#include "string-util.h"
-#include "strv.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/util.h"
+#include "shared/specifier.h"
static void test_specifier_printf(void) {
static const Specifier table[] = {
diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c
index 9bea770131..b5c6d5f191 100644
--- a/src/test/test-strxcpyx.c
+++ b/src/test/test-strxcpyx.c
@@ -19,9 +19,9 @@
#include <string.h>
-#include "string-util.h"
-#include "strxcpyx.h"
-#include "util.h"
+#include "basic/string-util.h"
+#include "basic/strxcpyx.h"
+#include "basic/util.h"
static void test_strpcpy(void) {
char target[25];
diff --git a/src/test/test-tables.c b/src/test/test-tables.c
index 0be74921fc..51ac9632f8 100644
--- a/src/test/test-tables.c
+++ b/src/test/test-tables.c
@@ -17,37 +17,37 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "architecture.h"
#include "automount.h"
+#include "basic/architecture.h"
+#include "basic/locale-util.h"
+#include "basic/log.h"
+#include "basic/rlimit-util.h"
+#include "basic/socket-util.h"
+#include "basic/unit-name.h"
+#include "basic/util.h"
#include "busname.h"
#include "cgroup.h"
-#include "compress.h"
-#include "condition.h"
#include "device.h"
#include "execute.h"
-#include "install.h"
#include "job.h"
#include "journald-server.h"
#include "kill.h"
#include "link-config.h"
-#include "locale-util.h"
-#include "log.h"
-#include "logs-show.h"
#include "mount.h"
#include "path.h"
-#include "rlimit-util.h"
#include "scope.h"
+#include "sd-journal/compress.h"
#include "service.h"
+#include "shared/condition.h"
+#include "shared/install.h"
+#include "shared/logs-show.h"
+#include "shared/test-tables.h"
#include "slice.h"
-#include "socket-util.h"
#include "socket.h"
#include "swap.h"
#include "target.h"
-#include "test-tables.h"
#include "timer.h"
-#include "unit-name.h"
#include "unit.h"
-#include "util.h"
int main(int argc, char **argv) {
test_table(architecture, ARCHITECTURE);
diff --git a/src/test/test-terminal-util.c b/src/test/test-terminal-util.c
index 84b448a095..bcdc048196 100644
--- a/src/test/test-terminal-util.c
+++ b/src/test/test-terminal-util.c
@@ -21,12 +21,12 @@
#include <stdbool.h>
#include <stdio.h>
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "macro.h"
-#include "terminal-util.h"
-#include "util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
static void test_default_term_for_tty(void) {
puts(default_term_for_tty("/dev/tty23"));
diff --git a/src/test/test-time.c b/src/test/test-time.c
index ee7d55c5ab..d6ff1f958f 100644
--- a/src/test/test-time.c
+++ b/src/test/test-time.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "strv.h"
-#include "time-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
static void test_parse_sec(void) {
usec_t u;
diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c
index b34ebeefb2..df262e0b92 100644
--- a/src/test/test-tmpfiles.c
+++ b/src/test/test-tmpfiles.c
@@ -22,14 +22,14 @@
#include <stdlib.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "formats-util.h"
-#include "fs-util.h"
-#include "log.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/formats-util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
int main(int argc, char** argv) {
_cleanup_free_ char *cmd = NULL, *cmd2 = NULL, *ans = NULL, *ans2 = NULL, *d = NULL, *tmp = NULL, *line = NULL;
diff --git a/src/test/test-udev.c b/src/test/test-udev.c
index e965b4494a..1f6dc878c8 100644
--- a/src/test/test-udev.c
+++ b/src/test/test-udev.c
@@ -26,13 +26,13 @@
#include <sys/signalfd.h>
#include <unistd.h>
-#include "fs-util.h"
-#include "log.h"
-#include "missing.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "udev-util.h"
+#include "basic/fs-util.h"
+#include "basic/log.h"
+#include "basic/missing.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "shared/udev-util.h"
#include "udev.h"
static int fake_filesystems(void) {
diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c
index 41f06a5cec..bb79ae6c3e 100644
--- a/src/test/test-uid-range.c
+++ b/src/test/test-uid-range.c
@@ -19,10 +19,10 @@
#include <stddef.h>
-#include "alloc-util.h"
-#include "uid-range.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
+#include "shared/uid-range.h"
int main(int argc, char *argv[]) {
_cleanup_free_ UidRange *p = NULL;
diff --git a/src/test/test-unaligned.c b/src/test/test-unaligned.c
index b18b3fca0e..82151638d2 100644
--- a/src/test/test-unaligned.c
+++ b/src/test/test-unaligned.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sparse-endian.h"
-#include "unaligned.h"
-#include "util.h"
+#include "basic/sparse-endian.h"
+#include "basic/unaligned.h"
+#include "basic/util.h"
static uint8_t data[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index ade0ff2a63..ba21dbcc83 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -25,24 +25,25 @@
#include <sys/capability.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "capability-util.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hashmap.h"
-#include "hostname-util.h"
-#include "install-printf.h"
-#include "install.h"
+#include "basic/alloc-util.h"
+#include "basic/capability-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hashmap.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
#include "load-fragment.h"
-#include "macro.h"
-#include "rm-rf.h"
-#include "specifier.h"
-#include "string-util.h"
-#include "strv.h"
+#include "shared/install-printf.h"
+#include "shared/install.h"
+#include "shared/specifier.h"
+#include "shared/tests.h"
+
#include "test-helper.h"
-#include "tests.h"
-#include "user-util.h"
-#include "util.h"
static int test_unit_file_get_set(void) {
int r;
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 2fd83f321c..e17355eac1 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -24,20 +24,21 @@
#include <stdlib.h>
#include <string.h>
-#include "alloc-util.h"
-#include "glob-util.h"
-#include "hostname-util.h"
-#include "macro.h"
+#include "basic/alloc-util.h"
+#include "basic/glob-util.h"
+#include "basic/hostname-util.h"
+#include "basic/macro.h"
+#include "basic/path-util.h"
+#include "basic/string-util.h"
+#include "basic/unit-name.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
#include "manager.h"
-#include "path-util.h"
-#include "specifier.h"
-#include "string-util.h"
-#include "test-helper.h"
-#include "unit-name.h"
+#include "shared/specifier.h"
#include "unit-printf.h"
#include "unit.h"
-#include "user-util.h"
-#include "util.h"
+
+#include "test-helper.h"
static void test_unit_name_is_valid(void) {
assert_se(unit_name_is_valid("foo.service", UNIT_NAME_ANY));
diff --git a/src/test/test-user-util.c b/src/test/test-user-util.c
index 8d1ec19f17..8460396b2c 100644
--- a/src/test/test-user-util.c
+++ b/src/test/test-user-util.c
@@ -17,11 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "user-util.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/user-util.h"
+#include "basic/util.h"
static void test_uid_to_name_one(uid_t uid, const char *name) {
_cleanup_free_ char *t = NULL;
diff --git a/src/test/test-utf8.c b/src/test/test-utf8.c
index 1ce5a5a24d..e6cfdac8ed 100644
--- a/src/test/test-utf8.c
+++ b/src/test/test-utf8.c
@@ -17,10 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "string-util.h"
-#include "utf8.h"
-#include "util.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
static void test_utf8_is_printable(void) {
assert_se(utf8_is_printable("ascii is valid\tunicode", 22));
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 05cb1eae76..13f6b2f953 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -23,12 +23,12 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "def.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "rm-rf.h"
-#include "string-util.h"
-#include "util.h"
+#include "basic/def.h"
+#include "basic/fileio.h"
+#include "basic/fs-util.h"
+#include "basic/rm-rf.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
static void test_align_power2(void) {
unsigned long i, p2;
diff --git a/src/test/test-verbs.c b/src/test/test-verbs.c
index 0fcdd9e78d..01a0ded37b 100644
--- a/src/test/test-verbs.c
+++ b/src/test/test-verbs.c
@@ -17,9 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
-#include "strv.h"
-#include "verbs.h"
+#include "basic/macro.h"
+#include "basic/strv.h"
+#include "basic/verbs.h"
static int noop_dispatcher(int argc, char *argv[], void *userdata) {
return 0;
diff --git a/src/test/test-watchdog.c b/src/test/test-watchdog.c
index e3c19647fc..64814fc174 100644
--- a/src/test/test-watchdog.c
+++ b/src/test/test-watchdog.c
@@ -19,8 +19,8 @@
#include <unistd.h>
-#include "log.h"
-#include "watchdog.h"
+#include "basic/log.h"
+#include "shared/watchdog.h"
int main(int argc, char *argv[]) {
usec_t t = 10 * USEC_PER_SEC;
diff --git a/src/test/test-web-util.c b/src/test/test-web-util.c
index 79a3a13af6..4907a5544c 100644
--- a/src/test/test-web-util.c
+++ b/src/test/test-web-util.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
-#include "web-util.h"
+#include "basic/macro.h"
+#include "basic/web-util.h"
static void test_is_valid_documentation_url(void) {
assert_se(documentation_url_is_valid("http://www.freedesktop.org/wiki/Software/systemd"));
diff --git a/src/test/test-xattr-util.c b/src/test/test-xattr-util.c
index 267f29426c..1a78e54d3c 100644
--- a/src/test/test-xattr-util.c
+++ b/src/test/test-xattr-util.c
@@ -23,12 +23,12 @@
#include <sys/xattr.h>
#include <unistd.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
-#include "macro.h"
-#include "string-util.h"
-#include "xattr-util.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fs-util.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/xattr-util.h"
static void test_fgetxattrat_fake(void) {
char t[] = "/var/tmp/xattrtestXXXXXX";
diff --git a/src/test/test-xml.c b/src/test/test-xml.c
index b0b72fa78a..22e92b2075 100644
--- a/src/test/test-xml.c
+++ b/src/test/test-xml.c
@@ -19,10 +19,10 @@
#include <stdarg.h>
-#include "alloc-util.h"
-#include "string-util.h"
-#include "util.h"
-#include "xml.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "basic/xml.h"
static void test_one(const char *data, ...) {
void *state = NULL;