Skip to contentSkip to conversation

selftests: lib.mk: Don't fail install if no modules were built

PATCH In review Mark Brown 2 participants 2 messages Oct 14 Kselftest

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

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
index f02cc8a2e4ae..7841bd4239c7 100644
@@ -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]>
maintainer
#1 lore raw
Quoted 8 lines · Mark Brown

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.

---

Thanks. I picked this up for 7.4-rc1

thanks,
-- Shuah