summaryrefslogtreecommitdiff
path: root/src/grp-machine
diff options
context:
space:
mode:
Diffstat (limited to 'src/grp-machine')
-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
46 files changed, 732 insertions, 298 deletions
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);