From 10392e96399c1254eb8ac9b1dead7174dd9002ed Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 27 Apr 2022 07:46:03 +0200 Subject: [PATCH] plugins: modules-load: skip lines starting with '#' Signed-off-by: Joachim Wiberg --- doc/plugins.md | 5 ++++- plugins/modules-load.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/plugins.md b/doc/plugins.md index 9b42419e..546e5e96 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -40,7 +40,10 @@ For your convenience a set of *optional* plugins are available: * *rtc.so*: Restore and save system clock from/to RTC on boot/halt. Enabled by default. -* *modules-load.so*: Scans /etc/modules-load.d for modules to modprobe. +* *modules-load.so*: Scans `/etc/modules-load.d/` for modules to load + using `modprobe`. Each file in this directory can contain multiple + lines with the name of the module to load. Any line starting with + the standard UNIX comment character, `#`, is skipped. * *netlink.so*: Listens to Linux kernel Netlink events for gateway and interfaces. These events are then sent to the Finit service monitor diff --git a/plugins/modules-load.c b/plugins/modules-load.c index 7781ca6f..33251a7c 100644 --- a/plugins/modules-load.c +++ b/plugins/modules-load.c @@ -69,6 +69,9 @@ static void load(void *arg) while (fgets(line, sizeof(line), fp)) { char cmd[CMD_SIZE], *mod, *args; + if (line[0] == '#') + continue; + mod = strip_line(line); if (!*mod) continue;