From 2b49c7ca97941cb9164f1f8b70892007706f6ae5 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 ++++++ 3 files changed, 20 insertions(+) diff --git a/docs/manpage.md b/docs/manpage.md index f8912fd..6cc1553 100644 --- a/docs/manpage.md +++ b/docs/manpage.md @@ -117,6 +117,7 @@ Some parts of booster boot functionality can be modified with kernel boot parame * `rd.luks.key=$UUID=$PATH` absolute path to a keyfile in the initrd/initramfs which can be unsed to unlock the device identified by UUID, if this file does not exist or fails to unlock it will fall back to a password request. * `rd.luks.options=opt1,opt2` a comma-separated list of LUKS flags. Supported options are `discard`, `same-cpu-crypt`, `submit-from-crypt-cpus`, `no-read-workqueue`, `no-write-workqueue`. Note that booster also supports LUKS v2 persistent flags stored with the partition metadata. Any command-line options are added on top of the persistent flags. + * `rd.modules_force_load` a comma-separated list of extra kernel modules which should be force loaded. * `resume=$deviceref` device reference to suspend-to-disk device. * `zfs=$pool/$dataset` specifies what ZFS dataset needs to be used for root partition. This option is only used if ZFS config option is enabled. If ZFS filesystem is enabled then `root=` boot param is ignored. * `booster.log` configures booster init logging. It accepts a comma separated list of following values: diff --git a/init/cmdline.go b/init/cmdline.go index fb9d4ef..8d7b3fa 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 "rd.modules_force_load": + if value == "" { + break + } + modules := strings.Split(value, ",") + config.ModulesForceLoad = append(config.ModulesForceLoad, modules...) case "resume": var err error cmdResume, err = parseDeviceRef(value)