From 3bcaf458f6d823f81399dfbc6fcd452d54c1cd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 31 Mar 2017 22:49:02 -0400 Subject: [PATCH 1/8] Move busctl sources to src/busctl busctl is not part of libsystemd, and should not be stored under libsystemd. In particular this is confusing because busctl is linked with libshared, but stuff in libsystemd is not supposed to depend on libshared. --- Makefile.am | 6 +++--- src/{libsystemd/sd-bus => busctl}/busctl-introspect.c | 0 src/{libsystemd/sd-bus => busctl}/busctl-introspect.h | 0 src/{libsystemd/sd-bus => busctl}/busctl.c | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/{libsystemd/sd-bus => busctl}/busctl-introspect.c (100%) rename src/{libsystemd/sd-bus => busctl}/busctl-introspect.h (100%) rename src/{libsystemd/sd-bus => busctl}/busctl.c (100%) diff --git a/Makefile.am b/Makefile.am index 1cc657acca..4da0642076 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3610,9 +3610,9 @@ test_resolve_LDADD = \ libsystemd-shared.la busctl_SOURCES = \ - src/libsystemd/sd-bus/busctl.c \ - src/libsystemd/sd-bus/busctl-introspect.c \ - src/libsystemd/sd-bus/busctl-introspect.h + src/busctl/busctl.c \ + src/busctl/busctl-introspect.c \ + src/busctl/busctl-introspect.h busctl_LDADD = \ libsystemd-shared.la diff --git a/src/libsystemd/sd-bus/busctl-introspect.c b/src/busctl/busctl-introspect.c similarity index 100% rename from src/libsystemd/sd-bus/busctl-introspect.c rename to src/busctl/busctl-introspect.c diff --git a/src/libsystemd/sd-bus/busctl-introspect.h b/src/busctl/busctl-introspect.h similarity index 100% rename from src/libsystemd/sd-bus/busctl-introspect.h rename to src/busctl/busctl-introspect.h diff --git a/src/libsystemd/sd-bus/busctl.c b/src/busctl/busctl.c similarity index 100% rename from src/libsystemd/sd-bus/busctl.c rename to src/busctl/busctl.c From a75e27eb7006bc67345a3f28bf28a111a7540830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 31 Mar 2017 23:21:20 -0400 Subject: [PATCH 2/8] shared/dissect-image: fix warning about unused function when !HAVE_BLKID --- src/shared/dissect-image.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 1c9d21566f..36c94ac71b 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -42,8 +42,8 @@ #include "udev-util.h" #include "xattr-util.h" -static int probe_filesystem(const char *node, char **ret_fstype) { #ifdef HAVE_BLKID +static int probe_filesystem(const char *node, char **ret_fstype) { _cleanup_blkid_free_probe_ blkid_probe b = NULL; const char *fstype; int r; @@ -80,10 +80,8 @@ static int probe_filesystem(const char *node, char **ret_fstype) { not_found: *ret_fstype = NULL; return 0; -#else - return -EOPNOTSUPP; -#endif } +#endif int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) { From 79f1c8f6194dc0a2ab1a1f718c1feef16e0d262e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 2 Apr 2017 20:12:36 -0400 Subject: [PATCH 3/8] build-sys: use a single ENABLE_LOGIND conditional We used ENABLE_LOGIND for the automake conditional, and HAVE_LOGIND for the ifdef. That wasn't wrong, but it certainly was confusing. Also, move the ifdeffery to avoid warning about unused static function logind_set_wall_message() when logind is disabled. --- configure.ac | 2 +- src/systemctl/systemctl.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 06fa908d43..c8e886a247 100644 --- a/configure.ac +++ b/configure.ac @@ -1113,7 +1113,7 @@ if test "x$enable_logind" != "xno"; then have_logind=yes fi AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"]) -AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ]) +AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(ENABLE_LOGIND, [1], [Logind support available]) ]) AC_ARG_WITH([kill-user-processes], [AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])]) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index cb9ca9ae1e..64945121f7 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3191,8 +3191,8 @@ static int start_unit(int argc, char *argv[], void *userdata) { return r; } +#ifdef ENABLE_LOGIND static int logind_set_wall_message(void) { -#ifdef HAVE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus *bus; _cleanup_free_ char *m = NULL; @@ -3220,15 +3220,14 @@ static int logind_set_wall_message(void) { if (r < 0) return log_warning_errno(r, "Failed to set wall message, ignoring: %s", bus_error_message(&error, r)); - -#endif return 0; } +#endif /* Ask systemd-logind, which might grant access to unprivileged users * through PolicyKit */ static int logind_reboot(enum action a) { -#ifdef HAVE_LOGIND +#ifdef ENABLE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; const char *method, *description; sd_bus *bus; @@ -3291,7 +3290,7 @@ static int logind_reboot(enum action a) { } static int logind_check_inhibitors(enum action a) { -#ifdef HAVE_LOGIND +#ifdef ENABLE_LOGIND _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; _cleanup_strv_free_ char **sessions = NULL; const char *what, *who, *why, *mode; @@ -3410,7 +3409,7 @@ static int logind_check_inhibitors(enum action a) { } static int logind_prepare_firmware_setup(void) { -#ifdef HAVE_LOGIND +#ifdef ENABLE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus *bus; int r; @@ -8281,7 +8280,7 @@ static int halt_now(enum action a) { static int logind_schedule_shutdown(void) { -#ifdef HAVE_LOGIND +#ifdef ENABLE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; char date[FORMAT_TIMESTAMP_MAX]; const char *action; @@ -8409,7 +8408,7 @@ static int runlevel_main(void) { } static int logind_cancel_shutdown(void) { -#ifdef HAVE_LOGIND +#ifdef ENABLE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus *bus; int r; From f52df9bff3aa8f282dc4eda6b12129d0d2809be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 2 Apr 2017 20:52:03 -0400 Subject: [PATCH 4/8] build-sys: drop undefined var ref from Makefile.am --- Makefile.am | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4da0642076..3ddde9e600 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5024,10 +5024,6 @@ systemd_localed_LDADD = \ libsystemd-shared.la \ -ldl -systemd_localed_CFLAGS = \ - $(AM_CFLAGS) \ - $(XKBCOMMON_CFLAGS) - nodist_systemunit_DATA += \ units/systemd-localed.service From 1b81e156c54a484c67022ee65465c2acd5613c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 2 Apr 2017 20:52:47 -0400 Subject: [PATCH 5/8] build-sys: drop undefined target ref from Makefile.am --- Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3ddde9e600..33e77d4329 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5080,8 +5080,6 @@ dist_zshcompletion_data += \ shell-completion/zsh/_localectl endif -.PHONY: update-kbd-model-map - polkitpolicy_in_files += \ src/locale/org.freedesktop.locale1.policy.in From 948aaa7c52e64b08e71043a4ea4f793b88a68f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Apr 2017 12:15:33 -0400 Subject: [PATCH 6/8] tree-wide: standardize on $(PACKAGE_VERSION) for the version string We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents. $(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and drop the other define. --- Makefile.am | 7 +++---- configure.ac | 2 +- src/analyze/analyze.c | 2 +- src/boot/efi/boot.c | 8 ++++---- src/boot/efi/stub.c | 2 +- src/hwdb/hwdb.c | 2 +- src/libudev/libudev.pc.in | 2 +- src/test/test-libudev.c | 2 +- src/test/test-udev.c | 2 +- src/udev/scsi_id/scsi_id.c | 2 +- src/udev/udev-ctrl.c | 2 +- src/udev/udev.pc.in | 2 +- src/udev/udevadm-hwdb.c | 2 +- src/udev/udevadm-info.c | 2 +- src/udev/udevadm-test.c | 2 +- src/udev/udevadm.c | 2 +- src/udev/udevd.c | 4 ++-- 17 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Makefile.am b/Makefile.am index 33e77d4329..120c8a9bd6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6269,7 +6269,6 @@ substitutions = \ '|exec_prefix=$(exec_prefix)|' \ '|libdir=$(libdir)|' \ '|includedir=$(includedir)|' \ - '|VERSION=$(VERSION)|' \ '|rootprefix=$(rootprefix)|' \ '|udevlibexecdir=$(udevlibexecdir)|' \ '|SUSHELL=$(SUSHELL)|' \ @@ -6400,7 +6399,7 @@ XSLTPROC_FLAGS = \ --stringparam funcsynopsis.style ansi \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \ - --stringparam systemd.version $(VERSION) \ + --stringparam systemd.version $(PACKAGE_VERSION) \ --path '$(builddir)/man:$(srcdir)/man' XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc) @@ -6634,11 +6633,11 @@ built-sources: $(BUILT_SOURCES) .PHONY: git-tag git-tag: - git tag -s "v$(VERSION)" -m "systemd $(VERSION)" + git tag -s "v$(PACKAGE_VERSION)" -m "systemd $(PACKAGE_VERSION)" .PHONY: git-tar git-tar: - git archive -o systemd-$(VERSION).tar.gz --prefix=systemd-$(VERSION)/ HEAD + git archive -o systemd-$(PACKAGE_VERSION).tar.gz --prefix=systemd-$(PACKAGE_VERSION)/ HEAD %.asc: % gpg2 --detach-sign -a -o $@ $< diff --git a/configure.ac b/configure.ac index c8e886a247..16c5d42911 100644 --- a/configure.ac +++ b/configure.ac @@ -1674,7 +1674,7 @@ AC_CONFIG_FILES([ AC_OUTPUT AC_MSG_RESULT([ - $PACKAGE_NAME $VERSION + $PACKAGE_NAME $PACKAGE_VERSION libcryptsetup: ${have_libcryptsetup} PAM: ${have_pam} diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index ac0470b20d..1eb2ca0ccf 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -627,7 +627,7 @@ static int analyze_plot(sd_bus *bus) { "\n" "\n" "\n\n" - "\n\n", VERSION); + "\n\n", PACKAGE_VERSION); /* style sheet */ svg("\n