| 1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/genkernel.xml,v 1.20 2005/07/31 16:26:20 neysx Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/genkernel.xml,v 1.31 2008/06/23 05:07:13 nightmorph Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link="/doc/en/genkernel.xml"> |
5 | <guide link="/doc/en/genkernel.xml" disclaimer="obsolete"> |
| 6 | <title>Gentoo Linux Genkernel Guide</title> |
6 | <title>Gentoo Linux Genkernel Guide</title> |
| 7 | |
7 | |
| 8 | <author title="Author"> |
8 | <author title="Author"> |
| 9 | <mail link="plasmaroo@gentoo.org">Tim Yamin</mail> |
9 | <mail link="plasmaroo@gentoo.org">Tim Yamin</mail> |
| 10 | </author> |
10 | </author> |
| 11 | |
|
|
| 12 | <!-- folajimi@speakeasy.net --> |
11 | <!-- folajimi@speakeasy.net --> |
| 13 | <author title="Contributor"> |
12 | <author title="Contributor"> |
| 14 | Jimi Ayodele |
13 | Jimi Ayodele |
| 15 | </author> |
14 | </author> |
| 16 | |
|
|
| 17 | <!-- thseiler@gmail.com --> |
15 | <!-- thseiler@gmail.com --> |
| 18 | <author title="NFS Support"> |
16 | <author title="NFS Support"> |
| 19 | Thomas Seiler |
17 | Thomas Seiler |
| 20 | </author> |
18 | </author> |
|
|
19 | <author title="Editor"> |
|
|
20 | <mail link="nightmorph"/> |
|
|
21 | </author> |
| 21 | |
22 | |
| 22 | <abstract> |
23 | <abstract> |
| 23 | This guide intends to provide a reference of all the functions provided by |
24 | This guide intends to provide a reference of all the functions provided by |
| 24 | genkernel. |
25 | genkernel. |
| 25 | </abstract> |
26 | </abstract> |
| 26 | |
27 | |
| 27 | <license/> |
28 | <license/> |
| 28 | |
29 | |
| 29 | <version>1.3</version> |
30 | <version>1.6</version> |
| 30 | <date>2005-07-24</date> |
31 | <date>2008-06-22</date> |
| 31 | |
32 | |
| 32 | <chapter> |
33 | <chapter> |
| 33 | <title>Introduction</title> |
34 | <title>Introduction</title> |
| 34 | <section> |
35 | <section> |
| 35 | <title>Rationale</title> |
36 | <title>Rationale</title> |
| … | |
… | |
| 46 | loaded for proper operation. |
47 | loaded for proper operation. |
| 47 | </p> |
48 | </p> |
| 48 | |
49 | |
| 49 | </body> |
50 | </body> |
| 50 | </section> |
51 | </section> |
| 51 | |
|
|
| 52 | <section> |
52 | <section> |
| 53 | <title>Target Audience</title> |
53 | <title>Target Audience</title> |
| 54 | <body> |
54 | <body> |
| 55 | |
55 | |
| 56 | <p> |
56 | <p> |
| … | |
… | |
| 75 | <title>Installing genkernel</title> |
75 | <title>Installing genkernel</title> |
| 76 | <body> |
76 | <body> |
| 77 | |
77 | |
| 78 | <p> |
78 | <p> |
| 79 | To obtain genkernel, run <c>emerge genkernel</c> from the command line. If you |
79 | To obtain genkernel, run <c>emerge genkernel</c> from the command line. If you |
| 80 | are using the |
80 | are using the <uri |
| 81 | <uri link="http://www.gentoo.org/doc/en/handbook/2005.0/hb-install-about.xml#doc_chap2_sect1"> |
81 | link="/doc/en/handbook/2005.1/hb-install-about.xml#doc_chap2_sect1">Gentoo |
| 82 | Gentoo Reference Platform</uri> (GRP), remember to install binary packages by |
82 | Reference Platform</uri> (GRP), remember to install binary packages by passing |
| 83 | passing the <c>-k</c> flag to emerge. Since the GRP is bundled with an older |
83 | the <c>-k</c> flag to emerge. Since the GRP is bundled with an older version of |
| 84 | version of genkernel, the flags may be different. In any case, consult |
84 | genkernel, the flags may be different. In any case, consult <c>genkernel |
| 85 | <c>genkernel --help</c> for help on how to use the version of genkernel |
85 | --help</c> for help on how to use the version of genkernel installed on your |
| 86 | installed on your system. |
86 | system. |
| 87 | </p> |
87 | </p> |
| 88 | |
88 | |
| 89 | </body> |
89 | </body> |
| 90 | </section> |
90 | </section> |
| 91 | </chapter> |
91 | </chapter> |
| 92 | |
92 | |
| 93 | <chapter> |
93 | <chapter> |
| … | |
… | |
| 104 | and may increase compile time. Below is an illustration of a more efficient |
104 | and may increase compile time. Below is an illustration of a more efficient |
| 105 | approach, achieved by passing certain flags to genkernel as root: |
105 | approach, achieved by passing certain flags to genkernel as root: |
| 106 | </p> |
106 | </p> |
| 107 | |
107 | |
| 108 | <pre caption="Running genkernel (with flags)"> |
108 | <pre caption="Running genkernel (with flags)"> |
| 109 | # genkernel --bootsplash --no-install --no-clean --menuconfig all |
109 | # <i>genkernel --splash --no-install --no-clean --menuconfig all</i> |
| 110 | </pre> |
110 | </pre> |
| 111 | |
111 | |
| 112 | <p> |
112 | <p> |
| 113 | The above operation causes genkernel to create a bootsplash-enabled kernel |
113 | The above operation causes genkernel to create a framebuffer splash-enabled |
| 114 | (<c>--bootsplash</c>) that will have to be manually installed |
114 | kernel (<c>--splash</c>) that will have to be manually installed |
| 115 | (<c>--no-install</c>). While preparing the kernel source tree, genkernel will |
115 | (<c>--no-install</c>). While preparing the kernel source tree, genkernel will |
| 116 | refrain from cleaning out any preexisting object files present in the source |
116 | refrain from cleaning out any preexisting object files present in the source |
| 117 | tree (<c>--no-clean</c>). A menu-driven kernel configuration utility will be |
117 | tree (<c>--no-clean</c>). A menu-driven kernel configuration utility will be |
| 118 | displayed that allows the user to select which modules will be built for the |
118 | displayed that allows the user to select which modules will be built for the |
| 119 | system (<c>--menuconfig</c>). |
119 | system (<c>--menuconfig</c>). |
| … | |
… | |
| 144 | and their effects are enclosed within the square brackets, []. |
144 | and their effects are enclosed within the square brackets, []. |
| 145 | </p> |
145 | </p> |
| 146 | |
146 | |
| 147 | </body> |
147 | </body> |
| 148 | </section> |
148 | </section> |
| 149 | |
|
|
| 150 | <section> |
149 | <section> |
| 151 | <title>Configuration Flags</title> |
150 | <title>Configuration Flags</title> |
| 152 | <body> |
151 | <body> |
| 153 | |
152 | |
| 154 | <p> |
153 | <p> |
| … | |
… | |
| 157 | choose whether or not the configuration file created in the process should be |
156 | choose whether or not the configuration file created in the process should be |
| 158 | saved. The following are the primary configuration flags: |
157 | saved. The following are the primary configuration flags: |
| 159 | </p> |
158 | </p> |
| 160 | |
159 | |
| 161 | <ul> |
160 | <ul> |
| 162 | <li> |
161 | <li> |
| 163 | <b>--<c>no-</c>menuconfig</b>: Activates <e>[or deactivates]</e> the |
162 | <b>--<c>no-</c>menuconfig</b>: Activates <e>[or deactivates]</e> the |
| 164 | <c>make menuconfig</c> command (which invokes an interactive, menu-based |
163 | <c>make menuconfig</c> command (which invokes an interactive, menu-based |
| 165 | kernel configuration utility), before building the kernel. |
164 | kernel configuration utility), before building the kernel. |
| 166 | </li> |
165 | </li> |
| 167 | <li> |
166 | <li> |
| 168 | <b>--gconfig</b>: Provides a kernel configuration utility which depends |
167 | <b>--gconfig</b>: Provides a kernel configuration utility which depends on |
| 169 | on the GTK+ libraries. The advantage of this option is that most users |
168 | the GTK+ libraries. The advantage of this option is that most users find it |
| 170 | find it easier and clearer to configure the kernel using this tool, since |
169 | easier and clearer to configure the kernel using this tool, since it relies |
| 171 | it relies on the X-windowing system. The disadvantage of this option is |
170 | on the X-windowing system. The disadvantage of this option is that you |
| 172 | that you <b>need</b> the X-windowing system to use it, so it will not |
171 | <b>need</b> the X-windowing system to use it, so it will not work on the |
| 173 | work on the command line. |
172 | command line. |
| 174 | </li> |
173 | </li> |
| 175 | <li> |
174 | <li> |
| 176 | <b>--xconfig</b>: Provides a kernel configuration utility which depends |
175 | <b>--xconfig</b>: Provides a kernel configuration utility which depends on |
| 177 | on the QT libraries. The advantage of this option is that most users find |
176 | the QT libraries. The advantage of this option is that most users find it |
| 178 | it easier and clearer to configure the kernel using this tool, since it |
177 | easier and clearer to configure the kernel using this tool, since it relies |
| 179 | relies on the X-windowing system. The disadvantage of this option is that |
178 | on the X-windowing system. The disadvantage of this option is that you |
| 180 | you <b>need</b> the X-windowing system to use it, so it will not work on |
179 | <b>need</b> the X-windowing system to use it, so it will not work on the |
| 181 | the command line. |
180 | command line. |
| 182 | </li> |
181 | </li> |
| 183 | <li> |
182 | <li> |
| 184 | <b>--<c>no-</c>save-config</b>: Saves [or does not save] the kernel |
183 | <b>--<c>no-</c>save-config</b>: Saves <e>[or does not save]</e> the kernel |
| 185 | configuration to a file in the <path>/etc/kernels/</path> directory for |
184 | configuration to a file in the <path>/etc/kernels/</path> directory for |
| 186 | later use. |
185 | later use. |
| 187 | </li> |
186 | </li> |
| 188 | </ul> |
187 | </ul> |
| 189 | |
188 | |
| 190 | </body> |
189 | </body> |
| 191 | </section> |
190 | </section> |
| 192 | |
|
|
| 193 | <section> |
191 | <section> |
| 194 | <title>Compilation Flags</title> |
192 | <title>Compilation Flags</title> |
| 195 | <body> |
193 | <body> |
| 196 | |
194 | |
| 197 | <p> |
195 | <p> |
| 198 | The following flags usually take effect during the actual compilation: |
196 | The following flags usually take effect during the actual compilation: |
| 199 | </p> |
197 | </p> |
| 200 | |
198 | |
| 201 | <ul> |
199 | <ul> |
| 202 | <li> |
200 | <li> |
| 203 | <b>--kerneldir=<path>/path/to/sources/</path></b>: Specifies an |
201 | <b>--kerneldir=<path>/path/to/sources/</path></b>: Specifies an alternative |
| 204 | alternative kernel source location, rather than the default |
202 | kernel source location, rather than the default |
| 205 | <path>/usr/src/linux/</path> location. |
203 | <path>/usr/src/linux/</path> location. |
| 206 | </li> |
204 | </li> |
| 207 | <li> |
205 | <li> |
| 208 | <b>--kernel-config=<path>/path/to/config-file</path></b>: Specifies what |
206 | <b>--kernel-config=<path>/path/to/config-file</path></b>: Specifies what |
| 209 | alternative kernel configuration will be used, rather than the default |
207 | alternative kernel configuration will be used, rather than the default |
| 210 | <path>/path/to/sources/.config</path> file. |
208 | <path>/path/to/sources/.config</path> file. |
| 211 | </li> |
209 | </li> |
| 212 | <li> |
210 | <li> |
| 213 | <b>--module-prefix=<path>/path/to/prefix-directory/</path></b>: Specifies |
211 | <b>--module-prefix=<path>/path/to/prefix-directory/</path></b>: Specifies a |
| 214 | a prefix to the directory where kernel modules will be installed (default |
212 | prefix to the directory where kernel modules will be installed (default |
| 215 | path is the <path>/lib/modules/</path> directory.) |
213 | path is the <path>/lib/modules/</path> directory.) |
| 216 | </li> |
214 | </li> |
| 217 | </ul> |
215 | </ul> |
| 218 | |
216 | |
| 219 | <ul> |
217 | <ul> |
| 220 | <li> |
218 | <li> |
| 221 | <b>--<c>no-</c>clean</b>: Activates <e>[or deactivates]</e> the |
219 | <b>--<c>no-</c>clean</b>: Activates <e>[or deactivates]</e> the <c>make |
| 222 | <c>make clean</c> command before compiling your kernel. The |
220 | clean</c> command before compiling your kernel. The <c>make clean</c> |
|
|
221 | command removes all object files and dependencies from the kernel's source |
|
|
222 | tree. |
|
|
223 | </li> |
|
|
224 | <li> |
|
|
225 | <b>--<c>no-</c>mrproper</b>: Activates <e>[or deactivates]</e> the <c>make |
|
|
226 | mrproper</c> command before kernel compilation. Like the <c>make clean</c> |
| 223 | <c>make clean</c> command removes all object files and dependencies from |
227 | command, <c>make mrproper</c> removes all object files and dependencies |
|
|
228 | from the kernel's source tree. However, any previous configuration files |
|
|
229 | (in <path>/path/to/sources/.config</path> or |
|
|
230 | <path>/path/to/sources/.config.old</path>) will <b>also</b> be purged from |
| 224 | the kernel's source tree. |
231 | the kernel's source tree. |
| 225 | </li> |
232 | </li> |
| 226 | <li> |
233 | <li> |
| 227 | <b>--<c>no-</c>mrproper</b>: Activates <e>[or deactivates]</e> the |
|
|
| 228 | <c>make mrproper</c> command before kernel compilation. Like the |
|
|
| 229 | <c>make clean</c> command, <c>make mrproper</c> removes all object files |
|
|
| 230 | and dependencies from the kernel's source tree. However, any previous |
|
|
| 231 | configuration files (in <path>/path/to/sources/.config</path> or |
|
|
| 232 | <path>/path/to/sources/.config.old</path>) will <b>also</b> be purged |
|
|
| 233 | from the kernel's source tree. |
|
|
| 234 | </li> |
|
|
| 235 | <li> |
|
|
| 236 | <b>--oldconfig</b>: Issues the <c>make oldconfig</c> command, which |
234 | <b>--oldconfig</b>: Issues the <c>make oldconfig</c> command, which |
| 237 | attempts to collect configuration information for the system's |
235 | attempts to collect configuration information for the system's architecture |
| 238 | architecture from a generic script in <path>/usr/share/genkernel/</path>. |
236 | from a generic script in <path>/usr/share/genkernel/</path>. This is a |
| 239 | This is a non-interactive process; no user input is entertained. Also, if |
237 | non-interactive process; no user input is entertained. Also, if |
| 240 | <c>--oldconfig</c> is used in conjunction with <c>--clean</c>, the latter |
238 | <c>--oldconfig</c> is used in conjunction with <c>--clean</c>, the latter |
| 241 | flag is negated, resulting in the activation of the <c>--no-clean</c> |
239 | flag is negated, resulting in the activation of the <c>--no-clean</c> flag. |
|
|
240 | </li> |
|
|
241 | </ul> |
|
|
242 | |
|
|
243 | <ul> |
|
|
244 | <li> |
|
|
245 | <b>--callback="<c>echo hello</c>"</b>: Calls the specified arguments |
|
|
246 | (<c>echo hello</c>, in this case) after the kernel and the relevant modules |
|
|
247 | have been built, but before building the initrd image. This may be useful |
|
|
248 | if you want to install external modules in the initrd image by emerging the |
|
|
249 | relevant item(s) with the callback feature, and then redefining a genkernel |
|
|
250 | module group. |
|
|
251 | </li> |
|
|
252 | </ul> |
|
|
253 | |
|
|
254 | <ul> |
|
|
255 | <li> |
|
|
256 | <b>--<c>no-</c>install</b>: Activates <e>[or deactivates]</e> the <c>make |
|
|
257 | install</c> command, which installs your new kernel image, configuration |
|
|
258 | file, initrd image and system map onto your mounted boot partition. Any |
|
|
259 | compiled modules will be installed as well. |
|
|
260 | </li> |
|
|
261 | <li> |
|
|
262 | <b>--<c>no-</c>initrdmodules</b>: Refrains from copying any modules to the |
|
|
263 | genkernel-created initrd image. This flag is an exception to the rule about |
|
|
264 | the <c>no-</c> prefix; omission of this prefix creates an invalid genkernel |
| 242 | flag. |
265 | flag. |
| 243 | </li> |
266 | </li> |
| 244 | </ul> |
|
|
| 245 | |
|
|
| 246 | <ul> |
|
|
| 247 | <li> |
267 | <li> |
| 248 | <b>--callback="<c>echo hello</c>"</b>: Calls the specified arguments |
|
|
| 249 | (<c>echo hello</c>, in this case) after the kernel and the relevant |
|
|
| 250 | modules have been built, but before building the initrd image. This may |
|
|
| 251 | be useful if you want to install external modules in the initrd image by |
|
|
| 252 | emerging the relevant item(s) with the callback feature, and then |
|
|
| 253 | redefining a genkernel module group. |
|
|
| 254 | </li> |
|
|
| 255 | </ul> |
|
|
| 256 | |
|
|
| 257 | <ul> |
|
|
| 258 | <li> |
|
|
| 259 | <b>--<c>no-</c>install</b>: Activates <e>[or deactivates]</e> the |
|
|
| 260 | <c>make install</c> command, which installs your new kernel image, |
|
|
| 261 | configuration file, initrd image and system map onto your mounted boot |
|
|
| 262 | partition. Any compiled modules will be installed as well. |
|
|
| 263 | </li> |
|
|
| 264 | <li> |
|
|
| 265 | <b>--<c>no-</c>initrdmodules</b>: Refrains from copying any modules to |
|
|
| 266 | the genkernel-created initrd image. This flag is an exception to the rule |
|
|
| 267 | about the <c>no-</c> prefix; omission of this prefix creates an invalid |
|
|
| 268 | genkernel flag. |
|
|
| 269 | </li> |
|
|
| 270 | <li> |
|
|
| 271 | <b>--genzimage</b>: Creates the initrd image, prior to the kernel image. |
268 | <b>--genzimage</b>: Creates the initrd image, prior to the kernel image. |
| 272 | (This hack currently applies only to PPC Pegasos systems.) |
269 | (This hack currently applies only to PPC Pegasos systems.) |
| 273 | </li> |
270 | </li> |
| 274 | </ul> |
271 | </ul> |
| 275 | |
272 | |
| 276 | </body> |
273 | </body> |
| 277 | </section> |
274 | </section> |
| 278 | |
|
|
| 279 | <section> |
275 | <section> |
| 280 | <title>Compiler Flags</title> |
276 | <title>Compiler Flags</title> |
| 281 | <body> |
277 | <body> |
| 282 | |
278 | |
| 283 | <p> |
279 | <p> |
| … | |
… | |
| 286 | <e>compiler</e> used for the kernel compilation process, albeit at a much lower |
282 | <e>compiler</e> used for the kernel compilation process, albeit at a much lower |
| 287 | level. |
283 | level. |
| 288 | </p> |
284 | </p> |
| 289 | |
285 | |
| 290 | <ul> |
286 | <ul> |
| 291 | <li> |
287 | <li> |
| 292 | <b>--kernel-cc=<c>someCompiler</c></b>: Specifies the compiler employed |
288 | <b>--kernel-cc=<c>someCompiler</c></b>: Specifies the compiler employed |
| 293 | during the kernel compilation process. |
289 | during the kernel compilation process. |
| 294 | </li> |
290 | </li> |
| 295 | <li> |
291 | <li> |
| 296 | <b>--kernel-ld=<c>someLinker</c></b>: Specifies the linker employed |
292 | <b>--kernel-ld=<c>someLinker</c></b>: Specifies the linker employed during |
| 297 | during the kernel compilation process. |
293 | the kernel compilation process. |
| 298 | </li> |
294 | </li> |
| 299 | <li> |
295 | <li> |
| 300 | <b>--kernel-as=<c>someAssembler</c></b>: Specifies the assembler employed |
296 | <b>--kernel-as=<c>someAssembler</c></b>: Specifies the assembler employed |
| 301 | during the kernel compilation process. |
297 | during the kernel compilation process. |
| 302 | </li> |
298 | </li> |
| 303 | <li> |
299 | <li> |
| 304 | <b>--kernel-make=<c>someMake</c></b>: Specifies an alternative to the |
300 | <b>--kernel-make=<c>someMake</c></b>: Specifies an alternative to the |
| 305 | <e>GNU make</e> utility employed during the kernel compilation process. |
301 | <e>GNU make</e> utility employed during the kernel compilation process. |
| 306 | </li> |
302 | </li> |
| 307 | </ul> |
|
|
| 308 | |
|
|
| 309 | <ul> |
303 | </ul> |
|
|
304 | |
|
|
305 | <ul> |
| 310 | <li> |
306 | <li> |
| 311 | <b>--utils-cc=<c>someCompiler</c></b>: Specifies the compiler employed |
307 | <b>--utils-cc=<c>someCompiler</c></b>: Specifies the compiler employed |
| 312 | during the compilation of support utilities. |
308 | during the compilation of support utilities. |
| 313 | </li> |
309 | </li> |
| 314 | <li> |
310 | <li> |
| 315 | <b>--utils-ld=<c>someLinker</c></b>: Specifies the linker employed during |
311 | <b>--utils-ld=<c>someLinker</c></b>: Specifies the linker employed during |
| 316 | the compilation of support utilities. |
312 | the compilation of support utilities. |
| 317 | </li> |
313 | </li> |
| 318 | <li> |
314 | <li> |
| 319 | <b>--utils-as=<c>someAssembler</c></b>: Specifies the assembler employed |
315 | <b>--utils-as=<c>someAssembler</c></b>: Specifies the assembler employed |
| 320 | during the compilation of support utilities. |
316 | during the compilation of support utilities. |
| 321 | </li> |
317 | </li> |
| 322 | <li> |
318 | <li> |
| 323 | <b>--utils-make=<c>someMake</c></b>: Specifies an alternative to the |
319 | <b>--utils-make=<c>someMake</c></b>: Specifies an alternative to the <e>GNU |
| 324 | <e>GNU make</e> utility employed during the compilation of support |
320 | make</e> utility employed during the compilation of support utilities. |
| 325 | utilities. |
|
|
| 326 | </li> |
321 | </li> |
| 327 | </ul> |
|
|
| 328 | |
|
|
| 329 | <ul> |
322 | </ul> |
|
|
323 | |
|
|
324 | <ul> |
| 330 | <li> |
325 | <li> |
| 331 | <b>--makeopts=<c>-jX</c></b>: Specifies the number of concurrent threads |
326 | <b>--makeopts=<c>-jX</c></b>: Specifies the number of concurrent threads |
| 332 | that the make utility can implement while the kernel (and utilities) are |
327 | that the make utility can implement while the kernel (and utilities) are |
| 333 | being compiled. The variable <b>'X'</b> is a number obtained by adding |
328 | being compiled. The variable <b>'X'</b> is a number obtained by adding one |
| 334 | one (1) to the number of CPUs used by the system. So, for a system with |
329 | (1) to the number of CPUs used by the system. So, for a system with one |
| 335 | one CPU, the appropriate flag is <c>-j2</c>; a system with two CPUs will |
330 | CPU, the appropriate flag is <c>-j2</c>; a system with two CPUs will use |
| 336 | use the <c>-j3</c> flag, and so on. <e>(A system with one processor that |
331 | the <c>-j3</c> flag, and so on. <e>(A system with one processor that |
| 337 | supports Hyper-Threading™ (HT) Technology can use the</e><c>-j3</c> |
332 | supports Hyper-Threading™ (HT) Technology can use the |
| 338 | <e>flag, provided Symmetric Multi-Processing (SMP) support is enabled in |
333 | </e><c>-j3</c><e> flag, provided Symmetric Multi-Processing (SMP) support is |
| 339 | the kernel.)</e> |
334 | enabled in the kernel.)</e> |
| 340 | </li> |
335 | </li> |
| 341 | </ul> |
336 | </ul> |
| 342 | |
337 | |
| 343 | </body> |
338 | </body> |
| 344 | </section> |
339 | </section> |
| 345 | |
|
|
| 346 | <section> |
340 | <section> |
| 347 | <title>Debugging Flags</title> |
341 | <title>Debugging Flags</title> |
| 348 | <body> |
342 | <body> |
| 349 | |
343 | |
| 350 | <p> |
344 | <p> |
| 351 | The use debugging flags during the kernel compilation process controls the |
345 | The use of debugging flags during the kernel compilation process controls the |
| 352 | amount of information reported, as well as the presentation of said data. |
346 | amount of information reported, as well as the presentation of said data. |
| 353 | </p> |
347 | </p> |
| 354 | |
348 | |
| 355 | <ul> |
349 | <ul> |
| 356 | <li> |
350 | <li> |
| 357 | <b>--debuglevel=<c>verblevel</c></b>: Controls the level of |
351 | <b>--debuglevel=<c>verblevel</c></b>: Controls the level of verbosity for |
| 358 | verbosity for information provided by genkernel. The variable |
352 | information provided by genkernel. The variable <c>verblevel</c> is an |
| 359 | <c>verblevel</c> is an integer between 0 and 5. The level '0' represents |
353 | integer between 0 and 5. The level '0' represents minimal output, while '5' |
| 360 | minimal output, while '5' provides as much information as possible about |
354 | provides as much information as possible about genkernel's activities |
| 361 | genkernel's activities during the kernel compilation process. |
355 | during the kernel compilation process. |
| 362 | </li> |
356 | </li> |
| 363 | <li> |
357 | <li> |
| 364 | <b>--debugfile=<path>/path/to/outputfile</path></b>: Ignores the value |
358 | <b>--debugfile=<path>/path/to/outputfile</path></b>: Ignores the value set |
| 365 | set by the <c>--debuglevel</c> argument, and sends <b>all</b> debugging |
359 | by the <c>--debuglevel</c> argument, and sends <b>all</b> debugging data |
| 366 | data produced by genkernel to the specified output file, which is located |
360 | produced by genkernel to the specified output file, which is located at |
| 367 | at <path>/var/log/genkernel.log</path> by default. |
361 | <path>/var/log/genkernel.log</path> by default. |
| 368 | </li> |
362 | </li> |
| 369 | <li> |
363 | <li> |
| 370 | <b>--no-color</b>: Activates [or deactivates] colored output of debugging |
364 | <b>--no-color</b>: Activates <e>[or deactivates]</e> colored output of |
| 371 | information (reported by genkernel) using escape sequences. |
365 | debugging information (reported by genkernel) using escape sequences. |
| 372 | </li> |
366 | </li> |
| 373 | </ul> |
367 | </ul> |
| 374 | |
368 | |
| 375 | </body> |
369 | </body> |
| 376 | </section> |
370 | </section> |
| 377 | |
371 | |
| … | |
… | |
| 384 | of these flags are primarily for aesthetics, while others may be essential for |
378 | of these flags are primarily for aesthetics, while others may be essential for |
| 385 | enabling certain features on the system. |
379 | enabling certain features on the system. |
| 386 | </p> |
380 | </p> |
| 387 | |
381 | |
| 388 | <ul> |
382 | <ul> |
| 389 | <li> |
383 | <li> |
| 390 | <b>--<c>no-</c>bootsplash</b>: Activates <e>[or deactivates]</e> support |
|
|
| 391 | for <uri link="http://www.bootsplash.org/">bootsplash</uri> in the |
|
|
| 392 | genkernel-built initrd image. The bootsplash feature is supported on a |
|
|
| 393 | limited number of architectures, and a kernel that supports bootsplash |
|
|
| 394 | is also required. |
|
|
| 395 | </li> |
|
|
| 396 | <li> |
|
|
| 397 | <b>--<c>no-</c>gensplash</b>: Activates <e>[or deactivates]</e> support |
384 | <b>--<c>no-</c>splash</b>: Activates <e>[or deactivates]</e> support for |
| 398 | for <uri link="http://dev.gentoo.org/~spock/projects/gensplash/">gensplash</uri> |
385 | <uri link="http://fbsplash.berlios.de/wiki/doku.php">framebuffer |
| 399 | support in the genkernel-built initrd image. The gensplash utility is |
386 | splash</uri> support in the genkernel-built initrd image. To override the |
| 400 | intended to be a replacement for bootsplash, and is designed for use with |
387 | default theme used by fbsplash, use <b>--splash=<c>PreferredTheme</c></b> |
| 401 | 2.6.x series kernels. To override the default theme used by gensplash, |
|
|
| 402 | use <b>--gensplash=<c>PreferredTheme</c></b> (where <c>PreferredTheme</c> |
|
|
| 403 | is the title of one of the directories inside the |
388 | (where <c>PreferredTheme</c> is the title of one of the directories inside |
| 404 | <path>/etc/splash/</path> directory. |
389 | the <path>/etc/splash/</path> directory. |
| 405 | </li> |
390 | </li> |
| 406 | <li> |
391 | <li> |
| 407 | <b>--gensplash-res=<c>PreferredResolution</c></b>: This flag allows you |
392 | <b>--splash-res=<c>PreferredResolution</c></b>: This flag allows you to |
| 408 | to select which splash screen resolutions will be supported in the initrd |
393 | select which splash screen resolutions will be supported in the initrd |
| 409 | during the start-up of the system. This is useful for two reasons: First, |
394 | during the start-up of the system. This is useful for two reasons: First, |
| 410 | you are able to select only the splash screen resolution(s) relevant to |
395 | you are able to select only the splash screen resolution(s) relevant to your |
| 411 | your system. Second, you avoid the unnecessary increase in the disk space |
396 | system. Second, you avoid the unnecessary increase in the disk space |
| 412 | required by initrd (since the initrd does not have to support resolutions |
397 | required by initrd (since the initrd does not have to support resolutions |
| 413 | that are irrelevant for your system configuration.) However, you may want |
398 | that are irrelevant for your system configuration.) However, you may want to |
| 414 | to omit this flag if the kernel is being compiled for an Installation CD; |
399 | omit this flag if the kernel is being compiled for an Installation CD; this |
| 415 | this allows gensplash support for all possible resolutions. |
400 | allows splash support for all possible resolutions. |
| 416 | </li> |
401 | </li> |
| 417 | <li> |
402 | <li> |
| 418 | <b>--do-keymap-auto</b>: Force keymap selection during the boot |
403 | <b>--do-keymap-auto</b>: Force keymap selection during the boot sequence. |
| 419 | sequence. |
|
|
| 420 | </li> |
404 | </li> |
| 421 | <li> |
405 | <li> |
| 422 | <b>--lvm2</b>: Includes support for storage using via <uri |
406 | <b>--lvm2</b>: Includes support for storage using via <uri |
| 423 | link="http://sources.redhat.com/lvm2/">Logical Volume Management</uri> |
407 | link="http://sources.redhat.com/lvm2/">Logical Volume Management</uri> |
| 424 | (LVM2) from <e>static</e> binaries, if available to the system. Relevant |
408 | (LVM2) from <e>static</e> binaries, if available to the system. Relevant |
| 425 | (static) LVM2 binaries are compiled if they are unavailable. Be sure to |
409 | (static) LVM2 binaries are compiled if they are unavailable. Be sure to |
| 426 | install the lvm2 package on your system with <c>emerge lvm2</c> before |
410 | install the lvm2 package on your system with <c>emerge lvm2</c> before |
| 427 | enabling this flag, and review the <uri |
411 | enabling this flag, and review the <uri link="/doc/en/lvm2.xml">Gentoo LVM2 |
| 428 | link="http://www.gentoo.org/doc/en/lvm2.xml">Gentoo LVM2 |
|
|
| 429 | Installation</uri> guide. |
412 | Installation</uri> guide. |
| 430 | </li> |
413 | </li> |
| 431 | <li> |
414 | <li> |
| 432 | <b>--evms2</b>: Includes support for storage using the <uri |
415 | <b>--evms2</b>: Includes support for storage using the <uri |
| 433 | link="http://evms.sourceforge.net/">Enterprise Volume Management |
416 | link="http://evms.sourceforge.net/">Enterprise Volume Management |
| 434 | System</uri> (EVMS2), if available. Be sure to install the evms package |
417 | System</uri> (EVMS2), if available. Be sure to install the evms package on |
| 435 | on your system with <c>USE=static emerge evms2</c> before using this |
418 | your system with <c>USE=static emerge evms2</c> before using this |
| 436 | (genkernel) flag. <e>(Omitting the </e><c>USE=static</c> <e>flag during |
419 | (genkernel) flag. <e>(Omitting the </e><c>USE=static</c><e> flag during |
| 437 | package installation will fail to include the necessary static binaries.) |
420 | package installation will fail to include the necessary static |
| 438 | </e> |
421 | binaries.)</e> |
| 439 | </li> |
422 | </li> |
| 440 | <li> |
423 | <li> |
| 441 | <b>--dmraid</b>: Includes support for <uri |
424 | <b>--dmraid</b>: Includes support for <uri |
| 442 | link="http://people.redhat.com/~heinzm/sw/dmraid/readme">DMRAID</uri>; |
425 | link="http://people.redhat.com/~heinzm/sw/dmraid/readme">DMRAID</uri>; the |
| 443 | the utility which creates RAID mappings using the kernel device-mapper |
426 | utility which creates RAID mappings using the kernel device-mapper |
| 444 | subsystem. DMRAID discovers, activates, deactivates and displays |
427 | subsystem. DMRAID discovers, activates, deactivates and displays properties |
| 445 | properties of software RAID sets (ATARAID, for example) and contained |
428 | of software RAID sets (ATARAID, for example) and contained DOS partitions. |
| 446 | DOS partitions. |
|
|
| 447 | </li> |
429 | </li> |
| 448 | <li> |
430 | <li> |
|
|
431 | <b>--luks</b>: Includes support for <uri |
|
|
432 | link="http://luks.endorphin.org/">Linux Unified Key Setup</uri> or LUKS. |
|
|
433 | This will allow you to use a device encrypted by LUKS which contains the |
|
|
434 | root filesystem. On the bootloader, you then set that encrypted device as |
|
|
435 | the value of crypt_root (and real_root shall be the unencrypted device LUKS |
|
|
436 | creates). |
|
|
437 | </li> |
|
|
438 | <li> |
| 449 | <b>--linuxrc=/path/to/your/linuxrc</b>: Specifies a user-created |
439 | <b>--linuxrc=/path/to/your/linuxrc</b>: Specifies a user-created |
| 450 | <e>linuxrc</e> — a script that is initialized during the start-up |
440 | <e>linuxrc</e> — a script that is initialized during the start-up |
| 451 | stage of the kernel, prior to the actual boot process. (A default linuxrc |
441 | stage of the kernel, prior to the actual boot process. (A default linuxrc |
| 452 | script should be in the <path>/usr/share/genkernel/</path> directory.) |
442 | script should be in the <path>/usr/share/genkernel/</path> directory.) This |
| 453 | This script allows you to boot into a small, modularized kernel and load |
443 | script allows you to boot into a small, modularized kernel and load the |
| 454 | the drivers that are needed (as modules) by the system. |
444 | drivers that are needed (as modules) by the system. |
| 455 | </li> |
445 | </li> |
| 456 | <li> |
446 | <li> |
| 457 | <b>--cachedir=/path/to/alt/dir/</b>: Overrides the default cache location |
447 | <b>--cachedir=/path/to/alt/dir/</b>: Overrides the default cache location |
| 458 | used while compiling the kernel. |
448 | used while compiling the kernel. |
| 459 | </li> |
449 | </li> |
| 460 | <li> |
450 | <li> |
| 461 | <b>--tempdir=/path/to/new/tempdir/</b>: Specifies the location of the |
451 | <b>--tempdir=/path/to/new/tempdir/</b>: Specifies the location of the |
| 462 | temporary directory used by genkernel while compiling the kernel. |
452 | temporary directory used by genkernel while compiling the kernel. |
| 463 | </li> |
453 | </li> |
| 464 | <li> |
454 | <li> |
| 465 | <b>--unionfs</b>: Includes support for the <uri |
455 | <b>--unionfs</b>: Includes support for the <uri |
| 466 | link="http://www.fsl.cs.sunysb.edu/project-unionfs.html">Unification File |
456 | link="http://www.fsl.cs.sunysb.edu/project-unionfs.html">Unification File |
| 467 | System</uri> in the initrd image. |
457 | System</uri> in the initrd image. |
| 468 | </li> |
458 | </li> |
| 469 | </ul> |
459 | </ul> |
| 470 | |
460 | |
| 471 | </body> |
461 | </body> |
| 472 | </section> |
462 | </section> |
| 473 | |
|
|
| 474 | <section> |
463 | <section> |
| 475 | <title>Miscellaneous Flags</title> |
464 | <title>Miscellaneous Flags</title> |
| 476 | <body> |
465 | <body> |
| 477 | |
466 | |
| 478 | <p> |
467 | <p> |
| 479 | The assortment of flags listed below are supported by genkernel, but do not fit |
468 | The assortment of flags listed below are supported by genkernel, but do not fit |
| 480 | neatly into any of the other categories: |
469 | neatly into any of the other categories: |
| 481 | </p> |
470 | </p> |
| 482 | |
471 | |
| 483 | <ul> |
472 | <ul> |
| 484 | <li> |
473 | <li> |
| 485 | <b>--mountboot</b>: Detects whether or not the <path>/boot/</path> |
474 | <b>--mountboot</b>: Detects whether or not the <path>/boot/</path> |
| 486 | directory needs to be mounted on a separate partition. It will check |
475 | directory needs to be mounted on a separate partition. It will check |
| 487 | <path>/etc/fstab</path> script for instructions on how to mount the boot |
476 | <path>/etc/fstab</path> script for instructions on how to mount the boot |
| 488 | partition on a file system (if needed). |
477 | partition on a file system (if needed). |
| 489 | </li> |
478 | </li> |
| 490 | <li> |
479 | <li> |
| 491 | <b>--kernname=<c>NickName</c></b>: Allows you to modify the name of the |
480 | <b>--kernname=<c>NickName</c></b>: Allows you to modify the name of the |
| 492 | kernel and initrd images in the <path>/boot/</path> directory, so that |
481 | kernel and initrd images in the <path>/boot/</path> directory, so that the |
| 493 | the images produced are kernel-<c>NickName</c>-version and |
482 | images produced are kernel-<c>NickName</c>-version and |
| 494 | initramfs-<c>NickName</c>-version. |
483 | initramfs-<c>NickName</c>-version. |
| 495 | </li> |
484 | </li> |
| 496 | </ul> |
485 | </ul> |
| 497 | |
486 | |
| 498 | </body> |
487 | </body> |
| 499 | </section> |
488 | </section> |
| 500 | |
|
|
| 501 | |
|
|
| 502 | <section> |
489 | <section> |
| 503 | <title>Possible Actions</title> |
490 | <title>Possible Actions</title> |
| 504 | <body> |
491 | <body> |
| 505 | |
492 | |
| 506 | <p> |
493 | <p> |
| 507 | An action tells genkernel what to build. Currently, the following actions are |
494 | An action tells genkernel what to build. Currently, the following actions are |
| 508 | supported: |
495 | supported: |
| 509 | </p> |
496 | </p> |
| 510 | |
497 | |
| 511 | <ul> |
498 | <ul> |
| 512 | <li><c>initrd</c>: Only builds the initrd image</li> |
499 | <li><c>initrd</c>: Only builds the initrd image</li> |
| 513 | <li><c>bzImage</c>: Only builds the kernel image</li> |
500 | <li><c>bzImage</c>: Only builds the kernel image</li> |
| 514 | <li><c>kernel</c>: Only builds the kernel image and modules</li> |
501 | <li><c>kernel</c>: Only builds the kernel image and modules</li> |
|
|
502 | <li> |
| 515 | <li><c>all</c>: Builds all stages — the initrd, kernel image and |
503 | <c>all</c>: Builds all stages — the initrd, kernel image and modules. |
| 516 | modules.</li> |
504 | </li> |
| 517 | </ul> |
505 | </ul> |
| 518 | |
506 | |
| 519 | <p> |
507 | <p> |
| 520 | The last action, <c>all</c>, is recommended for most users since it builds the |
508 | The last action, <c>all</c>, is recommended for most users since it builds the |
| 521 | stages required for a functional kernel. Remember, an <e>action</e> simply |
509 | stages required for a functional kernel. Remember, an <e>action</e> simply |
| 522 | tells genkernel what to <e>build</e>, not <e>install</e>. |
510 | tells genkernel what to <e>build</e>, not <e>install</e>. |
| 523 | </p> |
511 | </p> |
| 524 | |
512 | |
| 525 | </body> |
513 | </body> |
| 526 | </section> |
514 | </section> |
| 527 | |
|
|
| 528 | |
|
|
| 529 | <section> |
515 | <section> |
| 530 | <title>Bootloader Configuration</title> |
516 | <title>Bootloader Configuration</title> |
| 531 | <body> |
517 | <body> |
| 532 | |
518 | |
| 533 | <p> |
519 | <p> |
| 534 | To set up genkernel to work with your bootloader, three or four changes should |
520 | To set up genkernel to work with your bootloader, three or four changes should |
| 535 | be applied to the bootloader's configuration file: |
521 | be applied to the bootloader's configuration file: |
| 536 | </p> |
522 | </p> |
| 537 | |
523 | |
| 538 | <ol> |
524 | <ol> |
| 539 | <li> |
525 | <li> |
| 540 | Add <c>root=/dev/ram0</c> and <c>init=/linuxrc</c> to the kernel |
526 | Add <c>root=/dev/ram0</c> and <c>init=/linuxrc</c> to the kernel parameters |
| 541 | parameters passed to the kernel image. |
527 | passed to the kernel image. |
| 542 | </li> |
528 | </li> |
| 543 | <li> |
529 | <li> |
| 544 | Add <c>real_root=/dev/hda3</c>, for example, to the kernel parameters |
530 | Add <c>real_root=/dev/hda3</c>, for example, to the kernel parameters |
| 545 | passed to the kernel image, if <path>/dev/hda3</path> contains your root |
531 | passed to the kernel image, if <path>/dev/hda3</path> contains your root |
| 546 | partition. |
532 | partition. |
| 547 | </li> |
533 | </li> |
| 548 | <li> |
534 | <li> |
| 549 | If you are using bootsplash, add a suitable mode line such as |
535 | If you are using splash, add a suitable mode line such as <c>vga=0x317</c> |
| 550 | <c>vga=0x317</c> to the parameters passed to the kernel and also add |
536 | to the parameters passed to the kernel and also add <c>splash=verbose</c> or |
| 551 | <c>splash=verbose</c> or <c>splash=silent</c> depending on the |
537 | <c>splash=silent</c> depending on the verboseness you require from your |
| 552 | verboseness you require from your bootloader. |
538 | bootloader. |
| 553 | </li> |
539 | </li> |
| 554 | <li> |
540 | <li> |
| 555 | Add the initrd information as required by the bootloader. Consult the |
541 | Add the initrd information as required by the bootloader. Consult the <uri |
| 556 | <uri link="/doc/en/handbook/handbook-x86.xml?part=1&chap=10"> |
542 | link="/doc/en/handbook/handbook-x86.xml?part=1&chap=10">Bootloader |
| 557 | Bootloader Configuration Chapter</uri> of the Gentoo Handbook for details |
543 | Configuration Chapter</uri> of the Gentoo Handbook for details on how to |
| 558 | on how to make your bootloader initrd-aware. |
544 | make your bootloader initrd-aware. |
| 559 | </li> |
545 | </li> |
| 560 | </ol> |
546 | </ol> |
| 561 | |
547 | |
| 562 | </body> |
548 | </body> |
| 563 | </section> |
549 | </section> |
| 564 | |
|
|
| 565 | </chapter> |
550 | </chapter> |
| 566 | |
551 | |
| 567 | <chapter> |
552 | <chapter> |
| 568 | <title>Configuration Options</title> |
553 | <title>Configuration Options</title> |
| 569 | |
|
|
| 570 | <section> |
554 | <section> |
| 571 | <title>Editing /etc/genkernel.conf</title> |
555 | <title>Editing /etc/genkernel.conf</title> |
| 572 | <body> |
556 | <body> |
| 573 | |
557 | |
| 574 | <p> |
558 | <p> |
| 575 | Passing flags to genkernel from the command line can be cumbersome, especially |
559 | Passing flags to genkernel from the command line can be cumbersome, especially |
| 576 | if you have about a dozen flags: |
560 | if you have about a dozen flags: |
| 577 | </p> |
561 | </p> |
| 578 | |
562 | |
| 579 | <pre caption="Running genkernel (overloaded with flags)"> |
563 | <pre caption="Running genkernel (overloaded with flags)"> |
| 580 | # genkernel --debuglevel=5 --no-color --no-mrproper --clean --gensplash\ |
564 | # <i>genkernel --debuglevel=5 --no-color --no-mrproper --clean --splash \ |
| 581 | --kerneldir=/path/to/alternate/kernel/sources --install --menuconfig --udev\ |
565 | --kerneldir=/path/to/alternate/kernel/sources --install --menuconfig \ |
| 582 | --kernel-config=/path/to/preferred/configfile --save-config --mountboot all |
566 | --kernel-config=/path/to/preferred/configfile --save-config --mountboot all</i> |
| 583 | </pre> |
567 | </pre> |
| 584 | |
568 | |
|
|
569 | <p> |
| 585 | <p>Fortunately, there is a configuration file where most of the basic options |
570 | Fortunately, there is a configuration file where most of the basic options can |
| 586 | can be set (or changed) as necessary. What follows is a rundown of the more |
571 | be set (or changed) as necessary. What follows is a rundown of the more |
| 587 | relevant options: |
572 | relevant options: |
| 588 | </p> |
573 | </p> |
| 589 | |
574 | |
| 590 | <ul> |
575 | <ul> |
| 591 | <li> |
576 | <li> |
| 592 | <b>MENUCONFIG=<c>[yes|no]</c></b>: This option is equivalent to the |
577 | <b>MENUCONFIG=<c>[yes|no]</c></b>: This option is equivalent to the |
| 593 | <c>--menuconfig</c> flag used by genkernel, which in turn uses the |
578 | <c>--menuconfig</c> flag used by genkernel, which in turn uses the <c>make |
| 594 | <c>make menuconfig</c> command to invoke a command-line based kernel |
579 | menuconfig</c> command to invoke a command-line based kernel configuration |
| 595 | configuration utility. To invoke the utility automatically during kernel |
580 | utility. To invoke the utility automatically during kernel configuration |
| 596 | configuration via this script, set this option to 'yes' here; otherwise, |
581 | via this script, set this option to 'yes' here; otherwise, choose 'no'. |
| 597 | choose 'no'. |
|
|
| 598 | </li> |
582 | </li> |
| 599 | <li> |
583 | <li> |
| 600 | <b>CLEAN=<c>[yes|no]</c></b>: Setting this option to 'yes' is equivalent |
584 | <b>CLEAN=<c>[yes|no]</c></b>: Setting this option to 'yes' is equivalent to |
| 601 | to the <c>--clean</c> flag used by genkernel, and invokes the |
585 | the <c>--clean</c> flag used by genkernel, and invokes the <c>make |
| 602 | <c>make clean</c> command to remove all object files and dependencies |
586 | clean</c> command to remove all object files and dependencies from the |
| 603 | from the kernel's source tree. Setting this option to 'no' creates a |
587 | kernel's source tree. Setting this option to 'no' creates a cascade effect |
| 604 | cascade effect — it is equivalent to genkernel's <c>--no-clean</c> |
588 | — it is equivalent to genkernel's <c>--no-clean</c> flag, which |
| 605 | flag, which disables the <c>make clean</c> command and implies |
589 | disables the <c>make clean</c> command and implies genkernel's |
| 606 | genkernel's <c>--no-mrproper</c> flag — essentially nullifying the |
590 | <c>--no-mrproper</c> flag — essentially nullifying the <c>make |
| 607 | <c>make mrproper</c> command. |
591 | mrproper</c> command. |
| 608 | </li> |
592 | </li> |
| 609 | <li> |
593 | <li> |
| 610 | <b>MRPROPER=<c>[yes|no]</c></b>: Setting this option to 'yes' is |
594 | <b>MRPROPER=<c>[yes|no]</c></b>: Setting this option to 'yes' is equivalent |
| 611 | equivalent to <c>--mrproper</c> flag used by genkernel, and invokes the |
595 | to <c>--mrproper</c> flag used by genkernel, and invokes the <c>make |
| 612 | <c>make mrproper</c> command, which purges the kernel source tree of any |
596 | mrproper</c> command, which purges the kernel source tree of any |
| 613 | configuration files. Selecting 'no' here is equivalent to genkernel's |
597 | configuration files. Selecting 'no' here is equivalent to genkernel's |
| 614 | <c>--no-mrproper</c> flag, which disables the <c>make mrproper</c> |
598 | <c>--no-mrproper</c> flag, which disables the <c>make mrproper</c> command. |
| 615 | command. |
|
|
| 616 | </li> |
599 | </li> |
| 617 | <li> |
600 | <li> |
| 618 | <b>MOUNTBOOT=<c>[yes|no]</c></b>: Setting this option to 'yes' is |
601 | <b>MOUNTBOOT=<c>[yes|no]</c></b>: Setting this option to 'yes' is |
| 619 | equivalent to the <c>--mountboot</c> flag, and automatically mounts the |
602 | equivalent to the <c>--mountboot</c> flag, and automatically mounts the |
| 620 | <path>/boot/</path> directory (if needed) at compile time. If the |
603 | <path>/boot/</path> directory (if needed) at compile time. If the |
| 621 | <path>/boot/</path> directory is on a separate partition, consider |
604 | <path>/boot/</path> directory is on a separate partition, consider enabling |
| 622 | enabling this option; it will make for one less (essential) step to |
605 | this option; it will make for one less (essential) step to remember later. |
| 623 | remember later. |
|
|
| 624 | </li> |
606 | </li> |
| 625 | <li> |
607 | <li> |
| 626 | <b>SAVE_CONFIG=<c>[yes|no]</c></b>: After configuring the kernel, the |
608 | <b>SAVE_CONFIG=<c>[yes|no]</c></b>: After configuring the kernel, the |
| 627 | selected options are stored as <path>.config</path> in the kernel source |
609 | selected options are stored as <path>.config</path> in the kernel source |
| 628 | tree. This script may be overwritten during the next kernel compilation, |
610 | tree. This script may be overwritten during the next kernel compilation, or |
| 629 | or even purged from the kernel source tree. Choosing 'yes' here is |
611 | even purged from the kernel source tree. Choosing 'yes' here is equivalent |
| 630 | equivalent to the <c>--save-config</c> flag, and stores all options |
612 | to the <c>--save-config</c> flag, and stores all options selected during |
| 631 | selected during kernel configuration as a script in the |
613 | kernel configuration as a script in the <path>/etc/kernels/</path> |
| 632 | <path>/etc/kernels/</path> directory. Choosing 'no' preserves the |
614 | directory. Choosing 'no' preserves the <e>status quo</e>. |
| 633 | <e>status quo</e>. |
|
|
| 634 | </li> |
615 | </li> |
| 635 | <li> |
616 | <li> |
| 636 | <b>USECOLOR=<c>[yes|no]</c></b>: Setting this option to 'yes' is |
617 | <b>USECOLOR=<c>[yes|no]</c></b>: Setting this option to 'yes' is equivalent |
| 637 | equivalent to the <c>--color</c> flag, which colors genkernel's output |
618 | to the <c>--color</c> flag, which colors genkernel's output to ease |
| 638 | to ease debugging (when needed.) |
619 | debugging (when needed.) |
| 639 | </li> |
620 | </li> |
| 640 | <li> |
621 | <li> |
| 641 | <b>DEBUGLEVEL=<c>[0|1|2|3|4|5]</c></b>: This option is for adjusting the |
622 | <b>DEBUGLEVEL=<c>[0|1|2|3|4|5]</c></b>: This option is for adjusting the |
| 642 | verbosity of the output produced by genkernel — setting this option |
623 | verbosity of the output produced by genkernel — setting this option to |
| 643 | to '0' with <c>--debuglevel=0</c> will suppress all output produced by |
624 | '0' with <c>--debuglevel=0</c> will suppress all output produced by |
| 644 | genkernel; setting this option to '5' with <c>--debuglevel=5</c> |
625 | genkernel; setting this option to '5' with <c>--debuglevel=5</c> provides |
| 645 | provides the user with all output produced by genkernel. |
626 | the user with all output produced by genkernel. |
| 646 | </li> |
627 | </li> |
| 647 | </ul> |
628 | </ul> |
| 648 | |
629 | |
| 649 | <p> |
630 | <p> |
| 650 | By choosing the appropriate options in <path>/etc/genkernel.conf</path>, you |
631 | By choosing the appropriate options in <path>/etc/genkernel.conf</path>, you |
| 651 | can halve the number of flags passed to genkernel from the command line: |
632 | can halve the number of flags passed to genkernel from the command line: |
| 652 | </p> |
633 | </p> |
| 653 | |
634 | |
| 654 | <pre caption="Running genkernel (with flags), after employing genkernel.conf"> |
635 | <pre caption="Running genkernel (with flags), after employing genkernel.conf"> |
| 655 | # genkernel --gensplash --kerneldir=/path/to/alternate/kernel/sources --udev\ |
636 | # <i>genkernel --splash --kerneldir=/path/to/alternate/kernel/sources \ |
| 656 | --kernel-config=/path/to/preferred/configfile --install all |
637 | --kernel-config=/path/to/preferred/configfile --install all</i> |
| 657 | </pre> |
638 | </pre> |
| 658 | |
639 | |
| 659 | <p> |
640 | <p> |
| 660 | Identical results are obtained from both approaches, but the latter has most of |
641 | Identical results are obtained from both approaches, but the latter has most of |
| 661 | the options stored in a script that can be modified at a later date. |
642 | the options stored in a script that can be modified at a later date. |
| 662 | </p> |
643 | </p> |
| 663 | |
644 | |
| 664 | </body> |
645 | </body> |
| 665 | </section> |
646 | </section> |
| 666 | |
|
|
| 667 | </chapter> |
647 | </chapter> |
| 668 | |
648 | |
| 669 | <chapter> |
649 | <chapter> |
| 670 | <title>Network-Booting with genkernel</title> |
650 | <title>Network-Booting with genkernel</title> |
| 671 | |
|
|
| 672 | <section> |
651 | <section> |
| 673 | <title>Network Booting from an Installation CD</title> |
652 | <title>Network Booting from an Installation CD</title> |
| 674 | <body> |
653 | <body> |
| 675 | |
654 | |
| 676 | <p> |
655 | <p> |
| 677 | The genkernel utility can build kernel and initrd images that provide support |
656 | The genkernel utility can build kernel and initrd images that provide support |
| 678 | for network booting, or <e>netboot</e>ing . With any luck, you should be able |
657 | for network booting, or <e>netboot</e>ing. With any luck, you should be able |
| 679 | to netboot any recent computer into the environment provided by the |
658 | to netboot any recent computer into the environment provided by the |
| 680 | Installation CD. |
659 | Installation CD. |
| 681 | </p> |
660 | </p> |
| 682 | |
661 | |
| 683 | <p> |
662 | <p> |
| … | |
… | |
| 686 | Installation CD can take over, as if the CD was present locally. |
665 | Installation CD can take over, as if the CD was present locally. |
| 687 | </p> |
666 | </p> |
| 688 | |
667 | |
| 689 | </body> |
668 | </body> |
| 690 | </section> |
669 | </section> |
| 691 | |
|
|
| 692 | <section> |
670 | <section> |
| 693 | <title>Building Kernel and Initrd Images with Support for Netbooting</title> |
671 | <title>Building Kernel and Initrd Images with Support for Netbooting</title> |
| 694 | <body> |
672 | <body> |
| 695 | |
673 | |
| 696 | <p> |
674 | <p> |
| … | |
… | |
| 703 | </warn> |
681 | </warn> |
| 704 | |
682 | |
| 705 | <p> |
683 | <p> |
| 706 | First, the kernel image must include the drivers for your Network Interface |
684 | First, the kernel image must include the drivers for your Network Interface |
| 707 | Cards (NIC). Normally, drivers for such devices will be compiled as modules. |
685 | Cards (NIC). Normally, drivers for such devices will be compiled as modules. |
| 708 | However, it is essential (for netbooting) that you such drivers compiled |
686 | However, it is essential (for netbooting) that you have such drivers compiled |
| 709 | directly into the kernel image and <b>not</b> as modules. |
687 | directly into the kernel image and <b>not</b> as modules. |
| 710 | </p> |
688 | </p> |
| 711 | |
689 | |
| 712 | <pre caption="Configuring a 2.6.x series kernel to support your NIC driver"> |
690 | <pre caption="Configuring a 2.6.x series kernel to support your NIC driver"> |
| 713 | Device Drivers ---> |
691 | Device Drivers ---> |
| 714 | Networking Support ---> |
692 | Networking Support ---> |
| 715 | Ethernet (10 or 100Mbit) ---> |
693 | Ethernet (10 or 100Mbit) ---> |
| 716 | [*] Ethernet (10 or 100Mbit) |
694 | [*] Ethernet (10 or 100Mbit) |
| 717 | <*> the driver for your network card |
695 | <*> the driver for your network card |
| 718 | <comment>(Be sure to select <*> and not <m>)</comment> |
696 | <comment>(Be sure to select <*> and not <M>)</comment> |
| 719 | </pre> |
697 | </pre> |
| 720 | |
698 | |
| 721 | <p> |
699 | <p> |
| 722 | Secondly, we suggest that you enable <c>IP: kernel level |
700 | Secondly, we suggest that you enable <c>IP: kernel level autoconfiguration</c> |
| 723 | autoconfiguration</c> and the <c>IP: DHCP support</c> options. This avoids an |
701 | and the <c>IP: DHCP support</c> options. This avoids an unnecessary layer of |
| 724 | unnecessary layer of complexity since the IP address and the NFS path to the |
702 | complexity since the IP address and the NFS path to the Installation CD can be |
| 725 | Installation CD can be configured on a DHCP server. Of course, this means the |
703 | configured on a DHCP server. Of course, this means the kernel command line |
| 726 | kernel command line will remain constant for any machine — which is very |
704 | will remain constant for any machine — which is very important for |
| 727 | important for <e>etherbooting</e>. |
705 | <e>etherbooting</e>. |
| 728 | </p> |
706 | </p> |
| 729 | |
707 | |
| 730 | <pre caption="Configuring a 2.6.x series kernel to support DHCP"> |
708 | <pre caption="Configuring a 2.6.x series kernel to support DHCP"> |
| 731 | Device Drivers ---> |
709 | Device Drivers ---> |
| 732 | Networking Support ---> |
710 | Networking Support ---> |
| 733 | Networking options |
711 | Networking options |
| 734 | [*] TCP/IP networking---> |
712 | [*] TCP/IP networking---> |
| 735 | [*] IP: kernel level autoconfiguration |
713 | [*] IP: kernel level autoconfiguration |
| 736 | [*] IP: DHCP support |
714 | [*] IP: DHCP support |
| 737 | <comment>(These options tell the kernel to send a DHCP request at bootup.)</comment> |
715 | <comment>(These options tell the kernel to send a DHCP request at bootup.)</comment> |
| 738 | </pre> |
716 | </pre> |
| … | |
… | |
| 743 | generic kernel source tree. To enable SquashFS, apply the necessary patches to |
721 | generic kernel source tree. To enable SquashFS, apply the necessary patches to |
| 744 | the generic kernel source or install <c>gentoo-sources</c>. |
722 | the generic kernel source or install <c>gentoo-sources</c>. |
| 745 | </p> |
723 | </p> |
| 746 | |
724 | |
| 747 | <pre caption="Configuring the kernel to support SquashFS"> |
725 | <pre caption="Configuring the kernel to support SquashFS"> |
| 748 | File systems---> |
726 | File systems---> |
| 749 | Miscellaneous filesystems ---> |
727 | Miscellaneous filesystems ---> |
| 750 | [*] SquashFS 2.X - Squashed file system support |
728 | [*] SquashFS 2.X - Squashed file system support |
| 751 | </pre> |
729 | </pre> |
| 752 | |
730 | |
| 753 | <p> |
731 | <p> |
| … | |
… | |
| 756 | your kernel version does not match the kernel image version on the Installation |
734 | your kernel version does not match the kernel image version on the Installation |
| 757 | CD. |
735 | CD. |
| 758 | </p> |
736 | </p> |
| 759 | |
737 | |
| 760 | <pre caption="Creating a compressed tarball containing the kernel modules"> |
738 | <pre caption="Creating a compressed tarball containing the kernel modules"> |
| 761 | <comment># Create a tar.gz containing all the modules</comment> |
739 | <comment>(Create a tar.gz containing all the modules)</comment> |
| 762 | cd / |
740 | # <i>cd /</i> |
| 763 | tar -cf /tmp/modules-X.Y.Z.tar.gz /lib/modules/X.Y.Z/ |
741 | # <i>tar -cf /tmp/modules-X.Y.Z.tar.gz /lib/modules/X.Y.Z/</i> |
| 764 | </pre> |
742 | </pre> |
| 765 | |
743 | |
| 766 | <p> |
744 | <p> |
| 767 | Depending on your network boot mechanism, you will need to do some of the |
745 | Depending on your network boot mechanism, you will need to do some of the |
| 768 | following steps: |
746 | following steps: |
| 769 | </p> |
747 | </p> |
| 770 | |
748 | |
| 771 | <pre caption="Creating a boot image"> |
749 | <pre caption="Creating a boot image"> |
| 772 | <comment># Create a etherboot image</comment> |
750 | <comment>(Create an etherboot image)</comment> |
| 773 | emerge mknbi |
751 | # <i>emerge mknbi</i> |
| 774 | cd /boot |
752 | # <i>cd /boot</i> |
| 775 | mkelf-linux -params="root=/dev/ram0 init=/linuxrc ip=dhcp" kernel... initrd... > etherboot.img |
753 | # <i>mkelf-linux -params="root=/dev/ram0 init=/linuxrc ip=dhcp" kernel... initrd... > etherboot.img</i> |
| 776 | |
754 | |
| 777 | <comment># Create a OpenBoot / SPARC64 TFTP image</comment> |
755 | <comment>(Create a OpenBoot / SPARC64 TFTP image)</comment> |
| 778 | emerge sparc-utils |
756 | # <i>emerge sparc-utils</i> |
| 779 | cd /boot |
757 | # <i>cd /boot</i> |
| 780 | elftoaout kernel... -o kernel.aout |
758 | # <i>elftoaout kernel... -o kernel.aout</i> |
| 781 | piggyback64 kernel.aout System.map-... initrd-... |
759 | # <i>piggyback64 kernel.aout System.map-... initrd-...</i> |
| 782 | mv kernel.aout openboot.img <comment># This is the boot image</comment> |
760 | # <i>mv kernel.aout openboot.img</i> <comment>(This is the boot image)</comment> |
| 783 | |
761 | |
| 784 | <comment># PXE does not need any more steps, the kernel and initrd can be used as is</comment> |
762 | <comment>(PXE does not need any more steps, the kernel and initrd can be used as is)</comment> |
| 785 | </pre> |
763 | </pre> |
| 786 | |
764 | |
| 787 | <p> |
765 | <p> |
| 788 | Finally, copy this kernel to your TFTP server. The details are |
766 | Finally, copy this kernel to your TFTP server. The details are |
| 789 | architecture-dependent and are beyond the scope of this guide. Please refer to |
767 | architecture-dependent and are beyond the scope of this guide. Please refer to |
| 790 | the documentation for your platform. |
768 | the documentation for your platform. |
| 791 | </p> |
769 | </p> |
| 792 | |
770 | |
| 793 | </body> |
771 | </body> |
| 794 | </section> |
772 | </section> |
| 795 | |
|
|
| 796 | <section> |
773 | <section> |
| 797 | <title>NFS Setup</title> |
774 | <title>NFS Setup</title> |
| 798 | <body> |
775 | <body> |
| 799 | |
776 | |
| 800 | <p> |
777 | <p> |
| … | |
… | |
| 805 | the <c>modules-X.Y.Z.tar.gz</c> archive to the <path>/nfs/livecd/add/</path> |
782 | the <c>modules-X.Y.Z.tar.gz</c> archive to the <path>/nfs/livecd/add/</path> |
| 806 | directory. |
783 | directory. |
| 807 | </p> |
784 | </p> |
| 808 | |
785 | |
| 809 | <pre caption="Preparing the NFS share"> |
786 | <pre caption="Preparing the NFS share"> |
| 810 | <comment># This assumes that /nfs/livecd is a exported NFS share</comment> |
787 | <comment>(This assumes that /nfs/livecd is an exported NFS share)</comment> |
| 811 | mount /mnt/cdrom /tmp/gentoo-livecd.iso -o loop |
788 | # <i>mount /tmp/gentoo-livecd.iso /mnt/cdrom -o loop</i> |
| 812 | cp -p /mnt/cdrom /nfs/livecd |
789 | # <i>cp -p /mnt/cdrom /nfs/livecd</i> |
| 813 | umount /mnt/cdrom |
790 | # <i>umount /mnt/cdrom</i> |
| 814 | |
791 | |
| 815 | <comment># Copy the modules.tar.gz into /add</comment> |
792 | <comment>(Copy the modules.tar.gz into /add)</comment> |
| 816 | mkdir /nfs/livecd/add |
793 | # <i>mkdir /nfs/livecd/add</i> |
| 817 | cp /tmp/modules-X.Y.Z.tar.gz /nfs/livecd/add |
794 | # <i>cp /tmp/modules-X.Y.Z.tar.gz /nfs/livecd/add</i> |
| 818 | </pre> |
795 | </pre> |
| 819 | |
796 | |
| 820 | </body> |
797 | </body> |
| 821 | </section> |
798 | </section> |
| 822 | |
|
|
| 823 | <section> |
799 | <section> |
| 824 | <title>DHCP Setup</title> |
800 | <title>DHCP Setup</title> |
| 825 | <body> |
801 | <body> |
| 826 | |
802 | |
| 827 | <p> |
803 | <p> |
| 828 | The netboot images will ask your DHCP server for an IP as well as a |
804 | The netboot images will ask your DHCP server for an IP as well as a root-path |
| 829 | root-path parameter. Both can be specified per host using a MAC |
805 | parameter. Both can be specified per host using a MAC address to identify |
| 830 | address to identify machines: |
806 | machines: |
| 831 | </p> |
807 | </p> |
| 832 | |
808 | |
| 833 | <pre caption="Sample client dhcpd.conf setup"> |
809 | <pre caption="Sample client dhcpd.conf setup"> |
| 834 | ... |
810 | ... |
| 835 | |
811 | |
| … | |
… | |
| 843 | ... |
819 | ... |
| 844 | </pre> |
820 | </pre> |
| 845 | |
821 | |
| 846 | </body> |
822 | </body> |
| 847 | </section> |
823 | </section> |
| 848 | |
|
|
| 849 | <section> |
824 | <section> |
| 850 | <title>Netbooting Instructions</title> |
825 | <title>Netbooting Instructions</title> |
| 851 | <body> |
826 | <body> |
| 852 | |
827 | |
| 853 | <p> |
828 | <p> |
| 854 | Netbooting itself is again very platform-specific. The important part |
829 | Netbooting itself is again very platform-specific. The important part is to |
| 855 | is to specify the <c>ip=dhcp</c> and <c>init=/linuxrc</c> parameters |
830 | specify the <c>ip=dhcp</c> and <c>init=/linuxrc</c> parameters on the kernel |
| 856 | on the kernel command line, as this will bring up the |
831 | command line, as this will bring up the network interface and tell the initrd |
| 857 | network interface and tell the initrd scripts to mount the Installation CD via |
832 | scripts to mount the Installation CD via NFS. Here are some platform-specific |
| 858 | NFS. Here are some platform-specific tips: |
833 | tips: |
| 859 | </p> |
834 | </p> |
| 860 | |
835 | |
| 861 | <pre caption="Netbooting Instructions"> |
836 | <pre caption="Netbooting Instructions"> |
| 862 | <comment># Etherboot - insert the etherboot disk into the drive and reboot |
837 | <comment># Etherboot - insert the etherboot disk into the drive and reboot |
| 863 | # The kernel command line was specified when the image was constructed</comment> |
838 | # The kernel command line was specified when the image was constructed</comment> |
| 864 | |
839 | |
| 865 | <comment># Sparc64 - Hit Stop-A at the boot prompt </comment> |
840 | <comment># Sparc64 - Hit Stop-A at the boot prompt</comment> |
| 866 | ok boot net ip=dhcp init=/linuxrc |
841 | ok boot net ip=dhcp init=/linuxrc |
| 867 | |
842 | |
| 868 | <comment># PXE - Setup pxelinux (part of syslinux), then create a pxelinux.cfg/default along the lines of:</comment> |
843 | <comment># PXE - Setup pxelinux (part of syslinux), |
|
|
844 | then create a pxelinux.cfg/default along the lines of:</comment> |
| 869 | |
845 | |
| 870 | DEFAULT gentoo |
846 | DEFAULT gentoo |
| 871 | TIMEOUT 40 |
847 | TIMEOUT 40 |
| 872 | PROMPT 1 |
848 | PROMPT 1 |
| 873 | |
849 | |
| 874 | LABEL gentoo |
850 | LABEL gentoo |
| 875 | KERNEL kernel-X.Y.Z |
851 | KERNEL kernel-X.Y.Z |
| 876 | APPEND initrd=initrd-X.Y.Z root=/dev/ram0 init=/linuxrc ip=dhcp |
852 | APPEND initrd=initrd-X.Y.Z root=/dev/ram0 init=/linuxrc ip=dhcp |
| 877 | </pre> |
853 | </pre> |
| 878 | |
854 | |
| 879 | </body> |
855 | </body> |
| 880 | </section> |
856 | </section> |
| 881 | |
|
|
| 882 | </chapter> |
857 | </chapter> |
| 883 | |
858 | |
| 884 | <chapter> |
859 | <chapter> |
| 885 | <title>Conclusion</title> |
860 | <title>Conclusion</title> |
| 886 | |
|
|
| 887 | <section> |
861 | <section> |
| 888 | <title>To Automate or not to Automate?</title> |
862 | <title>To Automate or not to Automate?</title> |
| 889 | <body> |
863 | <body> |
| 890 | |
864 | |
| 891 | <p> |
865 | <p> |
| … | |
… | |
| 894 | on whether or not you want to automate the kernel compilation process. |
868 | on whether or not you want to automate the kernel compilation process. |
| 895 | </p> |
869 | </p> |
| 896 | |
870 | |
| 897 | </body> |
871 | </body> |
| 898 | </section> |
872 | </section> |
| 899 | |
|
|
| 900 | </chapter> |
873 | </chapter> |
| 901 | |
874 | |
| 902 | </guide> |
875 | </guide> |