3 (* Based on 04config.sh from module-init-tools *)
5 let conf = "# Various aliases
8 alias alias_to_export_dep-$BITNESS export_dep-$BITNESS
10 # Various options, including options to aliases.
11 options alias_to_export_dep-$BITNESS I am alias to export_dep
12 options alias_to_noexport_nodep-$BITNESS_with_tabbed_options index=0 id=\"Thinkpad\" isapnp=0 \\
13 \tport=0x530 cport=0x538 fm_port=0x388 \\
14 \tmpu_port=-1 mpu_irq=-1 \\
15 \tirq=9 dma1=1 dma2=3 \\
19 blacklist watchdog_drivers \t
22 install bar echo Installing bar
23 install foo echo Installing foo
24 install export_nodep-$BITNESS echo Installing export_nodep
27 remove bar echo Removing bar
28 remove foo echo Removing foo
29 remove export_nodep-$BITNESS echo Removing export_nodep
32 softdep uhci-hcd post: foo
33 softdep uhci-hcd pre: ehci-hcd foo
34 softdep uhci-hcd pre: ehci-hcd foo post: foo
37 test Modprobe.lns get conf =
38 { "#comment" = "Various aliases" }
39 { "alias" = "alias_to_foo"
40 { "modulename" = "foo" }
42 { "alias" = "alias_to_bar"
43 { "modulename" = "bar" }
45 { "alias" = "alias_to_export_dep-$BITNESS"
46 { "modulename" = "export_dep-$BITNESS" }
49 { "#comment" = "Various options, including options to aliases." }
50 { "options" = "alias_to_export_dep-$BITNESS"
57 { "options" = "alias_to_noexport_nodep-$BITNESS_with_tabbed_options"
59 { "id" = "\"Thinkpad\"" }
63 { "fm_port" = "0x388" }
73 { "#comment" = "Blacklist" }
74 { "blacklist" = "watchdog_drivers" }
76 { "#comment" = "Install commands" }
78 { "command" = "echo Installing bar" }
81 { "command" = "echo Installing foo" }
83 { "install" = "export_nodep-$BITNESS"
84 { "command" = "echo Installing export_nodep" }
87 { "#comment" = "Remove commands" }
89 { "command" = "echo Removing bar" }
92 { "command" = "echo Removing foo" }
94 { "remove" = "export_nodep-$BITNESS"
95 { "command" = "echo Removing export_nodep" }
98 { "#comment" = "Softdep" }
99 { "softdep" = "uhci-hcd"
102 { "softdep" = "uhci-hcd"
103 { "pre" = "ehci-hcd" }
106 { "softdep" = "uhci-hcd"
107 { "pre" = "ehci-hcd" }
114 test Modprobe.lns get "blacklist brokenmodule # never worked\n" =
115 { "blacklist" = "brokenmodule"
116 { "#comment" = "never worked" } }
120 let options_space_quote = "options name attr1=\"val\" attr2=\"val2 val3\"\n"
122 test Modprobe.entry get options_space_quote =
124 { "attr1" = "\"val\"" }
125 { "attr2" = "\"val2 val3\"" }
128 (* Allow spaces around the '=', BZ 826752 *)
129 test Modprobe.entry get "options ipv6 disable = 1\n" =
131 { "disable" = "1" } }
133 (* Support multiline split commands, Ubuntu bug #1054306 *)
134 test Modprobe.lns get "# /etc/modprobe.d/iwlwifi.conf
135 # iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
136 # microcode file installed on the system. When removing iwlwifi, first
137 # remove the iwl?vm module and then iwlwifi.
139 (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
140 && /sbin/modprobe -r mac80211\n" =
141 { "#comment" = "/etc/modprobe.d/iwlwifi.conf" }
142 { "#comment" = "iwlwifi will dyamically load either iwldvm or iwlmvm depending on the" }
143 { "#comment" = "microcode file installed on the system. When removing iwlwifi, first" }
144 { "#comment" = "remove the iwl?vm module and then iwlwifi." }
145 { "remove" = "iwlwifi"
146 { "command" = "(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \\\n&& /sbin/modprobe -r mac80211" }