selftests: lib.mk: Don't fail install if no modules were built
PATCH 1/1 selftests: lib.mk: Don't fail install if no modules were built
The install rule for TEST_GEN_MODS_DIR copies *.ko from the directory with rsync which fails if there are no modules, for example because the directory's Makefile skipped building them. Only run rsync if there is something to install. This currently affects the livepatch suite but it seems sensible to fix here for added robstness.
--- tools/testing/selftests/lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/lib.mk +1 -1
@@ -155,7 +155,7 @@ endef define INSTALL_MODS_RULE $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH)/$(INSTALL_LIST)) - $(if $(INSTALL_LIST),rsync -a --copy-unsafe-links $(INSTALL_LIST)/*.ko $(INSTALL_PATH)/$(INSTALL_LIST)) + $(if $(wildcard $(INSTALL_LIST)/*.ko),rsync -a --copy-unsafe-links $(INSTALL_LIST)/*.ko $(INSTALL_PATH)/$(INSTALL_LIST)) endef define INSTALL_RULE
---
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm master
change-id: 20261013-kselftest-lib-no-modules-b8d75c7c59c3
Best regards,
Signature · 1 line
Mark Brown <[email protected]>
Shuah Khan
maintainerQuoted 8 lines · Mark Brown
The install rule for
TEST_GEN_MODS_DIRcopies *.ko from the directory with rsync which fails if there are no modules, for example because the directory'sMakefileskipped building them. Only run rsync if there is something to install. This currently affects the livepatch suite but it seems sensible to fix here for added robstness.Signed-off-by Mark Brown <[email protected]>---
Thanks. I picked this up for 7.4-rc1
thanks,
-- Shuah