If a local package "foo-mod" for a Linux kernel module is selected by a
local tristate configuration option PTXCONF_FOO_MOD, then based on the
template for Linux drivers, it would include the following in its
foo-mod.make file:

ifdef PTXCONF_FOO_MOD
$(STATEDIR)/kernel.targetinstall.post: $(STATEDIR)/foo-mod.targetinstall
endif

However, this rule will be invoked even if the PTXCONF_FOO_MOD option
has been configured with the tristate option 'm' and has not been
changed to 'y' by a selected_collectionconfig.  This causes the Linux
kernel module to be built and installed unintentionally.  To prevent
that happening, the above lines in the foo-mod.make file can be changed
as follows (using a conditional test suggested by Michael Olbrich):

ifneq ($(filter foo-mod,$(PTX_PACKAGES_SELECTED)),)
$(STATEDIR)/kernel.targetinstall.post: $(STATEDIR)/foo-mod.targetinstall
endif

This patch changes the template for Linux driver packages in accordance
with the above change.

Signed-off-by: Ian Abbott <[email protected]>
Cc: Michael Olbrich <[email protected]>
---
v2: Changed the conditional test to that suggested by Michael Olbrich in
Message-ID <[email protected]> to avoid
breaking the build if the package is configured using the tristate 'm'
option and no collection is selected.

 rules/templates/template-src-linux-driver-make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/templates/template-src-linux-driver-make 
b/rules/templates/template-src-linux-driver-make
index e06a22497..c13857924 100644
--- a/rules/templates/template-src-linux-driver-make
+++ b/rules/templates/template-src-linux-driver-make
@@ -22,7 +22,7 @@ PACKAGES-$(PTXCONF_@PACKAGE@) += @package@
 @PACKAGE@_DIR          := $(BUILDDIR)/$(@PACKAGE@)
 @PACKAGE@_LICENSE      := unknown
 
-ifdef PTXCONF_@PACKAGE@
+ifneq ($(filter @package@,$(PTX_PACKAGES_SELECTED)),)
 $(STATEDIR)/kernel.targetinstall.post: $(STATEDIR)/@[email protected]
 endif
 
-- 
2.19.2


_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to