[PATCH] netconsole: Fix strange kconfig dependency on configfs

From: Steven Rostedt
Date: Thu Mar 10 2011 - 21:45:04 EST


Doing ktest rand config tests, I hit the following build bug:

LD .tmp_vmlinux1
drivers/built-in.o: In function `netconsole_target_get':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:127: undefined reference to `config_item_get'
drivers/built-in.o: In function `netconsole_target_put':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:133: undefined reference to `config_item_put'
drivers/built-in.o: In function `netconsole_target_get':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:127: undefined reference to `config_item_get'
drivers/built-in.o: In function `netconsole_target_put':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:133: undefined reference to `config_item_put'
drivers/built-in.o: In function `drop_netconsole_target':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:634: undefined reference to `config_item_put'
drivers/built-in.o: In function `make_netconsole_target':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:607: undefined reference to `config_item_init_type_name'
drivers/built-in.o: In function `dynamic_netconsole_init':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:109: undefined reference to `config_group_init'
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:111: undefined reference to `configfs_register_subsystem'
drivers/built-in.o: In function `dynamic_netconsole_exit':
/home/rostedt/work/autotest/nobackup/linux-test.git/drivers/net/netconsole.c:116: undefined reference to `configfs_unregister_subsystem'
make[1]: *** [.tmp_vmlinux1] Error 1

The .config had the following settings:

CONFIG_CONFIGFS_FS=m
CONFIG_NETCONSOLE=y
CONFIG_NETCONSOLE_DYNAMIC=y

NETCONSOLE_DYNAMIC depends on NETCONSOLE and CONFIGFS_FS, but
NETCONSOLE_DYNAMIC is just a boolean and not a tristate, where both
NETCONSOLE and CONFIGFS_FS are tristates and can be built as modules.

As we can see from the resulting config, NETCONSOLE_DYNAMIC can be set
to be builtin when CONFIGFS_FS which it depends on is built as a module.

The simplest solution is not to allow NETCONSOLE_DYNAMIC be enabled if
CONFIGFS_FS is a module but NETCONSOLE is built in, as
NETCONSOLE_DYNAMIC depends on code that is only compiled in when
CONFIGFS_FS is set.

Cc: Michal Marek <mmarek@xxxxxxx>
Cc: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx>
Cc: Joel Becker <jlbec@xxxxxxxxxxxx>
Cc: Randy Dunlap <randy.dunlap@xxxxxxxxxx>
CC: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

---
drivers/net/Kconfig | 1 +
1 file changed, 1 insertion(+)

Index: linux-test.git/drivers/net/Kconfig
===================================================================
--- linux-test.git.orig/drivers/net/Kconfig 2011-03-10 18:19:54.644008709 -0500
+++ linux-test.git/drivers/net/Kconfig 2011-03-10 18:21:21.320194133 -0500
@@ -3390,6 +3390,7 @@ config NETCONSOLE
config NETCONSOLE_DYNAMIC
bool "Dynamic reconfiguration of logging targets"
depends on NETCONSOLE && SYSFS && CONFIGFS_FS
+ depends on !(NETCONSOLE=y && CONFIGFS_FS=m)
help
This option enables the ability to dynamically reconfigure target
parameters (interface, IP addresses, port numbers, MAC addresses)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/