File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
features/runtime/data/etc Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ The following parameters can be passed via kernel command line.
1515- ` rd-preload-modules ` enables/disables loading a static list of modules before udev service.
1616- ` rd.driver.blacklist=<comma-separated list> ` specifies the list of kernel
1717 module names that should be added to blacklist before loading any kernel modules.
18+ - ` rd.driver.pre=<comma-separated list> ` specifies the list of kernel module
19+ names that should be preloaded.
1820
1921Parameters responsible for mounting the root file system:
2022
Original file line number Diff line number Diff line change @@ -23,3 +23,4 @@ register_parameter string ROOTFLAGS
2323register_parameter string ROOTFSTYPE
2424register_parameter string STOP
2525register_array string RD_DRIVER_BLACKLIST
26+ register_array string RD_DRIVER_PRE
Original file line number Diff line number Diff line change 4242preload_modules ()
4343{
4444 local check conf modname rc=0
45+
46+ if [ " ${RD_DRIVER_PRE:- 0} " != 0 ]; then
47+ local i modnames MODS
48+
49+ i=0
50+ while [ $i -lt ${RD_DRIVER_PRE:- 0} ]; do
51+ eval " MODS=\"\$ RD_DRIVER_PRE$i \" "
52+
53+ modnames=()
54+ readarray -t -d, modnames <<< " $MODS,"
55+
56+ for modname in " ${modnames[@]} " ; do
57+ [ -n " $modname " ] && [ " $modname " != $' \n ' ] ||
58+ continue
59+ modprobe " $modname " || rc=1
60+ done
61+ done
62+ fi 2> " /var/log/preload-modules.log"
63+
4564 for conf in /etc/modules-load.d/* .conf /run/modules-load.d/* .conf /lib/modules-load.d/* .conf /etc/initrd/modules-preudev; do
4665 # shellcheck disable=SC2162
4766 [ ! -e " $conf " ] ||
@@ -53,7 +72,7 @@ preload_modules()
5372 continue
5473 modprobe " $modname " $args || rc=1
5574 done < " $conf "
56- done 2> " /var/log/preload-modules.log"
75+ done 2>> " /var/log/preload-modules.log"
5776 return $rc
5877}
5978
You can’t perform that action at this time.
0 commit comments