diff options
57 files changed, 2193 insertions, 408 deletions
diff --git a/.gitignore b/.gitignore index f7db68b4a6..e51f9cc2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -22,11 +22,12 @@ /GRTAGS /GSYMS /GTAGS -/Makefile /TAGS /ata_id /bootctl -/build-aux +/build-aux/* +!/build-aux/Makefile* +!/build-aux/write-ifchanged /busctl /cdrom_id /collect @@ -303,3 +304,9 @@ config.log config.status configure stamp-* +.tmp* +/autoconf.mk +/automake.mk.in +/automake.mk +/config.mk +/gnustandards.mk diff --git a/Makefile.am b/Makefile.am index bc615bdc3b..537207c6a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,4 @@ +#@all # -*- Mode: makefile; indent-tabs-mode: t -*- # # This file is part of systemd. @@ -6,6 +7,7 @@ # 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 @@ -19,7 +21,10 @@ # # 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 +#@build-aux/Makefile.once.head/20-sd.mk ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AM_MAKEFLAGS = --no-print-directory AUTOMAKE_OPTIONS = color-tests parallel-tests @@ -38,14 +43,17 @@ SUBDIRS = . po # Keep the test-suite.log .PRECIOUS: $(TEST_SUITE_LOG) Makefile +#@src/libudev/Makefile LIBUDEV_CURRENT=7 LIBUDEV_REVISION=5 LIBUDEV_AGE=6 +#@src/libsystemd/Makefile LIBSYSTEMD_CURRENT=16 LIBSYSTEMD_REVISION=0 LIBSYSTEMD_AGE=16 +#@config.mk.in # Dirs of external packages dbuspolicydir=@dbuspolicydir@ dbussessionservicedir=@dbussessionservicedir@ @@ -97,6 +105,7 @@ rootprefix=@rootprefix@ rootbindir=$(rootprefix)/bin rootlibexecdir=$(rootprefix)/lib/systemd +#@discard.mk EXTRA_DIST = BUILT_SOURCES = INSTALL_EXEC_HOOKS = @@ -142,7 +151,7 @@ endif else noinst_PROGRAMS = TESTS = -endif +endif # ENABLE_TESTS AM_TESTS_ENVIRONMENT = \ export SYSTEMD_KBD_MODEL_MAP=$(abs_top_srcdir)/src/locale/kbd-model-map; \ export SYSTEMD_LANGUAGE_FALLBACK_MAP=$(abs_top_srcdir)/src/locale/language-fallback-map; @@ -150,11 +159,11 @@ AM_TESTS_ENVIRONMENT = \ if ENABLE_BASH_COMPLETION dist_bashcompletion_DATA = $(dist_bashcompletion_data) nodist_bashcompletion_DATA = $(nodist_bashcompletion_data) -endif +endif # ENABLE_BASH_COMPLETION if ENABLE_ZSH_COMPLETION dist_zshcompletion_DATA = $(dist_zshcompletion_data) nodist_zshcompletion_DATA = $(nodist_zshcompletion_data) -endif +endif # ENABLE_ZSH_COMPLETION udevlibexec_PROGRAMS = gperf_gperf_sources = @@ -346,47 +355,107 @@ INSTALL_EXEC_HOOKS += \ INSTALL_EXEC_HOOKS += \ install-busnames-target-wants-hook -# ------------------------------------------------------------------------------ +#@build-aux/Makefile.once.head/20-sd.mk ---------------------------------------- +V ?= + AM_V_M4 = $(AM_V_M4_$(V)) AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY)) AM_V_M4_0 = @echo " M4 " $@; +AM_V_M4_1 = +#@build-aux/Makefile.once.head/20-sdman.mk AM_V_XSLT = $(AM_V_XSLT_$(V)) AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY)) AM_V_XSLT_0 = @echo " XSLT " $@; +AM_V_XSLT_1 = +#@build-aux/Makefile.once.head/20-sd.mk AM_V_GPERF = $(AM_V_GPERF_$(V)) AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY)) AM_V_GPERF_0 = @echo " GPERF " $@; +AM_V_GPERF_1 = +#@build-aux/Makefile.once.head/20-sdman.mk AM_V_LN = $(AM_V_LN_$(V)) AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY)) AM_V_LN_0 = @echo " LN " $@; +AM_V_LN_1 = +#@build-aux/Makefile.once.head/20-sd.mk AM_V_RM = $(AM_V_RM_$(V)) AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY)) AM_V_RM_0 = @echo " RM " $@; - -# ------------------------------------------------------------------------------ -rootbin_PROGRAMS = \ - systemctl \ - systemd-notify \ - systemd-ask-password \ - systemd-tty-ask-password-agent \ - systemd-machine-id-setup \ - systemd-escape - -bin_PROGRAMS = \ - systemd-cgls \ - systemd-cgtop \ - systemd-nspawn \ - systemd-detect-virt \ - systemd-delta \ - systemd-analyze \ - systemd-run \ - systemd-stdio-bridge \ - systemd-path - +AM_V_RM_1 = + +AM_V_CC = $(AM_V_CC_$(V)) +AM_V_CC_ = $(AM_V_CC_$(AM_DEFAULT_VERBOSITY)) +AM_V_CC_0 = @echo " CC " $@; +AM_V_CC_1 = + +AM_V_CCLD = $(AM_V_CCLD_$(V)) +AM_V_CCLD_ = $(AM_V_CCLD_$(AM_DEFAULT_VERBOSITY)) +AM_V_CCLD_0 = @echo " CCLD " $@; +AM_V_CCLD_1 = + +AM_V_P = $(AM_V_P_$(V)) +AM_V_P_ = $(AM_V_P_$(AM_DEFAULT_VERBOSITY)) +AM_V_P_0 = false +AM_V_P_1 = : + +AM_V_GEN = $(AM_V_GEN_$(V)) +AM_V_GEN_ = $(AM_V_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN_0 = @echo " GEN " $@; +AM_V_GEN_1 = + +AM_V_at = $(AM_V_at_$(V)) +AM_V_at_ = $(AM_V_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at_0 = @ +AM_V_at_1 = + +AM_V_lt = $(AM_V_lt_$(V)) +AM_V_lt_ = $(AM_V_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt_0 = --silent +AM_V_lt_1 = + +INTLTOOL_V_MERGE = $(INTLTOOL_V_MERGE_$(V)) +INTLTOOL_V_MERGE_OPTIONS = $(intltool_v_merge_options_$(V)) +INTLTOOL_V_MERGE_ = $(INTLTOOL_V_MERGE_$(AM_DEFAULT_VERBOSITY)) +INTLTOOL_V_MERGE_0 = @echo " ITMRG " $@; +INTLTOOL_V_MERGE_1 = + +#@auto/systemctl/Makefile +rootbin_PROGRAMS += systemctl +#@auto/systemd-notify/Makefile +rootbin_PROGRAMS += systemd-notify +#@auto/systemd-ask-password/Makefile +rootbin_PROGRAMS += systemd-ask-password +#@auto/systemd-tty-ask-password-agent/Makefile +rootbin_PROGRAMS += systemd-tty-ask-password-agent +#@auto/systemd-machine-id-setup/Makefile +rootbin_PROGRAMS += systemd-machine-id-setup +#@auto/systemd-escape/Makefile +rootbin_PROGRAMS += systemd-escape + +#@auto/systemd-cgls/Makefile +bin_PROGRAMS += systemd-cgls +#@auto/systemd-cgtop/Makefile +bin_PROGRAMS += systemd-cgtop +#@auto/systemd-nspawn/Makefile +bin_PROGRAMS += systemd-nspawn +#@auto/systemd-detect-virt/Makefile +bin_PROGRAMS += systemd-detect-virt +#@auto/systemd-delta/Makefile +bin_PROGRAMS += systemd-delta +#@auto/systemd-analyze/Makefile +bin_PROGRAMS += systemd-analyze +#@auto/systemd-run/Makefile +bin_PROGRAMS += systemd-run +#@auto/systemd-stdio-bridge/Makefile +bin_PROGRAMS += systemd-stdio-bridge +#@auto/systemd-path/Makefile +bin_PROGRAMS += systemd-path + +#@auto/kernel-install/Makefile dist_bin_SCRIPTS = \ src/kernel-install/kernel-install @@ -394,31 +463,47 @@ dist_kernelinstall_SCRIPTS = \ src/kernel-install/50-depmod.install \ src/kernel-install/90-loaderentry.install -rootlibexec_PROGRAMS = \ - systemd \ - systemd-cgroups-agent \ - systemd-initctl \ - systemd-shutdown \ - systemd-remount-fs \ - systemd-reply-password \ - systemd-fsck \ - systemd-ac-power \ - systemd-sysctl \ - systemd-sleep \ - systemd-socket-proxyd \ - systemd-update-done - +#@src/grp-system/systemd/Makefile +rootlibexec_PROGRAMS += systemd +#@auto/systemd-cgroups-agent/Makefile +rootlibexec_PROGRAMS += systemd-cgroups-agent +#@auto/systemd-initctl/Makefile +rootlibexec_PROGRAMS += systemd-initctl +#@auto/systemd-shutdown/Makefile +rootlibexec_PROGRAMS += systemd-shutdown +#@auto/systemd-remount-fs/Makefile +rootlibexec_PROGRAMS += systemd-remount-fs +#@auto/systemd-reply-password/Makefile +rootlibexec_PROGRAMS += systemd-reply-password +#@auto/systemd-fsck/Makefile +rootlibexec_PROGRAMS += systemd-fsck +#@auto/systemd-ac-power/Makefile +rootlibexec_PROGRAMS += systemd-ac-power +#@auto/systemd-sysctl/Makefile +rootlibexec_PROGRAMS += systemd-sysctl +#@auto/systemd-sleep/Makefile +rootlibexec_PROGRAMS += systemd-sleep +#@auto/systemd-socket-proxyd/Makefile +rootlibexec_PROGRAMS += systemd-socket-proxyd +#@auto/systemd-update-done/Makefile +rootlibexec_PROGRAMS += systemd-update-done + +#@auto/systemd-update-utmp/Makefile if HAVE_UTMP rootlibexec_PROGRAMS += \ systemd-update-utmp -endif - -systemgenerator_PROGRAMS = \ - systemd-getty-generator \ - systemd-fstab-generator \ - systemd-system-update-generator \ - systemd-debug-generator - +endif # HAVE_UTMP + +#@auto/systemd-getty-generator/Makefile +systemgenerator_PROGRAMS += systemd-getty-generator +#@auto/systemd-fstab-generator/Makefile +systemgenerator_PROGRAMS += systemd-fstab-generator +#@auto/systemd-system-update-generator/Makefile +systemgenerator_PROGRAMS += systemd-system-update-generator +#@auto/systemd-debug-generator/Makefile +systemgenerator_PROGRAMS += systemd-debug-generator + +#@discard.mk dist_bashcompletion_data = \ shell-completion/bash/busctl \ shell-completion/bash/journalctl \ @@ -568,7 +653,7 @@ if HAVE_UTMP nodist_systemunit_DATA += \ units/systemd-update-utmp.service \ units/systemd-update-utmp-runlevel.service -endif +endif # HAVE_UTMP dist_userunit_DATA = \ units/user/basic.target \ @@ -627,7 +712,7 @@ nodist_systemunit_DATA += \ systemgenerator_PROGRAMS += \ systemd-sysv-generator \ systemd-rc-local-generator -endif +endif # HAVE_SYSV_COMPAT EXTRA_DIST += \ src/systemctl/systemd-sysv-install.SKELETON \ @@ -672,7 +757,7 @@ EXTRA_DIST += \ @INTLTOOL_POLICY_RULE@ -# ------------------------------------------------------------------------------ +#@build-aux/Makefile.each.tail/70-sdman.mk ------------------------------------- MANPAGES = MANPAGES_ALIAS = @@ -698,7 +783,7 @@ noinst_DATA += \ $(HTML_FILES) \ $(HTML_ALIAS) \ docs/html/man -endif +endif # ENABLE_MANPAGES CLEANFILES += \ $(man_MANS) \ @@ -716,7 +801,7 @@ man/index.html: man/systemd.index.html if HAVE_PYTHON noinst_DATA += \ man/index.html -endif +endif # HAVE_PYTHON CLEANFILES += \ man/index.html @@ -753,7 +838,9 @@ EXTRA_DIST += \ tools/xml_helper.py \ man/glib-event-glue.c -# ------------------------------------------------------------------------------ +#@src/libbasic/Makefile -------------------------------------------------------- +nested.subdirs += src include +#@src/libbasic/src/Makefile noinst_LTLIBRARIES += \ libbasic.la @@ -970,7 +1057,9 @@ libbasic_la_LIBADD = \ -lrt \ -lm -# ----------------------------------------------------------------------------- +#@src/libshared/Makefile ------------------------------------------------------- +nested.subdirs += src +#@src/libshared/src/Makefile noinst_LTLIBRARIES += \ libshared.la @@ -1064,19 +1153,19 @@ libshared_la_SOURCES = \ if HAVE_UTMP libshared_la_SOURCES += \ src/shared/utmp-wtmp.c -endif +endif # HAVE_UTMP if HAVE_SECCOMP libshared_la_SOURCES += \ src/shared/seccomp-util.h \ src/shared/seccomp-util.c -endif +endif # HAVE_SECCOMP if HAVE_ACL libshared_la_SOURCES += \ src/shared/acl-util.c \ src/shared/acl-util.h -endif +endif # HAVE_ACL libshared_la_CFLAGS = \ $(AM_CFLAGS) \ @@ -1130,8 +1219,7 @@ libsystemd_shared_la_LDFLAGS = \ $(AM_LDFLAGS) \ -release $(PACKAGE_VERSION) - -# ----------------------------------------------------------------------------- +#@src/libsystemd-firewall/src/Makefile ----------------------------------------- if HAVE_LIBIPTC noinst_LTLIBRARIES += \ libfirewall.la @@ -1146,18 +1234,18 @@ libfirewall_la_CFLAGS = \ libfirewall_la_LIBADD = \ $(LIBIPTC_LIBS) -endif +endif # HAVE_LIBIPTC -# ----------------------------------------------------------------------------- +#@discard.mk ------------------------------------------------------------------- if ENABLE_LDCONFIG dist_systemunit_DATA += \ units/ldconfig.service SYSINIT_TARGET_WANTS += \ ldconfig.service -endif +endif # ENABLE_LDCONFIG -# ------------------------------------------------------------------------------ +#@src/grp-system/libcore/src/Makefile ------------------------------------------ noinst_LTLIBRARIES += \ libcore.la @@ -1304,6 +1392,7 @@ src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@ +#@discard.mk gperf_gperf_m4_sources = \ src/core/load-fragment-gperf.gperf.m4 @@ -1332,6 +1421,7 @@ EXTRA_DIST += \ CLEANFILES += \ $(gperf_txt_sources) +#@build-aux/Makefile.each.tail/50-sd.mk %-from-name.gperf: %-list.txt $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ @@ -1340,7 +1430,7 @@ CLEANFILES += \ $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@ - +#@src/libbasic/src/Makefile src/basic/errno-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@ @@ -1388,10 +1478,11 @@ src/basic/cap-from-name.h: src/basic/cap-from-name.gperf $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@ +#@src/libsystemd/src/sd-journal/Makefile audit_list_includes = -include linux/audit.h -include missing.h if HAVE_AUDIT audit_list_includes += -include libaudit.h -endif +endif # HAVE_AUDIT src/journal/audit_type-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -1401,6 +1492,7 @@ src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" } {printf " case AUDIT_%s: return \"%s\";\n", $$1, $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@ +#@src/grp-resolve/libbasic-dns/src/Makefile src/resolve/dns_type-list.txt: src/resolve/dns-type.h $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -1414,7 +1506,7 @@ src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@ -# ------------------------------------------------------------------------------ +#@src/grp-system/systemd/Makefile ---------------------------------------------- systemd_SOURCES = \ src/core/main.c @@ -1453,7 +1545,7 @@ EXTRA_DIST += \ src/core/macros.systemd.in \ src/core/triggers.systemd.in -# ------------------------------------------------------------------------------ +#@test/Makefile ---------------------------------------------------------------- manual_tests += \ test-ns \ @@ -1471,12 +1563,12 @@ unsafe_tests = \ if HAVE_LIBIPTC manual_tests += \ test-firewall-util -endif +endif # HAVE_LIBIPTC if HAVE_KMOD manual_tests += \ test-netlink-manual -endif +endif # HAVE_KMOD tests += \ test-daemon \ @@ -1569,7 +1661,7 @@ tests += \ if HAVE_ACL tests += \ test-acl-util -endif +endif # HAVE_ACL EXTRA_DIST += \ test/a.service \ @@ -1752,7 +1844,7 @@ test_boot_timestamps_SOURCES = \ test_boot_timestamps_LDADD = \ libsystemd-shared.la -endif +endif # ENABLE_EFI test_unit_name_SOURCES = \ src/test/test-unit-name.c @@ -2188,7 +2280,7 @@ test_firewall_util_LDADD = \ libfirewall.la \ libsystemd-shared.la \ $(LIBIPTC_LIBS) -endif +endif # HAVE_LIBIPTC test_netlink_manual_SOURCES = \ src/test/test-netlink-manual.c @@ -2375,7 +2467,7 @@ test_arphrd_list_SOURCES = \ test_arphrd_list_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@discard.mk ------------------------------------------------------------------- ## .PHONY so it always rebuilds it .PHONY: coverage lcov-run lcov-report coverage-sync @@ -2412,9 +2504,9 @@ coverage-sync: coverage else lcov-run lcov-report: echo "Need to reconfigure with --enable-coverage" -endif +endif # ENABLE_COVERAGE -# ------------------------------------------------------------------------------ +#@auto/systemd-analyze/Makefile ------------------------------------------------ systemd_analyze_SOURCES = \ src/analyze/analyze.c \ src/analyze/analyze-verify.c \ @@ -2428,14 +2520,14 @@ systemd_analyze_CFLAGS = \ systemd_analyze_LDADD = \ libcore.la -# ------------------------------------------------------------------------------ +#@auto/systemd-initctl/Makefile ------------------------------------------------ systemd_initctl_SOURCES = \ src/initctl/initctl.c systemd_initctl_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-update-utmp/Makefile -------------------------------------------- systemd_update_utmp_SOURCES = \ src/update-utmp/update-utmp.c @@ -2447,14 +2539,14 @@ systemd_update_utmp_LDADD = \ libsystemd-shared.la \ $(AUDIT_LIBS) -# ------------------------------------------------------------------------------ +#@auto/systemd-update-done/Makefile -------------------------------------------- systemd_update_done_SOURCES = \ src/update-done/update-done.c systemd_update_done_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-shutdown/Makefile ----------------------------------------------- systemd_shutdown_SOURCES = \ src/core/umount.c \ src/core/umount.h \ @@ -2467,7 +2559,7 @@ systemd_shutdown_SOURCES = \ systemd_shutdown_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-modules-load/Makefile ------------------------------------------- if HAVE_KMOD systemd_modules_load_SOURCES = \ src/modules-load/modules-load.c @@ -2495,14 +2587,14 @@ nodist_systemunit_DATA += \ SYSINIT_TARGET_WANTS += \ kmod-static-nodes.service -endif -endif +endif # ENABLE_TMPFILES +endif # HAVE_KMOD EXTRA_DIST += \ units/systemd-modules-load.service.in \ units/kmod-static-nodes.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-tmpfiles/Makefile ----------------------------------------------- if ENABLE_TMPFILES systemd_tmpfiles_SOURCES = \ src/tmpfiles/tmpfiles.c @@ -2542,7 +2634,7 @@ dist_tmpfiles_DATA = \ if HAVE_SYSV_COMPAT dist_tmpfiles_DATA += \ tmpfiles.d/legacy.conf -endif +endif # HAVE_SYSV_COMPAT SYSINIT_TARGET_WANTS += \ systemd-tmpfiles-setup-dev.service \ @@ -2557,7 +2649,7 @@ TIMERS_TARGET_WANTS += \ INSTALL_DIRS += \ $(tmpfilesdir) \ $(sysconfdir)/tmpfiles.d -endif +endif # ENABLE_TMPFILES EXTRA_DIST += \ tmpfiles.d/systemd.conf.m4 \ @@ -2566,7 +2658,7 @@ EXTRA_DIST += \ units/systemd-tmpfiles-setup.service.in \ units/systemd-tmpfiles-clean.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-sysusers/Makefile ----------------------------------------------- if ENABLE_SYSUSERS systemd_sysusers_SOURCES = \ src/sysusers/sysusers.c @@ -2587,14 +2679,16 @@ nodist_sysusers_DATA = \ sysusers.d/systemd.conf \ sysusers.d/basic.conf +#@discard.mk if HAVE_REMOTE nodist_sysusers_DATA += \ sysusers.d/systemd-remote.conf -endif +endif # HAVE_REMOTE +#@auto/systemd-sysusers/Makefile INSTALL_DIRS += \ $(sysusersdir) -endif +endif # ENABLE_SYSUSERS EXTRA_DIST += \ units/systemd-sysusers.service.in \ @@ -2602,7 +2696,7 @@ EXTRA_DIST += \ sysusers.d/systemd-remote.conf.m4 \ sysusers.d/basic.conf.in -# ------------------------------------------------------------------------------ +#@discard.mk ------------------------------------------------------------------- dist_factory_etc_DATA = \ factory/etc/nsswitch.conf @@ -2610,9 +2704,9 @@ if HAVE_PAM dist_factory_pam_DATA = \ factory/etc/pam.d/system-auth \ factory/etc/pam.d/other -endif +endif # HAVE_PAM -# ------------------------------------------------------------------------------ +#@auto/systemd-firstboot/Makefile ---------------------------------------------- if ENABLE_FIRSTBOOT systemd_firstboot_SOURCES = \ src/firstboot/firstboot.c @@ -2629,12 +2723,12 @@ nodist_systemunit_DATA += \ SYSINIT_TARGET_WANTS += \ systemd-firstboot.service -endif +endif # ENABLE_FIRSTBOOT EXTRA_DIST += \ units/systemd-firstboot.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-machine-id-setup/Makefile --------------------------------------- systemd_machine_id_setup_SOURCES = \ src/machine-id-setup/machine-id-setup-main.c \ src/core/machine-id-setup.c \ @@ -2646,35 +2740,35 @@ systemd_machine_id_setup_LDADD = \ SYSINIT_TARGET_WANTS += \ systemd-machine-id-commit.service -# ------------------------------------------------------------------------------ +#@auto/systemd-sysctl/Makefile ------------------------------------------------- systemd_sysctl_SOURCES = \ src/sysctl/sysctl.c systemd_sysctl_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-sleep/Makefile -------------------------------------------------- systemd_sleep_SOURCES = \ src/sleep/sleep.c systemd_sleep_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-fsck/Makefile --------------------------------------------------- systemd_fsck_SOURCES = \ src/fsck/fsck.c systemd_fsck_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-ac-power/Makefile ----------------------------------------------- systemd_ac_power_SOURCES = \ src/ac-power/ac-power.c systemd_ac_power_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-detect-virt/Makefile -------------------------------------------- systemd_detect_virt_SOURCES = \ src/detect-virt/detect-virt.c @@ -2684,28 +2778,28 @@ systemd_detect_virt_LDADD = \ INSTALL_EXEC_HOOKS += \ systemd-detect-virt-install-hook -# ------------------------------------------------------------------------------ +#@auto/systemd-delta/Makefile -------------------------------------------------- systemd_delta_SOURCES = \ src/delta/delta.c systemd_delta_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-getty-generator/Makefile ---------------------------------------- systemd_getty_generator_SOURCES = \ src/getty-generator/getty-generator.c systemd_getty_generator_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-debug-generator/Makefile ---------------------------------------- systemd_debug_generator_SOURCES = \ src/debug-generator/debug-generator.c systemd_debug_generator_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-fstab-generator/Makefile ---------------------------------------- systemd_fstab_generator_SOURCES = \ src/fstab-generator/fstab-generator.c \ src/core/mount-setup.c @@ -2713,18 +2807,21 @@ systemd_fstab_generator_SOURCES = \ systemd_fstab_generator_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-system-update-generator/Makefile -------------------------------- systemd_system_update_generator_SOURCES = \ src/system-update-generator/system-update-generator.c systemd_system_update_generator_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-hibernate-resume-generator/Makefile ----------------------------- if ENABLE_HIBERNATE systemgenerator_PROGRAMS += \ systemd-hibernate-resume-generator +#@auto/systemd-hibernate-resume/Makefile +if ENABLE_HIBERNATE + rootlibexec_PROGRAMS += \ systemd-hibernate-resume @@ -2734,28 +2831,40 @@ systemd_hibernate_resume_SOURCES = \ systemd_hibernate_resume_LDADD = \ libsystemd-shared.la +nodist_systemunit_DATA += \ + units/systemd-hibernate-resume@.service + +endif # ENABLE_HIBERNATE + +EXTRA_DIST += \ + units/systemd-hibernate-resume@.service.in + +#@auto/systemd-hibernate-resume-generator/Makefile systemd_hibernate_resume_generator_SOURCES = \ src/hibernate-resume/hibernate-resume-generator.c systemd_hibernate_resume_generator_LDADD = \ libsystemd-shared.la +endif # ENABLE_HIBERNATE +#@auto/systemd-sleep/Makefile +if ENABLE_HIBERNATE + dist_systemunit_DATA += \ units/hibernate.target \ units/hybrid-sleep.target nodist_systemunit_DATA += \ units/systemd-hibernate.service \ - units/systemd-hibernate-resume@.service \ units/systemd-hybrid-sleep.service -endif + +endif # ENABLE_HIBERNATE EXTRA_DIST += \ units/systemd-hibernate.service.in \ - units/systemd-hibernate-resume@.service.in \ units/systemd-hybrid-sleep.service.in -# ------------------------------------------------------------------------------ +#@auto/bootctl/Makefile -------------------------------------------------------- if ENABLE_EFI if HAVE_BLKID bootctl_SOURCES = \ @@ -2782,9 +2891,11 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_bootctl -endif +endif # HAVE_BLKID +endif # ENABLE_EFI -# ------------------------------------------------------------------------------ +#@auto/systemd-boot/Makefile --------------------------------------------------- +if ENABLE_EFI if HAVE_GNUEFI efi_cppflags = \ $(EFI_CPPFLAGS) \ @@ -2816,13 +2927,13 @@ efi_cflags += \ -mno-mmx \ -DEFI_FUNCTION_WRAPPER \ -DGNU_EFI_USE_MS_ABI -endif +endif # ARCH_X86_64 if ARCH_IA32 efi_cflags += \ -mno-sse \ -mno-mmx -endif +endif # ARCH_IA32 efi_ldflags = \ $(EFI_LDFLAGS) \ @@ -2841,9 +2952,9 @@ efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa EFI_FORMAT = -O binary else EFI_FORMAT = --target=efi-app-$(EFI_ARCH) -endif -endif -endif +endif # ARCH_AARCH64 +endif # HAVE_GNUEFI +endif # ENABLE_EFI # ------------------------------------------------------------------------------ systemd_boot_headers = \ @@ -2885,8 +2996,8 @@ $(systemd_boot_solib): $(systemd_boot_objects) $(systemd_boot): $(systemd_boot_solib) $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \ -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ -endif -endif +endif # HAVE_GNUEFI +endif # ENABLE_EFI CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot) @@ -2935,8 +3046,8 @@ $(stub_solib): $(stub_objects) $(stub): $(stub_solib) $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \ -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ -endif -endif +endif # HAVE_GNUEFI +endif # ENABLE_EFI CLEANFILES += $(stub_objects) $(stub_solib) $(stub) @@ -2952,7 +3063,7 @@ test-efi: test-efi-disk.img EXTRA_DIST += test/test-efi-create-disk.sh -# ------------------------------------------------------------------------------ +#@auto/systemd-gpt-auto-generator/Makefile ------------------------------------- if HAVE_BLKID systemgenerator_PROGRAMS += \ systemd-gpt-auto-generator @@ -2968,27 +3079,27 @@ systemd_gpt_auto_generator_LDADD = \ systemd_gpt_auto_generator_CFLAGS = \ $(AM_CFLAGS) \ $(BLKID_CFLAGS) -endif +endif # HAVE_BLKID -# ------------------------------------------------------------------------------ +#@src/grp-system/systemd/Makefile ---------------------------------------------- dist_xinitrc_SCRIPTS = \ xorg/50-systemd-user.sh -# ------------------------------------------------------------------------------ +#@auto/systemd-sysv-generator/Makefile ----------------------------------------- systemd_sysv_generator_SOURCES = \ src/sysv-generator/sysv-generator.c systemd_sysv_generator_LDADD = \ libcore.la -# ------------------------------------------------------------------------------ +#@auto/systemd-rc-local-generator/Makefile ------------------------------------- systemd_rc_local_generator_SOURCES = \ src/rc-local-generator/rc-local-generator.c systemd_rc_local_generator_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-remount-fs/Makefile --------------------------------------------- systemd_remount_fs_SOURCES = \ src/remount-fs/remount-fs.c \ src/core/mount-setup.c \ @@ -2997,70 +3108,70 @@ systemd_remount_fs_SOURCES = \ systemd_remount_fs_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-cgroups-agent/Makefile ------------------------------------------ systemd_cgroups_agent_SOURCES = \ src/cgroups-agent/cgroups-agent.c systemd_cgroups_agent_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-escape/Makefile ------------------------------------------------- systemd_escape_SOURCES = \ src/escape/escape.c systemd_escape_LDADD = \ libsystemd-shared.la -# ----------------------------------------------------------------------------- +#@auto/systemctl/Makefile ------------------------------------------------------ systemctl_SOURCES = \ src/systemctl/systemctl.c systemctl_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-notify/Makefile ------------------------------------------------- systemd_notify_SOURCES = \ src/notify/notify.c systemd_notify_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-path/Makefile --------------------------------------------------- systemd_path_SOURCES = \ src/path/path.c systemd_path_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-ask-password/Makefile ------------------------------------------- systemd_ask_password_SOURCES = \ src/ask-password/ask-password.c systemd_ask_password_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-reply-password/Makefile ----------------------------------------- systemd_reply_password_SOURCES = \ src/reply-password/reply-password.c systemd_reply_password_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-cgls/Makefile --------------------------------------------------- systemd_cgls_SOURCES = \ src/cgls/cgls.c systemd_cgls_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-cgtop/Makefile -------------------------------------------------- systemd_cgtop_SOURCES = \ src/cgtop/cgtop.c systemd_cgtop_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-nspawn/Makefile ------------------------------------------------- systemd_nspawn_SOURCES = \ src/nspawn/nspawn.c \ src/nspawn/nspawn-settings.c \ @@ -3111,7 +3222,7 @@ systemd_nspawn_LDADD = \ if HAVE_LIBIPTC systemd_nspawn_LDADD += \ libfirewall.la -endif +endif # HAVE_LIBIPTC test_patch_uid_SOURCES = \ src/nspawn/nspawn-patch-uid.c \ @@ -3129,28 +3240,28 @@ test_patch_uid_LDADD = \ manual_tests += \ test-patch-uid -# ------------------------------------------------------------------------------ +#@auto/systemd-run/Makefile ---------------------------------------------------- systemd_run_SOURCES = \ src/run/run.c systemd_run_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-stdio-bridge/Makefile ------------------------------------------- systemd_stdio_bridge_SOURCES = \ src/stdio-bridge/stdio-bridge.c systemd_stdio_bridge_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-tty-ask-password-agent/Makefile --------------------------------- systemd_tty_ask_password_agent_SOURCES = \ src/tty-ask-password-agent/tty-ask-password-agent.c systemd_tty_ask_password_agent_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@src/libsystemd/src/Makefile -------------------------------------------------- libsystemd_internal_la_SOURCES = \ src/systemd/sd-bus.h \ src/systemd/sd-bus-protocol.h \ @@ -3249,6 +3360,7 @@ libsystemd_internal_la_LIBADD = \ noinst_LTLIBRARIES += \ libsystemd-internal.la +#@src/libsystemd/Makefile EXTRA_DIST += \ src/libsystemd/libsystemd.pc.in \ src/libsystemd/sd-bus/DIFFERENCES \ @@ -3266,6 +3378,7 @@ libsystemd_la_LIBADD = \ libbasic.la \ libsystemd-journal-internal.la +#@discard.mk libsystemd-install-hook: libname=libsystemd.so && $(move-to-rootlibdir) @@ -3275,6 +3388,7 @@ libsystemd-uninstall-hook: INSTALL_EXEC_HOOKS += libsystemd-install-hook UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook +#@src/libsystemd/Makefile pkgconfiglib_DATA += \ src/libsystemd/libsystemd.pc @@ -3290,6 +3404,8 @@ pkginclude_HEADERS += \ lib_LTLIBRARIES += \ libsystemd.la +# ------------------------------------------------------------------------------ + tests += \ test-bus-marshal \ test-bus-signature \ @@ -3311,9 +3427,11 @@ tests += \ test-local-addresses \ test-resolve +#@auto/busctl/Makefile bin_PROGRAMS += \ busctl +#@src/libsystemd/src/test.mk test_bus_marshal_SOURCES = \ src/libsystemd/sd-bus/test-bus-marshal.c @@ -3445,6 +3563,7 @@ test_resolve_SOURCES = \ test_resolve_LDADD = \ libsystemd-shared.la +#@auto/busctl/Makefile busctl_SOURCES = \ src/libsystemd/sd-bus/busctl.c \ src/libsystemd/sd-bus/busctl-introspect.c \ @@ -3453,7 +3572,9 @@ busctl_SOURCES = \ busctl_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@src/libsystemd-network/Makefile ---------------------------------------------- +nested.subdirs += src test +#@src/libsystemd-network/src/Makefile noinst_LTLIBRARIES += \ libsystemd-network.la @@ -3512,6 +3633,7 @@ libsystemd_network_la_SOURCES = \ libsystemd_network_la_LIBADD = \ $(KMOD_LIBS) +#@src/libsystemd-network/test/Makefile test_dhcp_option_SOURCES = \ src/libsystemd-network/dhcp-protocol.h \ src/libsystemd-network/dhcp-internal.h \ @@ -3604,13 +3726,15 @@ tests += \ test-dhcp6-client \ test-lldp -# ------------------------------------------------------------------------------ +#@src/libudev/Makefile --------------------------------------------------------- + include_HEADERS += \ src/libudev/libudev.h -lib_LTLIBRARIES += \ +rootlib_LTLIBRARIES += \ libudev.la +#@src/libudev/src/Makefile libudev_la_SOURCES =\ src/libudev/libudev.sym \ src/libudev/libudev-private.h \ @@ -3624,6 +3748,7 @@ libudev_la_SOURCES =\ src/libudev/libudev-monitor.c \ src/libudev/libudev-queue.c \ src/libudev/libudev-hwdb.c +#@src/libudev/Makefile libudev_la_LDFLAGS = \ $(AM_LDFLAGS) \ @@ -3640,6 +3765,7 @@ pkgconfiglib_DATA += \ EXTRA_DIST += \ src/libudev/libudev.pc.in +#@discard.mk # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed libudev-install-hook: libname=libudev.so && $(move-to-rootlibdir) @@ -3650,23 +3776,25 @@ libudev-uninstall-hook: INSTALL_EXEC_HOOKS += libudev-install-hook UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook -# ------------------------------------------------------------------------------ +#@src/libudev/src/Makefile ----------------------------------------------------- noinst_LTLIBRARIES += \ libudev-internal.la libudev_internal_la_SOURCES =\ $(libudev_la_SOURCES) -# ------------------------------------------------------------------------------ +#@src/grp-udev/Makefile -------------------------------------------------------- INSTALL_DIRS += \ $(sysconfdir)/udev/rules.d +#@src/grp-network/Makefile dist_network_DATA = \ network/99-default.link \ network/80-container-host0.network \ network/80-container-ve.network \ network/80-container-vz.network +#@src/grp-udev/Makefile dist_udevrules_DATA += \ rules/50-udev-default.rules \ rules/60-block.rules \ @@ -3687,10 +3815,12 @@ dist_udevrules_DATA += \ nodist_udevrules_DATA += \ rules/99-systemd.rules +#@auto/systemd-udevd/Makefile udevconfdir = $(sysconfdir)/udev dist_udevconf_DATA = \ src/udev/udev.conf +#@src/grp-udev/Makefile pkgconfigdata_DATA += \ src/udev/udev.pc @@ -3711,12 +3841,15 @@ SYSINIT_TARGET_WANTS += \ systemd-udevd.service \ systemd-udev-trigger.service +#@auto/udevadm/Makefile rootbin_PROGRAMS += \ udevadm +#@auto/systemd-udevd/Makefile rootlibexec_PROGRAMS += \ systemd-udevd +#@auto/libudev-core/Makefile noinst_LTLIBRARIES += \ libudev-core.la @@ -3775,15 +3908,18 @@ libudev_core_la_LIBADD = \ if HAVE_KMOD libudev_core_la_SOURCES += \ src/udev/udev-builtin-kmod.c - +endif # HAVE_KMOD +#@src/grp-udev/Makefile +if HAVE_KMOD dist_udevrules_DATA += \ rules/80-drivers.rules -endif +endif # HAVE_KMOD +#@auto/libudev-core/Makefile if HAVE_BLKID libudev_core_la_SOURCES += \ src/udev/udev-builtin-blkid.c -endif +endif # HAVE_BLKID if HAVE_ACL libudev_core_la_SOURCES += \ @@ -3791,8 +3927,9 @@ libudev_core_la_SOURCES += \ src/login/logind-acl.c \ src/libsystemd/sd-login/sd-login.c \ src/systemd/sd-login.h -endif +endif # HAVE_ACL +#@auto/systemd-udevd/Makefile systemd_udevd_SOURCES = \ src/udev/udevd.c @@ -3800,6 +3937,7 @@ systemd_udevd_LDADD = \ libudev-core.la \ libbasic.la +#@auto/udevadm/Makefile udevadm_SOURCES = \ src/udev/udevadm.c \ src/udev/udevadm-info.c \ @@ -3817,7 +3955,7 @@ udevadm_LDADD = \ libudev-core.la \ libbasic.la -# ------------------------------------------------------------------------------ +#@auto/systemd-hwdb/Makefile --------------------------------------------------- if ENABLE_HWDB INSTALL_DIRS += \ $(sysconfdir)/udev/hwdb.d @@ -3832,6 +3970,7 @@ systemd_hwdb_LDADD = \ rootbin_PROGRAMS += \ systemd-hwdb +#@auto/hwdb/Makefile dist_udevhwdb_DATA = \ hwdb/20-pci-vendor-model.hwdb \ hwdb/20-pci-classes.hwdb \ @@ -3849,12 +3988,14 @@ dist_udevhwdb_DATA = \ hwdb/70-pointingstick.hwdb \ hwdb/70-touchpad.hwdb +#@auto/systemd-hwdb/Makefile SYSINIT_TARGET_WANTS += \ systemd-hwdb-update.service +#@auto/hwdb/Makefile # Update hwdb on installation. Do not bother if installing # in DESTDIR, since this is likely for packaging purposes. -hwdb-update-hook: +hwdb-update-hook: $(DESTDIR)$(rootbindir)/systemd-hwdb -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update INSTALL_DATA_HOOKS += \ @@ -3862,14 +4003,17 @@ INSTALL_DATA_HOOKS += \ hwdb-remove-hook: -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin -endif +#@auto/systemd-hwdb/Makefile +endif # ENABLE_HWDB EXTRA_DIST += \ - units/systemd-hwdb-update.service.in \ + units/systemd-hwdb-update.service.in +#@auto/hwdb/Makefile +EXTRA_DIST += \ hwdb/ids-update.pl \ hwdb/sdio.ids -# ------------------------------------------------------------------------------ +#@discard.mk ------------------------------------------------------------------- if ENABLE_TESTS TESTS += \ test/udev-test.pl @@ -3882,9 +4026,9 @@ TESTS += \ if HAVE_SYSV_COMPAT TESTS += \ test/sysv-generator-test.py -endif -endif -endif +endif # HAVE_SYSV_COMPAT +endif # HAVE_PYTHON +endif # ENABLE_TESTS tests += \ test-libudev @@ -3911,7 +4055,7 @@ test_udev_LDADD = \ if ENABLE_TESTS check_DATA += \ test/sys -endif +endif # ENABLE_TESTS # packed sysfs test tree test/sys: test/sys.tar.xz @@ -3932,7 +4076,7 @@ EXTRA_DIST += \ test/mocks/fsck \ hwdb/parse_hwdb.py -# ------------------------------------------------------------------------------ +#@auto/ata_id/Makefile --------------------------------------------------------- ata_id_SOURCES = \ src/udev/ata_id/ata_id.c @@ -3942,7 +4086,7 @@ ata_id_LDADD = \ udevlibexec_PROGRAMS += \ ata_id -# ------------------------------------------------------------------------------ +#@auto/cdrom_id/Makefile ------------------------------------------------------- cdrom_id_SOURCES = \ src/udev/cdrom_id/cdrom_id.c @@ -3955,7 +4099,7 @@ udevlibexec_PROGRAMS += \ dist_udevrules_DATA += \ rules/60-cdrom_id.rules -# ------------------------------------------------------------------------------ +#@auto/collect/Makefile -------------------------------------------------------- collect_SOURCES = \ src/udev/collect/collect.c @@ -3965,7 +4109,7 @@ collect_LDADD = \ udevlibexec_PROGRAMS += \ collect -# ------------------------------------------------------------------------------ +#@auto/scsi_id/Makefile -------------------------------------------------------- scsi_id_SOURCES =\ src/udev/scsi_id/scsi_id.c \ src/udev/scsi_id/scsi_serial.c \ @@ -3981,7 +4125,7 @@ udevlibexec_PROGRAMS += \ EXTRA_DIST += \ src/udev/scsi_id/README -# ------------------------------------------------------------------------------ +#@auto/v4l_id/Makefile --------------------------------------------------------- v4l_id_SOURCES = \ src/udev/v4l_id/v4l_id.c @@ -3994,7 +4138,7 @@ udevlibexec_PROGRAMS += \ dist_udevrules_DATA += \ rules/60-persistent-v4l.rules -# ------------------------------------------------------------------------------ +#@auto/mtd_probe/Makefile ------------------------------------------------------ mtd_probe_SOURCES = \ src/udev/mtd_probe/mtd_probe.c \ src/udev/mtd_probe/mtd_probe.h \ @@ -4006,7 +4150,7 @@ dist_udevrules_DATA += \ udevlibexec_PROGRAMS += \ mtd_probe -# ------------------------------------------------------------------------------ +#@src/test/Makefile ------------------------------------------------------------ test_id128_SOURCES = \ src/test/test-id128.c @@ -4016,7 +4160,7 @@ test_id128_LDADD = \ tests += \ test-id128 -# ------------------------------------------------------------------------------ +#@auto/systemd-socket-activate/Makefile ---------------------------------------- bin_PROGRAMS += \ systemd-socket-activate @@ -4027,7 +4171,7 @@ systemd_socket_activate_SOURCES = \ systemd_socket_activate_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-journald/Makefile ----------------------------------------------- systemd_journald_SOURCES = \ src/journal/journald.c \ src/journal/journald-server.h @@ -4036,12 +4180,14 @@ systemd_journald_LDADD = \ libjournal-core.la \ libsystemd-shared.la +#@auto/systemd-cat/Makefile systemd_cat_SOURCES = \ src/journal/cat.c systemd_cat_LDADD = \ libjournal-core.la +#@auto/systemd-journal-upload/Makefile if HAVE_LIBCURL rootlibexec_PROGRAMS += \ systemd-journal-upload @@ -4064,12 +4210,14 @@ nodist_systemunit_DATA += \ nodist_pkgsysconf_DATA += \ src/journal-remote/journal-upload.conf -endif + +endif # HAVE_LIBCURL EXTRA_DIST += \ units/systemd-journal-upload.service.in \ src/journal-remote/journal-upload.conf.in +#@auto/systemd-journal-remote/Makefile if HAVE_MICROHTTPD rootlibexec_PROGRAMS += \ systemd-journal-remote @@ -4099,12 +4247,12 @@ systemd_journal_remote_LDADD += \ if ENABLE_TMPFILES dist_tmpfiles_DATA += \ tmpfiles.d/systemd-remote.conf -endif +endif # ENABLE_TMPFILES if HAVE_GNUTLS systemd_journal_remote_LDADD += \ $(GNUTLS_LIBS) -endif +endif # HAVE_GNUTLS # systemd-journal-remote make sense mostly with full crypto stack dist_systemunit_DATA += \ @@ -4127,8 +4275,9 @@ EXTRA_DIST += \ units/systemd-journal-remote.service.in \ src/journal-remote/journal-remote.conf.in \ src/journal-remote/log-generator.py -endif +endif # HAVE_MICROHTTPD +#@auto/journalctl/Makefile # using _CFLAGS = in the conditional below would suppress AM_CFLAGS journalctl_CFLAGS = \ $(AM_CFLAGS) @@ -4150,8 +4299,9 @@ journalctl_CFLAGS += \ journalctl_LDADD += \ $(QRENCODE_LIBS) -endif +endif # HAVE_QRENCODE +#@src/grp-journal/Makefile test_journal_SOURCES = \ src/journal/test-journal.c @@ -4235,8 +4385,10 @@ test_compress_LDADD = \ libsystemd-shared.la if HAVE_LZ4 +test_compress_CFLAGS += \ + $(LZ4_CFLAGA) test_compress_LDADD += \ - -llz4 + $(LZ4_LIBS) endif test_compress_benchmark_SOURCES = \ @@ -4251,6 +4403,7 @@ test_audit_type_SOURCES = \ test_audit_type_LDADD = \ libjournal-core.la +#@src/grp-journal/libjournal-core/src/Makefile libjournal_core_la_SOURCES = \ src/journal/journald-kmsg.c \ src/journal/journald-kmsg.h \ @@ -4281,6 +4434,7 @@ libjournal_core_la_LIBADD = \ noinst_LTLIBRARIES += \ libjournal-core.la +#@src/grp-journal/Makefile journal-install-hook: -$(MKDIR_P) $(DESTDIR)/var/log/journal -chown 0:0 $(DESTDIR)/var/log/journal @@ -4329,13 +4483,15 @@ if HAVE_COMPRESSION tests += \ test-compress \ test-compress-benchmark -endif +endif # HAVE_COMPRESSION +#@src/libsystemd/Makefile pkginclude_HEADERS += \ src/systemd/sd-journal.h \ src/systemd/sd-messages.h \ src/systemd/_sd-common.h +#@src/libsystemd/src/Makefile libsystemd_journal_internal_la_SOURCES = \ src/journal/sd-journal.c \ src/systemd/sd-journal.h \ @@ -4379,12 +4535,15 @@ libsystemd_journal_internal_la_CFLAGS += \ libsystemd_journal_internal_la_LIBADD += \ $(XZ_LIBS) -endif +endif # HAVE_XZ if HAVE_LZ4 +libsystemd_journal_internal_la_CFLAGS += \ + $(LZ4_CFLAGS) + libsystemd_journal_internal_la_LIBADD += \ - -llz4 -endif + $(LZ4_LIBS) +endif # HAVE_LZ4 if HAVE_GCRYPT libsystemd_journal_internal_la_SOURCES += \ @@ -4396,33 +4555,42 @@ libsystemd_journal_internal_la_SOURCES += \ libsystemd_journal_internal_la_LIBADD += \ $(GCRYPT_LIBS) +#@src/libsystemd/src/sd-journal/Makefile # fsprg.c is a drop-in file using void pointer arithmetic libsystemd_journal_internal_la_CFLAGS += \ $(GCRYPT_CFLAGS) \ -Wno-pointer-arith -endif +#@src/libsystemd/src/Makefile +endif # HAVE_GCRYPT noinst_LTLIBRARIES += \ libsystemd-journal-internal.la +#@auto/systemd-journald/Makefile rootlibexec_PROGRAMS += \ systemd-journald +#@auto/journalctl/Makefile rootbin_PROGRAMS += \ journalctl +#@auto/systemd-cat/Makefile bin_PROGRAMS += \ systemd-cat +#@auto/systemd-journald/Makefile dist_systemunit_DATA += \ units/systemd-journald.socket \ units/systemd-journald-dev-log.socket \ units/systemd-journald-audit.socket nodist_systemunit_DATA += \ - units/systemd-journald.service \ + units/systemd-journald.service +#@auto/journalctl/Makefile +nodist_systemunit_DATA += \ units/systemd-journal-flush.service \ units/systemd-journal-catalog-update.service +#@auto/systemd-journald/Makefile dist_pkgsysconf_DATA += \ src/journal/journald.conf @@ -4456,19 +4624,25 @@ SOCKETS_TARGET_WANTS += \ systemd-journald-audit.socket SYSINIT_TARGET_WANTS += \ - systemd-journald.service \ + systemd-journald.service +#@auto/journalctl/Makefile +SYSINIT_TARGET_WANTS += \ systemd-journal-flush.service \ systemd-journal-catalog-update.service +#@auto/systemd-journald/Makefile EXTRA_DIST += \ - units/systemd-journald.service.in \ + units/systemd-journald.service.in +#@auto/journalctl/Makefile +EXTRA_DIST += \ units/systemd-journal-flush.service.in \ units/systemd-journal-catalog-update.service.in +#@auto/systemd-journald/Makefile gperf_gperf_sources += \ src/journal/journald-gperf.gperf -# ------------------------------------------------------------------------------ +#@auto/systemd-journal-gatewayd/Makefile --------------------------------------- if HAVE_MICROHTTPD gatewayddocumentrootdir=$(pkgdatadir)/gatewayd @@ -4487,7 +4661,7 @@ systemd_journal_gatewayd_LDADD = \ if HAVE_GNUTLS systemd_journal_gatewayd_LDADD += \ $(GNUTLS_LIBS) -endif +endif # HAVE_GNUTLS systemd_journal_gatewayd_CFLAGS = \ $(AM_CFLAGS) \ @@ -4506,12 +4680,12 @@ nodist_systemunit_DATA += \ dist_gatewayddocumentroot_DATA = \ src/journal-remote/browse.html -endif +endif # HAVE_MICROHTTPD EXTRA_DIST += \ units/systemd-journal-gatewayd.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-socket-proxyd/Makefile ------------------------------------------ systemd_socket_proxyd_SOURCES = \ src/socket-proxy/socket-proxyd.c @@ -4519,7 +4693,7 @@ systemd_socket_proxyd_SOURCES = \ systemd_socket_proxyd_LDADD = \ libsystemd-shared.la -# ------------------------------------------------------------------------------ +#@auto/systemd-coredump/Makefile ----------------------------------------------- if ENABLE_COREDUMP systemd_coredump_SOURCES = \ src/coredump/coredump.c \ @@ -4541,7 +4715,7 @@ systemd_coredump_SOURCES += \ systemd_coredump_LDADD += \ $(ELFUTILS_LIBS) -endif +endif # HAVE_ELFUTILS nodist_systemunit_DATA += \ units/systemd-coredump@.service @@ -4558,6 +4732,7 @@ rootlibexec_PROGRAMS += \ dist_pkgsysconf_DATA += \ src/coredump/coredump.conf +#@auto/coredumpctl/Makefile coredumpctl_SOURCES = \ src/coredump/coredumpctl.c @@ -4567,6 +4742,7 @@ coredumpctl_LDADD = \ bin_PROGRAMS += \ coredumpctl +#@auto/systemd-coredump/Makefile manual_tests += \ test-coredump-vacuum @@ -4578,24 +4754,26 @@ test_coredump_vacuum_SOURCES = \ test_coredump_vacuum_LDADD = \ libsystemd-shared.la +#@auto/coredumpctl/Makefile dist_bashcompletion_data += \ shell-completion/bash/coredumpctl dist_zshcompletion_data += \ shell-completion/zsh/_coredumpctl +#@auto/systemd-coredump/Makefile nodist_sysctl_DATA = \ sysctl.d/50-coredump.conf CLEANFILES += \ sysctl.d/50-coredump.conf -endif +endif # ENABLE_COREDUMP EXTRA_DIST += \ sysctl.d/50-coredump.conf.in \ units/systemd-coredump@.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-binfmt/Makefile ------------------------------------------------- if ENABLE_BINFMT systemd_binfmt_SOURCES = \ src/binfmt/binfmt.c @@ -4621,12 +4799,12 @@ SYSINIT_TARGET_WANTS += \ systemd-binfmt.service \ proc-sys-fs-binfmt_misc.automount -endif +endif # ENABLE_BINFMT EXTRA_DIST += \ units/systemd-binfmt.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-vconsole-setup/Makefile ----------------------------------------- if ENABLE_VCONSOLE systemd_vconsole_setup_SOURCES = \ src/vconsole/vconsole-setup.c @@ -4642,13 +4820,13 @@ nodist_udevrules_DATA += \ nodist_systemunit_DATA += \ units/systemd-vconsole-setup.service -endif +endif # ENABLE_VCONSOLE EXTRA_DIST += \ src/vconsole/90-vconsole.rules.in \ units/systemd-vconsole-setup.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-quotacheck/Makefile --------------------------------------------- if ENABLE_QUOTACHECK rootlibexec_PROGRAMS += \ systemd-quotacheck @@ -4661,7 +4839,7 @@ systemd_quotacheck_SOURCES = \ systemd_quotacheck_LDADD = \ libsystemd-shared.la -endif +endif # ENABLE_QUOTACHECK EXTRA_DIST += \ units/systemd-quotacheck.service.in @@ -4669,7 +4847,7 @@ EXTRA_DIST += \ nodist_systemunit_DATA += \ units/quotaon.service -# ------------------------------------------------------------------------------ +#@auto/systemd-random-seed/Makefile -------------------------------------------- if ENABLE_RANDOMSEED rootlibexec_PROGRAMS += \ systemd-random-seed @@ -4686,12 +4864,12 @@ systemd_random_seed_LDADD = \ SYSINIT_TARGET_WANTS += \ systemd-random-seed.service -endif +endif # ENABLE_RANDOMSEED EXTRA_DIST += \ units/systemd-random-seed.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-backlight/Makefile ---------------------------------------------- if ENABLE_BACKLIGHT rootlibexec_PROGRAMS += \ systemd-backlight @@ -4704,12 +4882,12 @@ systemd_backlight_SOURCES = \ systemd_backlight_LDADD = \ libsystemd-shared.la -endif +endif # ENABLE_BACKLIGHT EXTRA_DIST += \ units/systemd-backlight@.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-rfkill/Makefile ------------------------------------------------- if ENABLE_RFKILL rootlibexec_PROGRAMS += \ systemd-rfkill @@ -4725,12 +4903,12 @@ systemd_rfkill_SOURCES = \ systemd_rfkill_LDADD = \ libsystemd-shared.la -endif +endif # ENABLE_RFKILL EXTRA_DIST += \ units/systemd-rfkill.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-cryptsetup/Makefile --------------------------------------------- if HAVE_LIBCRYPTSETUP rootlibexec_PROGRAMS += \ systemd-cryptsetup @@ -4762,9 +4940,9 @@ systemd_cryptsetup_generator_LDADD = \ SYSINIT_TARGET_WANTS += \ cryptsetup.target -endif +endif # HAVE_LIBCRYPTSETUP -# ------------------------------------------------------------------------------ +#@auto/systemd-hostnamed/Makefile ---------------------------------------------- if ENABLE_HOSTNAMED systemd_hostnamed_SOURCES = \ src/hostname/hostnamed.c @@ -4796,6 +4974,10 @@ SYSTEM_UNIT_ALIASES += \ BUSNAMES_TARGET_WANTS += \ org.freedesktop.hostname1.busname +endif # ENABLE_HOSTNAMED +#@auto/hostnamectl/Makefile +if ENABLE_HOSTNAMED + hostnamectl_SOURCES = \ src/hostname/hostnamectl.c @@ -4810,22 +4992,23 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_hostnamectl -endif +endif # ENABLE_HOSTNAMED +#@auto/systemd-hostnamed/Makefile polkitpolicy_in_files += \ src/hostname/org.freedesktop.hostname1.policy.in EXTRA_DIST += \ units/systemd-hostnamed.service.in -# ------------------------------------------------------------------------------ +#@src/grp-system/systemd/Makefile ---------------------------------------------- dist_systemunit_DATA_busnames += \ units/org.freedesktop.systemd1.busname BUSNAMES_TARGET_WANTS += \ org.freedesktop.systemd1.busname -# ------------------------------------------------------------------------------ +#@auto/systemd-localed/Makefile ------------------------------------------------ if ENABLE_LOCALED systemd_localed_SOURCES = \ src/locale/localed.c \ @@ -4880,6 +5063,10 @@ test_keymap_util_LDADD = \ tests += \ test-keymap-util +endif # ENABLE_LOCALED +#@auto/localectl/Makefile +if ENABLE_LOCALED + localectl_SOURCES = \ src/locale/localectl.c @@ -4894,7 +5081,8 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_localectl -endif +endif # ENABLE_LOCALED +#@auto/systemd-localed/Makefile .PHONY: update-kbd-model-map @@ -4904,7 +5092,7 @@ polkitpolicy_in_files += \ EXTRA_DIST += \ units/systemd-localed.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-timedated/Makefile ---------------------------------------------- if ENABLE_TIMEDATED systemd_timedated_SOURCES = \ src/timedate/timedated.c @@ -4936,6 +5124,9 @@ SYSTEM_UNIT_ALIASES += \ BUSNAMES_TARGET_WANTS += \ org.freedesktop.timedate1.busname +endif # ENABLE_TIMEDATED +#@auto/timedatectl/Makefile +if ENABLE_TIMEDATED timedatectl_SOURCES = \ src/timedate/timedatectl.c @@ -4950,7 +5141,8 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_timedatectl -endif +endif # ENABLE_TIMEDATED +#@auto/systemd-timedated/Makefile polkitpolicy_in_files += \ src/timedate/org.freedesktop.timedate1.policy.in @@ -4958,7 +5150,7 @@ polkitpolicy_in_files += \ EXTRA_DIST += \ units/systemd-timedated.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-timesyncd/Makefile ---------------------------------------------- if ENABLE_TIMESYNCD systemd_timesyncd_SOURCES = \ src/timesync/timesyncd.c \ @@ -4989,7 +5181,7 @@ GENERAL_ALIASES += \ nodist_pkgsysconf_DATA += \ src/timesync/timesyncd.conf -endif +endif # ENABLE_TIMESYNCD gperf_gperf_sources += \ src/timesync/timesyncd-gperf.gperf @@ -4998,7 +5190,7 @@ EXTRA_DIST += \ units/systemd-timesyncd.service.in \ src/timesync/timesyncd.conf.in -# ------------------------------------------------------------------------------ +#@discard.mk ------------------------------------------------------------------- test_nss_SOURCES = \ src/test/test-nss.c @@ -5010,7 +5202,7 @@ test_nss_LDADD = \ manual_tests += \ test-nss -# ------------------------------------------------------------------------------ +#@auto/nss-systemd/Makefile ---------------------------------------------------- libnss_systemd_la_SOURCES = \ src/nss-systemd/nss-systemd.sym \ src/nss-systemd/nss-systemd.c @@ -5031,7 +5223,7 @@ libnss_systemd_la_LIBADD = \ lib_LTLIBRARIES += \ libnss_systemd.la -# ------------------------------------------------------------------------------ +#@auto/nss-myhostname/Makefile ------------------------------------------------- if HAVE_MYHOSTNAME libnss_myhostname_la_SOURCES = \ src/nss-myhostname/nss-myhostname.sym \ @@ -5052,10 +5244,9 @@ libnss_myhostname_la_LIBADD = \ lib_LTLIBRARIES += \ libnss_myhostname.la -endif +endif # HAVE_MYHOSTNAME -# ------------------------------------------------------------------------------ -if ENABLE_MACHINED +#@auto/systemd-machined/Makefile ----------------------------------------------- systemd_machined_SOURCES = \ src/machine/machined.c \ src/machine/machined.h @@ -5066,6 +5257,7 @@ systemd_machined_LDADD = \ rootlibexec_PROGRAMS += \ systemd-machined +#@src/grp-machine/libmachine-core/src/Makefile libmachine_core_la_SOURCES = \ src/machine/machine.c \ src/machine/machine.h \ @@ -5083,6 +5275,7 @@ libmachine_core_la_LIBADD = \ noinst_LTLIBRARIES += \ libmachine-core.la +#@auto/machinectl/Makefile machinectl_SOURCES = \ src/machine/machinectl.c @@ -5092,6 +5285,7 @@ machinectl_LDADD = \ rootbin_PROGRAMS += \ machinectl +#@src/grp-machine/libmachine-core/test/Makefile test_machine_tables_SOURCES = \ src/machine/test-machine-tables.c @@ -5101,6 +5295,7 @@ test_machine_tables_LDADD = \ tests += \ test-machine-tables +#@auto/systemd-machined/Makefile nodist_systemunit_DATA += \ units/systemd-machined.service @@ -5119,6 +5314,7 @@ dist_dbuspolicy_DATA += \ polkitpolicy_files += \ src/machine/org.freedesktop.machine1.policy +#@auto/machinectl/Makefile dist_bashcompletion_data += \ shell-completion/bash/machinectl @@ -5126,12 +5322,15 @@ dist_zshcompletion_data += \ shell-completion/zsh/_machinectl \ shell-completion/zsh/_sd_machines +#@auto/systemd-machined/Makefile SYSTEM_UNIT_ALIASES += \ systemd-machined.service dbus-org.freedesktop.machine1.service BUSNAMES_TARGET_WANTS += \ org.freedesktop.machine1.busname +#@auto/nss-mymachines/Makefile + libnss_mymachines_la_SOURCES = \ src/nss-mymachines/nss-mymachines.sym \ src/nss-mymachines/nss-mymachines.c @@ -5152,7 +5351,7 @@ libnss_mymachines_la_LIBADD = \ lib_LTLIBRARIES += \ libnss_mymachines.la -endif +#@auto/systemd-machined/Makefile polkitpolicy_in_files += \ src/machine/org.freedesktop.machine1.policy.in @@ -5169,12 +5368,16 @@ if HAVE_ZLIB if HAVE_BZIP2 if HAVE_GCRYPT -rootlibexec_PROGRAMS += \ - systemd-importd \ - systemd-pull \ - systemd-import \ - systemd-export +#@auto/systemd-importd/Makefile +rootlibexec_PROGRAMS += systemd-importd +#@auto/systemd-pull/Makefile +rootlibexec_PROGRAMS += systemd-pull +#@auto/systemd-import/Makefile +rootlibexec_PROGRAMS += systemd-import +#@auto/systemd-export/Makefile +rootlibexec_PROGRAMS += systemd-export +#@auto/systemd-importd/Makefile systemd_importd_SOURCES = \ src/import/importd.c @@ -5187,6 +5390,7 @@ systemd_importd_CFLAGS = \ systemd_importd_LDADD = \ libsystemd-shared.la +#@auto/systemd-pull/Makefile systemd_pull_SOURCES = \ src/import/pull.c \ src/import/pull-raw.c \ @@ -5211,6 +5415,7 @@ systemd_pull_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\" @@ -5220,9 +5425,10 @@ systemd_pull_LDADD = \ $(LIBCURL_LIBS) \ $(XZ_LIBS) \ $(ZLIB_LIBS) \ - -lbz2 \ + $(BZIP2_LIBS) \ $(GCRYPT_LIBS) +#@auto/systemd-import/Makefile systemd_import_SOURCES = \ src/import/import.c \ src/import/import-raw.c \ @@ -5239,14 +5445,16 @@ systemd_import_SOURCES = \ systemd_import_CFLAGS = \ $(AM_CFLAGS) \ $(XZ_CFLAGS) \ - $(ZLIB_CFLAGS) + $(ZLIB_CFLAGS) \ + $(BZIP2_CFLAGS) systemd_import_LDADD = \ libsystemd-shared.la \ $(XZ_LIBS) \ $(ZLIB_LIBS) \ - -lbz2 + $(BZIP2_LIBS) +#@auto/systemd-export/Makefile systemd_export_SOURCES = \ src/import/export.c \ src/import/export-tar.c \ @@ -5261,14 +5469,16 @@ systemd_export_SOURCES = \ systemd_export_CFLAGS = \ $(AM_CFLAGS) \ $(XZ_CFLAGS) \ - $(ZLIB_CFLAGS) + $(ZLIB_CFLAGS) \ + $(BZIP2_CFLAGS) systemd_export_LDADD = \ libsystemd-shared.la \ $(XZ_LIBS) \ $(ZLIB_LIBS) \ - -lbz2 + $(BZIP2_LIBS) +#@auto/systemd-importd/Makefile dist_rootlibexec_DATA += \ src/import/import-pubring.gpg @@ -5293,6 +5503,7 @@ dist_dbuspolicy_DATA += \ polkitpolicy_files += \ src/import/org.freedesktop.import1.policy +#@auto/libimport/Makefile manual_tests += \ test-qcow2 @@ -5309,13 +5520,15 @@ test_qcow2_LDADD = \ libsystemd-shared.la \ $(ZLIB_LIBS) -endif -endif -endif -endif -endif +#@discard.mk +endif # HAVE_GCRYPT +endif # HAVE_BZIP2 +endif # HAVE_ZLIB +endif # HAVE_XZ +endif # HAVE_LIBCURL -endif +endif # ENABLE_IMPORTD +#@auto/systemd-importd/Makefile polkitpolicy_in_files += \ src/import/org.freedesktop.import1.policy.in @@ -5324,9 +5537,10 @@ EXTRA_DIST += \ units/systemd-importd.service.in -# ------------------------------------------------------------------------------ +#@auto/systemd-resolved/Makefile ----------------------------------------------- if ENABLE_RESOLVED +#@src/grp-resolve/libbasic-dns/src/Makefile basic_dns_sources = \ src/resolve/resolved-dns-dnssec.c \ src/resolve/resolved-dns-dnssec.h \ @@ -5341,6 +5555,7 @@ basic_dns_sources = \ src/resolve/dns-type.c \ src/resolve/dns-type.h +#@auto/systemd-resolved/Makefile systemd_resolved_SOURCES = \ src/resolve/resolved.c \ src/resolve/resolved-manager.c \ @@ -5430,6 +5645,7 @@ GENERAL_ALIASES += \ nodist_pkgsysconf_DATA += \ src/resolve/resolved.conf +#@auto/nss-resolve/Makefile libnss_resolve_la_SOURCES = \ src/nss-resolve/nss-resolve.sym \ src/nss-resolve/nss-resolve.c @@ -5451,6 +5667,7 @@ libnss_resolve_la_LIBADD = \ lib_LTLIBRARIES += \ libnss_resolve.la +#@auto/systemd-resolve/Makefile systemd_resolve_SOURCES = \ src/resolve/resolve-tool.c \ $(basic_dns_sources) \ @@ -5479,6 +5696,7 @@ dist_bashcompletion_data += \ dist_zshcompletion_data += \ shell-completion/zsh/_systemd-resolve +#@src/grp-resolve/libbasic-dns/test/Makefile tests += \ test-dns-packet \ test-resolve-tables \ @@ -5554,11 +5772,14 @@ test_dnssec_complex_SOURCES = \ test_dnssec_complex_LDADD = \ libsystemd-shared.la -endif +#@auto/systemd-resolved/Makefile +endif # ENABLE_RESOLVED +#@src/grp-resolve/libbasic-dns/src/Makefile gperf_txt_sources += \ src/resolve/dns_type-list.txt +#@auto/systemd-resolved/Makefile gperf_gperf_sources += \ src/resolve/resolved-gperf.gperf @@ -5569,8 +5790,9 @@ EXTRA_DIST += \ dist_rootlibexec_DATA += \ src/resolve/resolv.conf -# ------------------------------------------------------------------------------ +#@src/grp-network/Makefile ----------------------------------------------------- if ENABLE_NETWORKD +#@src/grp-network/systemd-networkd/Makefile rootlibexec_PROGRAMS += \ systemd-networkd @@ -5583,8 +5805,9 @@ systemd_networkd_LDADD = \ if HAVE_LIBIPTC systemd_networkd_LDADD += \ libfirewall.la -endif +endif # HAVE_LIBIPTC +#@src/grp-network/libnetworkd-core/Makefile noinst_LTLIBRARIES += \ libnetworkd-core.la @@ -5657,6 +5880,7 @@ libnetworkd_core_la_LIBADD = \ libsystemd-network.la \ libsystemd-shared.la +#@src/grp-network/systemd-networkd-wait-online/Makefile rootlibexec_PROGRAMS += \ systemd-networkd-wait-online @@ -5675,6 +5899,7 @@ systemd_networkd_wait_online_LDADD = \ libsystemd-network.la \ libsystemd-shared.la +#@src/grp-network/networkctl/Makefile rootbin_PROGRAMS += \ networkctl @@ -5688,6 +5913,7 @@ networkctl_LDADD = \ dist_bashcompletion_data += \ shell-completion/bash/networkctl +#@src/grp-network/Makefile test_networkd_conf_SOURCES = \ src/network/test-networkd-conf.c @@ -5703,7 +5929,7 @@ test_network_LDADD = \ if HAVE_LIBIPTC test_network_LDADD += \ libfirewall.la -endif +endif # HAVE_LIBIPTC test_network_tables_SOURCES = \ src/network/test-network-tables.c \ @@ -5716,13 +5942,14 @@ test_network_tables_LDADD = \ if HAVE_LIBIPTC test_network_tables_LDADD += \ libfirewall.la -endif +endif # HAVE_LIBIPTC tests += \ test-networkd-conf \ test-network \ test-network-tables +#@auto/systemd-networkd/Makefile dist_systemunit_DATA += \ units/systemd-networkd.socket @@ -5750,7 +5977,8 @@ SYSTEM_UNIT_ALIASES += \ BUSNAMES_TARGET_WANTS += \ org.freedesktop.network1.busname -endif +#@src/grp-network/Makefile +endif # ENABLE_NETWORKD gperf_gperf_sources += \ src/network/networkd-gperf.gperf \ @@ -5762,8 +5990,9 @@ EXTRA_DIST += \ units/systemd-networkd-wait-online.service.in \ test/networkd-test.py -# ------------------------------------------------------------------------------ +#@auto/systemd-logind/Makefile ------------------------------------------------- if ENABLE_LOGIND + systemd_logind_SOURCES = \ src/login/logind.c \ src/login/logind.h @@ -5805,14 +6034,16 @@ liblogind_core_la_LIBADD = \ if HAVE_ACL liblogind_core_la_SOURCES += \ src/login/logind-acl.c -endif +endif # HAVE_ACL noinst_LTLIBRARIES += \ liblogind-core.la +#@src/grp-login/systemd-logind/Makefile rootlibexec_PROGRAMS += \ systemd-logind +#@src/grp-login/loginctl/Makefile loginctl_SOURCES = \ src/login/loginctl.c \ src/login/sysfs-show.h \ @@ -5827,9 +6058,9 @@ rootbin_PROGRAMS += \ dist_bashcompletion_data += \ shell-completion/bash/loginctl -dist_zshcompletion_data += \ - shell-completion/zsh/_loginctl \ - shell-completion/zsh/_systemd-inhibit +dist_zshcompletion_data += shell-completion/zsh/_loginctl +#@src/grp-login/systemd-inhibit/Makefile +dist_zshcompletion_data += shell-completion/zsh/_systemd-inhibit systemd_inhibit_SOURCES = \ src/login/inhibit.c @@ -5840,6 +6071,7 @@ systemd_inhibit_LDADD = \ rootbin_PROGRAMS += \ systemd-inhibit +#@src/grp-login/Makefile test_login_SOURCES = \ src/libsystemd/sd-login/test-login.c @@ -5872,6 +6104,7 @@ tests += \ test-login-tables \ test-login-shared +#@src/grp-login/pam_systemd/Makefile if HAVE_PAM pam_systemd_la_SOURCES = \ src/login/pam_systemd.sym \ @@ -5901,7 +6134,8 @@ dist_pamconf_DATA = \ EXTRA_DIST += \ src/login/systemd-user.m4 -endif +endif # HAVE_PAM +#@auto/systemd-logind/Makefile nodist_systemunit_DATA += \ units/systemd-logind.service @@ -5944,7 +6178,7 @@ nodist_udevrules_DATA += \ src/login/71-seat.rules \ src/login/73-seat-late.rules -endif +endif # ENABLE_LOGIND polkitpolicy_in_files += \ src/login/org.freedesktop.login1.policy.in @@ -5958,7 +6192,7 @@ EXTRA_DIST += \ units/systemd-logind.service.in \ src/login/logind.conf.in -# ------------------------------------------------------------------------------ +#@auto/systemd-user-sessions/Makefile ------------------------------------------ if HAVE_PAM systemd_user_sessions_SOURCES = \ @@ -5976,12 +6210,12 @@ nodist_systemunit_DATA += \ MULTI_USER_TARGET_WANTS += \ systemd-user-sessions.service -endif +endif # HAVE_PAM EXTRA_DIST += \ units/systemd-user-sessions.service.in -# ------------------------------------------------------------------------------ +#@discard.mk ------------------------------------------------------------------- EXTRA_DIST += \ test/Makefile \ test/README.testsuite \ @@ -6029,7 +6263,7 @@ EXTRA_DIST += \ test/loopy.service.d \ test/loopy.service.d/compat.conf -# ------------------------------------------------------------------------------ +#@build-aux/Makefile.once.head/20-sd.mk ---------------------------------------- substitutions = \ '|rootlibexecdir=$(rootlibexecdir)|' \ '|rootbindir=$(rootbindir)|' \ @@ -6097,15 +6331,18 @@ SED_PROCESS = \ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ < $< > $@ +#@discard.mk units/%: units/%.in $(SED_PROCESS) man/%: man/%.in $(SED_PROCESS) +#@build-aux/Makefile.each.tail/50-sd.mk sysctl.d/%: sysctl.d/%.in $(SED_PROCESS) +#@discard.mk %.pc: %.pc.in $(SED_PROCESS) @@ -6127,6 +6364,7 @@ shell-completion/%: shell-completion/%.in %.conf: %.conf.in $(SED_PROCESS) +#@build-aux/Makefile.each.tail/50-sd.mk %.sh: %.sh.in $(SED_PROCESS) $(AM_V_GEN)chmod +x $@ @@ -6139,6 +6377,7 @@ src/%: src/%.m4 $(top_builddir)/config.status $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ +#@discard.mk sysusers.d/%: sysusers.d/%.m4 $(top_builddir)/config.status $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ @@ -6160,22 +6399,24 @@ if ENABLE_POLKIT nodist_polkitpolicy_DATA = \ $(polkitpolicy_files) \ $(polkitpolicy_in_in_files:.policy.in.in=.policy) -endif +endif # ENABLE_POLKIT EXTRA_DIST += \ $(polkitpolicy_in_files) \ $(polkitpolicy_in_in_files) -# ------------------------------------------------------------------------------ +#@man/Makefile ----------------------------------------------------------------- man/custom-entities.ent: configure.ac $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \ printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \ > $@ # ' +#@discard.mk CLEANFILES += \ man/custom-entities.ent +#@build-aux/Makefile.once.head/20-sdman.mk XSLTPROC_FLAGS = \ --nonet \ --xinclude \ @@ -6193,6 +6434,7 @@ XSLTPROC_PROCESS_MAN = \ XSLTPROC_PROCESS_HTML = \ $(AM_V_XSLT)$(XSLT) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $< +#@build-aux/Makefile.each.tail/70-sdman.mk man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent $(XSLTPROC_PROCESS_MAN) @@ -6211,37 +6453,47 @@ man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent $(XSLTPROC_PROCESS_HTML) +#@build-aux/Makefile.once.head/20-sdman.mk define html-alias $(AM_V_LN)$(LN_S) -f $(notdir $<) $@ endef +#@discard.mk EXTRA_DIST += \ man/custom-html.xsl \ man/custom-man.xsl # ------------------------------------------------------------------------------ +#@auto/systemd-sysv-generator/Makefile if HAVE_SYSV_COMPAT sysvinit_DATA = \ docs/sysvinit/README -varlog_DATA = \ - docs/var-log/README - docs/sysvinit/README: docs/sysvinit/README.in $(SED_PROCESS) +CLEANFILES += \ + docs/sysvinit/README +endif # HAVE_SYSV_COMPAT + +EXTRA_DIST += \ + docs/sysvinit/README.in +#@src/grp-journal/Makefile +if HAVE_SYSV_COMPAT + +varlog_DATA = \ + docs/var-log/README + docs/var-log/README: docs/var-log/README.in $(SED_PROCESS) CLEANFILES += \ - docs/sysvinit/README \ docs/var-log/README -endif +endif # HAVE_SYSV_COMPAT EXTRA_DIST += \ - docs/sysvinit/README.in \ docs/var-log/README.in - +#@discard.mk SOCKETS_TARGET_WANTS += \ systemd-initctl.socket @@ -6253,11 +6505,11 @@ GRAPHICAL_TARGET_WANTS += \ systemd-update-utmp-runlevel.service RESCUE_TARGET_WANTS += \ systemd-update-utmp-runlevel.service -endif +endif # HAVE_SYSV_COMPAT SYSINIT_TARGET_WANTS += \ systemd-update-utmp.service -endif +endif # HAVE_UTMP SYSINIT_TARGET_WANTS += \ systemd-update-done.service @@ -6289,7 +6541,7 @@ SYSTEM_UNIT_ALIASES += \ multi-user.target runlevel4.target \ graphical.target runlevel5.target \ reboot.target runlevel6.target -endif +endif # HAVE_SYSV_COMPAT SYSTEM_UNIT_ALIASES += \ graphical.target default.target \ @@ -6322,7 +6574,7 @@ INSTALL_DIRS += \ $(systemunitdir)/runlevel3.target.wants \ $(systemunitdir)/runlevel4.target.wants \ $(systemunitdir)/runlevel5.target.wants -endif +endif # HAVE_SYSV_COMPAT INSTALL_DIRS += \ $(prefix)/lib/modules-load.d \ @@ -6378,7 +6630,7 @@ else DISTCHECK_CONFIGURE_FLAGS += \ --with-sysvinit-path= \ --with-sysvrcnd-path= -endif +endif # HAVE_SYSV_COMPAT if ENABLE_SPLIT_USR DISTCHECK_CONFIGURE_FLAGS += \ @@ -6386,7 +6638,7 @@ DISTCHECK_CONFIGURE_FLAGS += \ else DISTCHECK_CONFIGURE_FLAGS += \ --disable-split-usr -endif +endif # ENABLE_SPLIT_USR .PHONY: dist-check-help dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS) @@ -6409,6 +6661,7 @@ dist-check-includes: $(public_headers) done; \ done; exit $$res +#@auto/hwdb/Makefile .PHONY: hwdb-update hwdb-update: ( cd $(top_srcdir)/hwdb && \ @@ -6423,6 +6676,7 @@ hwdb-update: ./acpi-update.py > 20-acpi-vendor.hwdb.base && \ patch -p0 -o- 20-acpi-vendor.hwdb.base < 20-acpi-vendor.hwdb.patch > 20-acpi-vendor.hwdb ) +#@discard.mk .PHONY: built-sources built-sources: $(BUILT_SOURCES) @@ -6446,6 +6700,7 @@ install-tree: all $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree tree $(abs_srcdir)/install-tree +#@build-aux/Makefile.once.tail/10-sd.mk # Let's run all tests of the test suite, but under valgrind. Let's # exclude perl/python/shell scripts we have in there .PHONY: valgrind-tests @@ -6498,6 +6753,7 @@ check-includes: $(top_srcdir)/tools/check-includes.pl EXTRA_DIST += \ $(top_srcdir)/tools/check-includes.pl +#@build-aux/Makefile.each.tail/50-sd.mk # Stupid test that everything purported to be exported really is define generate-sym-test $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -6510,6 +6766,7 @@ define generate-sym-test $(AM_V_at)printf 'return 0; }\n' >> $@ endef +#@src/libsystemd/Makefile test-libsystemd-sym.c: \ $(top_builddir)/src/libsystemd/libsystemd.sym \ src/systemd/sd-journal.h \ @@ -6522,16 +6779,19 @@ test-libsystemd-sym.c: \ src/systemd/sd-event.h $(generate-sym-test) +#@src/libudev/Makefile test-libudev-sym.c: \ src/libudev/libudev.sym \ src/udev/udev.h $(generate-sym-test) +#@src/libsystemd/Makefile nodist_test_libsystemd_sym_SOURCES = \ test-libsystemd-sym.c test_libsystemd_sym_LDADD = \ libsystemd.la +#@src/libudev/Makefile nodist_test_libudev_sym_SOURCES = \ test-libudev-sym.c test_libudev_sym_CFLAGS = \ @@ -6540,6 +6800,7 @@ test_libudev_sym_CFLAGS = \ test_libudev_sym_LDADD = \ libudev.la +#@discard.mk BUILT_SOURCES += \ test-libsystemd-sym.c \ test-libudev-sym.c @@ -6552,6 +6813,7 @@ tests += \ test-libsystemd-sym \ test-libudev-sym +#@build-aux/Makefile.once.tail/10-sd.mk .PHONY: cppcheck cppcheck: cppcheck --enable=all -q $(top_srcdir) @@ -6571,3 +6833,58 @@ list-keys: add-key: gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import - +#@Makefile +# intltoolize +files.src.gen += m4/intltool.m4 +files.src.gen += po/Makefile.in.in +# autoreconf +files.src.gen += aclocal.m4 +files.src.gen += automake.mk.in +files.src.gen += build-aux/compile +files.src.gen += build-aux/config.guess +files.src.gen += build-aux/config.sub +files.src.gen += build-aux/install-sh +files.src.gen += build-aux/ltmain.sh +files.src.gen += build-aux/missing +files.src.gen += m4/libtool.m4 +files.src.gen += m4/ltoptions.m4 +files.src.gen += m4/ltsugar.m4 +files.src.gen += m4/ltversion.m4 +files.src.gen += m4/lt~obsolete.m4 +files.src.gen += config.h.in +files.src.gen += configure +#@src/libsystemd/src/subdir.mk +sd.CPPFLAGS += -DLIBDIR=\"$(libdir)\" +sd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" +#@src/grp-udev/libudev-core/net/Makefile +sd.CPPFLAGS += $(libshared.CPPFLAGS) +sd.CPPFLAGS += $(libsystemd-network.CPPFLAGS) +#@src/Makefile +#@src/grp-boot/Makefile +#@src/grp-coredump/Makefile +#@src/grp-hostname/Makefile +#@src/grp-initprogs/Makefile +#@src/grp-initprogs/grp-sleep/Makefile +#@src/grp-journal/grp-remote/Makefile +#@src/grp-journal/grp-remote/libsystemd-microhttpd/Makefile +#@src/grp-journal/grp-remote/libsystemd-microhttpd/src/Makefile +#@src/grp-locale/Makefile +#@src/grp-machine/Makefile +#@src/grp-machine/grp-import/Makefile +#@src/grp-machine/grp-import/libimport/Makefile +#@src/grp-machine/libmachine-core/Makefile +#@src/grp-resolve/Makefile +#@src/grp-resolve/libbasic-dns/Makefile +#@src/grp-system/Makefile +#@src/grp-system/grp-utils/Makefile +#@src/grp-system/libcore/Makefile +#@src/grp-timedate/Makefile +#@src/grp-utils/Makefile +#@src/libsystemd-firewall/Makefile +#@src/libsystemd-gcrypt/Makefile +#@src/libsystemd-gcrypt/src/Makefile +#@src/libsystemd/src/sd-bus/Makefile +#@src/libsystemd/src/sd-hwdb/Makefile +#@all + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/build-aux/Makefile.each.head/.gitignore b/build-aux/Makefile.each.head/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/build-aux/Makefile.each.head/.gitignore diff --git a/build-aux/Makefile.each.tail/.gitignore b/build-aux/Makefile.each.tail/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/build-aux/Makefile.each.tail/.gitignore diff --git a/build-aux/Makefile.once.head/.gitignore b/build-aux/Makefile.once.head/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/build-aux/Makefile.once.head/.gitignore diff --git a/build-aux/Makefile.once.tail/.gitignore b/build-aux/Makefile.once.tail/.gitignore new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/build-aux/Makefile.once.tail/.gitignore diff --git a/build-aux/write-ifchanged b/build-aux/write-ifchanged new file mode 100755 index 0000000000..84dfd6e639 --- /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##*/}.tmp" + +cat > "$tmpfile" || exit $? +if cmp -s "$tmpfile" "$outfile"; then + rm -f "$tmpfile" || : +else + mv -f "$tmpfile" "$outfile" +fi diff --git a/man/daemon.xml b/man/daemon.xml index 485c66225e..a649749683 100644 --- a/man/daemon.xml +++ b/man/daemon.xml @@ -168,7 +168,7 @@ <refsect2> <title>New-Style Daemons</title> - <para>Modern services for Linux should be implemented as + <para>Modern services for GNU/Linux should be implemented as new-style daemons. This makes it easier to supervise and control them at runtime and simplifies their implementation.</para> @@ -309,7 +309,7 @@ as detailed in the <ulink url="http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB Linux Standard Base Core Specification</ulink>. This method of - activation is supported ubiquitously on Linux init systems, both + activation is supported ubiquitously on GNU/Linux init systems, both old-style and new-style systems. Among other issues, SysV init scripts have the disadvantage of involving shell scripts in the boot process. New-style init systems generally employ updated diff --git a/man/kernel-install.xml b/man/kernel-install.xml index d7e27de758..eb519188a6 100644 --- a/man/kernel-install.xml +++ b/man/kernel-install.xml @@ -106,7 +106,7 @@ <replaceable>PRETTY_NAME</replaceable> parameter specified in <filename>/etc/os-release</filename> or <filename>/usr/lib/os-release</filename> (if the former is - missing), or "Linux + missing), or "GNU/Linux <replaceable>KERNEL-VERSION</replaceable>", if unset. If the file <filename>initrd</filename> is found next to the <filename>linux</filename> file, the initrd will be added to diff --git a/man/os-release.xml b/man/os-release.xml index 99bbb61004..2811f434c5 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -121,8 +121,8 @@ <listitem><para>A string identifying the operating system, without a version component, and suitable for presentation to the user. If not set, defaults to - <literal>NAME=Linux</literal>. Example: - <literal>NAME=Fedora</literal> or <literal>NAME="Debian + <literal>NAME=GNU/Linux</literal>. Example: + <literal>NAME=BLAG</literal> or <literal>NAME="gNewSense GNU/Linux"</literal>.</para></listitem> </varlistentry> @@ -133,8 +133,8 @@ version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user. This field is optional. Example: - <literal>VERSION=17</literal> or <literal>VERSION="17 (Beefy - Miracle)"</literal>.</para></listitem> + <literal>VERSION=210k</literal> or <literal>VERSION="210k + (Spartakus)"</literal>.</para></listitem> </varlistentry> <varlistentry> @@ -145,9 +145,9 @@ the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames. If not set, defaults to - <literal>ID=linux</literal>. Example: - <literal>ID=fedora</literal> or - <literal>ID=debian</literal>.</para></listitem> + <literal>ID=gnu-linux</literal>. Example: + <literal>ID=blag</literal> or + <literal>ID=gnewsense</literal>.</para></listitem> </varlistentry> <varlistentry> @@ -168,9 +168,9 @@ should be listed in order of how closely the local operating system relates to the listed ones, starting with the closest. This field is optional. Example: for an operating system with - <literal>ID=centos</literal>, an assignment of + <literal>ID=blag</literal>, an assignment of <literal>ID_LIKE="rhel fedora"</literal> would be appropriate. - For an operating system with <literal>ID=ubuntu</literal>, an + For an operating system with <literal>ID=gnewsense</literal>, an assignment of <literal>ID_LIKE=debian</literal> is appropriate.</para></listitem> </varlistentry> @@ -199,8 +199,8 @@ identifying the operating system version, excluding any OS name information or release code name, and suitable for processing by scripts or usage in generated filenames. This - field is optional. Example: <literal>VERSION_ID=17</literal> - or <literal>VERSION_ID=11.04</literal>.</para></listitem> + field is optional. Example: <literal>VERSION_ID=210k</literal> + or <literal>VERSION_ID=7.0</literal>.</para></listitem> </varlistentry> <varlistentry> @@ -210,9 +210,9 @@ suitable for presentation to the user. May or may not contain a release code name or OS version of some kind, as suitable. If not set, defaults to - <literal>PRETTY_NAME="Linux"</literal>. Example: - <literal>PRETTY_NAME="Fedora 17 (Beefy - Miracle)"</literal>.</para></listitem> + <literal>PRETTY_NAME="GNU/Linux"</literal>. Example: + <literal>PRETTY_NAME="BLAG 210k + (Spartakus)"</literal>.</para></listitem> </varlistentry> <varlistentry> @@ -235,7 +235,7 @@ <ulink url="http://scap.nist.gov/specifications/cpe/">Common Platform Enumeration Specification</ulink> as proposed by the NIST. This field is optional. Example: - <literal>CPE_NAME="cpe:/o:fedoraproject:fedora:17"</literal> + <literal>CPE_NAME="cpe:/o:blagblagblag:blag:210k"</literal> </para></listitem> </varlistentry> @@ -270,8 +270,8 @@ one URL shall be listed in each setting. If multiple resources need to be referenced, it is recommended to provide an online landing page linking all available resources. Examples: - <literal>HOME_URL="https://fedoraproject.org/"</literal> and - <literal>BUG_REPORT_URL="https://bugzilla.redhat.com/"</literal></para></listitem> + <literal>HOME_URL="https://www.blagblagblag.org/"</literal> and + <literal>BUG_REPORT_URL="https://blag.fsf.org/"</literal></para></listitem> </varlistentry> <varlistentry> @@ -346,21 +346,22 @@ recommended to prefix new fields with an OS specific name in order to avoid name clashes. Applications reading this file must ignore unknown fields. Example: - <literal>DEBIAN_BTS="debbugs://bugs.debian.org/"</literal></para> + <literal>DEBIAN_BTS="debbugs://bugs.gnewsense.org/"</literal></para> </refsect1> <refsect1> <title>Example</title> - <programlisting>NAME=Fedora -VERSION="17 (Beefy Miracle)" -ID=fedora -VERSION_ID=17 -PRETTY_NAME="Fedora 17 (Beefy Miracle)" -ANSI_COLOR="0;34" -CPE_NAME="cpe:/o:fedoraproject:fedora:17" -HOME_URL="https://fedoraproject.org/" -BUG_REPORT_URL="https://bugzilla.redhat.com/"</programlisting> + <programlisting>NAME=Parabola +VERSION="rolling-release" +ID=parabola +ID_LIKE=arch +VERSION_ID=rolling-release +PRETTY_NAME="Parabola GNU/Linux-libre" +ANSI_COLOR="1;35" +CPE_NAME="cpe:/o:parabola:parabola:rolling-release" +HOME_URL="https://www.parabola.nu/" +BUG_REPORT_URL="https://labs.parabola.nu/"</programlisting> </refsect1> <refsect1> diff --git a/man/sd-bus-errors.xml b/man/sd-bus-errors.xml index 055af7a682..d2b81f4e4a 100644 --- a/man/sd-bus-errors.xml +++ b/man/sd-bus-errors.xml @@ -126,7 +126,7 @@ <para>In addition to this list, in sd-bus, the special error namespace <literal>System.Error.</literal> is used to map - arbitrary Linux system errors (as defined by <citerefentry + arbitrary GNU/Linux system errors (as defined by <citerefentry project='man-pages'><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>) to D-Bus errors and back. For example, the error <constant>EUCLEAN</constant> is mapped to diff --git a/man/sd_bus_error_add_map.xml b/man/sd_bus_error_add_map.xml index 139bd77d8c..7dc1ef6c90 100644 --- a/man/sd_bus_error_add_map.xml +++ b/man/sd_bus_error_add_map.xml @@ -82,7 +82,7 @@ <para>The <function>sd_bus_error_add_map()</function> call may be used to register additional mappings for converting D-Bus errors - to Linux <varname>errno</varname>-style errors. The mappings + to GNU/Linux <varname>errno</varname>-style errors. The mappings defined with this call are consulted by calls such as <citerefentry><refentrytitle>sd_bus_error_set</refentrytitle><manvolnum>3</manvolnum></citerefentry> or diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 97b348b565..93f93880c3 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -1005,46 +1005,35 @@ <title>Examples</title> <example> - <title>Download a Fedora image and start a shell in it</title> + <title>Build and boot a minimal BLAG distribution in a container</title> - <programlisting># machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz -# systemd-nspawn -M Fedora-Cloud-Base-20141203-21</programlisting> - - <para>This downloads an image using - <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> - and opens a shell in it.</para> - </example> - - <example> - <title>Build and boot a minimal Fedora distribution in a container</title> - - <programlisting># dnf -y --releasever=23 --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora --enablerepo=updates install systemd passwd dnf fedora-release vim-minimal + <programlisting># dnf -y --releasever=210k --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=blag --enablerepo=updates install systemd passwd dnf blag-release vim-minimal # systemd-nspawn -bD /srv/mycontainer</programlisting> - <para>This installs a minimal Fedora distribution into the + <para>This installs a minimal BLAG distribution into the directory <filename noindex='true'>/srv/mycontainer/</filename> and then boots an OS in a namespace container in it.</para> </example> <example> - <title>Spawn a shell in a container of a minimal Debian unstable distribution</title> + <title>Spawn a shell in a container of a minimal gNewSense unstable distribution</title> - <programlisting># debootstrap --arch=amd64 unstable ~/debian-tree/ -# systemd-nspawn -D ~/debian-tree/</programlisting> + <programlisting># debootstrap --arch=amd64 unstable ~/gnewsense-tree/ +# systemd-nspawn -D ~/gnewsense-tree/</programlisting> - <para>This installs a minimal Debian unstable distribution into - the directory <filename>~/debian-tree/</filename> and then + <para>This installs a minimal gNewSense unstable distribution into + the directory <filename>~/gnewsense-tree/</filename> and then spawns a shell in a namespace container in it.</para> </example> <example> - <title>Boot a minimal Arch Linux distribution in a container</title> + <title>Boot a minimal Parabola GNU/Linux-libre distribution in a container</title> - <programlisting># pacstrap -c -d ~/arch-tree/ base -# systemd-nspawn -bD ~/arch-tree/</programlisting> + <programlisting># pacstrap -c -d ~/parabola-tree/ base +# systemd-nspawn -bD ~/parabola-tree/</programlisting> - <para>This installs a minimal Arch Linux distribution into the - directory <filename>~/arch-tree/</filename> and then boots an OS + <para>This installs a minimal Parabola GNU/Linux-libre distribution into the + directory <filename>~/parabola-tree/</filename> and then boots an OS in a namespace container in it.</para> </example> diff --git a/man/systemd.xml b/man/systemd.xml index 65f55199e2..4f0201fc76 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -61,7 +61,7 @@ <refsect1> <title>Description</title> - <para>systemd is a system and service manager for Linux operating + <para>systemd is a system and service manager for GNU/Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services.</para> diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index cbf9354a7a..66830695f3 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -653,7 +653,7 @@ static int analyze_plot(sd_bus *bus) { svg("<rect class=\"background\" width=\"100%%\" height=\"100%%\" />\n"); svg("<text x=\"20\" y=\"50\">%s</text>", pretty_times); svg("<text x=\"20\" y=\"30\">%s %s (%s %s %s) %s %s</text>", - isempty(host->os_pretty_name) ? "Linux" : host->os_pretty_name, + isempty(host->os_pretty_name) ? "GNU/Linux" : host->os_pretty_name, strempty(host->hostname), strempty(host->kernel_name), strempty(host->kernel_release), diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index a7cdf92ed2..e77ab3f850 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -831,13 +831,13 @@ static int install_variables(const char *esp_path, "Failed to determine current boot order: %m"); if (first || r == 0) { - r = efi_add_boot_option(slot, "Linux Boot Manager", + r = efi_add_boot_option(slot, "Systemd Boot Manager", part, pstart, psize, uuid, path); if (r < 0) return log_error_errno(r, "Failed to create EFI Boot variable entry: %m"); - log_info("Created EFI boot entry \"Linux Boot Manager\"."); + log_info("Created EFI boot entry \"Systemd Boot Manager\"."); } return insert_into_order(slot, first); diff --git a/src/core/main.c b/src/core/main.c index 02324d325e..35b0a43901 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1239,11 +1239,11 @@ static int status_welcome(void) { return status_printf(NULL, false, false, "\nWelcome to \x1B[%sm%s\x1B[0m!\n", isempty(ansi_color) ? "1" : ansi_color, - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); else return status_printf(NULL, false, false, "\nWelcome to %s!\n", - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); } static int write_container_id(void) { @@ -2013,9 +2013,6 @@ finish: log_error_errno(r, "Failed to switch root, trying to continue: %m"); } - /* Reopen the console */ - (void) make_console_stdio(); - args_size = MAX(6, argc+1); args = newa(const char*, args_size); @@ -2063,6 +2060,9 @@ finish: arg_serialization = safe_fclose(arg_serialization); fds = fdset_free(fds); + /* Reopen the console */ + (void) make_console_stdio(); + for (j = 1, i = 1; j < (unsigned) argc; j++) args[i++] = argv[j]; args[i++] = NULL; diff --git a/src/core/manager.c b/src/core/manager.c index c20e185d78..bb2000d860 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1589,13 +1589,12 @@ static int manager_dispatch_cgroups_agent_fd(sd_event_source *source, int fd, ui return 0; } -static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, size_t n, FDSet *fds) { +static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, FDSet *fds) { _cleanup_strv_free_ char **tags = NULL; assert(m); assert(u); assert(buf); - assert(n > 0); tags = strv_split(buf, "\n\r"); if (!tags) { @@ -1648,10 +1647,14 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t n = recvmsg(m->notify_fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC); if (n < 0) { - if (errno == EAGAIN || errno == EINTR) - return 0; + if (!IN_SET(errno, EAGAIN, EINTR)) + log_error("Failed to receive notification message: %m"); - return -errno; + /* It's not an option to return an error here since it + * would disable the notification handler entirely. Services + * wouldn't be able to send the WATCHDOG message for + * example... */ + return 0; } CMSG_FOREACH(cmsg, &msghdr) { @@ -1674,7 +1677,8 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t r = fdset_new_array(&fds, fd_array, n_fds); if (r < 0) { close_many(fd_array, n_fds); - return log_oom(); + log_oom(); + return 0; } } @@ -1688,25 +1692,27 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t return 0; } + /* The message should be a string. Here we make sure it's NUL-terminated, + * but only the part until first NUL will be used anyway. */ buf[n] = 0; /* Notify every unit that might be interested, but try * to avoid notifying the same one multiple times. */ u1 = manager_get_unit_by_pid_cgroup(m, ucred->pid); if (u1) { - manager_invoke_notify_message(m, u1, ucred->pid, buf, n, fds); + manager_invoke_notify_message(m, u1, ucred->pid, buf, fds); found = true; } u2 = hashmap_get(m->watch_pids1, PID_TO_PTR(ucred->pid)); if (u2 && u2 != u1) { - manager_invoke_notify_message(m, u2, ucred->pid, buf, n, fds); + manager_invoke_notify_message(m, u2, ucred->pid, buf, fds); found = true; } u3 = hashmap_get(m->watch_pids2, PID_TO_PTR(ucred->pid)); if (u3 && u3 != u2 && u3 != u1) { - manager_invoke_notify_message(m, u3, ucred->pid, buf, n, fds); + manager_invoke_notify_message(m, u3, ucred->pid, buf, fds); found = true; } diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index c9e8e54ee3..83a21eaf0e 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -96,7 +96,7 @@ static void print_welcome(void) { log_warning_errno(r, "Failed to read os-release file: %m"); printf("\nWelcome to your new installation of %s!\nPlease configure a few basic system settings:\n\n", - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); press_any_key(); diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index c2b5a5f205..1b3942b3dc 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -805,7 +805,7 @@ static int request_handler_machine( SD_ID128_FORMAT_VAL(mid), SD_ID128_FORMAT_VAL(bid), hostname_cleanup(hostname), - os_name ? os_name : "Linux", + os_name ? os_name : "GNU/Linux", v ? v : "bare", usage, cutoff_from, diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install index a0bca05c9a..af9f0f9ccd 100644 --- a/src/kernel-install/90-loaderentry.install +++ b/src/kernel-install/90-loaderentry.install @@ -38,7 +38,7 @@ elif [[ -f /usr/lib/os-release ]]; then fi if ! [[ $PRETTY_NAME ]]; then - PRETTY_NAME="Linux $KERNEL_VERSION" + PRETTY_NAME="GNU/Linux $KERNEL_VERSION" fi declare -a BOOT_OPTIONS diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 92ade820ac..9bb623c321 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -430,12 +430,12 @@ static int manager_watch_hostname(Manager *m) { r = determine_hostname(&m->llmnr_hostname, &m->mdns_hostname); if (r < 0) { - log_info("Defaulting to hostname 'linux'."); - m->llmnr_hostname = strdup("linux"); + log_info("Defaulting to hostname 'gnu-linux'."); + m->llmnr_hostname = strdup("gnu-linux"); if (!m->llmnr_hostname) return log_oom(); - m->mdns_hostname = strdup("linux.local"); + m->mdns_hostname = strdup("gnu-linux.local"); if (!m->mdns_hostname) return log_oom(); } else diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index b4ce6fba5a..ebedb11b14 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4685,12 +4685,14 @@ static int show_one( return log_error_errno(r, "Failed to map properties: %s", bus_error_message(&error, r)); if (streq_ptr(info.load_state, "not-found") && streq_ptr(info.active_state, "inactive")) { - log_error("Unit %s could not be found.", unit); + log_full(streq(verb, "status") ? LOG_ERR : LOG_DEBUG, + "Unit %s could not be found.", unit); if (streq(verb, "status")) return EXIT_PROGRAM_OR_SERVICES_STATUS_UNKNOWN; - return -ENOENT; + if (!streq(verb, "show")) + return -ENOENT; } r = sd_bus_message_rewind(reply, true); @@ -4755,10 +4757,11 @@ static int show_one( r = 0; if (show_properties) { char **pp; + int not_found_level = streq(verb, "show") ? LOG_DEBUG : LOG_WARNING; STRV_FOREACH(pp, arg_properties) if (!set_contains(found_properties, *pp)) { - log_warning("Property %s does not exist.", *pp); + log_full(not_found_level, "Property %s does not exist.", *pp); r = -ENXIO; } diff --git a/system-preset/90-journal-remote.preset b/system-preset/90-journal-remote.preset new file mode 100644 index 0000000000..f5917b2b84 --- /dev/null +++ b/system-preset/90-journal-remote.preset @@ -0,0 +1,13 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# These ones should be enabled by default, even if distributions +# generally follow a default-off policy. + +disable systemd-journal-gatewayd.* +disable systemd-journal-remote.* +disable systemd-journal-upload.* diff --git a/system-preset/90-journald.preset b/system-preset/90-journald.preset new file mode 100644 index 0000000000..1022f0e86f --- /dev/null +++ b/system-preset/90-journald.preset @@ -0,0 +1,11 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# These ones should be enabled by default, even if distributions +# generally follow a default-off policy. + +disable syslog.socket diff --git a/system-preset/90-networkd.preset b/system-preset/90-networkd.preset new file mode 100644 index 0000000000..609edafe23 --- /dev/null +++ b/system-preset/90-networkd.preset @@ -0,0 +1,12 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# These ones should be enabled by default, even if distributions +# generally follow a default-off policy. + +enable systemd-networkd.service +enable systemd-networkd-wait-online.service diff --git a/system-preset/90-resolved.preset b/system-preset/90-resolved.preset new file mode 100644 index 0000000000..c5a5063cc1 --- /dev/null +++ b/system-preset/90-resolved.preset @@ -0,0 +1,11 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# These ones should be enabled by default, even if distributions +# generally follow a default-off policy. + +enable systemd-resolved.service diff --git a/system-preset/90-systemd.preset b/system-preset/90-systemd.preset index 0f494b7552..07ef1e1bf6 100644 --- a/system-preset/90-systemd.preset +++ b/system-preset/90-systemd.preset @@ -12,10 +12,6 @@ enable remote-fs.target enable machines.target enable getty@.service -enable systemd-timesyncd.service -enable systemd-networkd.service -enable systemd-resolved.service -enable systemd-networkd-wait-online.service disable console-getty.service disable console-shell.service @@ -27,9 +23,3 @@ disable poweroff.target enable reboot.target disable rescue.target disable exit.target - -disable syslog.socket - -disable systemd-journal-gatewayd.* -disable systemd-journal-remote.* -disable systemd-journal-upload.* diff --git a/system-preset/90-timesyncd.preset b/system-preset/90-timesyncd.preset new file mode 100644 index 0000000000..b42460ef5e --- /dev/null +++ b/system-preset/90-timesyncd.preset @@ -0,0 +1,11 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# These ones should be enabled by default, even if distributions +# generally follow a default-off policy. + +enable systemd-timesyncd.service diff --git a/sysusers.d/systemd-coredump.conf b/sysusers.d/systemd-coredump.conf new file mode 100644 index 0000000000..bc0816ca5e --- /dev/null +++ b/sysusers.d/systemd-coredump.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-coredump - "systemd Core Dumper" diff --git a/sysusers.d/systemd-remote.conf.m4 b/sysusers.d/systemd-journal-gatewayd.conf index 0e9d71cdd0..379be0852e 100644 --- a/sysusers.d/systemd-remote.conf.m4 +++ b/sysusers.d/systemd-journal-gatewayd.conf @@ -5,10 +5,4 @@ # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. -m4_ifdef(`HAVE_MICROHTTPD', u systemd-journal-gateway - "systemd Journal Gateway" -u systemd-journal-remote - "systemd Journal Remote" -)m4_dnl -m4_ifdef(`HAVE_LIBCURL', -u systemd-journal-upload - "systemd Journal Upload" -)m4_dnl diff --git a/sysusers.d/systemd-journal-remote.conf b/sysusers.d/systemd-journal-remote.conf new file mode 100644 index 0000000000..ca20c24896 --- /dev/null +++ b/sysusers.d/systemd-journal-remote.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-journal-remote - "systemd Journal Remote" diff --git a/sysusers.d/systemd-journal-upload.conf b/sysusers.d/systemd-journal-upload.conf new file mode 100644 index 0000000000..927d400279 --- /dev/null +++ b/sysusers.d/systemd-journal-upload.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-journal-upload - "systemd Journal Upload" diff --git a/sysusers.d/systemd-journald.conf b/sysusers.d/systemd-journald.conf new file mode 100644 index 0000000000..dcb01f606a --- /dev/null +++ b/sysusers.d/systemd-journald.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +g systemd-journal - - diff --git a/sysusers.d/systemd-networkd.conf b/sysusers.d/systemd-networkd.conf new file mode 100644 index 0000000000..208148d6b8 --- /dev/null +++ b/sysusers.d/systemd-networkd.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-network - "systemd Network Management" diff --git a/sysusers.d/systemd-resolved.conf b/sysusers.d/systemd-resolved.conf new file mode 100644 index 0000000000..5872bf2db7 --- /dev/null +++ b/sysusers.d/systemd-resolved.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-resolve - "systemd Resolver" diff --git a/sysusers.d/systemd.conf.m4 b/sysusers.d/systemd-timesyncd.conf index af97509c05..4d7af7b3ae 100644 --- a/sysusers.d/systemd.conf.m4 +++ b/sysusers.d/systemd-timesyncd.conf @@ -5,16 +5,4 @@ # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. -g systemd-journal - - -m4_ifdef(`ENABLE_NETWORKD', -u systemd-network - "systemd Network Management" -)m4_dnl -m4_ifdef(`ENABLE_RESOLVED', -u systemd-resolve - "systemd Resolver" -)m4_dnl -m4_ifdef(`ENABLE_TIMESYNCD', u systemd-timesync - "systemd Time Synchronization" -)m4_dnl -m4_ifdef(`ENABLE_COREDUMP', -u systemd-coredump - "systemd Core Dumper" -)m4_dnl diff --git a/tmpfiles.d/.gitignore b/tmpfiles.d/.gitignore index 4f0ecaa9c3..c8c9fe059b 100644 --- a/tmpfiles.d/.gitignore +++ b/tmpfiles.d/.gitignore @@ -1,2 +1,2 @@ /etc.conf -/systemd.conf +/systemd-journald.conf diff --git a/tmpfiles.d/etc.conf.m4 b/tmpfiles.d/etc.conf.m4 index 064eae94f1..928105ea8d 100644 --- a/tmpfiles.d/etc.conf.m4 +++ b/tmpfiles.d/etc.conf.m4 @@ -13,9 +13,6 @@ L+ /etc/mtab - - - - ../proc/self/mounts m4_ifdef(`HAVE_SMACK_RUN_LABEL', t /etc/mtab - - - - security.SMACK64=_ )m4_dnl -m4_ifdef(`ENABLE_RESOLVED', -L! /etc/resolv.conf - - - - ../usr/lib/systemd/resolv.conf -)m4_dnl C /etc/nsswitch.conf - - - - m4_ifdef(`HAVE_PAM', C /etc/pam.d - - - - diff --git a/tmpfiles.d/systemd-coredump.conf b/tmpfiles.d/systemd-coredump.conf new file mode 100644 index 0000000000..02b052583d --- /dev/null +++ b/tmpfiles.d/systemd-coredump.conf @@ -0,0 +1,10 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +d /var/lib/systemd/coredump 0755 root root 3d diff --git a/tmpfiles.d/systemd.conf.m4 b/tmpfiles.d/systemd-journald.conf.m4 index 2cd58e9121..2e8bd8cbef 100644 --- a/tmpfiles.d/systemd.conf.m4 +++ b/tmpfiles.d/systemd-journald.conf.m4 @@ -7,21 +7,6 @@ # See tmpfiles.d(5) for details -d /run/user 0755 root root - -F! /run/utmp 0664 root utmp - - -d /run/systemd/ask-password 0755 root root - -d /run/systemd/seats 0755 root root - -d /run/systemd/sessions 0755 root root - -d /run/systemd/users 0755 root root - -d /run/systemd/machines 0755 root root - -d /run/systemd/shutdown 0755 root root - -m4_ifdef(`ENABLE_NETWORKD', -d /run/systemd/netif 0755 systemd-network systemd-network - -d /run/systemd/netif/links 0755 systemd-network systemd-network - -d /run/systemd/netif/leases 0755 systemd-network systemd-network - -)m4_dnl - d /run/log 0755 root root - z /run/log/journal 2755 root systemd-journal - - @@ -68,6 +53,3 @@ a+ /var/log/journal/%m - - - - d:group:wheel:r-x a+ /var/log/journal/%m - - - - group:wheel:r-x a+ /var/log/journal/%m/system.journal - - - - group:wheel:r-- '')')')m4_dnl - -d /var/lib/systemd 0755 root root - -d /var/lib/systemd/coredump 0755 root root 3d diff --git a/tmpfiles.d/systemd-networkd.conf b/tmpfiles.d/systemd-networkd.conf new file mode 100644 index 0000000000..24197555ee --- /dev/null +++ b/tmpfiles.d/systemd-networkd.conf @@ -0,0 +1,12 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +d /run/systemd/netif 0755 systemd-network systemd-network - +d /run/systemd/netif/links 0755 systemd-network systemd-network - +d /run/systemd/netif/leases 0755 systemd-network systemd-network - diff --git a/tmpfiles.d/systemd-resolved.conf b/tmpfiles.d/systemd-resolved.conf new file mode 100644 index 0000000000..760fe11412 --- /dev/null +++ b/tmpfiles.d/systemd-resolved.conf @@ -0,0 +1,10 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +L! /etc/resolv.conf - - - - ../usr/lib/systemd/resolv.conf diff --git a/tmpfiles.d/systemd-tmpfs.conf b/tmpfiles.d/systemd-tmpfs.conf new file mode 100644 index 0000000000..98050d329d --- /dev/null +++ b/tmpfiles.d/systemd-tmpfs.conf @@ -0,0 +1,14 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +# Exclude namespace mountpoints created with PrivateTmp=yes +x /tmp/systemd-private-%b-* +X /tmp/systemd-private-%b-*/tmp +x /var/tmp/systemd-private-%b-* +X /var/tmp/systemd-private-%b-*/tmp diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf new file mode 100644 index 0000000000..00951c92c9 --- /dev/null +++ b/tmpfiles.d/systemd.conf @@ -0,0 +1,20 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +d /run/user 0755 root root - +F! /run/utmp 0664 root utmp - + +d /run/systemd/ask-password 0755 root root - +d /run/systemd/seats 0755 root root - +d /run/systemd/sessions 0755 root root - +d /run/systemd/users 0755 root root - +d /run/systemd/machines 0755 root root - +d /run/systemd/shutdown 0755 root root - + +d /var/lib/systemd 0755 root root - diff --git a/tmpfiles.d/tmp.conf b/tmpfiles.d/tmp.conf index 6bbd1aa341..fe5225d751 100644 --- a/tmpfiles.d/tmp.conf +++ b/tmpfiles.d/tmp.conf @@ -10,9 +10,3 @@ # Clear tmp directories separately, to make them easier to override q /tmp 1777 root root 10d q /var/tmp 1777 root root 30d - -# Exclude namespace mountpoints created with PrivateTmp=yes -x /tmp/systemd-private-%b-* -X /tmp/systemd-private-%b-*/tmp -x /var/tmp/systemd-private-%b-* -X /var/tmp/systemd-private-%b-*/tmp diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000000..4bba404d19 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1 @@ +/notsd-fixup--includes.cache diff --git a/tools/git-setup b/tools/git-setup new file mode 100755 index 0000000000..f40a7724d9 --- /dev/null +++ b/tools/git-setup @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +cd "$(dirname -- "$0")" +cd "$(git rev-parse --show-toplevel)" + +if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then + # This part is allowed to fail + cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ + chmod +x .git/hooks/pre-commit && \ + echo "Activated pre-commit hook." || : +fi + +declare -A fetch +git config -f .gitconfig --get-regexp '.*' | while read -r key val; do + if [[ $key = *.fetch ]]; then + if [[ -z "${fetch[$key]}" ]]; then + git config --local --unset-all "$key" + fetch[$key]='true' + fi + git config --local --add "$key" "$val" + else + git config --local "$key" "$val" + fi +done diff --git a/tools/notsd-find-includes b/tools/notsd-find-includes new file mode 100755 index 0000000000..494398b082 --- /dev/null +++ b/tools/notsd-find-includes @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +phase=phase0 + +phase0() { + 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 +} + +phase2() { + 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" +} + +main "$@" diff --git a/tools/notsd-find-renames b/tools/notsd-find-renames new file mode 100755 index 0000000000..fe90e325f6 --- /dev/null +++ b/tools/notsd-find-renames @@ -0,0 +1,2 @@ +#!/bin/sh +git diff --find-renames -l1000 --stat=300,290 "${1:-notsystemd/postmove}" "${2:-notsystemd/master}" |sed -n '/=>/s/\s*|.*//p'
\ No newline at end of file diff --git a/tools/notsd-fixup b/tools/notsd-fixup new file mode 100755 index 0000000000..71b3bf4dfa --- /dev/null +++ b/tools/notsd-fixup @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Copyright (C) 2015-2016 Luke Shumaker + +main() { + set -e + set -o pipefail + export LC_COLLATE=C + + # We wrap the programs called by xargs with `sh` because xargs only exits early + # if the status is 255, but we want to exit early for all non-zero statuses. + # We use xargs instead of `find -exec` because `-exec` won't do much of + # anything useful with the exit status. + + # Makefiles + find "$@" -type f -name Makefile -print0 | + xargs -r0 sh -c "$0--makefiles \"\$@\" || exit 255" -- + + # C includes + rm -rf -- "$0"--includes.cache + find "$@" \( -name '*.h' -o -name '*.c' -o -name '*.gperf' -o -name '*.gperf.m4' \) -type f -print0 | + xargs -r0 sh -c "$0--includes \"\$@\" || exit 255" -- + rm -rf -- "$0"--includes.cache +} + +main "$@" diff --git a/tools/notsd-fixup--includes b/tools/notsd-fixup--includes new file mode 100755 index 0000000000..a636c78be6 --- /dev/null +++ b/tools/notsd-fixup--includes @@ -0,0 +1,305 @@ +#!/usr/bin/env python3 + +# If you are thinking "this file looks gross!", it is. It +# started out as a set of Bash one-liners. Which got turned +# into a script. Which grew somewhat organically. Not huge, +# but given that it started as some one liners, that's not a +# very pretty several hunderd lines. Then got fairly litterally +# translated into this, for speed. So yes, it is gross. +# Rewrites welcome; just don't introduce any behavioral changes +# (easy since `tools/notsd-move` runs it on the entire repo and +# puts the results in git history). + +import atexit +import filecmp +import json +import os +import re +import shlex +import subprocess +import sys + +################################################################ +# Everything else in this program is just fluff and bookkeeping +# around around calling classify(). + +# Return a tuple of (class/group, path); which is a class that +# the header path belongs to, and a normalized path for it. +# +# There are a fixed number of classes that it may put a header +# in; in order of most-public to most-private: +# +# system +# linux +# public +# protected +# private +def classify(expensive, current_file, path): + if re.fullmatch('.*/include(-staging)?/.*/.*', current_file): + lib = os.path.basename(os.path.dirname(current_file)) + if path.startswith(lib+'/'): + path = re.sub('^'+lib+'/', path) + if path.startswith('linux/'): + return 'linux', path + elif expensive.exists(os.path.join(os.path.dirname(current_file), path)): + return 'private', path + elif not path.startswith('systemd/') and path != 'libudev.h' and expensive.cpp(path): + return 'system', path + else: + if path.endswith('-to-name.h') or path.endswith('-from-name.h'): + base = re.fullmatch('(.*)-(to|from)-name\.h', os.path.basename(path)).group(1) + d={ + 'dns_type' : 'src/grp-resolve/systemd-resolved', + 'keyboard-keys' : 'src/grp-udev/libudev-core', + 'af' : 'src/libsystemd-basic/src', + 'arphrd' : 'src/libsystemd-basic/src', + 'cap' : 'src/libsystemd-basic/src', + 'errno' : 'src/libsystemd-basic/src', + 'audit_type' : 'src/libsystemd/src/sd-journal', + } + file = os.path.join(d[base], os.path.basename(path)) + if current_file.startswith(d[base]): + return 'private', os.path.basename(file) + elif '/include/' in file: + return 'protected', re.sub('.*/include/', '', file) + else: + return 'protected', os.path.basename(file) + elif path in [ 'asm/sgidefs.h', 'dbus/dbus.h', 'efi.h', 'efilib.h', 'gio/gio.h', 'glib.h', 'libmount.h' ]: + return 'system', path + elif os.path.basename(path) == 'util.h': + if '/systemd-boot/' in current_file: + return 'private', 'util.h' + else: + return 'protected', 'systemd-basic/util.h' + else: + find = expensive.find(os.path.basename(path)) + if len(find) == 1: + file = find[0] + if '/src/' in file: + if os.path.dirname(current_file) == os.path.dirname(file): + return 'private', os.path.basename(file) + else: + return 'protected', re.sub('.*/src/', '', file) + elif ('/libsystemd/include/' in file) or ('/libudev/include/' in file): + return 'public', re.sub('.*/include/', '', file) + elif '/include/' in file: + return 'protected', re.sub('.*/include/', '', file) + elif '/include-staging/' in file: + return 'protected', re.sub('.*/include-staging/', '', file) + else: + if os.path.dirname(current_file) == os.path.dirname(file): + return 'private', os.path.basename(file) + else: + return 'protected', os.path.basename(file) + else: + sys.exit('Cannot figure out: {0}'.format(path)) + +################################################################ +# Cache expensive things + +class Cache: + def __init__(self, filename): + self.cache = { + 'find': None, + 'cpp': {} + } + self.dirty = True + + if os.path.isfile(filename): + with open(filename) as file: + self.cache = json.load(file) + self.dirty = False + + def save(self, filename): + if self.dirty: + with open(filename, 'w') as file: + json.dump(self.cache, file) + + def real_cpp(path): + # `cpp -include "$path" <<<'' &>/dev/null` + print(' -> cpp({0})'.format(path), file=sys.stderr) + with subprocess.Popen(['cpp', '-include', path], + stdin=subprocess.PIPE, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) as proc: + proc.stdin.close() + return proc.wait() == 0 + + def real_find(): + # This can probably be done with os.walk or something, + # but since it is only called once, it isn't a good + # place to start optimizing. + # + # `find src -name '*.h' \( -type l -printf 'l %p\n' -o -type f -printf 'f %p\n' \)` + print(' -> find()', file=sys.stderr) + ret = {} + with subprocess.Popen(['find', 'src', '-name', '*.h', '(', '-type', 'l', '-printf', 'l %p\n', '-o', '-type', 'f', '-printf', 'f %p\n', ')'], + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, universal_newlines=True, + stderr=subprocess.DEVNULL) as proc: + for line in proc.stdout: + t, p = line.rstrip('\n').split(' ', 1) + ret[p]=t + return ret + + def cpp(self, path): + # `cpp -include "$path" <<<'' &>/dev/null` + if path not in self.cache['cpp']: + self.cache['cpp'][path] = Cache.real_cpp(path) + self.dirty = True + return self.cache['cpp'][path] + + def exists(self, path): + # `test -f "$path"` + if not self.cache['find']: + self.cache['find'] = Cache.real_find() + self.dirty = True + return path in self.cache['find'] + + def find(self, name): + # `find src -type f -name "$name"` + if not self.cache['find']: + self.cache['find'] = Cache.real_find() + self.dirty = True + return [p for p in self.cache['find'].keys() if self.cache['find'][p]=='f' and os.path.basename(p) == name] + +################################################################ +# Data structure for storing a chunk of `#include` lines. + +class IncludeSection: + def __init__(self): + self.trailing_nl = '' + self.system = [] + self.linux = [] + self.public = [] + self.protected = [] + self.typedef = [] + self.typedef_last = True + self.private = [] + def print(self, file=sys.stdout): + b='' + if len(self.system) > 0: + for line in sorted(set(self.system)): + print(line, file=file) + b='\n' + if len(self.linux) > 0: + print(b, end='', file=file) + for line in self.linux: + print(line, file=file) + b='\n' + if len(self.public) > 0: + print(b, end='', file=file) + for line in sorted(set(self.public)): + print(line, file=file) + b='\n' + if len(self.protected) > 0: + print(b, end='', file=file) + for line in sorted(set(self.protected)): + print(line, file=file) + b='\n' + if len(self.typedef) > 0 and not self.typedef_last: + print(b, end='', file=file) + for line in sorted(set(self.typedef)): + print(line, file=file) + b='\n' + if len(self.private) > 0: + print(b, end='', file=file) + for line in sorted(set(self.private)): + print(line, file=file) + b='\n' + if len(self.typedef) > 0 and self.typedef_last: + print(b, end='', file=file) + for line in self.typedef: + print(line, file=file) + print(self.trailing_nl, end='', file=file) + def add(self, group, path, extra): + if group == 'system': + self.system.append('#include <{0}>{1}'.format(path, extra)) + elif group == 'linux': + self.linux.append('#include <{0}>{1}'.format(path, extra)) + elif group == 'public': + self.public.append('#include <{0}>{1}'.format(path, extra)) + elif group == 'protected': + self.protected.append('#include "{0}"{1}'.format(path, extra)) + elif group == 'private': + if len(self.typedef) > 0: + self.typedef_last = False + self.private.append('#include "{0}"{1}'.format(path, extra)) + else: + sys.exit('panic: unrecognized line class: {0}'.format(group)) + +################################################################ +# The main program loop + +class Parser: + def __init__(self, cache, ifilename, ofilename): + self.cache = cache + self.ifilename = os.path.normpath(ifilename) + self.ofilename = ofilename + + self.includes = None + self.phase = self.phase0 + + def phase0(self, line, ofile): + self.phase = self.phase0 + + if re.fullmatch('#include.*|typedef .*;', line): + self.includes = IncludeSection() + self.phase1(line, ofile) + else: + print(line, file=ofile) + + def phase1(self, line, ofile): + self.phase = self.phase1 + + if line == '': + self.includes.trailing_nl += '\n' + elif line.startswith('#include'): + self.includes.trailing_nl = '' + match = re.fullmatch('^#include [<"]([^">]*)[">](.*)', line) + if match: + group, path = classify(self.cache, self.ifilename, match.group(1)) + self.includes.add(group, path, match.group(2)) + else: + sys.exit('panic: malformed #include line') + elif re.fullmatch('typedef .*;', line): + self.includes.trailing_nl = '' + self.includes.typedef.append(line) + else: + self.includes.print(file=ofile) + self.includes = None + self.phase0(line, ofile) + + def run(self): + print(' => {0} {1}'.format( + shlex.quote(__file__), + shlex.quote(self.ifilename), + ), file=sys.stderr) + with open(self.ofilename, 'w') as ofile: + with open(self.ifilename) as ifile: + for line in ifile: + self.phase(line.rstrip('\n'), ofile) + if self.includes: + self.includes.print(file=ofile) + +def main(argv): + cache = Cache(__file__+'.cache') + tmpfilename = '' + def cleanup(): + if tmpfilename != '': + try: + os.unlink(tmpfilename) + except FileNotFoundError: + pass + atexit.register(cleanup) + for filename in argv[1:]: + tmpfilename = os.path.join(os.path.dirname(filename), '.tmp.'+os.path.basename(filename)+'.tmp') + Parser(cache, filename, tmpfilename).run() + if not filecmp.cmp(filename, tmpfilename): + os.rename(tmpfilename, filename) + cleanup() + tmpfilename = '' + cache.save(__file__+'.cache') + +if __name__ == '__main__': + main(sys.argv) diff --git a/tools/notsd-fixup--makefiles b/tools/notsd-fixup--makefiles new file mode 100755 index 0000000000..f89e4b075b --- /dev/null +++ b/tools/notsd-fixup--makefiles @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +doit() { + local filename=$1 + { + <"$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" +} + +main() { + set -e + set -o pipefail + local filename + for filename in "$@"; do + >&2 printf ' => %q %q\n' "$0" "$filename" + doit "$filename" + done +} + +main "$@" diff --git a/tools/notsd-move b/tools/notsd-move new file mode 100755 index 0000000000..096c3d8338 --- /dev/null +++ b/tools/notsd-move @@ -0,0 +1,873 @@ +#!/usr/bin/env bash + +in_array() ( + set +x + local needle=$1; shift + local item + for item in "$@"; do + [[ $item = $needle ]] && return 0 # Found + done + return 1 # Not Found +) + +split_lib() ( + shopt -s nullglob + local d=$1 + local t + + if t=("$d"/test-*) && [[ ${#t[@]} -gt 0 ]]; then + mkdir "$d/test" + mv -t "$d/test" -- "${t[@]}" + fi + + if t=("$d"/*.c) && [[ ${#t[@]} -gt 0 ]]; then + mkdir "$d/src" + mv -t "$d/src" -- "${t[@]}" + fi + + if t=("$d"/*.h) && [[ ${#t[@]} -gt 0 ]]; then + local h=${d##*/lib} + mkdir "$d/include" + mkdir "$d/include/$h" + mv -t "$d/include/$h" -- "${t[@]}" + else + return 1 + fi +) + +grp() { + local grp=$1 + shift + if [[ -d "${grp}.d" ]]; then + mv -T "${grp}.d" "$grp" + else + mkdir "$grp" + fi + mv "$@" -t "$grp" +} + +move_files() ( + # first focus on getting directories to the right names. + mv -T src/{,systemd-}debug-generator + mv -T src/{,systemd-}fstab-generator + mv -T src/{,systemd-}getty-generator + mv -T src/{,systemd-}gpt-auto-generator + mv -T src/{,systemd-}rc-local-generator + mv -T src/{,systemd-}system-update-generator + mv -T src/{,systemd-}sysv-generator + + mv -T src/{,systemd-}ac-power + mv -T src/{,systemd-}analyze + mv -T src/{,systemd-}ask-password + mv -T src/{,systemd-}backlight + mv -T src/{,systemd-}binfmt + mv -T src/{,systemd-}cgls + mv -T src/{,systemd-}cgroups-agent + mv -T src/{,systemd-}cgtop + mv -T src/{,systemd-}cryptsetup + mv -T src/{,systemd-}delta + mv -T src/{,systemd-}detect-virt + mv -T src/{,systemd-}escape + mv -T src/{,systemd-}firstboot + mv -T src/{,systemd-}fsck + mv -T src/{,systemd-}hibernate-resume + mv -T src/{,systemd-}hwdb + mv -T src/{,systemd-}initctl + mv -T src/{,systemd-}machine-id-setup + mv -T src/{,systemd-}modules-load + mv -T src/{,systemd-}notify + mv -T src/{,systemd-}nspawn + mv -T src/{,systemd-}path + mv -T src/{,systemd-}quotacheck + mv -T src/{,systemd-}random-seed + mv -T src/{,systemd-}remount-fs + mv -T src/{,systemd-}reply-password + mv -T src/{,systemd-}rfkill + mv -T src/{,systemd-}run + mv -T src/{,systemd-}sleep + mv -T src/{,systemd-}stdio-bridge + mv -T src/{,systemd-}sysctl + mv -T src/{,systemd-}sysusers + mv -T src/{,systemd-}tmpfiles + mv -T src/{,systemd-}tty-ask-password-agent + mv -T src/{,systemd-}update-done + mv -T src/{,systemd-}update-utmp + mv -T src/{,systemd-}user-sessions + mv -T src/vconsole src/systemd-vconsole-setup + mv -T src/socket-proxy src/systemd-socket-proxyd + mv -T src/timesync src/systemd-timesyncd + mv -T src/activate src/systemd-socket-activate + + mv src/udev/*_id -t src + mv src/udev/mtd_probe -t src + mv src/udev/collect -t src + + mv -T src/boot/efi src/systemd-boot + mv -T src/boot src/bootctl + + mkdir src/libsystemd/src + mv -t src/libsystemd/src src/libsystemd/sd-* + mkdir src/libsystemd/include + mv -T src/systemd src/libsystemd/include/systemd + + mkdir src/busctl + mv src/libsystemd/src/sd-bus/busctl* -t src/busctl + + mkdir src/systemd + mv -t src/systemd \ + src/core/main* \ + src/core/*systemd* \ + src/core/system.conf \ + src/core/user.conf + mkdir src/systemd-shutdown + mv -t src/systemd-shutdown \ + src/core/shutdown* \ + src/core/umount* + mv -T src/{,lib}core + + mv -T src/{,libsystemd-}basic + mv -T src/{,libsystemd-}shared + + mv -T src/lib{systemd-shared,core}/linux + + mkdir src/libsystemd-firewall + mv -T src/libsystemd-{shared,firewall}/firewall-util.c + mv -T src/libsystemd-{shared,firewall}/firewall-util.h + + mkdir src/libsystemd-gcrypt + mv -T src/libsystemd-{shared,gcrypt}/gcrypt-util.c + mv -T src/libsystemd-{shared,gcrypt}/gcrypt-util.h + + mkdir src/libsystemd-blkid + mv -T src/libsystemd-{basic,blkid}/blkid-util.h + + mkdir src/libsystemd-microhttpd + mv -t src/libsystemd-microhttpd \ + src/journal-remote/microhttpd* + + split_lib src/libcore + split_lib src/libsystemd-basic + split_lib src/libsystemd-shared + split_lib src/libsystemd-network + split_lib src/libsystemd-firewall + split_lib src/libsystemd-gcrypt + split_lib src/libsystemd-blkid + split_lib src/libsystemd-microhttpd + + mv -t src/libcore/src \ + src/libcore/linux \ + src/libcore/include/core/dbus*.h + mv -T src/libcore/{src,include/core}/dbus-manager.h + mv -T src/libcore/{include/core,src}/audit-fd.h + mv -T src/libcore/{include/core,src}/load-dropin.h + mv -T src/libcore/{include/core,src}/locale-setup.h + mv -T src/libcore/{include/core,src}/selinux-access.h + mv -T src/libcore/{include/core,src}/transaction.h + mv -T src/libcore/{include/core,src}/unit-printf.h + mv -T src/libcore/{,src}/load-fragment-gperf.gperf.m4 + + mv src/libsystemd-shared/{test,include/systemd-shared}/test-tables.h + rmdir src/libsystemd-shared/test + + mkdir src/systemd-hibernate-resume-generator + mv -t src/systemd-hibernate-resume-generator \ + src/systemd-hibernate-resume/*generator* + + # src/resolve => src/{libbasic-dns,resolve,resolved} + mkdir src/libbasic-dns + mv -t src/libbasic-dns \ + src/resolve/dns-type.{c,h} \ + src/resolve/resolved-dns-{answer,dnssec,packet,question,rr}.{c,h} \ + src/resolve/test-* + mkdir src/systemd-resolve + mv -t src/systemd-resolve \ + src/resolve/resolve-tool.c + mkdir src/systemd-resolved + mv -t src/systemd-resolved \ + src/resolve/.gitignore \ + src/resolve/* + rmdir src/resolve + split_lib src/libbasic-dns + + # src/import => src/{libimport,systemd-{export,importd,import}} + mkdir src/libimport + mv -t src/libimport \ + src/import/import-common.{c,h} \ + src/import/import-compress.{c,h} \ + src/import/qcow2-util.{c,h} \ + src/import/test-qcow2.c + mkdir src/systemd-export + mv -t src/systemd-export \ + src/import/export* + mkdir src/systemd-importd + mv -t src/systemd-importd \ + src/import/.gitignore \ + src/import/importd.c \ + src/import/org.* + mkdir src/systemd-import + mv -t src/systemd-import \ + src/import/import* + mkdir src/systemd-pull + mv -t src/systemd-pull \ + src/import/pull* \ + src/import/curl-util* + rmdir src/import + + # src/journal => src/... + mkdir src/libjournal-core + mv -t src/libjournal-core \ + src/journal/.gitignore \ + src/journal/journald-* \ + src/journal/test-* + mkdir src/systemd-cat + mv -t src/systemd-cat \ + src/journal/cat.c + mkdir src/journalctl + mv -t src/journalctl \ + src/journal/journal-qrcode.{c,h} \ + src/journal/journalctl.c + mkdir src/systemd-journald + mv -t src/systemd-journald \ + src/journal/journald.* + mkdir src/libsystemd/src/sd-journal + mv -t src/libsystemd/src/sd-journal \ + src/journal/audit-type.c \ + src/journal/audit-type.h \ + src/journal/catalog.c \ + src/journal/catalog.h \ + src/journal/compress.c \ + src/journal/compress.h \ + src/journal/fsprg.c \ + src/journal/fsprg.h \ + src/journal/journal-authenticate.c \ + src/journal/journal-authenticate.h \ + src/journal/journal-def.h \ + src/journal/journal-file.c \ + src/journal/journal-file.h \ + src/journal/journal-internal.h \ + src/journal/journal-send.c \ + src/journal/journal-vacuum.c \ + src/journal/journal-vacuum.h \ + src/journal/journal-verify.c \ + src/journal/journal-verify.h \ + src/journal/lookup3.c \ + src/journal/lookup3.h \ + src/journal/mmap-cache.c \ + src/journal/mmap-cache.h \ + src/journal/sd-journal.c + rmdir src/journal + split_lib src/libjournal-core + mv -T src/libjournal-core/{,src/}journald-gperf.gperf + + # src/network => src/... + mkdir src/systemd-networkd-wait-online + mv -t src/systemd-networkd-wait-online \ + src/network/networkd-wait-online* + mkdir src/libnetworkd-core + mv -t src/libnetworkd-core \ + src/network/.gitignore \ + src/network/networkd-* + mkdir src/networkctl + mv -t src/networkctl \ + src/network/networkctl.c + mkdir src/systemd-networkd + mv -t src/systemd-networkd \ + src/network/networkd* \ + src/network/org.* + mkdir src/grp-network.d + mv -t src/grp-network.d \ + src/network/test-* + rmdir src/network + + # src/machine => src/{machinectl,systemd-machined,libmachine-core} + mkdir src/machinectl src/systemd-machined src/libmachine-core + mv -T src/{machine,machinectl}/machinectl.c + mv -T src/{machine,systemd-machined}/machined.c + mv -t src/systemd-machined \ + src/machine/.gitignore \ + src/machine/org.* + mv -t src/libmachine-core \ + src/machine/* + rmdir src/machine + split_lib src/libmachine-core + + # src/coredump => src/{coredumpctl,systemd-coredump} + mkdir src/coredumpctl + mv -t src/coredumpctl \ + src/coredump/coredumpctl* + mkdir src/systemd-coredump + mv -t src/systemd-coredump \ + src/coredump/* + rmdir src/coredump + + # src/hostname => src/{hostnamectl,systemd-hostnamed} + mkdir src/hostnamectl + mv -t src/hostnamectl \ + src/hostname/hostnamectl* + mkdir src/systemd-hostnamed + mv -t src/systemd-hostnamed \ + src/hostname/.gitignore \ + src/hostname/* + rmdir src/hostname + + # src/journal-remote => src/... + mkdir src/systemd-journal-gatewayd + mv -t src/systemd-journal-gatewayd \ + src/journal-remote/journal-gateway* + mkdir src/systemd-journal-remote + mv -t src/systemd-journal-remote \ + src/journal-remote/journal-remote* + mkdir src/systemd-journal-upload + mv -t src/systemd-journal-upload \ + src/journal-remote/journal-upload* + mkdir src/grp-remote.d + mv -t src/grp-remote.d \ + src/journal-remote/.gitignore \ + src/journal-remote/browse.html \ + src/journal-remote/log-generator.py + rmdir src/journal-remote + + # src/locale => src/... + mkdir src/localectl + mv -t src/localectl \ + src/locale/localectl* + mkdir src/systemd-localed + mv -t src/systemd-localed \ + src/locale/.gitignore \ + src/locale/* + rmdir src/locale + + # src/login => src/... + mkdir src/grp-login.d + mv -t src/grp-login.d \ + src/login/.gitignore \ + src/login/test-* + mkdir src/loginctl + mv -t src/loginctl \ + src/login/loginctl* \ + src/login/sysfs-show* + mkdir src/pam_systemd + mv -t src/pam_systemd \ + src/login/pam* + mkdir src/systemd-inhibit + mv -t src/systemd-inhibit \ + src/login/inhibit* + mkdir src/systemd-logind + mv -t src/systemd-logind \ + src/login/logind* \ + src/login/*.rules \ + src/login/*.rules.in \ + src/login/org.* + mv -T src/login/systemd-user.m4 src/systemd-logind/systemd-user.pam.m4 + rmdir src/login + + # src/timedate => src/... + mkdir src/timedatectl + mv -t src/timedatectl \ + src/timedate/timedatectl* + mkdir src/systemd-timedated + mv -t src/systemd-timedated \ + src/timedate/.gitignore \ + src/timedate/timedated* \ + src/timedate/org.* + rmdir src/timedate + + # src/udev => src/... + mv -T src/udev/udev.h src/libudev/udev.h + mkdir src/udevadm + mv -t src/udevadm \ + src/udev/udevadm* + mkdir src/libudev-core + mv -t src/libudev-core \ + src/udev/net \ + src/udev/udev-* + mkdir src/systemd-udevd + mv -t src/systemd-udevd \ + src/udev/udev.conf* \ + src/udev/udevd* + mkdir src/grp-udev.d + mv -t src/grp-udev.d \ + src/udev/.gitignore \ + src/udev/udev.* + rm src/udev/.vimrc + rmdir src/udev + + # .conf is such a useless suffix + for ext in sysctl sysusers tmpfiles; do + for file in $ext.d/*.conf*; do + mv -T "$file" "${file/.conf/.$ext}" + done + done + for ext in xorg; do + for file in $ext/*.sh*; do + mv -T "$file" "${file/.sh/.$ext}" + done + done + + # less obvious manpage groups + mv -T man/{glib-event-glue,sd_event_get_fd-glib-example}.c + mv -T man/systemd-{halt.service,shutdown}.xml + mv -T man/systemd-{suspend.service,sleep}.xml + mv -t src/libsystemd \ + man/libsystemd* \ + man/sd* + mv -t src/libudev \ + man/udev_* + mkdir src/manpages + mv -t src/manpages \ + man/daemon.xml \ + man/file-hierarchy.xml \ + man/hostname.xml \ + man/locale.conf.xml \ + man/localtime.xml \ + man/machine-id.xml \ + man/machine-info.xml \ + man/os-release.xml + mv -t src/systemctl \ + man/halt.xml \ + man/runlevel.xml \ + man/shutdown.xml \ + man/telinit.xml \ + man/systemd.preset.xml + mv -t src/systemd \ + man/systemd-system.conf.xml + mkdir src/grp-system.d + mv -t src/grp-system.d \ + man/bootup.xml \ + man/kernel-command-line.xml + mv -t src/systemd-udevd \ + man/udev.conf.xml + mv -t src/grp-udev.d \ + man/udev.xml + mv -t src/systemd-cryptsetup \ + man/*crypt* + mv -t src/systemd-machine-id-setup \ + man/systemd-machine-id* + mv -t src/systemd-path src/libsystemd/include/systemd/sd-path* + mv -t src/systemd-path src/libsystemd/src/sd-path/* + rmdir src/libsystemd/src/sd-path + mv -t src/systemd-resolved \ + man/dnssec-trust-anchors* + mv -t src/systemd-tty-ask-password-agent \ + man/systemd-ask-password-console* + + # less obvious unit groups + # suffix these with '*' in case they gain or lose the .in suffix. + for thing in hibernate hybrid-sleep suspend; do + mv -t src/systemd-sleep \ + units/"$thing".target* \ + units/systemd-"$thing".service* + done + for thing in halt kexec poweroff reboot; do + mv -t src/systemd-shutdown \ + units/"$thing".target* \ + units/systemd-"$thing".service* + done + mv -t src/systemd-binfmt \ + units/*binfmt* + mv -t src/systemd-modules-load \ + units/kmod* + mv -t src/systemd-quotacheck \ + units/quota* + mv -t src/systemd-journald \ + units/*journald* + mv -t src/systemd-cryptsetup \ + units/cryptsetup* + mv -t src/systemd-logind \ + units/user.slice* + mv -t src/systemd-machined \ + units/machine.slice* + + # muck + mv -t src/libsystemd-basic/src src/libsystemd-basic/.gitignore + mv -T {test,src/systemd-boot}/test-efi-create-disk.sh + mv -t src/systemd-tmpfiles units/systemd-tmpfiles* + mv -t src/systemd-tmpfiles \ + tmpfiles.d/tmp.* \ + tmpfiles.d/var.* \ + tmpfiles.d/etc.* \ + tmpfiles.d/home.* \ + tmpfiles.d/*nologin* \ + tmpfiles.d/legacy.* \ + tmpfiles.d/x11.* + mv -t src/systemd-sysusers \ + sysusers.d/.gitignore \ + sysusers.d/basic* + mkdir src/libudev/src + mv -t src/libudev/src src/libudev/*.{c,h} + mkdir src/libudev/include + mv -T src/libudev/{src,include}/libudev.h + mv -T src/{systemd-networkd,libnetworkd-core}/networkd.h + mv -T src/{systemd-resolved,libbasic-dns/include/basic-dns}/resolved-def.h + mv -t src/cdrom_id rules/*cdrom* + mv -t src/mtd_probe rules/*mtd* + mv -t src/v4l_id rules/*v4l* + mv -t src/libsystemd-network/include/systemd-network \ + src/libsystemd/include/systemd/sd-dhcp* \ + src/libsystemd/include/systemd/sd-ipv4* \ + src/libsystemd/include/systemd/sd-lldp* \ + src/libsystemd/include/systemd/sd-ndisc* + mkdir src/libsystemd/include-staging{,/systemd-staging} + mv -t src/libsystemd/include-staging/systemd-staging \ + src/libsystemd/include/systemd/sd-{device,hwdb,netlink,network,resolve}.h + + mkdir src/grp-journal.d + mv -t src/grp-journal.d tmpfiles.d/journal-nocow.* + mv -t src/grp-remote.d tmpfiles.d/systemd-remote.* + mv -t src/systemd tmpfiles.d/systemd-tmpfs.tmpfiles* + mv -t src/systemd xorg/??-systemd-user.*; rmdir xorg + mv -t src/systemd-vconsole-setup man/vconsole.conf.xml + mv -t src/systemd-coredump \ + sysctl.d/*coredump* + mv -t src/systemd-sysctl \ + sysctl.d/??-default.* + + mv -t src/systemd-sysv-generator \ + docs/sysvinit/.gitignore \ + docs/sysvinit/* + rmdir docs/sysvinit + mv -t src/grp-journal.d \ + docs/var-log/.gitignore \ + docs/var-log/* + rmdir docs/var-log + rm docs/.gitignore + rmdir docs + + # auto-distribute the stuff + for d in man units sysusers.d tmpfiles.d; do + pushd $d >/dev/null + for file in *; do + base=${file%%.*} + base=${base%%@*} + if [[ -d ../src/"${base}" ]]; then + mv "$file" -t ../src/"${base}" + elif [[ -d ../src/"${base#systemd-}" ]]; then + mv "$file" -t ../src/"${base#systemd-}" + elif [[ -d ../src/systemd-"${base}" ]]; then + mv "$file" -t ../src/systemd-"${base}" + fi + done + popd >/dev/null + done + rmdir sysusers.d #tmpfiles.d + + pushd shell-completion/bash >/dev/null + mv -T systemctl.in ../../src/systemctl/systemctl.completion.bash.in + cat .gitignore >> ../../src/systemctl/.gitignore + rm .gitignore + for file in *; do + if [[ -d ../../src/"$file" ]]; then + mv -T "$file" "../../src/$file/$file.completion.bash" + fi + done + popd >/dev/null + rmdir shell-completion/bash + + pushd shell-completion/zsh >/dev/null + mv -T _systemctl.in ../../src/systemctl/systemctl.completion.zsh.in + cat .gitignore >> ../../src/systemctl/.gitignore + rm .gitignore + for file in _*; do + if [[ -d ../../src/"${file#_}" ]]; then + mv -T "$file" "../../src/${file#_}/${file#_}.completion.zsh" + fi + done + popd >/dev/null + mv -T shell-completion/zsh src/zsh-completion + rmdir shell-completion + + # do this *after* auto-splitting, because of + # systemd-journal-{gatewayd,remote,upload}. + mv -t src/journalctl \ + units/*journal* + # fix a false positive + mv -t units \ + src/systemd-shutdown/shutdown.target + + # categorize + grp src/grp-boot \ + src/bootctl \ + src/kernel-install \ + src/systemd-boot + grp src/grp-coredump \ + src/coredumpctl \ + src/systemd-coredump + grp src/grp-hostname \ + src/hostnamectl \ + src/systemd-hostnamed + grp src/grp-initprogs \ + src/systemd-backlight \ + src/systemd-binfmt \ + src/systemd-detect-virt \ + src/systemd-firstboot \ + src/systemd-fsck \ + src/systemd-modules-load \ + src/systemd-quotacheck \ + src/systemd-random-seed \ + src/systemd-rfkill \ + src/systemd-sysctl \ + src/systemd-sysusers \ + src/systemd-tmpfiles \ + src/systemd-update-done \ + src/systemd-update-utmp \ + src/systemd-user-sessions \ + src/systemd-vconsole-setup + grp src/grp-initprogs/grp-sleep \ + src/systemd-hibernate-resume \ + src/systemd-hibernate-resume-generator \ + src/systemd-sleep + grp src/grp-remote \ + src/libsystemd-microhttpd \ + src/systemd-journal-gatewayd \ + src/systemd-journal-remote \ + src/systemd-journal-upload + grp src/grp-journal \ + catalog \ + src/grp-remote \ + src/journalctl \ + src/libjournal-core \ + src/systemd-cat \ + src/systemd-journald + grp src/grp-locale \ + src/localectl \ + src/systemd-localed + grp src/grp-login \ + src/loginctl \ + src/pam_systemd \ + src/systemd-inhibit \ + src/systemd-logind + grp src/grp-machine \ + src/libmachine-core \ + src/machinectl \ + src/nss-mymachines \ + src/systemd-machined + grp src/grp-machine/grp-import \ + src/libimport \ + src/systemd-export \ + src/systemd-import \ + src/systemd-importd \ + src/systemd-pull + grp src/grp-network \ + network \ + src/libnetworkd-core \ + src/networkctl \ + src/systemd-networkd \ + src/systemd-networkd-wait-online + grp src/grp-resolve \ + src/libbasic-dns \ + src/nss-resolve \ + src/systemd-resolve \ + src/systemd-resolved + grp src/grp-system \ + src/libcore \ + src/systemctl \ + src/systemd \ + src/systemd-shutdown + grp src/grp-system/grp-utils \ + src/systemd-analyze \ + src/systemd-delta \ + src/systemd-fstab-generator \ + src/systemd-run \ + src/systemd-sysv-generator + grp src/grp-timedate \ + src/systemd-timedated \ + src/timedatectl + grp src/grp-udev \ + rules \ + hwdb \ + src/libudev-core \ + src/*_id \ + src/collect \ + src/mtd_probe \ + src/systemd-hwdb \ + src/systemd-udevd \ + src/udevadm + grp src/grp-utils \ + src/systemd-ac-power \ + src/systemd-escape \ + src/systemd-notify \ + src/systemd-path \ + src/systemd-socket-activate + + mv -t src/grp-udev \ + src/grp-udev/rules/* + cat src/grp-udev/rules/.gitignore >> src/grp-udev/.gitignore + rm src/grp-udev/rules/.gitignore + rmdir src/grp-udev/rules + + mv -t src/grp-journal/systemd-journald \ + src/grp-journal/catalog/.gitignore \ + src/grp-journal/catalog/* + rmdir src/grp-journal/catalog + + mv -t src/systemd-timesyncd system-preset/??-timesyncd.preset + for file in system-preset/??-*.preset; do + base="${file##*/??-}" + base="${base%.preset}" + base="${base%d}" + mv -t src/grp-"$base" "$file" + done + rmdir system-preset + + mv -t src/libsystemd/src/sd-bus \ + src/libsystemd-shared/src/bus-util.c \ + src/libsystemd-shared/include/systemd-shared/bus-util.h + + ln -srT src/libsystemd/include/systemd/_sd-common.h src/libsystemd-network/include/systemd-network/_sd-common.h + ln -srT src/libsystemd/include/systemd/_sd-common.h src/grp-utils/systemd-path/_sd-common.h + ln -srT src/grp-login/systemd-logind/logind-acl.h src/grp-udev/libudev-core/logind-acl.h + ln -srT src/grp-login/systemd-logind/logind-acl.c src/grp-udev/libudev-core/logind-acl.c + ln -srT src/libsystemd/src/sd-login/sd-login.c src/grp-udev/libudev-core/sd-login.c +) + +breakup_makefile() ( + mkdir -p build-aux/Makefile.{once,each}.{head,tail} + + touch .tmp.move.all + files=(.tmp.move.all) + file=/dev/null + IFS='' + declare -i i=0 + trap 'printf "Makefile.am:%d:%s\n" $i "$line"' EXIT + while read -r line; do + i+=1 + if [[ $line = '#@'* ]]; then + file="${line#'#@'}" + file="${file%% *}" + if [[ $file = auto/* ]]; then + IFS=/ + read -r auto dir makefile <<<"$file" + IFS='' + [[ $auto = auto ]] + [[ $makefile = Makefile ]] + d="$(find src -type d -name "$dir")" + [[ -n "$d" ]] + [[ "$(wc -l <<<"$d")" = 1 ]] + file="$d/Makefile" + fi + if [[ "$file" != all ]] && ! in_array "$file" "${files[@]}"; then + cat .tmp.move.all > "$file" + files+=("$file") + fi + elif [[ $file = all ]]; then + printf '%s\n' "$line" | tee -a "${files[@]}" >/dev/null + else + printf '%s\n' "$line" >> "$file" + fi + done < <(fixup_makefile <Makefile.am) + trap -- EXIT + rm .tmp.move.all + + sed -ri \ + -e '/^[^# ]*:/ { s|\S+/|$(outdir)/|g }' \ + src/libsystemd-basic/src/Makefile \ + src/libsystemd/src/Makefile \ + src/libsystemd/src/sd-journal/Makefile \ + src/grp-udev/libudev-core/Makefile + + ln -sT ../subdir.mk src/libsystemd/src/sd-network/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-device/Makefile +) + +fixup_makefile() { + sed -r \ + -e '#### Specific complete strings #####' \ + -e 's|\$\(CPP\) \$\(CFLAGS\) \$\(AM_CPPFLAGS\) \$\(CPPFLAGS\)|$(CPP) $(sd.ALL_CPPFLAGS)|g' \ + -e '/^ \$\(AM_V_at\)\$\(MKDIR_P\) \$\(dir \$@\)/d' \ + \ + -e '#### General cases #################' \ + -e '/^[^# ]*:/ { s|^(\s*)\S+/|\1$(outdir)/| }' \ + -e 's|^if (.*)|ifneq ($(\1),)|' \ + -e '/^\s*\$\(AM_(C|CPP|LD)FLAGS\b/d' \ + -e 's|--version-script=.*/([^/]+)\.sym|--version-script=$(srcdir)/\1.sym|g' \ + -e 's|\$\((lib\S+)_la_LIBADD\)|\1.la|g' \ + \ + -e '#### Rename helpers ################' \ + -e 's|libbasic_la|libsystemd_basic_la|g' \ + -e 's|libbasic|libsystemd-basic|g' \ + -e 's|libsystemd-basic-dns|libbasic-dns|g' \ + \ + -e 's|libshared_la|libsystemd_shared_la|g' \ + -e 's|libshared|libsystemd-shared|g' \ + \ + -e 's|libfirewall_la|libsystemd_firewall_la|g' \ + -e 's|libfirewall|libsystemd-firewall|g' +} + +breakup_zshcompletion() ( + sed_expr=' + 1 { + i #compdef %s + d + } + /^case/,/^esac/ { + /^ %s)/,/^ ;;/ { + s/^ //p + } + d + } + ' + + cd shell-completion/zsh + read -r _ cmds < _systemd + for cmd in $cmds; do + printf -v cmd_sed_expr "$sed_expr" $cmd $cmd + sed -e "$cmd_sed_expr" < _systemd > _$cmd + done + rm _systemd +) + +run() ( + local tmp + tmp="$(mktemp --tmpdir)" + trap 'rm -f -- "$tmp"' EXIT + "$0" "$@" |& tail -n20 > "$tmp" || { r=$?; cat "$tmp"; return $r; } + return 0 +) + +move() ( + find . \( -name Makefile -o -name '*.mk' \) -delete + find src -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} + + + >&2 echo ' => breakup_zshcompletion' + run breakup_zshcompletion + >&2 echo ' => move_files' + run move_files + >&2 echo ' => breakup_makefile' + run breakup_makefile + >&2 echo ' => ./tools/notsd-fixup' + ./tools/notsd-fixup +) + +main() { + if [[ -n "$(git status -s)" ]] || [[ -n "$(git clean -xdn)" ]]; then + echo 'There are changes in the current directory.' >&2 + exit 1 + fi + + git checkout -b tmp/postmove + + move + + git add . + git commit -m './tools/notsd-move' + git merge --no-edit -s ours notsystemd/postmove + git checkout notsystemd/postmove + git merge tmp/postmove + git branch -d tmp/postmove +} + +set -e +set -o pipefail +if [[ $# -gt 0 ]]; then + set -x; +else + set -- main +fi +"$@" diff --git a/tools/notsd-reset b/tools/notsd-reset new file mode 100755 index 0000000000..d7141587fa --- /dev/null +++ b/tools/notsd-reset @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e +git checkout notsystemd/premove +git branch -D tmp/postmove || true +git checkout . +git clean -xdf diff --git a/tools/test-header.c b/tools/test-header.c new file mode 100644 index 0000000000..76e8197013 --- /dev/null +++ b/tools/test-header.c @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/tools/test-header.sh b/tools/test-header.sh new file mode 100755 index 0000000000..b11285af7d --- /dev/null +++ b/tools/test-header.sh @@ -0,0 +1,2 @@ +#!/bin/bash +gcc -c -o /dev/null -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/libmount $(find src -type d |sed 's|^|-I&|') -include ./config.h -include "$(realpath -- "$1")" test-header.c |