Skip to contentSkip to conversation

samples: build configfs sample on when enabled

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 12, 2015 configfs

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samples: build configfs sample on when enabled

Most samples have their own Kconfig option, but for some reason the configfs sample does not have one and gets built unconditionally when CONFIG_SAMPLES is enabled, which fails if CONFIG_CONFIGFS_FS is not:

ERROR: "configfs_unregister_subsystem" [samples/configfs/configfs_sample.ko] undefined!
ERROR: "configfs_register_subsystem" [samples/configfs/configfs_sample.ko] undefined!

This adds a new Kconfig symbol to mirror the existing method and only let the user enable this sample if configfs is present.

samples/Kconfig +6 -0
index fbd55eefa418..b283dc2e8ed6 100644
@@ -5,6 +5,12 @@ menuconfig SAMPLES
 
 if SAMPLES
 
+config SAMPLE_CONFIGFS
+	tristate "Build configfs sample -- loadable modules only"
+	depends on CONFIGFS_FS && m
+	help
+	  This builds the same for configfs
+
 config SAMPLE_TRACE_EVENTS
 	tristate "Build trace_events examples -- loadable modules only"
 	depends on EVENT_TRACING && m
samples/configfs/Makefile +1 -2
index 4d3c8b668f06..b9153ed0b7d6 100644
@@ -1,2 +1 @@
-
-obj-m += configfs_sample.o
+obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs_sample.o
#1 lore raw
Quoted 5 lines · Arnd Bergmann

Most samples have their own Kconfig option, but for some reason the configfs sample does not have one and gets built unconditionally when CONFIG_SAMPLES is enabled, which fails if CONFIG_CONFIGFS_FS is not:

Quoted 7 lines

ERROR: "configfs_unregister_subsystem" [samples/configfs/configfs_sample.ko] undefined!
ERROR: "configfs_register_subsystem" [samples/configfs/configfs_sample.ko] undefined!

This adds a new Kconfig symbol to mirror the existing method and only let the user enable this sample if configfs is present.

This should already be in version two of the series I sent last week.