chiark / gitweb /
machine-id-setup: simplifications
[elogind.git] / Makefile.am
index 89f3af8..3539e03 100644 (file)
@@ -46,9 +46,9 @@ LIBGUDEV_CURRENT=2
 LIBGUDEV_REVISION=0
 LIBGUDEV_AGE=2
 
-LIBSYSTEMD_CURRENT=5
-LIBSYSTEMD_REVISION=1
-LIBSYSTEMD_AGE=5
+LIBSYSTEMD_CURRENT=6
+LIBSYSTEMD_REVISION=0
+LIBSYSTEMD_AGE=6
 
 # The following four libraries only exist for compatibility reasons,
 # their version info should not be bumped anymore
@@ -74,7 +74,6 @@ dbussessionservicedir=@dbussessionservicedir@
 dbussystemservicedir=@dbussystemservicedir@
 pamlibdir=@pamlibdir@
 pamconfdir=@pamconfdir@
-pkgconfigdatadir=$(datadir)/pkgconfig
 pkgconfiglibdir=$(libdir)/pkgconfig
 polkitpolicydir=$(datadir)/polkit-1/actions
 bashcompletiondir=@bashcompletiondir@
@@ -85,6 +84,7 @@ sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
 varlogdir=$(localstatedir)/log
 systemdstatedir=$(localstatedir)/lib/systemd
 catalogstatedir=$(systemdstatedir)/catalog
+xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
 
 # Our own, non-special dirs
 pkgsysconfdir=$(sysconfdir)/systemd
@@ -111,14 +111,13 @@ catalogdir=$(prefix)/lib/systemd/catalog
 kernelinstalldir = $(prefix)/lib/kernel/install.d
 factory_etcdir = $(prefix)/share/factory/etc
 factory_pamdir = $(prefix)/share/factory/etc/pam.d
+bootlibdir = $(prefix)/lib/systemd/boot/efi
 
 # And these are the special ones for /
 rootprefix=@rootprefix@
 rootbindir=$(rootprefix)/bin
 rootlibexecdir=$(rootprefix)/lib/systemd
 
-CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES =
 EXTRA_DIST =
 BUILT_SOURCES =
 INSTALL_EXEC_HOOKS =
@@ -144,10 +143,13 @@ dist_pkgdata_DATA =
 dist_dbuspolicy_DATA =
 dist_dbussystemservice_DATA =
 dist_systemunit_DATA_busnames =
+dist_sysusers_DATA =
 check_PROGRAMS =
 check_DATA =
 tests=
 manual_tests =
+TEST_EXTENSIONS = .py
+PY_LOG_COMPILER = $(PYTHON)
 if ENABLE_TESTS
 noinst_PROGRAMS = $(manual_tests) $(tests)
 TESTS = $(tests)
@@ -157,6 +159,15 @@ TESTS =
 endif
 udevlibexec_PROGRAMS =
 
+in_files = $(filter %.in,$(EXTRA_DIST))
+in_in_files = $(filter %.in.in, $(in_files))
+m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
+
+CLEANFILES = $(BUILT_SOURCES) \
+       $(pkgconfiglib_DATA) \
+       $(in_files:.in=) $(in_in_files:.in.in=) \
+       $(m4_files:.m4=)
+
 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
        $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
        $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
@@ -188,6 +199,7 @@ AM_CPPFLAGS = \
        -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
        -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
        -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
+       -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \
        -DX_SERVER=\"$(bindir)/X\" \
        -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
        -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
@@ -195,6 +207,7 @@ AM_CPPFLAGS = \
        -DKEXEC=\"$(KEXEC)\" \
        -DLIBDIR=\"$(libdir)\" \
        -DROOTLIBDIR=\"$(rootlibdir)\" \
+       -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
        -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
        -I $(top_srcdir)/src \
        -I $(top_builddir)/src/shared \
@@ -238,14 +251,11 @@ endef
 
 INSTALL_DIRS =
 
-RUNLEVEL1_TARGET_WANTS =
-RUNLEVEL2_TARGET_WANTS =
-RUNLEVEL3_TARGET_WANTS =
-RUNLEVEL4_TARGET_WANTS =
-RUNLEVEL5_TARGET_WANTS =
 SHUTDOWN_TARGET_WANTS =
 LOCAL_FS_TARGET_WANTS =
 MULTI_USER_TARGET_WANTS =
+GRAPHICAL_TARGET_WANTS =
+RESCUE_TARGET_WANTS =
 SYSINIT_TARGET_WANTS =
 SOCKETS_TARGET_WANTS =
 BUSNAMES_TARGET_WANTS =
@@ -259,14 +269,11 @@ USER_UNIT_ALIASES =
 GENERAL_ALIASES =
 
 install-target-wants-hook:
-       what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && dir=$(systemunitdir) && $(add-wants)
-       what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && dir=$(systemunitdir) && $(add-wants)
-       what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && dir=$(systemunitdir) && $(add-wants)
-       what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && dir=$(systemunitdir) && $(add-wants)
-       what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && dir=$(systemunitdir) && $(add-wants)
        what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
        what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
        what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
+       what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
+       what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
        what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
        what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
        what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
@@ -368,6 +375,7 @@ bin_PROGRAMS = \
        systemd-delta \
        systemd-analyze \
        systemd-run \
+       systemd-stdio-bridge \
        systemd-path
 
 dist_bin_SCRIPTS = \
@@ -386,6 +394,7 @@ rootlibexec_PROGRAMS = \
        systemd-remount-fs \
        systemd-reply-password \
        systemd-fsck \
+       systemd-fsckd \
        systemd-machine-id-commit \
        systemd-ac-power \
        systemd-sysctl \
@@ -488,6 +497,7 @@ dist_systemunit_DATA = \
        units/slices.target \
        units/system.slice \
        units/x-.slice \
+       units/systemd-fsckd.socket \
        units/systemd-initctl.socket \
        units/systemd-shutdownd.socket \
        units/syslog.socket \
@@ -497,6 +507,7 @@ dist_systemunit_DATA = \
        units/sys-kernel-debug.mount \
        units/sys-fs-fuse-connections.mount \
        units/tmp.mount \
+       units/var-lib-machines.mount \
        units/printer.target \
        units/sound.target \
        units/bluetooth.target \
@@ -506,7 +517,8 @@ dist_systemunit_DATA = \
        units/systemd-udevd-control.socket \
        units/systemd-udevd-kernel.socket \
        units/system-update.target \
-       units/initrd-switch-root.target
+       units/initrd-switch-root.target \
+       units/machines.target
 
 if ENABLE_KDBUS
 dist_systemunit_DATA += \
@@ -538,6 +550,7 @@ nodist_systemunit_DATA = \
        units/systemd-kexec.service \
        units/systemd-fsck@.service \
        units/systemd-fsck-root.service \
+       units/systemd-fsckd.service \
        units/systemd-machine-id-commit.service \
        units/systemd-udevd.service \
        units/systemd-udev-trigger.service \
@@ -591,6 +604,7 @@ EXTRA_DIST += \
        units/user/systemd-exit.service.in \
        units/systemd-fsck@.service.in \
        units/systemd-fsck-root.service.in \
+       units/systemd-fsckd.service.in \
        units/systemd-machine-id-commit.service.in \
        units/user@.service.m4.in \
        units/debug-shell.service.in \
@@ -603,12 +617,6 @@ EXTRA_DIST += \
        units/systemd-nspawn@.service.in \
        units/systemd-update-done.service.in
 
-CLEANFILES += \
-       units/console-shell.service.m4 \
-       units/console-getty.service.m4 \
-       units/container-getty@.service.m4 \
-       units/user@.service.m4
-
 if HAVE_SYSV_COMPAT
 nodist_systemunit_DATA += \
        units/rc-local.service \
@@ -768,6 +776,8 @@ libsystemd_shared_la_SOURCES = \
        src/shared/architecture.h \
        src/shared/efivars.c \
        src/shared/efivars.h \
+       src/shared/fstab-util.c \
+       src/shared/fstab-util.h \
        src/shared/path-util.c \
        src/shared/path-util.h \
        src/shared/time-util.c \
@@ -885,8 +895,6 @@ libsystemd_shared_la_SOURCES = \
        src/shared/pty.h \
        src/shared/async.c \
        src/shared/async.h \
-       src/shared/copy.c \
-       src/shared/copy.h \
        src/shared/base-filesystem.c \
        src/shared/base-filesystem.h \
        src/shared/memfd-util.c \
@@ -894,11 +902,13 @@ libsystemd_shared_la_SOURCES = \
        src/shared/uid-range.c \
        src/shared/uid-range.h \
        src/shared/nss-util.h \
-       src/shared/btrfs-util.c \
-       src/shared/btrfs-util.h \
        src/shared/verbs.c \
        src/shared/verbs.h \
-       src/shared/build.h
+       src/shared/sigbus.c \
+       src/shared/sigbus.h \
+       src/shared/build.h \
+       src/shared/import-util.c \
+       src/shared/import-util.h
 
 if HAVE_UTMP
 libsystemd_shared_la_SOURCES += \
@@ -922,7 +932,8 @@ libsystemd_shared_la_CFLAGS = \
        -pthread
 
 libsystemd_shared_la_LIBADD = \
-       $(CAP_LIBS)
+       $(CAP_LIBS) \
+       -lm
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -962,7 +973,16 @@ libsystemd_label_la_SOURCES = \
        src/shared/condition.c \
        src/shared/condition.h \
        src/shared/generator.h \
-       src/shared/generator.c
+       src/shared/generator.c \
+       src/shared/btrfs-util.c \
+       src/shared/btrfs-util.h \
+       src/shared/btrfs-ctree.h \
+       src/shared/machine-image.c \
+       src/shared/machine-image.h \
+       src/shared/machine-pool.c \
+       src/shared/machine-pool.h \
+       src/shared/copy.c \
+       src/shared/copy.h
 
 libsystemd_label_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -973,6 +993,24 @@ libsystemd_label_la_LIBADD = \
 
 # -----------------------------------------------------------------------------
 
+if HAVE_LIBIPTC
+noinst_LTLIBRARIES += \
+       libsystemd-fw.la
+
+libsystemd_fw_la_SOURCES = \
+       src/shared/fw-util.h \
+       src/shared/fw-util.c
+
+libsystemd_fw_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(LIBIPTC_CFLAGS)
+
+libsystemd_fw_la_LIBADD = \
+       $(LIBIPTC_LIBS)
+endif
+
+# -----------------------------------------------------------------------------
+
 if ENABLE_LDCONFIG
 dist_systemunit_DATA += \
        units/ldconfig.service
@@ -1186,35 +1224,34 @@ src/core/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 ";" }' < $< > $@
 
-EXTRA_DIST += \
+gperf_gperf_m4_sources = \
        src/core/load-fragment-gperf.gperf.m4
 
-CLEANFILES += \
-       src/core/load-fragment-gperf.gperf \
-       src/core/load-fragment-gperf.c \
-       src/core/load-fragment-gperf-nulstr.c \
+gperf_txt_sources = \
        src/shared/errno-list.txt \
-       src/shared/errno-from-name.gperf \
        src/shared/af-list.txt \
-       src/shared/af-from-name.gperf \
        src/shared/arphrd-list.txt \
-       src/shared/arphrd-from-name.gperf \
-       src/shared/cap-list.txt \
-       src/shared/cap-from-name.gperf \
-       src/resolve/dns_type-list.txt \
-       src/resolve/dns_type-from-name.gperf
+       src/shared/cap-list.txt
 
 BUILT_SOURCES += \
-       src/shared/errno-from-name.h \
-       src/shared/errno-to-name.h \
-       src/shared/af-from-name.h \
-       src/shared/af-to-name.h \
-       src/shared/arphrd-from-name.h \
-       src/shared/arphrd-to-name.h \
-       src/shared/cap-from-name.h \
-       src/shared/cap-to-name.h \
-       src/resolve/dns_type-from-name.h \
-       src/resolve/dns_type-to-name.h
+       $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
+       $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf-nulstr.c) \
+       $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
+       $(gperf_txt_sources:-list.txt=-from-name.h) \
+       $(gperf_txt_sources:-list.txt=-to-name.h)
+
+CLEANFILES += \
+       $(gperf_txt_sources:-list.txt=-from-name.gperf)
+DISTCLEANFILES = \
+       $(gperf_txt_sources)
+
+EXTRA_DIST += \
+       $(gperf_gperf_m4_sources) \
+       $(gperf_gperf_sources) \
+       $(gperf_txt_sources:-list.txt=-from-name.gperf)
+
+CLEANFILES += \
+       $(gperf_txt_sources)
 
 %-from-name.gperf: %-list.txt
        $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
@@ -1299,7 +1336,7 @@ dist_dbussystemservice_DATA += \
 polkitpolicy_in_in_files += \
        src/core/org.freedesktop.systemd1.policy.in.in
 
-pkgconfigdata_DATA = \
+pkgconfiglib_DATA += \
        src/core/systemd.pc
 
 nodist_rpmmacros_DATA = \
@@ -1309,10 +1346,6 @@ EXTRA_DIST += \
        src/core/systemd.pc.in \
        src/core/macros.systemd.in
 
-CLEANFILES += \
-       src/core/macros.systemd \
-       src/core/org.freedesktop.systemd1.policy.in
-
 # ------------------------------------------------------------------------------
 
 manual_tests += \
@@ -1327,6 +1360,11 @@ manual_tests += \
        test-ipcrm \
        test-btrfs
 
+if HAVE_LIBIPTC
+manual_tests += \
+       test-fw-util
+endif
+
 if HAVE_KMOD
 manual_tests += \
        test-rtnl-manual
@@ -1347,6 +1385,7 @@ tests += \
        test-utf8 \
        test-ellipsize \
        test-util \
+       test-path-lookup \
        test-ring \
        test-barrier \
        test-pty \
@@ -1359,6 +1398,7 @@ tests += \
        test-calendarspec \
        test-strip-tab-ansi \
        test-cgroup-util \
+       test-fstab-util \
        test-prioq \
        test-fileio \
        test-time \
@@ -1383,7 +1423,9 @@ tests += \
        test-locale-util \
        test-execute \
        test-copy \
-       test-cap-list
+       test-cap-list \
+       test-sigbus \
+       test-verbs
 
 EXTRA_DIST += \
        test/a.service \
@@ -1392,7 +1434,7 @@ EXTRA_DIST += \
        test/c.service \
        test/daughter.service \
        test/d.service \
-       test/end.service \
+       test/end.service.in \
        test/e.service \
        test/f.service \
        test/grandchild.service \
@@ -1575,6 +1617,13 @@ test_copy_SOURCES = \
        src/test/test-copy.c
 
 test_copy_LDADD = \
+       libsystemd-label.la \
+       libsystemd-shared.la
+
+test_sigbus_SOURCES = \
+       src/test/test-sigbus.c
+
+test_sigbus_LDADD = \
        libsystemd-shared.la
 
 test_condition_SOURCES = \
@@ -1592,6 +1641,12 @@ test_fdset_LDADD = \
        libsystemd-shared.la \
        libsystemd-internal.la
 
+test_fstab_util_SOURCES = \
+       src/test/test-fstab-util.c
+
+test_fstab_util_LDADD = \
+       libsystemd-shared.la
+
 test_ratelimit_SOURCES = \
        src/test/test-ratelimit.c
 
@@ -1602,7 +1657,14 @@ test_util_SOURCES = \
        src/test/test-util.c
 
 test_util_LDADD = \
+       libsystemd-shared.la
+
+test_path_lookup_SOURCES = \
+       src/test/test-path-lookup.c
+
+test_path_lookup_LDADD = \
        -lm \
+       libsystemd-units.la \
        libsystemd-shared.la
 
 test_uid_range_SOURCES = \
@@ -1650,12 +1712,15 @@ test_tmpfiles_LDADD = \
 test_namespace_SOURCES = \
        src/test/test-namespace.c
 
+test_verbs_SOURCES = \
+       src/test/test-verbs.c
+
+test_verbs_LDADD = \
+       libsystemd-shared.la
+
 test_namespace_LDADD = \
        libsystemd-core.la
 
-CLEANFILES += \
-       src/test/test-hashmap-ordered.c
-
 BUILT_SOURCES += \
        src/test/test-hashmap-ordered.c
 
@@ -1694,8 +1759,7 @@ test_json_SOURCES = \
        src/test/test-json.c
 
 test_json_LDADD = \
-       libsystemd-shared.la \
-       -lm
+       libsystemd-shared.la
 
 test_list_SOURCES = \
        src/test/test-list.c
@@ -1774,8 +1838,23 @@ test_btrfs_SOURCES = \
        src/test/test-btrfs.c
 
 test_btrfs_LDADD = \
+       libsystemd-label.la \
        libsystemd-shared.la
 
+if HAVE_LIBIPTC
+test_fw_util_SOURCES = \
+       src/test/test-fw-util.c
+
+test_fw_util_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(LIBIPTC_CFLAGS)
+
+test_fw_util_LDADD = \
+       libsystemd-fw.la \
+       libsystemd-shared.la \
+       $(LIBIPTC_LIBS)
+endif
+
 test_rtnl_manual_SOURCES = \
        src/test/test-rtnl-manual.c
 
@@ -1947,11 +2026,10 @@ test_conf_files_LDADD = \
        libsystemd-shared.la
 
 test_bus_policy_SOURCES = \
-       src/bus-proxyd/test-bus-xml-policy.c \
-       src/bus-proxyd/bus-xml-policy.c \
-       src/bus-proxyd/bus-xml-policy.h
+       src/bus-proxyd/test-bus-xml-policy.c
 
 test_bus_policy_LDADD = \
+       libsystemd-proxy.la \
        libsystemd-internal.la \
        libsystemd-shared.la
 
@@ -2113,6 +2191,11 @@ systemd_tmpfiles_LDADD = \
        libsystemd-internal.la \
        libsystemd-shared.la
 
+if HAVE_ACL
+systemd_tmpfiles_LDADD += \
+       libsystemd-acl.la
+endif
+
 rootbin_PROGRAMS += \
        systemd-tmpfiles
 
@@ -2125,10 +2208,10 @@ nodist_systemunit_DATA += \
        units/systemd-tmpfiles-clean.service
 
 nodist_tmpfiles_DATA = \
+       tmpfiles.d/systemd.conf \
        tmpfiles.d/etc.conf
 
 dist_tmpfiles_DATA = \
-       tmpfiles.d/systemd.conf \
        tmpfiles.d/systemd-nologin.conf \
        tmpfiles.d/tmp.conf \
        tmpfiles.d/x11.conf \
@@ -2155,14 +2238,12 @@ INSTALL_DIRS += \
 endif
 
 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
 
-CLEANFILES += \
-       tmpfiles.d/etc.conf
-
 # ------------------------------------------------------------------------------
 if ENABLE_SYSUSERS
 systemd_sysusers_SOURCES = \
@@ -2183,19 +2264,15 @@ nodist_systemunit_DATA += \
 SYSINIT_TARGET_WANTS += \
        systemd-sysusers.service
 
-dist_sysusers_DATA = \
-       sysusers.d/systemd.conf
-
 nodist_sysusers_DATA = \
+       sysusers.d/systemd.conf \
        sysusers.d/basic.conf
 
 EXTRA_DIST += \
        units/systemd-sysusers.service.in \
+       sysusers.d/systemd.conf.m4 \
        sysusers.d/basic.conf.in
 
-CLEANFILES += \
-       sysusers.d/basic.conf
-
 INSTALL_DIRS += \
        $(sysusersdir)
 endif
@@ -2270,6 +2347,19 @@ systemd_fsck_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
+systemd_fsckd_SOURCES = \
+       src/fsckd/fsckd.c \
+       src/fsckd/fsckd.h \
+       $(NULL)
+
+systemd_fsckd_LDADD = \
+       libsystemd-internal.la \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       libudev-internal.la \
+       $(NULL)
+
+# ------------------------------------------------------------------------------
 systemd_machine_id_commit_SOURCES = \
        src/machine-id-commit/machine-id-commit.c \
        src/core/machine-id-setup.c \
@@ -2391,16 +2481,23 @@ systemd_efi_boot_generator_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
+if HAVE_BLKID
 bootctl_SOURCES = \
-       src/boot/boot.h \
-       src/boot/boot-loader.h \
-       src/boot/bootctl.c \
-       src/boot/boot-loader.c \
-       src/boot/boot-efi.c
+       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 = \
        libsystemd-shared.la \
-       libsystemd-internal.la
+       libsystemd-internal.la \
+       $(BLKID_LIBS)
 
 bin_PROGRAMS += \
        bootctl
@@ -2410,7 +2507,136 @@ dist_bashcompletion_DATA += \
 
 dist_zshcompletion_DATA += \
        shell-completion/zsh/_bootctl
+endif
 
+# ------------------------------------------------------------------------------
+if 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 \
+       -mno-sse \
+       -mno-mmx
+
+if ARCH_X86_64
+efi_cflags += \
+       -mno-red-zone \
+       -DEFI_FUNCTION_WRAPPER \
+       -DGNU_EFI_USE_MS_ABI
+endif
+
+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
+
+# ------------------------------------------------------------------------------
+systemd_boot_headers = \
+       src/boot/efi/util.h \
+       src/boot/efi/console.h \
+       src/boot/efi/graphics.h \
+       src/boot/efi/pefile.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/boot.c
+
+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
+
+bootlib_DATA = $(systemd_boot)
+CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
+EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
+
+$(top_builddir)/src/boot/efi/%.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 \
+         --target=efi-app-$(EFI_ARCH) $< $@
+
+# ------------------------------------------------------------------------------
+stub_headers = \
+       src/boot/efi/util.h \
+       src/boot/efi/pefile.h \
+       src/boot/efi/graphics.h \
+       src/boot/efi/splash.h \
+       src/boot/efi/linux.h
+
+stub_sources = \
+       src/boot/efi/util.c \
+       src/boot/efi/pefile.c \
+       src/boot/efi/graphics.c \
+       src/boot/efi/splash.c \
+       src/boot/efi/linux.c \
+       src/boot/efi/stub.c
+
+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
+
+bootlib_DATA += $(stub)
+CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
+EXTRA_DIST += $(stub_sources) $(stub_headers)
+
+$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
+       @$(MKDIR_P) $(top_builddir)/src/boot/efi/
+       $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+
+$(stub_solib): $(stub_objects)
+       $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
+               -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
+       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 \
+         --target=efi-app-$(EFI_ARCH) $< $@
+
+# ------------------------------------------------------------------------------
+CLEANFILES += test-efi-disk.img
+EXTRA_DIST += test/test-efi-create-disk.sh
+
+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
+endif
 endif
 
 # ------------------------------------------------------------------------------
@@ -2455,6 +2681,9 @@ dbus1-generator-install-hook:
 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
 endif
@@ -2585,6 +2814,11 @@ systemd_nspawn_LDADD += \
        $(SECCOMP_LIBS)
 endif
 
+if HAVE_LIBIPTC
+systemd_nspawn_LDADD += \
+       libsystemd-fw.la
+endif
+
 # ------------------------------------------------------------------------------
 systemd_run_SOURCES = \
        src/run/run.c
@@ -2595,46 +2829,64 @@ systemd_run_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
-systemd_bus_proxyd_SOURCES = \
-       src/bus-proxyd/bus-proxyd.c \
+noinst_LTLIBRARIES += \
+       libsystemd-proxy.la
+
+libsystemd_proxy_la_SOURCES = \
        src/bus-proxyd/bus-xml-policy.c \
-       src/bus-proxyd/bus-xml-policy.h
+       src/bus-proxyd/bus-xml-policy.h \
+       src/bus-proxyd/driver.c \
+       src/bus-proxyd/driver.h \
+       src/bus-proxyd/proxy.c \
+       src/bus-proxyd/proxy.h \
+       src/bus-proxyd/synthesize.c \
+       src/bus-proxyd/synthesize.h
+
+libsystemd_proxy_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       -pthread
 
-systemd_bus_proxyd_LDADD = \
+libsystemd_proxy_la_LIBADD = \
        libsystemd-internal.la \
        libsystemd-shared.la
 
-bus-proxyd-install-hook:
-       $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
-       $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
-       $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
+systemd_bus_proxyd_SOURCES = \
+       src/bus-proxyd/bus-proxyd.c
 
-bus-proxyd-uninstall-hook:
-       rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
+systemd_bus_proxyd_CFLAGS = \
+       $(AM_CFLAGS) \
+       -pthread
+
+systemd_bus_proxyd_LDADD = \
+       libsystemd-proxy.la \
+       libsystemd-internal.la \
+       libsystemd-shared.la
 
-INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
-UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
+systemd_stdio_bridge_SOURCES = \
+       src/bus-proxyd/stdio-bridge.c
+
+systemd_stdio_bridge_LDADD = \
+       libsystemd-proxy.la \
+       libsystemd-internal.la \
+       libsystemd-shared.la
 
 if ENABLE_KDBUS
 nodist_systemunit_DATA += \
-       units/systemd-bus-proxyd@.service
+       units/systemd-bus-proxyd.service
 
 dist_systemunit_DATA += \
        units/systemd-bus-proxyd.socket
 
 nodist_userunit_DATA += \
-       units/user/systemd-bus-proxyd@.service
+       units/user/systemd-bus-proxyd.service
 
 dist_userunit_DATA += \
        units/user/systemd-bus-proxyd.socket
 endif
 
 EXTRA_DIST += \
-       units/systemd-bus-proxyd@.service.m4.in \
-       units/user/systemd-bus-proxyd@.service.in
-
-CLEANFILES += \
-       units/systemd-bus-proxyd@.service.m4
+       units/systemd-bus-proxyd.service.m4.in \
+       units/user/systemd-bus-proxyd.service.in
 
 if HAVE_SMACK
 bus-proxyd-set-cap-hook:
@@ -2769,9 +3021,6 @@ EXTRA_DIST += \
        src/libsystemd/sd-bus/DIFFERENCES \
        src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
 
-CLEANFILES += \
-       src/libsystemd/libsystemd.sym
-
 BUILT_SOURCES += \
        src/libsystemd/libsystemd.sym
 
@@ -3054,6 +3303,7 @@ libsystemd_network_la_SOURCES = \
        src/systemd/sd-dhcp6-client.h \
        src/systemd/sd-dhcp6-lease.h \
        src/systemd/sd-pppoe.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 \
@@ -3079,6 +3329,8 @@ libsystemd_network_la_SOURCES = \
        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.h \
        src/libsystemd-network/lldp-tlv.h \
        src/libsystemd-network/lldp-tlv.c \
@@ -3089,7 +3341,6 @@ libsystemd_network_la_SOURCES = \
        src/libsystemd-network/lldp-internal.h \
        src/libsystemd-network/lldp-internal.c \
        src/libsystemd-network/lldp-util.h \
-       src/libsystemd-network/sd-lldp.h \
        src/libsystemd-network/sd-lldp.c
 
 libsystemd_network_la_LIBADD = \
@@ -3152,7 +3403,9 @@ test_icmp6_rs_SOURCES = \
        src/systemd/sd-dhcp6-client.h \
        src/systemd/sd-icmp6-nd.h \
        src/libsystemd-network/dhcp6-internal.h \
-       src/libsystemd-network/test-icmp6-rs.c
+       src/libsystemd-network/test-icmp6-rs.c \
+       src/libsystemd-network/dhcp-identifier.h \
+       src/libsystemd-network/dhcp-identifier.c
 
 test_icmp6_rs_LDADD = \
        libsystemd-network.la \
@@ -3162,7 +3415,9 @@ test_icmp6_rs_LDADD = \
 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/test-dhcp6-client.c \
+       src/libsystemd-network/dhcp-identifier.h \
+       src/libsystemd-network/dhcp-identifier.c
 
 test_dhcp6_client_LDADD = \
        libsystemd-network.la \
@@ -3206,7 +3461,7 @@ noinst_PROGRAMS += \
        systemd-subterm
 
 dist_pkgdata_DATA += \
-       src/libsystemd-terminal/unifont-glyph-array.bin
+       src/libsystemd-terminal/unifont-glyph-array.bin
 
 nodist_userunit_DATA += \
        units/user/systemd-consoled.service
@@ -3334,12 +3589,8 @@ test_unifont_LDADD = \
        libsystemd-internal.la \
        libsystemd-shared.la
 
-.PHONY: update-unifont
-update-unifont: tools/compile-unifont.py
-       $(AM_V_GEN)$(PYTHON) $< \
-               <$(top_srcdir)/src/libsystemd-terminal/unifont.hex \
-               >$(top_srcdir)/src/libsystemd-terminal/unifont-glyph-array.bin
-       @echo "unifont-glyph-array.bin has been regenerated"
+src/libsystemd-terminal/unifont-glyph-array.bin: tools/compile-unifont.py $(UNIFONT)
+       $(AM_V_GEN)$(PYTHON) $< <$(UNIFONT) >$@
 
 # ------------------------------------------------------------------------------
 if ENABLE_GTK_DOC
@@ -3389,7 +3640,6 @@ EXTRA_DIST += \
        src/libudev/libudev.pc.in
 
 CLEANFILES += \
-       src/libudev/libudev.pc \
        docs/html/libudev \
        docs/html/gudev
 
@@ -3437,13 +3687,14 @@ dist_udevrules_DATA += \
        rules/50-udev-default.rules \
        rules/60-drm.rules \
        rules/60-keyboard.rules \
-       rules/70-mouse.rules \
        rules/60-persistent-storage-tape.rules \
        rules/60-persistent-serial.rules \
        rules/60-persistent-input.rules \
        rules/60-persistent-alsa.rules \
        rules/60-persistent-storage.rules \
        rules/64-btrfs.rules \
+       rules/70-mouse.rules \
+       rules/70-touchpad.rules \
        rules/75-net-description.rules \
        rules/75-tty-description.rules \
        rules/78-sound-card.rules \
@@ -3465,20 +3716,11 @@ EXTRA_DIST += \
        rules/99-systemd.rules.in \
        src/udev/udev.pc.in
 
-CLEANFILES += \
-       rules/99-systemd.rules \
-       src/udev/udev.pc
-
 EXTRA_DIST += \
        units/systemd-udevd.service.in \
        units/systemd-udev-trigger.service.in \
        units/systemd-udev-settle.service.in
 
-CLEANFILES += \
-       units/systemd-udevd.service \
-       units/systemd-udev-trigger.service \
-       units/systemd-udev-settle.service
-
 SOCKETS_TARGET_WANTS += \
        systemd-udevd-control.socket \
        systemd-udevd-kernel.socket
@@ -3496,19 +3738,22 @@ rootlibexec_PROGRAMS += \
 noinst_LTLIBRARIES += \
        libudev-core.la
 
-src/udev/keyboard-keys.txt:
+src/udev/keyboard-keys-list.txt:
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
 
-src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
+src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
        $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
 
 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
        $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
 
-src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
+src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys-list.txt
        $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
 
+gperf_txt_sources += \
+       src/udev/keyboard-keys-list.txt
+
 libudev_core_la_SOURCES = \
        src/udev/udev.h \
        src/udev/udev-event.c \
@@ -3535,15 +3780,7 @@ nodist_libudev_core_la_SOURCES = \
        src/udev/keyboard-keys-to-name.h \
        src/udev/net/link-config-gperf.c
 
-BUILT_SOURCES += \
-       $(nodist_libudev_core_la_SOURCES)
-
-CLEANFILES += \
-       src/udev/keyboard-keys-from-name.gperf \
-       src/udev/keyboard-keys.txt \
-       src/udev/net/link-config-gperf.c
-
-EXTRA_DIST += \
+gperf_gperf_sources = \
        src/udev/net/link-config-gperf.gperf
 
 libudev_core_la_CFLAGS = \
@@ -3635,14 +3872,12 @@ dist_udevhwdb_DATA = \
        hwdb/20-OUI.hwdb \
        hwdb/20-net-ifname.hwdb \
        hwdb/60-keyboard.hwdb \
-       hwdb/70-mouse.hwdb
+       hwdb/70-mouse.hwdb \
+       hwdb/70-touchpad.hwdb
 
 EXTRA_DIST += \
        units/systemd-hwdb-update.service.in
 
-CLEANFILES += \
-       units/systemd-hwdb-update.service
-
 SYSINIT_TARGET_WANTS += \
        systemd-hwdb-update.service
 
@@ -3661,7 +3896,19 @@ endif
 # ------------------------------------------------------------------------------
 TESTS += \
        test/udev-test.pl \
-       test/rules-test.sh
+       $(NULL)
+
+if HAVE_PYTHON
+TESTS += \
+       test/rule-syntax-check.py \
+       $(NULL)
+
+if HAVE_SYSV_COMPAT
+TESTS += \
+       test/sysv-generator-test.py \
+       $(NULL)
+endif
+endif
 
 manual_tests += \
        test-libudev \
@@ -3705,8 +3952,10 @@ DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
 EXTRA_DIST += \
        test/sys.tar.xz \
        test/udev-test.pl \
-       test/rules-test.sh \
-       test/rule-syntax-check.py
+       test/rule-syntax-check.py \
+       test/sysv-generator-test.py \
+       $(NULL)
+
 
 # ------------------------------------------------------------------------------
 ata_id_SOURCES = \
@@ -3766,7 +4015,8 @@ v4l_id_SOURCES = \
        src/udev/v4l_id/v4l_id.c
 
 v4l_id_LDADD = \
-       libudev-internal.la
+       libudev-internal.la \
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        v4l_id
@@ -3779,7 +4029,7 @@ accelerometer_SOURCES = \
        src/udev/accelerometer/accelerometer.c
 
 accelerometer_LDADD = \
-       libudev-internal.la -lm \
+       libudev-internal.la \
        libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
@@ -3812,9 +4062,6 @@ lib_LTLIBRARIES += libgudev-1.0.la
 pkgconfiglib_DATA += \
        src/gudev/gudev-1.0.pc
 
-CLEANFILES += \
-       src/gudev/gudev-1.0.pc
-
 libgudev_1_0_la_SOURCES = \
        src/gudev/libgudev-1.0.sym \
        src/gudev/gudevenums.h \
@@ -4054,8 +4301,6 @@ nodist_pkgsysconf_DATA += \
 EXTRA_DIST += \
        src/journal-remote/journal-remote.conf.in
 
-CLEANFILES += \
-       src/journal-remote/journal-remote.conf
 endif
 
 if HAVE_LIBCURL
@@ -4088,9 +4333,6 @@ nodist_pkgsysconf_DATA += \
 
 EXTRA_DIST += \
        src/journal-remote/journal-upload.conf.in
-
-CLEANFILES += \
-       src/journal-remote/journal-upload.conf
 endif
 
 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
@@ -4326,16 +4568,15 @@ libsystemd_journal_internal_la_SOURCES = \
        src/journal/catalog.c \
        src/journal/catalog.h \
        src/journal/mmap-cache.c \
-       src/journal/mmap-cache.h
+       src/journal/mmap-cache.h \
+       src/journal/compress.c
 
 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
 libsystemd_journal_internal_la_CFLAGS = \
        $(AM_CFLAGS)
 
-libsystemd_journal_internal_la_LIBADD =
-
-libsystemd_journal_internal_la_SOURCES += \
-       src/journal/compress.c
+libsystemd_journal_internal_la_LIBADD = \
+       libsystemd-label.la
 
 if HAVE_XZ
 libsystemd_journal_internal_la_CFLAGS += \
@@ -4395,6 +4636,7 @@ dist_catalog_DATA = \
        catalog/systemd.fr.catalog \
        catalog/systemd.it.catalog \
        catalog/systemd.pl.catalog \
+       catalog/systemd.pt_BR.catalog \
        catalog/systemd.ru.catalog \
        catalog/systemd.catalog
 
@@ -4411,11 +4653,10 @@ SYSINIT_TARGET_WANTS += \
 EXTRA_DIST += \
        units/systemd-journald.service.in \
        units/systemd-journal-flush.service.in \
-       units/systemd-journal-catalog-update.service.in \
-       src/journal/journald-gperf.gperf
+       units/systemd-journal-catalog-update.service.in
 
-CLEANFILES += \
-       src/journal/journald-gperf.c
+gperf_gperf_sources += \
+       src/journal/journald-gperf.gperf
 
 # ------------------------------------------------------------------------------
 if HAVE_MICROHTTPD
@@ -4537,7 +4778,7 @@ dist_bashcompletion_DATA += \
 dist_zshcompletion_DATA += \
        shell-completion/zsh/_coredumpctl
 
-sysctl_DATA = \
+nodist_sysctl_DATA = \
        sysctl.d/50-coredump.conf
 
 CLEANFILES += \
@@ -4589,17 +4830,14 @@ systemd_vconsole_setup_LDADD = \
 rootlibexec_PROGRAMS += \
        systemd-vconsole-setup
 
-nodist_systemunit_DATA += \
-       units/systemd-vconsole-setup.service
-
 nodist_udevrules_DATA += \
        src/vconsole/90-vconsole.rules
 
+nodist_systemunit_DATA += \
+       units/systemd-vconsole-setup.service
+
 SYSINIT_TARGET_WANTS += \
        systemd-vconsole-setup.service
-
-CLEANFILES += \
-       src/vconsole/90-vconsole.rules
 endif
 
 EXTRA_DIST += \
@@ -4631,9 +4869,6 @@ nodist_systemunit_DATA += \
 
 EXTRA_DIST += \
        units/systemd-bootchart.service.in
-
-CLEANFILES += \
-       units/systemd-bootchart.service
 endif
 
 # ------------------------------------------------------------------------------
@@ -4862,10 +5097,8 @@ BUSNAMES_TARGET_WANTS += \
        org.freedesktop.locale1.busname
 
 dist_pkgdata_DATA += \
-       src/locale/kbd-model-map
-
-dist_noinst_SCRIPT = \
-       src/locale/generate-kbd-model-map
+       src/locale/kbd-model-map \
+       src/locale/language-fallback-map
 
 localectl_SOURCES = \
        src/locale/localectl.c
@@ -4964,19 +5197,15 @@ systemd_timesyncd_SOURCES = \
 nodist_systemd_timesyncd_SOURCES = \
        src/timesync/timesyncd-gperf.c
 
-EXTRA_DIST += \
+gperf_gperf_sources += \
        src/timesync/timesyncd-gperf.gperf
 
-CLEANFILES += \
-       src/timesync/timesyncd-gperf.c
-
 systemd_timesyncd_LDADD = \
        libsystemd-resolve.la \
        libsystemd-network.la \
        libsystemd-label.la \
        libsystemd-internal.la \
-       libsystemd-shared.la \
-       -lm
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-timesyncd
@@ -4995,9 +5224,6 @@ nodist_pkgsysconf_DATA += \
 
 EXTRA_DIST += \
        src/timesync/timesyncd.conf.in
-
-CLEANFILES += \
-       src/timesync/timesyncd.conf
 endif
 
 # ------------------------------------------------------------------------------
@@ -5038,11 +5264,11 @@ rootlibexec_PROGRAMS += \
 libsystemd_machine_core_la_SOURCES = \
        src/machine/machine.c \
        src/machine/machine.h \
-       src/machine/image.c \
-       src/machine/image.h \
        src/machine/machined-dbus.c \
        src/machine/machine-dbus.c \
-       src/machine/image-dbus.c
+       src/machine/machine-dbus.h \
+       src/machine/image-dbus.c \
+       src/machine/image-dbus.h
 
 libsystemd_machine_core_la_LIBADD = \
        libsystemd-label.la \
@@ -5058,6 +5284,8 @@ machinectl_SOURCES = \
 
 machinectl_LDADD = \
        libsystemd-internal.la \
+       libsystemd-logs.la \
+       libsystemd-journal-internal.la \
        libsystemd-shared.la
 
 rootbin_PROGRAMS += \
@@ -5129,31 +5357,181 @@ libnss_mymachines_la_LIBADD = \
 lib_LTLIBRARIES += \
        libnss_mymachines.la
 
+endif
+
+# ------------------------------------------------------------------------------
+if ENABLE_IMPORTD
+
 if HAVE_LIBCURL
+if HAVE_XZ
+if HAVE_ZLIB
+if HAVE_BZIP2
+if HAVE_GCRYPT
 
-bin_PROGRAMS += \
-       systemd-import
+rootlibexec_PROGRAMS += \
+       systemd-importd \
+       systemd-pull \
+       systemd-import \
+       systemd-export
 
-systemd_import_SOURCES = \
-       src/import/import.c \
-       src/import/import-gpt.c \
-       src/import/import-gpt.h \
-       src/import/import-dkr.c \
-       src/import/import-dkr.h \
+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 = \
+       libsystemd-internal.la \
+       libsystemd-label.la \
+       libsystemd-shared.la
+
+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-dkr.c \
+       src/import/pull-dkr.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/aufs-util.c \
-       src/import/aufs-util.h
+       src/import/aufs-util.h \
+       src/import/qcow2-util.c \
+       src/import/qcow2-util.h
+
+systemd_pull_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(LIBCURL_CFLAGS) \
+       $(XZ_CFLAGS) \
+       $(ZLIB_CFLAGS) \
+       $(GCRYPT_CFLAGS) \
+       -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \
+       -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
+
+systemd_pull_LDADD = \
+       libsystemd-internal.la \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       $(LIBCURL_LIBS) \
+       $(XZ_LIBS) \
+       $(ZLIB_LIBS) \
+       -lbz2 \
+       $(GCRYPT_LIBS)
+
+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) \
-       $(LIBCURL_CFLAGS)
+       $(XZ_CFLAGS) \
+       $(ZLIB_CFLAGS)
 
 systemd_import_LDADD = \
        libsystemd-internal.la \
+       libsystemd-label.la \
        libsystemd-shared.la \
-       $(LIBCURL_LIBS) \
-       -lm
+       $(XZ_LIBS) \
+       $(ZLIB_LIBS) \
+       -lbz2
+
+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)
+
+systemd_export_LDADD = \
+       libsystemd-internal.la \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       $(XZ_LIBS) \
+       $(ZLIB_LIBS) \
+       -lbz2
+
+dist_rootlibexec_DATA = \
+       src/import/import-pubring.gpg
+
+nodist_systemunit_DATA += \
+       units/systemd-importd.service
+
+EXTRA_DIST += \
+       units/systemd-importd.service.in
+
+dist_systemunit_DATA_busnames += \
+       units/org.freedesktop.import1.busname
+
+BUSNAMES_TARGET_WANTS += \
+       org.freedesktop.import1.busname
+
+SYSTEM_UNIT_ALIASES += \
+       systemd-importd.service dbus-org.freedesktop.import1.service
+
+dist_dbussystemservice_DATA += \
+       src/import/org.freedesktop.import1.service
+
+dist_dbuspolicy_DATA += \
+       src/import/org.freedesktop.import1.conf
+
+polkitpolicy_files += \
+       src/import/org.freedesktop.import1.policy
+
+polkitpolicy_in_files += \
+       src/import/org.freedesktop.import1.policy.in
+
+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 = \
+       libsystemd-internal.la \
+       libsystemd-label.la \
+       libsystemd-shared.la \
+       $(ZLIB_LIBS)
+
+endif
+endif
+endif
+endif
 endif
 
 endif
@@ -5203,19 +5581,17 @@ systemd_resolved_SOURCES = \
 nodist_systemd_resolved_SOURCES = \
        src/resolve/resolved-gperf.c
 
-EXTRA_DIST += \
-       src/resolve/resolved-gperf.gperf \
-       src/resolve/dns_type-from-name.gperf
+gperf_gperf_sources += \
+       src/resolve/resolved-gperf.gperf
 
-CLEANFILES += \
-       src/resolve/resolved-gperf.c
+gperf_txt_sources += \
+       src/resolve/dns_type-list.txt
 
 systemd_resolved_LDADD = \
        libsystemd-network.la \
        libsystemd-label.la \
        libsystemd-internal.la \
        libsystemd-shared.la \
-       -lm \
        $(LIBIDN_LIBS)
 
 rootlibexec_PROGRAMS += \
@@ -5251,9 +5627,6 @@ nodist_pkgsysconf_DATA += \
 EXTRA_DIST += \
        src/resolve/resolved.conf.in
 
-CLEANFILES += \
-       src/resolve/resolved.conf
-
 tests += \
        test-dns-domain
 
@@ -5283,8 +5656,8 @@ libnss_resolve_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym
 
 libnss_resolve_la_LIBADD = \
-       libsystemd-shared.la \
-       libsystemd-internal.la
+       libsystemd-internal.la \
+       libsystemd-shared.la
 
 lib_LTLIBRARIES += \
        libnss_resolve.la
@@ -5309,7 +5682,6 @@ systemd_resolve_host_SOURCES = \
 systemd_resolve_host_LDADD = \
        libsystemd-internal.la \
        libsystemd-shared.la \
-       -lm \
        $(LIBIDN_LIBS)
 
 rootlibexec_PROGRAMS += \
@@ -5328,6 +5700,11 @@ systemd_networkd_SOURCES = \
 systemd_networkd_LDADD = \
        libsystemd-networkd-core.la
 
+if HAVE_LIBIPTC
+systemd_networkd_LDADD += \
+       libsystemd-fw.la
+endif
+
 noinst_LTLIBRARIES += \
        libsystemd-networkd-core.la
 
@@ -5344,6 +5721,7 @@ libsystemd_networkd_core_la_SOURCES = \
        src/network/networkd-netdev-vxlan.h \
        src/network/networkd-netdev-vlan.h \
        src/network/networkd-netdev-macvlan.h \
+       src/network/networkd-netdev-ipvlan.h \
        src/network/networkd-netdev-dummy.h \
        src/network/networkd-netdev-tuntap.h \
        src/network/networkd-netdev-bond.h \
@@ -5354,18 +5732,22 @@ libsystemd_networkd_core_la_SOURCES = \
        src/network/networkd-netdev-vxlan.c \
        src/network/networkd-netdev-vlan.c \
        src/network/networkd-netdev-macvlan.c \
+       src/network/networkd-netdev-ipvlan.c \
        src/network/networkd-netdev-dummy.c \
        src/network/networkd-netdev-tuntap.c \
        src/network/networkd-netdev-bond.c \
        src/network/networkd-netdev-bridge.c \
        src/network/networkd-link.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-network.c \
+       src/network/networkd-network-bus.c \
        src/network/networkd-address.c \
        src/network/networkd-route.c \
        src/network/networkd-manager.c \
+       src/network/networkd-manager-bus.c \
        src/network/networkd-fdb.c \
        src/network/networkd-address-pool.c
 
@@ -5418,6 +5800,11 @@ test_network_SOURCES = \
 test_network_LDADD = \
        libsystemd-networkd-core.la
 
+if HAVE_LIBIPTC
+test_network_LDADD += \
+       libsystemd-fw.la
+endif
+
 test_network_tables_SOURCES = \
        src/network/test-network-tables.c \
        src/shared/test-tables.h
@@ -5426,27 +5813,50 @@ test_network_tables_LDADD = \
        libsystemd-networkd-core.la \
        libudev-core.la
 
+if HAVE_LIBIPTC
+test_network_tables_LDADD += \
+       libsystemd-fw.la
+endif
+
 tests += \
        test-network \
        test-network-tables
 
+dist_systemunit_DATA += \
+       units/systemd-networkd.socket
+
 nodist_systemunit_DATA += \
        units/systemd-networkd.service \
        units/systemd-networkd-wait-online.service
 
+dist_systemunit_DATA_busnames += \
+       units/org.freedesktop.network1.busname
+
+dist_dbussystemservice_DATA += \
+       src/network/org.freedesktop.network1.service
+
+dist_dbuspolicy_DATA += \
+       src/network/org.freedesktop.network1.conf
+
 GENERAL_ALIASES += \
+       $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \
        $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
        $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
 
-EXTRA_DIST += \
+SYSTEM_UNIT_ALIASES += \
+       systemd-networkd.service dbus-org.freedesktop.network1.service
+
+BUSNAMES_TARGET_WANTS += \
+       org.freedesktop.network1.busname
+
+gperf_gperf_sources += \
        src/network/networkd-network-gperf.gperf \
-       src/network/networkd-netdev-gperf.gperf \
+       src/network/networkd-netdev-gperf.gperf
+
+EXTRA_DIST += \
        units/systemd-networkd.service.in \
        units/systemd-networkd-wait-online.service.in
 
-CLEANFILES += \
-       src/network/networkd-network-gperf.c \
-       src/network/networkd-netdev-gperf.c
 endif
 
 # ------------------------------------------------------------------------------
@@ -5502,15 +5912,8 @@ endif
 noinst_LTLIBRARIES += \
        libsystemd-logind-core.la
 
-systemd_user_sessions_SOURCES = \
-       src/login/user-sessions.c
-
-systemd_user_sessions_LDADD = \
-       libsystemd-shared.la
-
 rootlibexec_PROGRAMS += \
-       systemd-logind \
-       systemd-user-sessions
+       systemd-logind
 
 loginctl_SOURCES = \
        src/login/loginctl.c \
@@ -5519,6 +5922,8 @@ loginctl_SOURCES = \
 
 loginctl_LDADD = \
        libsystemd-internal.la \
+       libsystemd-logs.la \
+       libsystemd-journal-internal.la \
        libudev-internal.la \
        libsystemd-shared.la
 
@@ -5605,11 +6010,11 @@ pamlib_LTLIBRARIES = \
 
 dist_pamconf_DATA = \
        src/login/systemd-user
+
 endif
 
 nodist_systemunit_DATA += \
-       units/systemd-logind.service \
-       units/systemd-user-sessions.service
+       units/systemd-logind.service
 
 dist_systemunit_DATA += \
        units/user.slice
@@ -5633,8 +6038,7 @@ INSTALL_DIRS += \
        $(systemdstatedir)
 
 MULTI_USER_TARGET_WANTS += \
-       systemd-logind.service \
-       systemd-user-sessions.service
+       systemd-logind.service
 
 SYSTEM_UNIT_ALIASES += \
        systemd-logind.service dbus-org.freedesktop.login1.service
@@ -5650,23 +6054,44 @@ nodist_udevrules_DATA += \
        src/login/71-seat.rules \
        src/login/73-seat-late.rules
 
-CLEANFILES += \
-       src/login/logind-gperf.c \
-       src/login/71-seat.rules \
-       src/login/73-seat-late.rules
 endif
 
 polkitpolicy_in_files += \
        src/login/org.freedesktop.login1.policy.in
 
+gperf_gperf_sources += \
+       src/login/logind-gperf.gperf
+
 EXTRA_DIST += \
-       src/login/logind-gperf.gperf \
        src/login/71-seat.rules.in \
        src/login/73-seat-late.rules.in \
-       units/systemd-logind.service.in \
+       units/systemd-logind.service.in
+
+# ------------------------------------------------------------------------------
+if HAVE_PAM
+
+systemd_user_sessions_SOURCES = \
+       src/user-sessions/user-sessions.c
+
+systemd_user_sessions_LDADD = \
+       libsystemd-shared.la
+
+rootlibexec_PROGRAMS += \
+       systemd-user-sessions
+
+nodist_systemunit_DATA += \
+       units/systemd-user-sessions.service
+
+EXTRA_DIST += \
        units/systemd-user-sessions.service.in
 
+MULTI_USER_TARGET_WANTS += \
+       systemd-user-sessions.service
+
+endif
+
 # ------------------------------------------------------------------------------
+
 if HAVE_PYTHON_DEVEL
 pkgpyexec_LTLIBRARIES = \
        _journal.la \
@@ -5792,7 +6217,7 @@ src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
        $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
 
 BUILT_SOURCES += \
-       src/python-systemd/id128-constants.h
+       $(nodist_id128_la_SOURCES)
 
 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
 sphinx-%:
@@ -5980,6 +6405,7 @@ substitutions = \
        '|rootprefix=$(rootprefix)|' \
        '|udevlibexecdir=$(udevlibexecdir)|' \
        '|SUSHELL=$(SUSHELL)|' \
+       '|SULOGIN=$(SULOGIN)|' \
        '|DEBUGTTY=$(DEBUGTTY)|' \
        '|KILL=$(KILL)|' \
        '|KMOD=$(KMOD)|' \
@@ -6076,13 +6502,6 @@ EXTRA_DIST += \
        $(polkitpolicy_in_files) \
        $(polkitpolicy_in_in_files)
 
-CLEANFILES += \
-       $(nodist_systemunit_DATA) \
-       $(nodist_userunit_DATA) \
-       $(pkgconfigdata_DATA) \
-       $(pkgconfiglib_DATA) \
-       $(nodist_polkitpolicy_DATA)
-
 # ------------------------------------------------------------------------------
 if ENABLE_MANPAGES
 man/custom-entities.ent: configure.ac
@@ -6167,15 +6586,11 @@ SOCKETS_TARGET_WANTS += \
 
 if HAVE_UTMP
 if HAVE_SYSV_COMPAT
-RUNLEVEL1_TARGET_WANTS += \
-       systemd-update-utmp-runlevel.service
-RUNLEVEL2_TARGET_WANTS += \
-       systemd-update-utmp-runlevel.service
-RUNLEVEL3_TARGET_WANTS += \
+MULTI_USER_TARGET_WANTS += \
        systemd-update-utmp-runlevel.service
-RUNLEVEL4_TARGET_WANTS += \
+GRAPHICAL_TARGET_WANTS += \
        systemd-update-utmp-runlevel.service
-RUNLEVEL5_TARGET_WANTS += \
+RESCUE_TARGET_WANTS += \
        systemd-update-utmp-runlevel.service
 endif
 
@@ -6188,7 +6603,8 @@ SYSINIT_TARGET_WANTS += \
 
 LOCAL_FS_TARGET_WANTS += \
        systemd-remount-fs.service \
-       tmp.mount
+       tmp.mount \
+       var-lib-machines.mount
 
 MULTI_USER_TARGET_WANTS += \
        getty.target \
@@ -6320,7 +6736,7 @@ endif
 #
 # Require python when making dist
 #
-.PHONY: dist-check-python
+.PHONY: dist-check-python dist-check-compat-libs dist-check-help
 dist-check-python:
 if !HAVE_PYTHON
        @echo "*** python and python-lxml module must be installed and enabled in order to make dist"
@@ -6333,6 +6749,14 @@ if !ENABLE_COMPAT_LIBS
        @false
 endif
 
+dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
+       for i in $(abspath $^); do                                             \
+            if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
+               echo "$(basename $$i) --help output is too wide:";             \
+               $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
+               exit 1;                                                        \
+            fi; done
+
 dist: dist-check-python dist-check-compat-libs
 
 # check "broken" platforms limited toolchains for link breakage before we release
@@ -6500,3 +6924,9 @@ git-contrib:
 
 EXTRA_DIST += \
         tools/gdb-sd_dump_hashmaps.py
+
+list-keys:
+       gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
+
+add-key:
+       gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -