From 0306c98d319d189281af3c15101c8d343e400f13 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 30 Aug 2012 20:51:27 +0200 Subject: daemon: collect list of called external commands guestfsd calls many different tools. Keeping track of all of them is error prone. This patch introduces a new helper macro to put the command string into its own ELF section: GUESTFSD_EXT_CMD(C_variable, command_name); This syntax makes it still possible to grep for used command names. The actual usage of the collected list could be like this: objcopy -j .guestfsd_ext_cmds -O binary daemon/guestfsd /dev/stdout | tr '\0' '\n' | sort -u The resulting output will be used to tell mkinitrd which programs to copy into the initrd. Signed-off-by: Olaf Hering RWMJ: - Move str_vgchange at request of author. - Fix snprintf call in daemon/debug.c --- daemon/guestfsd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'daemon/guestfsd.c') diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 80175e08..e6d5fde4 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -53,6 +53,9 @@ #include "daemon.h" +GUESTFSD_EXT_CMD(str_udevadm, udevadm); +GUESTFSD_EXT_CMD(str_udevsettle, udevsettle); + static char *read_cmdline (void); #ifndef MAX @@ -1294,6 +1297,6 @@ random_name (char *template) void udev_settle (void) { - (void) command (NULL, NULL, "udevadm", "settle", NULL); - (void) command (NULL, NULL, "udevsettle", NULL); + (void) command (NULL, NULL, str_udevadm, "settle", NULL); + (void) command (NULL, NULL, str_udevsettle, NULL); } -- cgit