1 |
commit: 809f1f547f0ba8bfa38bbd0977ab2c57ec4c4581 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 26 21:35:52 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 26 21:46:37 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=809f1f54 |
7 |
|
8 |
defaults/linuxrc: Disable processing of modules_load file by default |
9 |
|
10 |
Now that we are using (e)udev with kmod support, we can rely on UDEV to |
11 |
load required kernel modules. |
12 |
|
13 |
Old module loading based on modules_load file can still be enabled via |
14 |
boolean "gk.hw.use-modules_load" kernel command-line option which is inverting |
15 |
and replacing previous "nodetect" kernel command-line option. |
16 |
|
17 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
18 |
|
19 |
defaults/initrd.defaults | 1 + |
20 |
defaults/initrd.scripts | 11 +++++++---- |
21 |
defaults/linuxrc | 26 ++++++++++++++++++-------- |
22 |
doc/genkernel.8.txt | 17 +++++++++++------ |
23 |
4 files changed, 37 insertions(+), 18 deletions(-) |
24 |
|
25 |
diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults |
26 |
index 3ac5856..e4c861b 100644 |
27 |
--- a/defaults/initrd.defaults |
28 |
+++ b/defaults/initrd.defaults |
29 |
@@ -73,6 +73,7 @@ IP='dhcp' |
30 |
GK_BOOTFONT_DISABLED=0 |
31 |
GK_DEBUGMODE_STATEFILE="/tmp/debug.enabled" |
32 |
GK_HW_LOAD_ALL_MODULES=0 |
33 |
+GK_HW_USE_MODULES_LOAD=0 |
34 |
GK_INIT_LOG='/tmp/init.log' |
35 |
GK_INIT_LOG_COPYTO= |
36 |
GK_INIT_LOG_COPYTO_DEFAULT='/genkernel-boot.log' |
37 |
|
38 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
39 |
index fd87623..29ec123 100644 |
40 |
--- a/defaults/initrd.scripts |
41 |
+++ b/defaults/initrd.scripts |
42 |
@@ -2019,10 +2019,13 @@ iface_name() { |
43 |
start_network() { |
44 |
good_msg "Starting network ..." |
45 |
|
46 |
- # Load network modules only when we need them to avoid possible |
47 |
- # firmware problems for people not using network that early |
48 |
- modules_scan net |
49 |
- udevsettle |
50 |
+ if [ "${GK_HW_USE_MODULES_LOAD}" = '1' ] |
51 |
+ then |
52 |
+ # Load network modules only when we need them to avoid possible |
53 |
+ # firmware problems for people not using network that early |
54 |
+ modules_scan net |
55 |
+ udevsettle |
56 |
+ fi |
57 |
|
58 |
# At least gk.net.iface can only be processed after sysfs was |
59 |
# mounted. |
60 |
|
61 |
diff --git a/defaults/linuxrc b/defaults/linuxrc |
62 |
index 9793fde..263f738 100644 |
63 |
--- a/defaults/linuxrc |
64 |
+++ b/defaults/linuxrc |
65 |
@@ -175,9 +175,6 @@ do |
66 |
doload=*) |
67 |
MDOLIST=$(echo ${MDOLIST} ${x#*=} | sed -e 's/^\ *//;s/,/ /g') |
68 |
;; |
69 |
- nodetect) |
70 |
- NODETECT=1 |
71 |
- ;; |
72 |
noload=*) |
73 |
MLIST=$(echo ${MLIST} ${x#*=} | sed -e 's/^\ *//;s/,/ /g') |
74 |
export MLIST |
75 |
@@ -291,6 +288,14 @@ do |
76 |
fi |
77 |
unset tmp_disabled |
78 |
;; |
79 |
+ gk.hw.use-modules_load=*) |
80 |
+ tmp_disabled=${x#*=} |
81 |
+ if is_true "${tmp_disabled}" |
82 |
+ then |
83 |
+ GK_HW_USE_MODULES_LOAD=1 |
84 |
+ fi |
85 |
+ unset tmp_disabled |
86 |
+ ;; |
87 |
gk.log.disabled=*) |
88 |
tmp_disabled=${x#*=} |
89 |
if is_true "${tmp_disabled}" |
90 |
@@ -542,26 +547,31 @@ fi |
91 |
# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel |
92 |
if [ -z "${DO_modules}" ] |
93 |
then |
94 |
- good_msg 'Skipping module load; disabled via commandline' |
95 |
+ good_msg 'Skipping module load; disabled via command-line' |
96 |
elif [ -d "/lib/modules/${KV}" ] |
97 |
then |
98 |
- good_msg 'Loading modules ...' |
99 |
if [ -n "${FIRSTMODS}" ] |
100 |
then |
101 |
+ good_msg 'Loading first modules ...' |
102 |
# try these modules first -- detected modules for root device: |
103 |
modules_load firstmods ${FIRSTMODS} |
104 |
fi |
105 |
|
106 |
# Load appropriate kernel modules |
107 |
- if [ "${NODETECT}" != '1' ] |
108 |
+ if [ "${GK_HW_USE_MODULES_LOAD}" = '1' ] |
109 |
then |
110 |
+ good_msg 'Loading modules ...' |
111 |
for modules in ${MY_HWOPTS} |
112 |
do |
113 |
modules_scan ${modules} |
114 |
done |
115 |
fi |
116 |
- # Always eval doload=... |
117 |
- modules_load extra_load ${MDOLIST} |
118 |
+ |
119 |
+ if [ -n "${MDOLIST}" ] |
120 |
+ then |
121 |
+ good_msg 'Loading modules from command-line ...' |
122 |
+ modules_load extra_load ${MDOLIST} |
123 |
+ fi |
124 |
else |
125 |
good_msg 'Skipping module load; no modules in the ramdisk!' |
126 |
fi |
127 |
|
128 |
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt |
129 |
index 8c527b0..f0e4414 100644 |
130 |
--- a/doc/genkernel.8.txt |
131 |
+++ b/doc/genkernel.8.txt |
132 |
@@ -823,6 +823,12 @@ when not set. This will allow remote user to provide answer through |
133 |
loading of all module groups regardless whether root device is |
134 |
already available. |
135 |
|
136 |
+*gk.hw.use-modules_load*=<...>:: |
137 |
+ By default, genkernel relies on UDEV's capability to load required |
138 |
+ kernel modules. This boolean option allows you to force old module |
139 |
+ loading depending on modules_load file until *root* device becomes |
140 |
+ available. |
141 |
+ |
142 |
*gk.log.disabled*=<...>:: |
143 |
By default, any shown message and external command calls will be logged |
144 |
to '/tmp/init.log' in initramfs. This boolean option allows you to |
145 |
@@ -848,15 +854,14 @@ NOTE: Because no user interaction is possible when this option is set, |
146 |
system will automatically reboot on error after a timeout. |
147 |
|
148 |
*noload*=<...>:: |
149 |
- List of modules to skip loading. |
150 |
- Separate using commas or spaces. |
151 |
+List of modules to skip loading. |
152 |
+Separate using commas or spaces. |
153 |
|
154 |
-*nodetect*:: |
155 |
- Skipping scanning modules using "modprobe <MODULE> -n". |
156 |
- Use *doload=* for specifying a whitelist of exceptions. |
157 |
+NOTE: This option has only an effect when *gk.hw.use-modules_load* is |
158 |
+enabled. |
159 |
|
160 |
*doload*=<...>:: |
161 |
- List of modules to load despite *nodetect*. |
162 |
+ List of modules which should always be loaded. |
163 |
|
164 |
*domodules*:: |
165 |
*nomodules*:: |