From d54d5b7f20274ad37d072f33d15f9aa10afbec32 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 10 Sep 2017 13:48:07 +0200 Subject: [PATCH] Allow kernel modules to be loaded from /etc/finit.d/*.conf Signed-off-by: Joachim Nilsson --- src/conf.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/conf.c b/src/conf.c index 3963be73..9304d0da 100644 --- a/src/conf.c +++ b/src/conf.c @@ -232,16 +232,6 @@ static void parse_static(char *line) return; } - if (MATCH_CMD(line, "module ", x)) { - char *mod = strip_line(x); - - strcpy(cmd, "modprobe "); - strlcat(cmd, mod, sizeof(cmd)); - run_interactive(cmd, "Loading kernel module %s", mod); - - return; - } - if (MATCH_CMD(line, "mknod ", x)) { char *dev = strip_line(x); @@ -307,6 +297,17 @@ static void parse_dynamic(char *line, struct timeval *mtime) if (MATCH_CMD(line, "#", x)) return; + /* Kernel module to load at bootstrap */ + if (MATCH_CMD(line, "module ", x)) { + char *mod = strip_line(x); + + strcpy(cmd, "modprobe "); + strlcat(cmd, mod, sizeof(cmd)); + run_interactive(cmd, "Loading kernel module %s", mod); + + return; + } + /* Monitored daemon, will be respawned on exit */ if (MATCH_CMD(line, "service ", x)) { service_register(SVC_TYPE_SERVICE, x, mtime, NULL);