From 4a31eb780a35063a34cad7374987db3be6d1e66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 26 Sep 2022 04:06:30 +0200 Subject: [PATCH] init: allow force loading of extra modules via the kernel command-line Fixes #186 --- docs/manpage.md | 1 + init/cmdline.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/manpage.md b/docs/manpage.md index f8912fdb..7a9feb60 100644 --- a/docs/manpage.md +++ b/docs/manpage.md @@ -129,6 +129,7 @@ Some parts of booster boot functionality can be modified with kernel boot parame If debug level is enabled then kmsg throttling gets disabled automatically. * `booster.debug` an obsolete option that is equivalent to `booster.log=debug,console`. * `quiet` Set booster init verbosity to minimum. This option is ignored if `booster.debug` or `booster.log` is set. + * `modules` a comma-separated list of extra kernel modules which should be force loaded. * `init=$PATH` path to user-space init binary. If not specified then default value `/sbin/init` is used. ## NOTES diff --git a/init/cmdline.go b/init/cmdline.go index fb9d4efd..4b458dff 100644 --- a/init/cmdline.go +++ b/init/cmdline.go @@ -192,7 +192,13 @@ func parseParams(params string) error { if err != nil { return fmt.Errorf("root=%s: %v", value, err) } + case "modules": + if (value == "") { + break + } + modules := strings.Split(value, ",") + config.ModulesForceLoad = append(config.ModulesForceLoad, modules...) case "resume": var err error cmdResume, err = parseDeviceRef(value)