Debian Codegraph @

src/usr/lib/debian-installer-startup.d/S02module-params

raw
1 # Before udev is started, parse kernel command word for module params of
2 # the form module.param=value and register them so they will be used when
3 # modules are loaded. Also check for modules to be blacklisted.
4
5 for word in $(cat /proc/cmdline); do
6 var="${word%%=*}"
7 val="${word#[!=]*=}"
8
9 # skip things that lack an '='
10 if [ -z "$var" ]; then
11 continue
12 fi
13
14 # skip normal variables with no dots
15 if [ "${var##*.*}" ]; then
16 continue
17 fi
18
19 module="${var%.*}"
20 param="${var#[!.]*.}"
21
22 # skip things that we know are not modules
23 case "$module" in
24 fsck|\
25 locale|\
26 luks|\
27 net|\
28 plymouth|\
29 quotacheck|\
30 rd|\
31 systemd|\
32 udev|\
33 vconsole)
34 continue
35 ;;
36 esac
37
38 if [ "$module" ] && [ "$param" ]; then
39 if [ "$param" = blacklist ]; then
40 register-module -b "$module"
41 else
42 register-module -p -a "$module" "$param=$val"
43 fi
44 fi
45 done