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.

Link: https://lore.kernel.org/r/20261014-kselftest-lib-no-modules-v1-1-e4f7208dcb56@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Mark Brown 2026-10-14 14:03:33 +01:00 committed by Shuah Khan
parent 0abfa9ad5c
commit 62d4320383

View File

@ -156,7 +156,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