1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

Merge pull request #5706 from keszybz/make-cleanups

Move busctl to its own dir and other cleanups
This commit is contained in:
Lennart Poettering 2017-04-05 12:10:11 +02:00 committed by GitHub
commit 6cb484cc06
23 changed files with 39 additions and 52 deletions

View File

@ -2816,9 +2816,6 @@ systemd_detect_virt_SOURCES = \
systemd_detect_virt_LDADD = \ systemd_detect_virt_LDADD = \
libsystemd-shared.la libsystemd-shared.la
INSTALL_EXEC_HOOKS += \
systemd-detect-virt-install-hook
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
systemd_delta_SOURCES = \ systemd_delta_SOURCES = \
src/delta/delta.c src/delta/delta.c
@ -3610,9 +3607,9 @@ test_resolve_LDADD = \
libsystemd-shared.la libsystemd-shared.la
busctl_SOURCES = \ busctl_SOURCES = \
src/libsystemd/sd-bus/busctl.c \ src/busctl/busctl.c \
src/libsystemd/sd-bus/busctl-introspect.c \ src/busctl/busctl-introspect.c \
src/libsystemd/sd-bus/busctl-introspect.h src/busctl/busctl-introspect.h
busctl_LDADD = \ busctl_LDADD = \
libsystemd-shared.la libsystemd-shared.la
@ -3881,7 +3878,7 @@ src/udev/keyboard-keys-list.txt:
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($$2 != "KEY_MAX") { print $$2 } }' > $@ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($$2 != "KEY_MAX") { print $$2 } }' > $@
src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key_name { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
@ -5024,10 +5021,6 @@ systemd_localed_LDADD = \
libsystemd-shared.la \ libsystemd-shared.la \
-ldl -ldl
systemd_localed_CFLAGS = \
$(AM_CFLAGS) \
$(XKBCOMMON_CFLAGS)
nodist_systemunit_DATA += \ nodist_systemunit_DATA += \
units/systemd-localed.service units/systemd-localed.service
@ -5084,8 +5077,6 @@ dist_zshcompletion_data += \
shell-completion/zsh/_localectl shell-completion/zsh/_localectl
endif endif
.PHONY: update-kbd-model-map
polkitpolicy_in_files += \ polkitpolicy_in_files += \
src/locale/org.freedesktop.locale1.policy.in src/locale/org.freedesktop.locale1.policy.in
@ -6275,7 +6266,6 @@ substitutions = \
'|exec_prefix=$(exec_prefix)|' \ '|exec_prefix=$(exec_prefix)|' \
'|libdir=$(libdir)|' \ '|libdir=$(libdir)|' \
'|includedir=$(includedir)|' \ '|includedir=$(includedir)|' \
'|VERSION=$(VERSION)|' \
'|rootprefix=$(rootprefix)|' \ '|rootprefix=$(rootprefix)|' \
'|udevlibexecdir=$(udevlibexecdir)|' \ '|udevlibexecdir=$(udevlibexecdir)|' \
'|SUSHELL=$(SUSHELL)|' \ '|SUSHELL=$(SUSHELL)|' \
@ -6406,7 +6396,7 @@ XSLTPROC_FLAGS = \
--stringparam funcsynopsis.style ansi \ --stringparam funcsynopsis.style ansi \
--stringparam man.authors.section.enabled 0 \ --stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \
--stringparam systemd.version $(VERSION) \ --stringparam systemd.version $(PACKAGE_VERSION) \
--path '$(builddir)/man:$(srcdir)/man' --path '$(builddir)/man:$(srcdir)/man'
XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc) XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
@ -6640,11 +6630,11 @@ built-sources: $(BUILT_SOURCES)
.PHONY: git-tag .PHONY: git-tag
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 .PHONY: git-tar
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: % %.asc: %
gpg2 --detach-sign -a -o $@ $< gpg2 --detach-sign -a -o $@ $<

View File

@ -1113,7 +1113,7 @@ if test "x$enable_logind" != "xno"; then
have_logind=yes have_logind=yes
fi fi
AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"]) 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], AC_ARG_WITH([kill-user-processes],
[AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])]) [AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])])
@ -1674,7 +1674,7 @@ AC_CONFIG_FILES([
AC_OUTPUT AC_OUTPUT
AC_MSG_RESULT([ AC_MSG_RESULT([
$PACKAGE_NAME $VERSION $PACKAGE_NAME $PACKAGE_VERSION
libcryptsetup: ${have_libcryptsetup} libcryptsetup: ${have_libcryptsetup}
PAM: ${have_pam} PAM: ${have_pam}

View File

@ -627,7 +627,7 @@ static int analyze_plot(sd_bus *bus) {
"<!-- that render these files properly but much slower are ImageMagick, -->\n" "<!-- that render these files properly but much slower are ImageMagick, -->\n"
"<!-- gimp, inkscape, etc. To display the files on your system, just -->\n" "<!-- gimp, inkscape, etc. To display the files on your system, just -->\n"
"<!-- point your browser to this file. -->\n\n" "<!-- point your browser to this file. -->\n\n"
"<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", VERSION); "<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", PACKAGE_VERSION);
/* style sheet */ /* style sheet */
svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n" svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n"

View File

@ -29,7 +29,7 @@
#endif #endif
/* magic string to find in the binary image */ /* magic string to find in the binary image */
static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " VERSION " ####"; static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " PACKAGE_VERSION " ####";
static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
@ -363,7 +363,7 @@ static VOID print_status(Config *config, CHAR16 *loaded_image_path) {
uefi_call_wrapper(ST->ConOut->SetAttribute, 2, ST->ConOut, EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK); uefi_call_wrapper(ST->ConOut->SetAttribute, 2, ST->ConOut, EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK);
uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut); uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut);
Print(L"systemd-boot version: " VERSION "\n"); Print(L"systemd-boot version: " PACKAGE_VERSION "\n");
Print(L"architecture: " EFI_MACHINE_TYPE_NAME "\n"); Print(L"architecture: " EFI_MACHINE_TYPE_NAME "\n");
Print(L"loaded image: %s\n", loaded_image_path); Print(L"loaded image: %s\n", loaded_image_path);
Print(L"UEFI specification: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff); Print(L"UEFI specification: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff);
@ -781,7 +781,7 @@ static BOOLEAN menu_run(Config *config, ConfigEntry **chosen_entry, CHAR16 *load
break; break;
case KEYPRESS(0, 0, 'v'): case KEYPRESS(0, 0, 'v'):
status = PoolPrint(L"systemd-boot " VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d", status = PoolPrint(L"systemd-boot " PACKAGE_VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d",
ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff, ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff,
ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
break; break;
@ -1718,7 +1718,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
InitializeLib(image, sys_table); InitializeLib(image, sys_table);
init_usec = time_usec(); init_usec = time_usec();
efivar_set_time_usec(L"LoaderTimeInitUSec", init_usec); efivar_set_time_usec(L"LoaderTimeInitUSec", init_usec);
efivar_set(L"LoaderInfo", L"systemd-boot " VERSION, FALSE); efivar_set(L"LoaderInfo", L"systemd-boot " PACKAGE_VERSION, FALSE);
s = PoolPrint(L"%s %d.%02d", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); s = PoolPrint(L"%s %d.%02d", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
efivar_set(L"LoaderFirmwareInfo", s, FALSE); efivar_set(L"LoaderFirmwareInfo", s, FALSE);
FreePool(s); FreePool(s);

View File

@ -23,7 +23,7 @@
#include "measure.h" #include "measure.h"
/* magic string to find in the binary image */ /* magic string to find in the binary image */
static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " VERSION " ####"; static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " PACKAGE_VERSION " ####";
static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;

View File

@ -390,7 +390,7 @@ static int trie_store(struct trie *trie, const char *filename) {
int64_t size; int64_t size;
struct trie_header_f h = { struct trie_header_f h = {
.signature = HWDB_SIG, .signature = HWDB_SIG,
.tool_version = htole64(atoi(VERSION)), .tool_version = htole64(atoi(PACKAGE_VERSION)),
.header_size = htole64(sizeof(struct trie_header_f)), .header_size = htole64(sizeof(struct trie_header_f)),
.node_size = htole64(sizeof(struct trie_node_f)), .node_size = htole64(sizeof(struct trie_node_f)),
.child_entry_size = htole64(sizeof(struct trie_child_entry_f)), .child_entry_size = htole64(sizeof(struct trie_child_entry_f)),

View File

@ -12,6 +12,6 @@ includedir=@includedir@
Name: libudev Name: libudev
Description: Library to access udev device information Description: Library to access udev device information
Version: @VERSION@ Version: @PACKAGE_VERSION@
Libs: -L${libdir} -ludev Libs: -L${libdir} -ludev
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -42,8 +42,8 @@
#include "udev-util.h" #include "udev-util.h"
#include "xattr-util.h" #include "xattr-util.h"
static int probe_filesystem(const char *node, char **ret_fstype) {
#ifdef HAVE_BLKID #ifdef HAVE_BLKID
static int probe_filesystem(const char *node, char **ret_fstype) {
_cleanup_blkid_free_probe_ blkid_probe b = NULL; _cleanup_blkid_free_probe_ blkid_probe b = NULL;
const char *fstype; const char *fstype;
int r; int r;
@ -80,10 +80,8 @@ static int probe_filesystem(const char *node, char **ret_fstype) {
not_found: not_found:
*ret_fstype = NULL; *ret_fstype = NULL;
return 0; 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) { int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) {

View File

@ -3191,8 +3191,8 @@ static int start_unit(int argc, char *argv[], void *userdata) {
return r; return r;
} }
#ifdef ENABLE_LOGIND
static int logind_set_wall_message(void) { static int logind_set_wall_message(void) {
#ifdef HAVE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus; sd_bus *bus;
_cleanup_free_ char *m = NULL; _cleanup_free_ char *m = NULL;
@ -3220,15 +3220,14 @@ static int logind_set_wall_message(void) {
if (r < 0) if (r < 0)
return log_warning_errno(r, "Failed to set wall message, ignoring: %s", bus_error_message(&error, r)); return log_warning_errno(r, "Failed to set wall message, ignoring: %s", bus_error_message(&error, r));
#endif
return 0; return 0;
} }
#endif
/* Ask systemd-logind, which might grant access to unprivileged users /* Ask systemd-logind, which might grant access to unprivileged users
* through PolicyKit */ * through PolicyKit */
static int logind_reboot(enum action a) { 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; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
const char *method, *description; const char *method, *description;
sd_bus *bus; sd_bus *bus;
@ -3291,7 +3290,7 @@ static int logind_reboot(enum action a) {
} }
static int logind_check_inhibitors(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_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_strv_free_ char **sessions = NULL; _cleanup_strv_free_ char **sessions = NULL;
const char *what, *who, *why, *mode; 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) { 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; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus; sd_bus *bus;
int r; int r;
@ -8281,7 +8280,7 @@ static int halt_now(enum action a) {
static int logind_schedule_shutdown(void) { 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; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
char date[FORMAT_TIMESTAMP_MAX]; char date[FORMAT_TIMESTAMP_MAX];
const char *action; const char *action;
@ -8409,7 +8408,7 @@ static int runlevel_main(void) {
} }
static int logind_cancel_shutdown(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; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus; sd_bus *bus;
int r; int r;

View File

@ -392,7 +392,7 @@ int main(int argc, char *argv[]) {
return EXIT_SUCCESS; return EXIT_SUCCESS;
case 'V': case 'V':
printf("%s\n", VERSION); printf("%s\n", PACKAGE_VERSION);
return EXIT_SUCCESS; return EXIT_SUCCESS;
case 'm': case 'm':

View File

@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
if (udev == NULL) if (udev == NULL)
return EXIT_FAILURE; return EXIT_FAILURE;
log_debug("version %s", VERSION); log_debug("version %s", PACKAGE_VERSION);
mac_selinux_init(); mac_selinux_init();
action = argv[1]; action = argv[1];

View File

@ -391,7 +391,7 @@ static int set_options(struct udev *udev,
break; break;
case 'V': case 'V':
printf("%s\n", VERSION); printf("%s\n", PACKAGE_VERSION);
exit(0); exit(0);
case 'x': case 'x':

View File

@ -29,7 +29,7 @@
#include "string-util.h" #include "string-util.h"
#include "udev.h" #include "udev.h"
static const struct key *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len); static const struct key_name *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len);
#include "keyboard-keys-from-name.h" #include "keyboard-keys-from-name.h"
static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) { static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) {
@ -76,7 +76,7 @@ static void map_keycode(int fd, const char *devnode, int scancode, const char *k
unsigned key; unsigned key;
} map; } map;
char *endptr; char *endptr;
const struct key *k; const struct key_name *k;
unsigned keycode_num; unsigned keycode_num;
/* translate identifier to key code */ /* translate identifier to key code */

View File

@ -239,7 +239,7 @@ static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int
int err = 0; int err = 0;
memzero(&ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire)); memzero(&ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire));
strcpy(ctrl_msg_wire.version, "udev-" VERSION); strcpy(ctrl_msg_wire.version, "udev-" PACKAGE_VERSION);
ctrl_msg_wire.magic = UDEV_CTRL_MAGIC; ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
ctrl_msg_wire.type = type; ctrl_msg_wire.type = type;

View File

@ -1,5 +1,5 @@
Name: udev Name: udev
Description: udev Description: udev
Version: @VERSION@ Version: @PACKAGE_VERSION@
udevdir=@udevlibexecdir@ udevdir=@udevlibexecdir@

View File

@ -352,7 +352,7 @@ static int trie_store(struct trie *trie, const char *filename) {
int64_t size; int64_t size;
struct trie_header_f h = { struct trie_header_f h = {
.signature = HWDB_SIG, .signature = HWDB_SIG,
.tool_version = htole64(atoi(VERSION)), .tool_version = htole64(atoi(PACKAGE_VERSION)),
.header_size = htole64(sizeof(struct trie_header_f)), .header_size = htole64(sizeof(struct trie_header_f)),
.node_size = htole64(sizeof(struct trie_node_f)), .node_size = htole64(sizeof(struct trie_node_f)),
.child_entry_size = htole64(sizeof(struct trie_child_entry_f)), .child_entry_size = htole64(sizeof(struct trie_child_entry_f)),

View File

@ -376,7 +376,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) {
export_prefix = optarg; export_prefix = optarg;
break; break;
case 'V': case 'V':
printf("%s\n", VERSION); printf("%s\n", PACKAGE_VERSION);
return 0; return 0;
case 'h': case 'h':
help(); help();

View File

@ -59,7 +59,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
{} {}
}; };
log_debug("version %s", VERSION); log_debug("version %s", PACKAGE_VERSION);
while ((c = getopt_long(argc, argv, "a:N:h", options, NULL)) >= 0) while ((c = getopt_long(argc, argv, "a:N:h", options, NULL)) >= 0)
switch (c) { switch (c) {

View File

@ -25,7 +25,7 @@
#include "udev.h" #include "udev.h"
static int adm_version(struct udev *udev, int argc, char *argv[]) { static int adm_version(struct udev *udev, int argc, char *argv[]) {
printf("%s\n", VERSION); printf("%s\n", PACKAGE_VERSION);
return 0; return 0;
} }

View File

@ -1492,7 +1492,7 @@ static int parse_argv(int argc, char *argv[]) {
help(); help();
return 0; return 0;
case 'V': case 'V':
printf("%s\n", VERSION); printf("%s\n", PACKAGE_VERSION);
return 0; return 0;
case '?': case '?':
return -EINVAL; return -EINVAL;
@ -1740,7 +1740,7 @@ int main(int argc, char *argv[]) {
if (arg_daemonize) { if (arg_daemonize) {
pid_t pid; pid_t pid;
log_info("starting version " VERSION); log_info("starting version " PACKAGE_VERSION);
/* connect /dev/null to stdin, stdout, stderr */ /* connect /dev/null to stdin, stdout, stderr */
if (log_get_max_level() < LOG_DEBUG) { if (log_get_max_level() < LOG_DEBUG) {