diff options
90 files changed, 467 insertions, 302 deletions
@@ -23,8 +23,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += src - # intltoolize files.src.gen += m4/intltool.m4 files.src.gen += po/Makefile.in.in @@ -45,4 +43,8 @@ files.src.gen += m4/lt~obsolete.m4 files.src.gen += config.h.in files.src.gen += configure +nested.subdirs += man +nested.subdirs += src +nested.subdirs += test + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/build-aux/write-ifchanged b/build-aux/write-ifchanged new file mode 100755 index 0000000000..185ceb0039 --- /dev/null +++ b/build-aux/write-ifchanged @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Copyright (C) 2015 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +outfile=$1 +tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}" + +cat > "$tmpfile" || exit $? +if cmp -s "$tmpfile" "$outfile"; then + rm -f "$tmpfile" || : +else + mv -f "$tmpfile" "$outfile" +fi diff --git a/src/Makefile b/src/Makefile index 905d11d803..ba72df7255 100644 --- a/src/Makefile +++ b/src/Makefile @@ -37,7 +37,6 @@ nested.subdirs += grp-resolve nested.subdirs += grp-system nested.subdirs += grp-timedate nested.subdirs += grp-udev -nested.subdirs += grp-utils nested.subdirs += libbasic nested.subdirs += libfirewall nested.subdirs += libshared @@ -65,5 +64,6 @@ nested.subdirs += systemd-stdio-bridge nested.subdirs += systemd-system-update-generator nested.subdirs += systemd-timesyncd nested.subdirs += systemd-tty-ask-password-agent +nested.subdirs += test include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-boot/Makefile b/src/grp-boot/Makefile index 6f46e5e035..df1febe823 100644 --- a/src/grp-boot/Makefile +++ b/src/grp-boot/Makefile @@ -23,6 +23,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += bootctl systemd-boot kernel-install +nested.subdirs += bootctl +nested.subdirs += kernel-install +nested.subdirs += systemd-boot include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile index 5b53fdc7e4..3b4d4ddda1 100644 --- a/src/grp-boot/systemd-boot/Makefile +++ b/src/grp-boot/systemd-boot/Makefile @@ -179,7 +179,6 @@ endif # ENABLE_EFI CLEANFILES += $(stub_objects) $(stub_solib) $(stub) - # ------------------------------------------------------------------------------ CLEANFILES += test-efi-disk.img diff --git a/src/grp-coredump/Makefile b/src/grp-coredump/Makefile index 811efb5af5..c2bbf948e9 100644 --- a/src/grp-coredump/Makefile +++ b/src/grp-coredump/Makefile @@ -23,6 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += coredumpctl systemd-coredump +nested.subdirs += coredumpctl +nested.subdirs += systemd-coredump include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-hostname/Makefile b/src/grp-hostname/Makefile index 319c1d2c8e..939c268c10 100644 --- a/src/grp-hostname/Makefile +++ b/src/grp-hostname/Makefile @@ -23,6 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += systemd-hostnamed hostnamectl +nested.subdirs += hostnamectl +nested.subdirs += systemd-hostnamed include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/Makefile b/src/grp-journal/Makefile index fcefb81581..35ece6e443 100644 --- a/src/grp-journal/Makefile +++ b/src/grp-journal/Makefile @@ -167,4 +167,9 @@ tests += \ test-compress-benchmark endif # HAVE_COMPRESSION +nested.subdirs += grp-remote +nested.subdirs += journalctl +nested.subdirs += libjournal-core +nested.subdirs += systemd-journald + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/grp-remote/Makefile b/src/grp-journal/grp-remote/Makefile index 737faaba4b..18618942a7 100644 --- a/src/grp-journal/grp-remote/Makefile +++ b/src/grp-journal/grp-remote/Makefile @@ -31,8 +31,8 @@ ifneq ($(HAVE_ZLIB),) ifneq ($(HAVE_BZIP2),) ifneq ($(HAVE_GCRYPT),) -nested.subdirs += systemd-journa-gatewayd -nested.subdirs += systemd-journa-remote -nested.subdirs += systemd-journa-upload +nested.subdirs += systemd-journal-gatewayd +nested.subdirs += systemd-journal-remote +nested.subdirs += systemd-journal-upload include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/systemd-journald/Makefile b/src/grp-journal/systemd-journald/Makefile index 755e2d2c36..046f0e8a3c 100644 --- a/src/grp-journal/systemd-journald/Makefile +++ b/src/grp-journal/systemd-journald/Makefile @@ -37,7 +37,6 @@ systemd_cat_SOURCES = \ systemd_cat_LDADD = \ libjournal-core.la - rootlibexec_PROGRAMS += \ systemd-journald diff --git a/src/grp-login/Makefile b/src/grp-login/Makefile index 381d653166..cca3e844e1 100644 --- a/src/grp-login/Makefile +++ b/src/grp-login/Makefile @@ -56,7 +56,6 @@ tests += \ test-login-tables \ test-login-shared - nodist_systemunit_DATA += \ units/systemd-logind.service @@ -112,4 +111,9 @@ EXTRA_DIST += \ units/systemd-logind.service.in \ src/login/logind.conf.in +nested.subdirs += loginctl +nested.subdirs += pam_systemd +nested.subdirs += systemd-inhibit +nested.subdirs += systemd-logind + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-login/loginctl/Makefile b/src/grp-login/loginctl/Makefile index 7c8c3d91a0..d2c6eebd27 100644 --- a/src/grp-login/loginctl/Makefile +++ b/src/grp-login/loginctl/Makefile @@ -38,4 +38,5 @@ dist_bashcompletion_data += \ shell-completion/bash/loginctl dist_zshcompletion_data += shell-completion/zsh/_loginctl + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-login/pam_systemd/Makefile b/src/grp-login/pam_systemd/Makefile index 8c87421bb0..9bb3af70b0 100644 --- a/src/grp-login/pam_systemd/Makefile +++ b/src/grp-login/pam_systemd/Makefile @@ -53,4 +53,5 @@ dist_pamconf_DATA = \ EXTRA_DIST += \ src/login/systemd-user.m4 endif # HAVE_PAM + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-machine/Makefile b/src/grp-machine/Makefile index a724b63ceb..4692e99c02 100644 --- a/src/grp-machine/Makefile +++ b/src/grp-machine/Makefile @@ -23,7 +23,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += machinectl systemd-machined +nested.subdirs += machinectl nested.subdirs += nss-mymachines +nested.subdirs += systemd-machined include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-machine/grp-import/systemd-importd/Makefile b/src/grp-machine/grp-import/systemd-importd/Makefile index 350b35bf26..80c4ab819b 100644 --- a/src/grp-machine/grp-import/systemd-importd/Makefile +++ b/src/grp-machine/grp-import/systemd-importd/Makefile @@ -90,5 +90,4 @@ polkitpolicy_in_files += \ EXTRA_DIST += \ units/systemd-importd.service.in - include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-machine/nss-mymachines/Makefile b/src/grp-machine/nss-mymachines/Makefile index c7c0d76907..78cb6419c0 100644 --- a/src/grp-machine/nss-mymachines/Makefile +++ b/src/grp-machine/nss-mymachines/Makefile @@ -23,7 +23,6 @@ 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 diff --git a/src/grp-machine/systemd-machined/Makefile b/src/grp-machine/systemd-machined/Makefile index 98d7a58d92..664a54d190 100644 --- a/src/grp-machine/systemd-machined/Makefile +++ b/src/grp-machine/systemd-machined/Makefile @@ -83,7 +83,6 @@ SYSTEM_UNIT_ALIASES += \ BUSNAMES_TARGET_WANTS += \ org.freedesktop.machine1.busname - polkitpolicy_in_files += \ src/machine/org.freedesktop.machine1.policy.in diff --git a/src/grp-network/Makefile b/src/grp-network/Makefile index 7cbd9142d0..d4ceaba2d7 100644 --- a/src/grp-network/Makefile +++ b/src/grp-network/Makefile @@ -104,4 +104,9 @@ EXTRA_DIST += \ units/systemd-networkd-wait-online.service.in \ test/networkd-test.py +nested.subdirs += libnetworkd-core +nested.subdirs += networkctl +nested.subdirs += systemd-networkd +nested.subdirs += systemd-networkd-wait-online + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-resolve/Makefile b/src/grp-resolve/Makefile index 4cea7de4c6..ccff3bfbeb 100644 --- a/src/grp-resolve/Makefile +++ b/src/grp-resolve/Makefile @@ -23,6 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += systemd-resolved nss-resolve +nested.subdirs += nss-resolve +nested.subdirs += systemd-resolved include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile index e18b1b3d90..31bd6d6ed1 100644 --- a/src/grp-resolve/systemd-resolved/Makefile +++ b/src/grp-resolve/systemd-resolved/Makefile @@ -23,7 +23,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk - $(outdir)/dns_type-list.txt: src/resolve/dns-type.h $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@ diff --git a/src/grp-system/Makefile b/src/grp-system/Makefile index 546ff4e88f..b4bff093f6 100644 --- a/src/grp-system/Makefile +++ b/src/grp-system/Makefile @@ -23,6 +23,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += systemctl systemd +nested.subdirs += libcore +nested.subdirs += systemctl +nested.subdirs += systemd +nested.subdirs += systemd-shutdown include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c b/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c index 307941bb95..49c8487935 100644 --- a/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c +++ b/src/grp-system/grp-utils/systemd-fstab-generator/fstab-generator.c @@ -39,10 +39,11 @@ #include "basic/unit-name.h" #include "basic/util.h" #include "basic/virt.h" -#include "mount-setup.h" #include "shared/fstab-util.h" #include "shared/generator.h" +#include "mount-setup.h" + static const char *arg_dest = "/tmp"; static bool arg_fstab_enabled = true; static char *arg_root_what = NULL; diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c new file mode 120000 index 0000000000..7f7ff15b46 --- /dev/null +++ b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c @@ -0,0 +1 @@ +../../libcore/mount-setup.c
\ No newline at end of file diff --git a/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h new file mode 120000 index 0000000000..50721d8bfc --- /dev/null +++ b/src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h @@ -0,0 +1 @@ +../../libcore/mount-setup.h
\ No newline at end of file diff --git a/src/grp-system/systemd-shutdown/killall.c b/src/grp-system/systemd-shutdown/killall.c new file mode 120000 index 0000000000..5ddb36306b --- /dev/null +++ b/src/grp-system/systemd-shutdown/killall.c @@ -0,0 +1 @@ +../libcore/killall.c
\ No newline at end of file diff --git a/src/grp-system/systemd-shutdown/killall.h b/src/grp-system/systemd-shutdown/killall.h new file mode 120000 index 0000000000..60b334fe91 --- /dev/null +++ b/src/grp-system/systemd-shutdown/killall.h @@ -0,0 +1 @@ +../libcore/killall.h
\ No newline at end of file diff --git a/src/grp-system/systemd-shutdown/mount-setup.c b/src/grp-system/systemd-shutdown/mount-setup.c new file mode 120000 index 0000000000..a4ab487157 --- /dev/null +++ b/src/grp-system/systemd-shutdown/mount-setup.c @@ -0,0 +1 @@ +../libcore/mount-setup.c
\ No newline at end of file diff --git a/src/grp-system/systemd-shutdown/mount-setup.h b/src/grp-system/systemd-shutdown/mount-setup.h new file mode 120000 index 0000000000..1f984851f8 --- /dev/null +++ b/src/grp-system/systemd-shutdown/mount-setup.h @@ -0,0 +1 @@ +../libcore/mount-setup.h
\ No newline at end of file diff --git a/src/grp-system/systemd-shutdown/shutdown.c b/src/grp-system/systemd-shutdown/shutdown.c index 516128e2d1..bf74b5ec99 100644 --- a/src/grp-system/systemd-shutdown/shutdown.c +++ b/src/grp-system/systemd-shutdown/shutdown.c @@ -42,10 +42,10 @@ #include "basic/terminal-util.h" #include "basic/util.h" #include "basic/virt.h" -#include "killall.h" #include "shared/switch-root.h" #include "shared/watchdog.h" +#include "killall.h" #include "umount.h" #define FINALIZE_ATTEMPTS 50 diff --git a/src/grp-system/systemd-shutdown/umount.c b/src/grp-system/systemd-shutdown/umount.c index 3e756ec7fb..0079f8ec78 100644 --- a/src/grp-system/systemd-shutdown/umount.c +++ b/src/grp-system/systemd-shutdown/umount.c @@ -36,10 +36,10 @@ #include "basic/string-util.h" #include "basic/util.h" #include "basic/virt.h" -#include "mount-setup.h" #include "shared/fstab-util.h" #include "shared/udev-util.h" +#include "mount-setup.h" #include "umount.h" typedef struct MountPoint { diff --git a/src/grp-timedate/Makefile b/src/grp-timedate/Makefile index 01c4f2f841..b9277c7c64 100644 --- a/src/grp-timedate/Makefile +++ b/src/grp-timedate/Makefile @@ -23,6 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += timedatectl systemd-timedated +nested.subdirs += systemd-timedated +nested.subdirs += timedatectl include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-timedate/timedatectl/Makefile b/src/grp-timedate/timedatectl/Makefile index c1be945443..4394bf892b 100644 --- a/src/grp-timedate/timedatectl/Makefile +++ b/src/grp-timedate/timedatectl/Makefile @@ -39,4 +39,5 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_timedatectl endif # ENABLE_TIMEDATED + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-udev/Makefile b/src/grp-udev/Makefile index cc85f0317f..4b09a3497d 100644 --- a/src/grp-udev/Makefile +++ b/src/grp-udev/Makefile @@ -69,4 +69,16 @@ SYSINIT_TARGET_WANTS += \ systemd-udevd.service \ systemd-udev-trigger.service +nested.subdirs += ata_id +nested.subdirs += cdrom_id +nested.subdirs += collect +nested.subdirs += hwdb +nested.subdirs += libudev-core +nested.subdirs += mtd_probe +nested.subdirs += scsi_id +nested.subdirs += systemd-hwdb +nested.subdirs += systemd-udevd +nested.subdirs += udevadm +nested.subdirs += v4l_id + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-udev/libudev-core/logind-acl.c b/src/grp-udev/libudev-core/logind-acl.c new file mode 120000 index 0000000000..dd15b7973f --- /dev/null +++ b/src/grp-udev/libudev-core/logind-acl.c @@ -0,0 +1 @@ +../../grp-login/systemd-logind/logind-acl.c
\ No newline at end of file diff --git a/src/grp-udev/libudev-core/logind-acl.h b/src/grp-udev/libudev-core/logind-acl.h new file mode 120000 index 0000000000..6065dde301 --- /dev/null +++ b/src/grp-udev/libudev-core/logind-acl.h @@ -0,0 +1 @@ +../../grp-login/systemd-logind/logind-acl.h
\ No newline at end of file diff --git a/src/grp-udev/libudev-core/sd-login.c b/src/grp-udev/libudev-core/sd-login.c new file mode 120000 index 0000000000..913dcedc6a --- /dev/null +++ b/src/grp-udev/libudev-core/sd-login.c @@ -0,0 +1 @@ +../../libsystemd/src/sd-login/sd-login.c
\ No newline at end of file diff --git a/src/grp-udev/libudev-core/udev-builtin-uaccess.c b/src/grp-udev/libudev-core/udev-builtin-uaccess.c index 91bd843f80..aab1c376de 100644 --- a/src/grp-udev/libudev-core/udev-builtin-uaccess.c +++ b/src/grp-udev/libudev-core/udev-builtin-uaccess.c @@ -26,9 +26,10 @@ #include "basic/login-util.h" #include "basic/util.h" -#include "logind-acl.h" #include "udev.h" +#include "logind-acl.h" + static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool test) { int r; const char *path = NULL, *seat; diff --git a/src/grp-utils/systemd-path/_sd-common.h b/src/grp-utils/systemd-path/_sd-common.h new file mode 120000 index 0000000000..d2b5d6f4e4 --- /dev/null +++ b/src/grp-utils/systemd-path/_sd-common.h @@ -0,0 +1 @@ +../../libsystemd/include/systemd/_sd-common.h
\ No newline at end of file diff --git a/src/grp-utils/systemd-path/sd-path.h b/src/grp-utils/systemd-path/sd-path.h index cac5ce761d..be6abdcd03 100644 --- a/src/grp-utils/systemd-path/sd-path.h +++ b/src/grp-utils/systemd-path/sd-path.h @@ -22,7 +22,7 @@ #include <inttypes.h> -#include <systemd/_sd-common.h> +#include "_sd-common.h" _SD_BEGIN_DECLARATIONS; diff --git a/src/grp-utils/systemd-socket-activate/Makefile b/src/grp-utils/systemd-socket-activate/Makefile index 7d69a80d36..da1a1a5e43 100644 --- a/src/grp-utils/systemd-socket-activate/Makefile +++ b/src/grp-utils/systemd-socket-activate/Makefile @@ -23,7 +23,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk - bin_PROGRAMS += \ systemd-socket-activate diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile index 47ce9cf936..3778a42f06 100644 --- a/src/libbasic/Makefile +++ b/src/libbasic/Makefile @@ -23,5 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += src include +nested.subdirs += include +nested.subdirs += src + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libbasic/include/Makefile b/src/libbasic/include/Makefile index d3a3e62a0e..ac4e6e896a 100644 --- a/src/libbasic/include/Makefile +++ b/src/libbasic/include/Makefile @@ -24,4 +24,5 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk nested.subdirs += basic + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libbasic/include/basic/Makefile b/src/libbasic/include/basic/Makefile index eb8483fe8f..d442808156 100644 --- a/src/libbasic/include/basic/Makefile +++ b/src/libbasic/include/basic/Makefile @@ -29,14 +29,12 @@ $(outdir)/errno-list.txt: $(outdir)/errno-to-name.h: $(outdir)/errno-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ - $(outdir)/af-list.txt: $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@ $(outdir)/af-to-name.h: $(outdir)/af-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ - $(outdir)/arphrd-list.txt: $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@ @@ -46,7 +44,6 @@ $(outdir)/arphrd-to-name.h: $(outdir)/arphrd-list.txt $(outdir)/arphrd-from-name.gperf: $(outdir)/arphrd-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@ - $(outdir)/cap-list.txt: $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@ diff --git a/src/libshared/Makefile b/src/libshared/Makefile index d6a307fc5a..369b265ff7 100644 --- a/src/libshared/Makefile +++ b/src/libshared/Makefile @@ -24,4 +24,5 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk nested.subdirs += src + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd-network/Makefile b/src/libsystemd-network/Makefile index afd9224056..8ba25db413 100644 --- a/src/libsystemd-network/Makefile +++ b/src/libsystemd-network/Makefile @@ -23,5 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -nested.subdirs += src test +nested.subdirs += src +nested.subdirs += test + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd-network/include/systemd-network/_sd-common.h b/src/libsystemd-network/include/systemd-network/_sd-common.h new file mode 120000 index 0000000000..653327c267 --- /dev/null +++ b/src/libsystemd-network/include/systemd-network/_sd-common.h @@ -0,0 +1 @@ +../../../libsystemd/include/systemd/_sd-common.h
\ No newline at end of file diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h index 1fe42aa4c0..958a5a18a6 100644 --- a/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h +++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-client.h @@ -25,9 +25,9 @@ #include <netinet/in.h> #include <sys/types.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" #include "sd-dhcp-lease.h" _SD_BEGIN_DECLARATIONS; diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h index 014288b8c1..2f565ca825 100644 --- a/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h +++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-lease.h @@ -26,7 +26,7 @@ #include <netinet/in.h> #include <sys/types.h> -#include <systemd/_sd-common.h> +#include "_sd-common.h" _SD_BEGIN_DECLARATIONS; diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h b/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h index 8f0cbaefad..bbb2bb203c 100644 --- a/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h +++ b/src/libsystemd-network/include/systemd-network/sd-dhcp-server.h @@ -24,9 +24,10 @@ #include <inttypes.h> #include <netinet/in.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" + _SD_BEGIN_DECLARATIONS; typedef struct sd_dhcp_server sd_dhcp_server; diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h b/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h index b5a5219830..d56497ee59 100644 --- a/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h +++ b/src/libsystemd-network/include/systemd-network/sd-dhcp6-client.h @@ -24,9 +24,9 @@ #include <net/ethernet.h> #include <sys/types.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" #include "sd-dhcp6-lease.h" _SD_BEGIN_DECLARATIONS; diff --git a/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h b/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h index 3e633548d0..184fbb8e0d 100644 --- a/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h +++ b/src/libsystemd-network/include/systemd-network/sd-dhcp6-lease.h @@ -24,7 +24,7 @@ #include <inttypes.h> #include <netinet/in.h> -#include <systemd/_sd-common.h> +#include "_sd-common.h" _SD_BEGIN_DECLARATIONS; diff --git a/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h b/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h index b6ba392921..93db7a4a6c 100644 --- a/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h +++ b/src/libsystemd-network/include/systemd-network/sd-ipv4acd.h @@ -24,9 +24,10 @@ #include <net/ethernet.h> #include <netinet/in.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" + _SD_BEGIN_DECLARATIONS; enum { diff --git a/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h b/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h index 9314360b6f..9167623167 100644 --- a/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h +++ b/src/libsystemd-network/include/systemd-network/sd-ipv4ll.h @@ -23,9 +23,10 @@ #include <net/ethernet.h> #include <netinet/in.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" + _SD_BEGIN_DECLARATIONS; enum { diff --git a/src/libsystemd-network/include/systemd-network/sd-lldp.h b/src/libsystemd-network/include/systemd-network/sd-lldp.h index 6559df44b6..391e7c2a2e 100644 --- a/src/libsystemd-network/include/systemd-network/sd-lldp.h +++ b/src/libsystemd-network/include/systemd-network/sd-lldp.h @@ -24,9 +24,10 @@ #include <inttypes.h> #include <net/ethernet.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" + _SD_BEGIN_DECLARATIONS; typedef struct sd_lldp sd_lldp; diff --git a/src/libsystemd-network/include/systemd-network/sd-ndisc.h b/src/libsystemd-network/include/systemd-network/sd-ndisc.h index a26ec878bd..58e6e80b5d 100644 --- a/src/libsystemd-network/include/systemd-network/sd-ndisc.h +++ b/src/libsystemd-network/include/systemd-network/sd-ndisc.h @@ -23,9 +23,10 @@ #include <inttypes.h> #include <net/ethernet.h> -#include <systemd/_sd-common.h> #include <systemd/sd-event.h> +#include "_sd-common.h" + _SD_BEGIN_DECLARATIONS; enum { diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile index 2c6505918b..479bcb6487 100644 --- a/src/libsystemd/Makefile +++ b/src/libsystemd/Makefile @@ -107,4 +107,6 @@ nodist_test_libsystemd_sym_SOURCES = \ test_libsystemd_sym_LDADD = \ libsystemd.la +nested.subdirs += src + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/Makefile b/src/libsystemd/src/Makefile index dceadf81da..d9769a0376 100644 --- a/src/libsystemd/src/Makefile +++ b/src/libsystemd/src/Makefile @@ -326,4 +326,17 @@ endif # HAVE_GCRYPT noinst_LTLIBRARIES += \ libsystemd-journal-internal.la + +nested.subdirs += sd-bus +nested.subdirs += sd-daemon +nested.subdirs += sd-device +nested.subdirs += sd-event +nested.subdirs += sd-hwdb +nested.subdirs += sd-id128 +nested.subdirs += sd-journal +nested.subdirs += sd-login +nested.subdirs += sd-netlink +nested.subdirs += sd-network +nested.subdirs += sd-resolve + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/sd-bus/Makefile b/src/libsystemd/src/sd-bus/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-bus/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-daemon/Makefile b/src/libsystemd/src/sd-daemon/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-daemon/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-device/Makefile b/src/libsystemd/src/sd-device/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-device/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-event/Makefile b/src/libsystemd/src/sd-event/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-event/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-hwdb/Makefile b/src/libsystemd/src/sd-hwdb/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-hwdb/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-id128/Makefile b/src/libsystemd/src/sd-id128/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-id128/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-journal/audit-type.c b/src/libsystemd/src/sd-journal/audit-type.c index f4dd1e9417..0ccbb456c3 100644 --- a/src/libsystemd/src/sd-journal/audit-type.c +++ b/src/libsystemd/src/sd-journal/audit-type.c @@ -24,8 +24,8 @@ # include <libaudit.h> #endif +#include "audit_type-to-name.h" #include "basic/macro.h" #include "basic/missing.h" #include "audit-type.h" -#include "audit_type-to-name.h" diff --git a/src/libsystemd/src/sd-journal/fsprg.c b/src/libsystemd/src/sd-journal/fsprg.c index acb8263151..612b10f3a9 100644 --- a/src/libsystemd/src/sd-journal/fsprg.c +++ b/src/libsystemd/src/sd-journal/fsprg.c @@ -29,9 +29,8 @@ #include <gcrypt.h> #include <string.h> -#include "shared/gcrypt-util.h" - #include "fsprg.h" +#include "gcrypt-util.h" #define ISVALID_SECPAR(secpar) (((secpar) % 16 == 0) && ((secpar) >= 16) && ((secpar) <= 16384)) #define VALIDATE_SECPAR(secpar) assert(ISVALID_SECPAR(secpar)); diff --git a/src/libsystemd/src/sd-journal/gcrypt-util.c b/src/libsystemd/src/sd-journal/gcrypt-util.c new file mode 120000 index 0000000000..56bb2382a6 --- /dev/null +++ b/src/libsystemd/src/sd-journal/gcrypt-util.c @@ -0,0 +1 @@ +../../../libshared/src/gcrypt-util.c
\ No newline at end of file diff --git a/src/libsystemd/src/sd-journal/gcrypt-util.h b/src/libsystemd/src/sd-journal/gcrypt-util.h new file mode 120000 index 0000000000..c1168ad265 --- /dev/null +++ b/src/libsystemd/src/sd-journal/gcrypt-util.h @@ -0,0 +1 @@ +../../../libshared/include/shared/gcrypt-util.h
\ No newline at end of file diff --git a/src/libsystemd/src/sd-journal/journal-authenticate.c b/src/libsystemd/src/sd-journal/journal-authenticate.c index 8e983f7e8f..5400d38ffd 100644 --- a/src/libsystemd/src/sd-journal/journal-authenticate.c +++ b/src/libsystemd/src/sd-journal/journal-authenticate.c @@ -22,9 +22,9 @@ #include "basic/fd-util.h" #include "basic/hexdecoct.h" -#include "shared/gcrypt-util.h" #include "fsprg.h" +#include "gcrypt-util.h" #include "journal-authenticate.h" #include "journal-def.h" #include "journal-file.h" diff --git a/src/libsystemd/src/sd-login/Makefile b/src/libsystemd/src/sd-login/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-login/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-netlink/Makefile b/src/libsystemd/src/sd-netlink/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-netlink/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-network/Makefile b/src/libsystemd/src/sd-network/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-network/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/libsystemd/src/sd-resolve/Makefile b/src/libsystemd/src/sd-resolve/Makefile new file mode 120000 index 0000000000..71a1159ce0 --- /dev/null +++ b/src/libsystemd/src/sd-resolve/Makefile @@ -0,0 +1 @@ +../subdir.mk
\ No newline at end of file diff --git a/src/systemd-machine-id-setup/machine-id-setup-main.c b/src/systemd-machine-id-setup/machine-id-setup-main.c index fdc009b225..009bb5c5c0 100644 --- a/src/systemd-machine-id-setup/machine-id-setup-main.c +++ b/src/systemd-machine-id-setup/machine-id-setup-main.c @@ -25,6 +25,7 @@ #include "basic/log.h" #include "basic/path-util.h" #include "basic/util.h" + #include "machine-id-setup.h" static char *arg_root = NULL; diff --git a/src/systemd-machine-id-setup/machine-id-setup.c b/src/systemd-machine-id-setup/machine-id-setup.c new file mode 120000 index 0000000000..78f80e2b73 --- /dev/null +++ b/src/systemd-machine-id-setup/machine-id-setup.c @@ -0,0 +1 @@ +../grp-system/libcore/machine-id-setup.c
\ No newline at end of file diff --git a/src/systemd-machine-id-setup/machine-id-setup.h b/src/systemd-machine-id-setup/machine-id-setup.h new file mode 120000 index 0000000000..d2659724ce --- /dev/null +++ b/src/systemd-machine-id-setup/machine-id-setup.h @@ -0,0 +1 @@ +../grp-system/libcore/machine-id-setup.h
\ No newline at end of file diff --git a/src/systemd-nspawn/loopback-setup.c b/src/systemd-nspawn/loopback-setup.c new file mode 120000 index 0000000000..da633f4936 --- /dev/null +++ b/src/systemd-nspawn/loopback-setup.c @@ -0,0 +1 @@ +../grp-system/libcore/loopback-setup.c
\ No newline at end of file diff --git a/src/systemd-nspawn/loopback-setup.h b/src/systemd-nspawn/loopback-setup.h new file mode 120000 index 0000000000..dc051ab1bd --- /dev/null +++ b/src/systemd-nspawn/loopback-setup.h @@ -0,0 +1 @@ +../grp-system/libcore/loopback-setup.h
\ No newline at end of file diff --git a/src/systemd-nspawn/machine-id-setup.c b/src/systemd-nspawn/machine-id-setup.c new file mode 120000 index 0000000000..78f80e2b73 --- /dev/null +++ b/src/systemd-nspawn/machine-id-setup.c @@ -0,0 +1 @@ +../grp-system/libcore/machine-id-setup.c
\ No newline at end of file diff --git a/src/systemd-nspawn/machine-id-setup.h b/src/systemd-nspawn/machine-id-setup.h new file mode 120000 index 0000000000..d2659724ce --- /dev/null +++ b/src/systemd-nspawn/machine-id-setup.h @@ -0,0 +1 @@ +../grp-system/libcore/machine-id-setup.h
\ No newline at end of file diff --git a/src/systemd-nspawn/mount-setup.c b/src/systemd-nspawn/mount-setup.c new file mode 120000 index 0000000000..67cb74c218 --- /dev/null +++ b/src/systemd-nspawn/mount-setup.c @@ -0,0 +1 @@ +../grp-system/libcore/mount-setup.c
\ No newline at end of file diff --git a/src/systemd-nspawn/mount-setup.h b/src/systemd-nspawn/mount-setup.h new file mode 120000 index 0000000000..bae54ba700 --- /dev/null +++ b/src/systemd-nspawn/mount-setup.h @@ -0,0 +1 @@ +../grp-system/libcore/mount-setup.h
\ No newline at end of file diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c index fc2b5b9eed..7f555accf4 100644 --- a/src/systemd-nspawn/nspawn.c +++ b/src/systemd-nspawn/nspawn.c @@ -72,8 +72,6 @@ #include "basic/process-util.h" #include "basic/random-util.h" #include "basic/rm-rf.h" -#include "loopback-setup.h" -#include "machine-id-setup.h" #include "sd-netlink/netlink-util.h" #include "shared/base-filesystem.h" #include "shared/dev-setup.h" @@ -81,6 +79,8 @@ #include "shared/machine-image.h" #include "shared/ptyfwd.h" +#include "loopback-setup.h" +#include "machine-id-setup.h" #include "nspawn-cgroup.h" #include "nspawn-expose-ports.h" #include "nspawn-mount.h" diff --git a/src/systemd-remount-fs/mount-setup.c b/src/systemd-remount-fs/mount-setup.c new file mode 120000 index 0000000000..67cb74c218 --- /dev/null +++ b/src/systemd-remount-fs/mount-setup.c @@ -0,0 +1 @@ +../grp-system/libcore/mount-setup.c
\ No newline at end of file diff --git a/src/systemd-remount-fs/mount-setup.h b/src/systemd-remount-fs/mount-setup.h new file mode 120000 index 0000000000..bae54ba700 --- /dev/null +++ b/src/systemd-remount-fs/mount-setup.h @@ -0,0 +1 @@ +../grp-system/libcore/mount-setup.h
\ No newline at end of file diff --git a/src/systemd-remount-fs/remount-fs.c b/src/systemd-remount-fs/remount-fs.c index 936b5f11b3..116c370ef7 100644 --- a/src/systemd-remount-fs/remount-fs.c +++ b/src/systemd-remount-fs/remount-fs.c @@ -33,6 +33,7 @@ #include "basic/signal-util.h" #include "basic/strv.h" #include "basic/util.h" + #include "mount-setup.h" /* Goes through /etc/fstab and remounts all API file systems, applying diff --git a/test/Makefile b/test/Makefile index bc794e0d6c..48c8debc3c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -23,7 +23,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk - manual_tests += \ test-ns \ test-cgroup \ @@ -247,7 +246,6 @@ EXTRA_DIST += \ test/bus-policy/many-rules.conf \ test/bus-policy/test.conf - EXTRA_DIST += \ src/test/test-helper.h @@ -308,7 +306,6 @@ test_dns_domain_LDADD = \ libsystemd-network.la \ libshared.la - ifneq ($(ENABLE_EFI),) tests += \ test-boot-timestamps diff --git a/tools/notsd-find-includes b/tools/notsd-find-includes index 6dfb406fa3..494398b082 100755 --- a/tools/notsd-find-includes +++ b/tools/notsd-find-includes @@ -3,50 +3,50 @@ phase=phase0 phase0() { - phase=phase0 - local line="$1" - case "$line" in - '#include'*|'typedef '*';') - phase1 "$line" - ;; - *) - ;; - esac + phase=phase0 + local line="$1" + case "$line" in + '#include'*|'typedef '*';') + phase1 "$line" + ;; + *) + ;; + esac } phase1() { - phase=phase1 - local line="$1" - case "$line" in - '') - ;; - '#include'*) - ;; - 'typedef '*';') - ;; - *) - phase2 "$line" - ;; - esac + phase=phase1 + local line="$1" + case "$line" in + '') + ;; + '#include'*) + ;; + 'typedef '*';') + ;; + *) + phase2 "$line" + ;; + esac } phase2() { - phase=phase2 - local line="$1" - printf '%s\n' "$line" - cat + phase=phase2 + local line="$1" + printf '%s\n' "$line" + cat } main() { - current_file="$1" - set -o pipefail - { - IFS='' - while read -r line; do - "$phase" "$line" - IFS='' - done - } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file" + current_file="$1" + set -o pipefail + { + IFS='' + while read -r line; do + "$phase" "$line" + IFS='' + done + } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file" } main "$@" diff --git a/tools/notsd-fixup b/tools/notsd-fixup index 868260e503..77df56fff4 100755 --- a/tools/notsd-fixup +++ b/tools/notsd-fixup @@ -5,28 +5,41 @@ fixup_makefiles() ( find "$@" -type f -name Makefile | while read -r filename; do - sed -r -i "s|(/\.\.)*/config.mk|/$(realpath -ms --relative-to="${filename%/*}" config.mk)|" "$filename" + { + <"$filename" sed -r \ + -e "s|(/\.\.)*/config.mk|/$(realpath -ms --relative-to="$(dirname -- "$filename")" config.mk)|" \ + -e '/^nested\.subdirs/d' \ + -e '/^include \$\(topsrcdir\)\/build-aux\/Makefile\.tail\.mk$/d' + echo + find "$(dirname "$filename")" -mindepth 2 -maxdepth 2 -name Makefile -print0 | + xargs -r0 dirname -z -- | + xargs -r0 basename -a -z | + xargs -r0 printf 'nested.subdirs += %s\n' | sort + echo + echo 'include $(topsrcdir)/build-aux/Makefile.tail.mk' + } | cat -s | build-aux/write-ifchanged "$filename" done ) fixup_includes() ( - find $(find . -type d -name include) -type d | while read -r dir; do - lib="${dir##*/}" - pushd "$dir" >/dev/null - find . -type f -exec sed -ri -e "s|$lib/||" -- {} + - popd >/dev/null - done + find $(find . -type d -name include) -type d | while read -r dir; do + lib="${dir##*/}" + pushd "$dir" >/dev/null + find . -type f -exec sed -ri -e "s|$lib/||" -- {} + + popd >/dev/null + done - find "$@" \( -name '*.h' -o -name '*.c' -o -name '*.gperf' \) -type f | while read -r filename; do - "$0"--includes "$filename" - done + find "$@" \( -name '*.h' -o -name '*.c' -o -name '*.gperf' \) -type f | while read -r filename; do + "$0"--includes "$filename" + done ) main() { - set -e - set -o pipefail - fixup_makefiles "$@" - fixup_includes "$@" + set -e + set -o pipefail + export LC_COLLATE=C + fixup_makefiles "$@" + fixup_includes "$@" } main "$@" diff --git a/tools/notsd-fixup--includes b/tools/notsd-fixup--includes index 46deaa8e8e..315be32c8d 100755 --- a/tools/notsd-fixup--includes +++ b/tools/notsd-fixup--includes @@ -1,12 +1,12 @@ #!/usr/bin/env bash panic() { - >&2 echo panic - exit 2 + >&2 echo panic + exit 2 } out() { - printf '%q ' "$@" + printf '%q ' "$@" } # system @@ -15,224 +15,226 @@ out() { # protected # private classify() { - local path=$1 - if [[ "$path" = linux/* ]]; then - out linux "$path" - elif [[ -f "${current_file%/*}/${path}" ]]; then - out private "$path" - elif [[ "$path" != systemd/* ]] && - [[ "$path" != libudev.h ]] && - cpp -include "$path" <<<'' &>/dev/null; then - out system "$path" - else - case "$path" in - *-to-name.h|*-from-name.h) - base="${path##*/}" - base="${base%-to-name.h}" - base="${base%-from-name.h}" - case "$base" in - dns_type) d=src/grp-resolve/systemd-resolved;; - keyboard-keys) d=src/grp-udev/libudev-core;; - af|arphrd|cap|errno) d=src/libbasic/include/basic;; - audit_type) d=src/libsystemd/src/sd-journal;; - *) - >&2 printf 'Unknown gperf base: %q\n' "$base" - >&2 printf 'Cannot figure out: %q\n' "$path" - exit 2 - ;; - esac - file="$d/${path##*/}" - if [[ "$current_file" = "$d"/* ]]; then - out private "${file##*/}" - elif [[ "$file" = */include/* ]]; then - out protected "${file##*/include/}" - else - out protected "${file##*/}" - fi - ;; - asm/sgidefs.h|dbus/dbus.h|efi.h|efilib.h|gio/gio.h|glib.h|libmount.h) - out system "$path" - ;; - util.h|*/util.h) - if [[ "$current_file" = */systemd-boot/* ]]; then - out private util.h - else - out protected basic/util.h - fi - ;; - *) - file=$(find src -type f -name "${path##*/}") - if [[ -f "$file" ]]; then - case "$file" in - */src/*) - if [[ "${current_file%/*}" = "${file%/*}" ]]; then - out private "${file##*/}" - else - out protected "${file##*/src/}" - fi - ;; - */libsystemd/include/*|*/libudev/include/*) - out public "${file##*/include/}" - ;; - */include/*) - out protected "${file##*/include/}" - ;; - *) - if [[ "${current_file%/*}" = "${file%/*}" ]]; then - out private "${file##*/}" - else - out protected "${file##*/}" - fi - ;; - esac - else - >&2 printf 'Cannot figure out: %q\n' "$path" - exit 2 - fi - ;; - esac - fi + local path=$1 + if [[ "$path" = linux/* ]]; then + out linux "$path" + elif [[ -f "${current_file%/*}/${path}" ]]; then + out private "$path" + elif [[ "$path" != systemd/* ]] && + [[ "$path" != libudev.h ]] && + cpp -include "$path" <<<'' &>/dev/null; then + out system "$path" + else + case "$path" in + *-to-name.h|*-from-name.h) + base="${path##*/}" + base="${base%-to-name.h}" + base="${base%-from-name.h}" + case "$base" in + dns_type) d=src/grp-resolve/systemd-resolved;; + keyboard-keys) d=src/grp-udev/libudev-core;; + af|arphrd|cap|errno) d=src/libbasic/include/basic;; + audit_type) d=src/libsystemd/src/sd-journal;; + *) + >&2 printf 'Unknown gperf base: %q\n' "$base" + >&2 printf 'Cannot figure out: %q\n' "$path" + exit 2 + ;; + esac + file="$d/${path##*/}" + if [[ "$current_file" = "$d"/* ]]; then + out private "${file##*/}" + elif [[ "$file" = */include/* ]]; then + out protected "${file##*/include/}" + else + out protected "${file##*/}" + fi + ;; + asm/sgidefs.h|dbus/dbus.h|efi.h|efilib.h|gio/gio.h|glib.h|libmount.h) + out system "$path" + ;; + util.h|*/util.h) + if [[ "$current_file" = */systemd-boot/* ]]; then + out private util.h + else + out protected basic/util.h + fi + ;; + *) + file=$(find src -type f -name "${path##*/}") + if [[ -f "$file" ]]; then + case "$file" in + */src/*) + if [[ "${current_file%/*}" = "${file%/*}" ]]; then + out private "${file##*/}" + else + out protected "${file##*/src/}" + fi + ;; + */libsystemd/include/*|*/libudev/include/*) + out public "${file##*/include/}" + ;; + */include/*) + out protected "${file##*/include/}" + ;; + *) + if [[ "${current_file%/*}" = "${file%/*}" ]]; then + out private "${file##*/}" + else + out protected "${file##*/}" + fi + ;; + esac + else + >&2 printf 'Cannot figure out: %q\n' "$path" + exit 2 + fi + ;; + esac + fi } phase=phase0 hook=: phase0() { - phase=phase0 - hook=: - local line="$1" - case "$line" in - '#include'*|'typedef '*';') - phase1 "$line" - ;; - *) - printf '%s\n' "$line" - ;; - esac + phase=phase0 + hook=: + local line="$1" + case "$line" in + '#include'*|'typedef '*';') + phase1 "$line" + ;; + *) + printf '%s\n' "$line" + ;; + esac } phase1_init() { - phase1_tail= - system=() - linux=() - public=() - protected=() - typedef=(); typedef_last=true - private=() + phase1_tail= + system=() + linux=() + public=() + protected=() + typedef=(); typedef_last=true + private=() } phase1_init phase1_flush() { - local b=: - if [[ ${#system[@]} -gt 0 ]]; then - printf '%s\n' "${system[@]}" | sort -u - b=echo - fi - if [[ ${#linux[@]} -gt 0 ]]; then - $b - printf '%s\n' "${linux[@]}" - b=echo - fi - if [[ ${#public[@]} -gt 0 ]]; then - $b - printf '%s\n' "${public[@]}" | sort -u - b=echo - fi - if [[ ${#protected[@]} -gt 0 ]]; then - $b - printf '%s\n' "${protected[@]}" | sort -u - b=echo - fi - if [[ ${#typedef[@]} -gt 0 ]] && ! $typedef_last; then - $b - printf '%s\n' "${typedef[@]}" | sort -u - b=echo - fi - if [[ ${#private[@]} -gt 0 ]]; then - $b - printf '%s\n' "${private[@]}" | sort -u - b=echo - fi - if [[ ${#typedef[@]} -gt 0 ]] && $typedef_last; then - $b - printf '%s\n' "${typedef[@]}" - fi - printf '%s' "$phase1_tail" - phase1_init + local b=: + if [[ ${#system[@]} -gt 0 ]]; then + printf '%s\n' "${system[@]}" | sort -u + b=echo + fi + if [[ ${#linux[@]} -gt 0 ]]; then + $b + printf '%s\n' "${linux[@]}" + b=echo + fi + if [[ ${#public[@]} -gt 0 ]]; then + $b + printf '%s\n' "${public[@]}" | sort -u + b=echo + fi + if [[ ${#protected[@]} -gt 0 ]]; then + $b + printf '%s\n' "${protected[@]}" | sort -u + b=echo + fi + if [[ ${#typedef[@]} -gt 0 ]] && ! $typedef_last; then + $b + printf '%s\n' "${typedef[@]}" | sort -u + b=echo + fi + if [[ ${#private[@]} -gt 0 ]]; then + $b + printf '%s\n' "${private[@]}" | sort -u + b=echo + fi + if [[ ${#typedef[@]} -gt 0 ]] && $typedef_last; then + $b + printf '%s\n' "${typedef[@]}" + fi + printf '%s' "$phase1_tail" + phase1_init } phase1() { - phase=phase1 - hook=phase1_flush - local line="$1" - case "$line" in - '') - phase1_tail+=$'\n' - ;; - '#include'*) - phase1_tail='' - local re='^#include [<"]([^">]*)[">](.*)' - if [[ "$line" =~ $re ]]; then - IFS=' ' - local buf - buf="$(classify "${BASH_REMATCH[1]}")" || panic - read -r class path <<<"$buf" - case "$class" in - system) - printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" - system+=("$line") - ;; - linux) - printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" - linux+=("$line") - ;; - public) - printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" - public+=("$line") - ;; - protected) - printf -v line '#include "%s"%s' "$path" "${BASH_REMATCH[2]}" - protected+=("$line") - ;; - private) - if [[ ${#typedef[@]} -gt 0 ]]; then - typedef_last=false - fi - printf -v line '#include "%s"%s' "$path" "${BASH_REMATCH[2]}" - private+=("$line") - ;; - esac - else - panic - fi - ;; - 'typedef '*';') - phase1_tail='' - typedef+=("$line") - ;; - *) - phase1_flush - phase0 "$line" - ;; - esac + phase=phase1 + hook=phase1_flush + local line="$1" + case "$line" in + '') + phase1_tail+=$'\n' + ;; + '#include'*) + phase1_tail='' + local re='^#include [<"]([^">]*)[">](.*)' + if [[ "$line" =~ $re ]]; then + IFS=' ' + local buf + buf="$(classify "${BASH_REMATCH[1]}")" || panic + read -r class path <<<"$buf" + case "$class" in + system) + printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" + system+=("$line") + ;; + linux) + printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" + linux+=("$line") + ;; + public) + printf -v line '#include <%s>%s' "$path" "${BASH_REMATCH[2]}" + public+=("$line") + ;; + protected) + printf -v line '#include "%s"%s' "$path" "${BASH_REMATCH[2]}" + protected+=("$line") + ;; + private) + if [[ ${#typedef[@]} -gt 0 ]]; then + typedef_last=false + fi + printf -v line '#include "%s"%s' "$path" "${BASH_REMATCH[2]}" + private+=("$line") + ;; + esac + else + panic + fi + ;; + 'typedef '*';') + phase1_tail='' + typedef+=("$line") + ;; + *) + phase1_flush + phase0 "$line" + ;; + esac } main() { - current_file="$1" - printf ' => %q %q\n' "$0" "$current_file" - set -o pipefail - trap 'rm -f -- "$current_file.tmp"' EXIT - { - IFS='' - while read -r line; do - "$phase" "$line" - IFS='' - done - "$hook" - } < "$current_file" > "$current_file.tmp" - if cmp -s "$current_file.tmp" "$current_file"; then - rm -f "$current_file.tmp" || : - else - mv -Tf "$current_file.tmp" "$current_file" - fi + current_file="$1" + printf ' => %q %q\n' "$0" "$current_file" + set -o pipefail + trap 'rm -f -- "$current_file.tmp"' EXIT + { + IFS='' + while read -r line; do + "$phase" "$line" + IFS='' + done + "$hook" + } < "$current_file" > "$current_file.tmp" + # I specificially don't use write-ifchanged because I don't want the + # temporary file to have the .c suffix. + if cmp -s "$current_file.tmp" "$current_file"; then + rm -f "$current_file.tmp" || : + else + mv -Tf "$current_file.tmp" "$current_file" + fi } main "$@" diff --git a/tools/notsd-move b/tools/notsd-move index 5ae639fe26..bf0646528f 100755 --- a/tools/notsd-move +++ b/tools/notsd-move @@ -706,6 +706,41 @@ breakup_makefile() ( src/libsystemd/src/Makefile \ src/libsystemd/src/sd-journal/Makefile \ src/grp-udev/libudev-core/Makefile + + ln -sT ../grp-system/libcore/mount-setup.h src/systemd-remount-fs/mount-setup.h + ln -sT ../grp-system/libcore/mount-setup.c src/systemd-remount-fs/mount-setup.c + ln -sT ../libcore/mount-setup.h src/grp-system/systemd-shutdown/mount-setup.h + ln -sT ../libcore/mount-setup.c src/grp-system/systemd-shutdown/mount-setup.c + ln -sT ../libcore/killall.h src/grp-system/systemd-shutdown/killall.h + ln -sT ../libcore/killall.c src/grp-system/systemd-shutdown/killall.c + ln -sT ../../libcore/mount-setup.h src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.h + ln -sT ../../libcore/mount-setup.c src/grp-system/grp-utils/systemd-fstab-generator/mount-setup.c + ln -sT ../grp-system/libcore/mount-setup.h src/systemd-nspawn/mount-setup.h + ln -sT ../grp-system/libcore/loopback-setup.h src/systemd-nspawn/loopback-setup.h + ln -sT ../grp-system/libcore/loopback-setup.c src/systemd-nspawn/loopback-setup.c + ln -sT ../grp-system/libcore/machine-id-setup.h src/systemd-nspawn/machine-id-setup.h + ln -sT ../grp-system/libcore/machine-id-setup.c src/systemd-nspawn/machine-id-setup.c + ln -sT ../grp-system/libcore/mount-setup.c src/systemd-nspawn/mount-setup.c + ln -sT ../../../libsystemd/include/systemd/_sd-common.h src/libsystemd-network/include/systemd-network/_sd-common.h + ln -sT ../../libsystemd/include/systemd/_sd-common.h src/grp-utils/systemd-path/_sd-common.h + ln -sT ../../grp-login/systemd-logind/logind-acl.h src/grp-udev/libudev-core/logind-acl.h + ln -sT ../../libsystemd/src/sd-login/sd-login.c src/grp-udev/libudev-core/sd-login.c + ln -sT ../../grp-login/systemd-logind/logind-acl.c src/grp-udev/libudev-core/logind-acl.c + ln -sT ../../../libshared/include/shared/gcrypt-util.h src/libsystemd/src/sd-journal/gcrypt-util.h + ln -sT ../../../libshared/src/gcrypt-util.c src/libsystemd/src/sd-journal/gcrypt-util.c + ln -sT ../grp-system/libcore/machine-id-setup.h src/systemd-machine-id-setup/machine-id-setup.h + ln -sT ../grp-system/libcore/machine-id-setup.c src/systemd-machine-id-setup/machine-id-setup.c + + ln -sT ../subdir.mk src/libsystemd/src/sd-network/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-bus/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-event/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-login/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-resolve/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-daemon/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-netlink/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-id128/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-hwdb/Makefile + ln -sT ../subdir.mk src/libsystemd/src/sd-device/Makefile ) fixup_makefile() { |