From df54f5a59c80d034029281a8622ae6f65d235b87 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 1 Jul 2020 13:07:57 +0200 Subject: [PATCH] plugins: modprobe: Skip for systems without modules Skip for systems without modules, e.g. small embedded or containers Signed-off-by: Joachim Nilsson --- plugins/modprobe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/modprobe.c b/plugins/modprobe.c index 0cb0f311..7476a308 100644 --- a/plugins/modprobe.c +++ b/plugins/modprobe.c @@ -142,6 +142,10 @@ static void coldplug(void *arg) struct module *m, *tmp; int rc = 0; + /* Skip for systems without modules, e.g. small embedded or containers */ + if (!fisdir("/lib/modules")) + return; + if (!fismnt("/sys")) { print(1, "Cannot modprobe system, /sys is not mounted"); return;