Skip to contentSkip to conversation

kbuild: teach kselftest-merge to find nested config files

PATCH In review Dan Rue 3 participants 5 messages May 20, 2019 – Jun 4, 2019

Subsystems (2)
lore
Share & tools
lore

Dan Rue

author
#0 lore raw

PATCH 1/1 kbuild: teach kselftest-merge to find nested config files

Current implementation of kselftest-merge only finds config files that are one level deep using $(srctree)/tools/testing/selftests/*/config.

Often, config files are added in nested directories, and do not get picked up by kselftest-merge.

Use find to catch all config files under
$(srctree)/tools/testing/selftests instead.

Signed-off-by Dan Rue <dan.rue at linaro.org>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Makefile +2 -3
index a45f84a7e811..e99e7f9484af 100644
@@ -1228,9 +1228,8 @@ kselftest-clean:
 PHONY += kselftest-merge
 kselftest-merge:
 	$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-		-m $(objtree)/.config \
-		$(srctree)/tools/testing/selftests/*/config
+	$(Q)find $(srctree)/tools/testing/selftests -name config | \
+		xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
 # ---------------------------------------------------------------------------
Signature · 1 line
2.21.0
#1 lore raw
Quoted 6 lines · Dan Rue

Current implementation of kselftest-merge only finds config files that are one level deep using $(srctree)/tools/testing/selftests/*/config.

Often, config files are added in nested directories, and do not get picked up by kselftest-merge.

Quoted 7 lines

Use find to catch all config files under
$(srctree)/tools/testing/selftests instead.

Signed-off-by Dan Rue <dan.rue at linaro.org>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

To be more specific here, the binderfs test is not catching the config entry, so it would be nice to get this into the stable trees as well :)

Quoted 6 lines
Makefile +0 -0
index a45f84a7e811..e99e7f9484af 100644
@@ -1228,9 +1228,8 @@ kselftest-clean:
 PHONY += kselftest-merge

Makefile kselftest-clean: · line 1235

Quoted 10 lines
Makefile +2 -3
 kselftest-merge:
 	$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-		-m $(objtree)/.config \
-		$(srctree)/tools/testing/selftests/*/config
+	$(Q)find $(srctree)/tools/testing/selftests -name config | \
+		xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
 # ---------------------------------------------------------------------------

is find run with $(Q)? It isn't with other instances in the Makefile.

thanks,

greg k-h

author
#2 lore raw
Quoted 33 lines · Greg KH
Quoted 6 lines · Dan Rue

Current implementation of kselftest-merge only finds config files that are one level deep using $(srctree)/tools/testing/selftests/*/config.

Often, config files are added in nested directories, and do not get picked up by kselftest-merge.

Quoted 7 lines

Use find to catch all config files under
$(srctree)/tools/testing/selftests instead.

Signed-off-by Dan Rue <dan.rue at linaro.org>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

To be more specific here, the binderfs test is not catching the config entry, so it would be nice to get this into the stable trees as well :)

Quoted 15 lines
Makefile +2 -3
index a45f84a7e811..e99e7f9484af 100644
@@ -1228,9 +1228,8 @@ kselftest-clean:
 PHONY += kselftest-merge
 kselftest-merge:
 	$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-		-m $(objtree)/.config \
-		$(srctree)/tools/testing/selftests/*/config
+	$(Q)find $(srctree)/tools/testing/selftests -name config | \
+		xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
 	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
Quoted 3 lines

Makefile kselftest-clean: · line 1235

Quoted 1 line
Makefile +0 -0
 # ---------------------------------------------------------------------------

is find run with $(Q)? It isn't with other instances in the Makefile.

I'm not entirely sure all the ways that $(Q) is used (it looks like it just gets set to @), but if i run 'KBUILD_VERBOSE=1 make kselftest-merge' I do see the find command printed before running:

find ./tools/testing/selftests -name config | \
xargs ./scripts/kconfig/merge_config.sh -m ./.config

I noticed find used inconsistently (sometimes with @, sometimes with $(Q), sometimes with neither), so I picked the usage that seemed most correct to me.

Dan

Quoted 4 lines

thanks,

greg k-h

Signature · 1 line
Linaro - Kernel Validation
#3 lore raw
Quoted 43 lines · Dan Rue
Quoted 33 lines · Greg KH
Quoted 6 lines · Dan Rue

Current implementation of kselftest-merge only finds config files that are one level deep using $(srctree)/tools/testing/selftests/*/config.

Often, config files are added in nested directories, and do not get picked up by kselftest-merge.

Quoted 7 lines

Use find to catch all config files under
$(srctree)/tools/testing/selftests instead.

Signed-off-by Dan Rue <dan.rue at linaro.org>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

To be more specific here, the binderfs test is not catching the config entry, so it would be nice to get this into the stable trees as well :)

Quoted 15 lines
Makefile +2 -3
index a45f84a7e811..e99e7f9484af 100644
@@ -1228,9 +1228,8 @@ kselftest-clean:
 PHONY += kselftest-merge
 kselftest-merge:
    $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
-   $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-           -m $(objtree)/.config \
-           $(srctree)/tools/testing/selftests/*/config
+   $(Q)find $(srctree)/tools/testing/selftests -name config | \
+           xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
    +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
Quoted 3 lines

Makefile kselftest-clean: · line 1235

Quoted 1 line
Makefile +0 -0
 # ---------------------------------------------------------------------------

is find run with $(Q)? It isn't with other instances in the Makefile.

I'm not entirely sure all the ways that $(Q) is used (it looks like it just gets set to @), but if i run 'KBUILD_VERBOSE=1 make kselftest-merge' I do see the find command printed before running:

Quoted 6 lines

find ./tools/testing/selftests -name config | \
xargs ./scripts/kconfig/merge_config.sh -m ./.config

I noticed find used inconsistently (sometimes with @, sometimes with $(Q), sometimes with neither), so I picked the usage that seemed most correct to me.

I agree. Using $(Q) looks correct to me.

Quoted 9 lines

Dan

Quoted 4 lines

thanks,

greg k-h

--
Linaro - Kernel Validation

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
In reply to Dan Rue
Quoted 32 lines · Dan Rue

Current implementation of kselftest-merge only finds config files that are one level deep using $(srctree)/tools/testing/selftests/*/config.

Often, config files are added in nested directories, and do not get picked up by kselftest-merge.

Use find to catch all config files under
$(srctree)/tools/testing/selftests instead.

Signed-off-by Dan Rue <dan.rue at linaro.org>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Makefile +2 -4
index a45f84a7e811..e99e7f9484af 100644
@@ -1228,9 +1228,8 @@ kselftest-clean:
 PHONY += kselftest-merge
 kselftest-merge:
        $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
-       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-               -m $(objtree)/.config \
-               $(srctree)/tools/testing/selftests/*/config
+       $(Q)find $(srctree)/tools/testing/selftests -name config | \
+               xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
        +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
 # ---------------------------------------------------------------------------
--
Quoted 2 lines

2.21.0

Applied to linux-kbuild/fixes. Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada