-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathch02.xml
584 lines (494 loc) · 19.2 KB
/
ch02.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
<chapter id="LKN-chapter-requirements">
<title>Requirements for building and using the kernel</title>
<para>
This chapter describes the programs you need
to configure a kernel, build it, and successfully
boot it. It's a smart idea to consult the file
<filename>Documentation/Changes</filename> to verify the specific
version number you should have of each
tool described in this chapter. This chapter was based on the 2.6.18
kernel, and describes the versions of tools that work with that
kernel.
If you are using a different kernel, please verify that you
have the required versions as specified in this file, or things
might not work properly and it can be very hard to determine what went
wrong.
</para>
<!--
Taken from 2.6.18 Documenation/Changes:
o Gnu C 3.2 # gcc - -version
o Gnu make 3.79.1 # make - -version
o binutils 2.12 # ld -v
o util-linux 2.10o # fdformat - -version
o module-init-tools 0.9.10 # depmod -V
o e2fsprogs 1.29 # tune2fs
o jfsutils 1.1.3 # fsck.jfs -V
o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
o xfsprogs 2.6.0 # xfs_db -V
o pcmciautils 004
o pcmcia-cs 3.1.21 # cardmgr -V
o quota-tools 3.09 # quota -V
o PPP 2.4.0 # pppd - -version
o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
o nfs-utils 1.0.5 # showmount - -version
o procps 3.2.0 # ps - -version
o oprofile 0.9 # oprofiled - -version
o udev 081 # udevinfo -V
-->
<sect1>
<title>Tools to build the kernel</title>
<para>
Most Linux distributions offer an installation option to install a
range of <literal>Kernel Hacking</literal> packages. If your distribution
offers this option, it is easiest to install this instead of
trying to track down all of the individual programs that are needed for
this task.
</para>
<para>
Only three packages that are needed in order to
successfully build a kernel: a compiler, a linker, and a make
utility. This section describes the contents of each package.
</para>
<sect2>
<title>Compiler</title>
<para>
The Linux kernel is written in the C programming language, with a small
amount of assembly language in some places. To build the kernel, the GCC C compiler must be
used. Most Linux distributions have a package entitiled
<literal>gcc</literal> that should be installed. If you wish to download
the compiler and build it yourself, you can find it at
<systemitem role="url">http://gcc.gnu.org</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 3.2 version of GCC is the oldest that can
properly build a working kernel. Be warned that getting
the most recent GCC version is not always a good idea. Some of the newest GCC
releases don't build the kernel properly, so unless you wish to
help debug compiler bugs, it is not recommended that you try them out.
</para>
<para>
To determine which version of <literal>gcc</literal> you have on your system, run the following command:
<screen>
$ <userinput>gcc --version</userinput>
</screen>
</para>
</sect2>
<sect2>
<title>Linker</title>
<para>
The C compiler, <literal>gcc</literal>, does not do all of the compiling on
its own. It needs an additional set of tools known as
<literal>binutils</literal> to do the linking and assembling of source
files. The <literal>binutils</literal> package also contains useful
utilities that can manipulate object files in lots of useful ways,
such as to view the contents of a library.
</para>
<para>
<literal>binutils</literal> can usually be found in a distribution package
called (not surprisingly) <literal>binutils</literal>. If you wish to download
and install the package yourself, you can find it at
<systemitem role="url">http://www.gnu.org/software/binutils</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 2.12 release of
<literal>binutils</literal> is the oldest that can
successfully link the kernel.
To determine which version of <literal>binutils</literal> you have on your system, run the following command:
<screen>
$ <userinput>ld -v</userinput>
</screen>
</para>
</sect2>
<sect2>
<title>Make</title>
<para>
<literal>make</literal> is a tool that walks the kernel source tree to
determine which files need to be compiled, and then calls the compiler and
other build tools to do the work in building the kernel. The kernel
requires the GNU version of <literal>make</literal>, which can usually be found in a package
called <literal>make</literal> for your distribution.
</para>
<para>
If you wish to download and install <literal>make</literal> youself,
you can find it at
<systemitem role="url">http://www.gnu.org/software/make</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 3.79.1 release of <literal>make</literal> is the oldest that can
properly build the kernel. It is recommended that you install
the latest stable version of <literal>make</literal>, because newer versions are known
to work faster at processing the build files.
</para>
<para>
To determine which version of <literal>make</literal> you have on your system, run the following command:
<screen>
$ <userinput>make --version</userinput>
</screen>
</para>
</sect2>
</sect1>
<sect1>
<title>Tools to use the kernel</title>
<para>
While the version of the kernel that is running does not usually affect any user
application, there are a small number of program for which the kernel
version is important.
This section describes a number of tools that are probably
already installed on your Linux system. If you upgrade your
kernel to a version different from the one that came with your distribution, some
of these packages may also need to be upgraded in order for the system to
work properly.
</para>
<sect2>
<title>util-linux</title>
<para>
The <literal>util-linux</literal> package is a collection of small
utilities that do a wide range of different tasks. Most of these utilities
handle the mounting and creation of disk partitions and manipulation of the
hardware clock in the system.
<!--
AO: No need to tell them to look in the package to find out what's
in the package.
-->
</para>
<para>
If you wish to download and install the <literal>util-linux</literal>
package yourself, you can find it at
<systemitem role="url">http://www.kernel.org/pub/linux/utils/util-linux</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 2.10o release of
<literal>util-linux</literal> is the oldest that works properly .
It is recommended that you install the latest version of this package,
because new version support new features added to the kernel.
Bind mounts are one example of an
option in newer kernels, and a newer version of
<literal>util-linux</literal> is needed in order to have them work
properly.
</para>
<para>
To determine which version of the <literal>util-linux</literal> package you
have on your system, run the following command:
<screen>
$ <userinput>fdformat --version</userinput>
</screen>
</para>
</sect2>
<sect2>
<title><literal>module-init-tools</literal></title>
<para>
The <literal>module-init-tools</literal> package is needed if you wish to
use Linux kernel modules. A kernel module is a loadable chunk of code that
can be added to or removed from the kernel while the kernel is running. It
is useful to compile device drivers as modules and then load only the
ones that correspond to the hardware present in the system. All Linux distributions
use modules in order to load only the needed drivers and options for the
system based on the hardware present, instead of being forced to build all
possible drivers and options in the kernel in one large chunk. By
using modules, memory is saved by loading just the code that is needed to
control the machine properly.
</para>
<para>
The kernel module loading process underwent a radical change in the 2.6
kernel release. The linker for the module
(the code that resolves all symbols and figures out how to put the pieces
together in memory) is now built into the kernel, which makes the userspace
tools quite small. Older distributions have a package called
<literal>modutils</literal> that does not work properly with the 2.6
kernel. The <literal>module-init-tools</literal> package is what you need
to get the 2.6 kernel to work properly with modules.
</para>
<para>
If you wish to download and install the <literal>module-init-tools</literal>
package yourself, you can find it at
<systemitem role="url">http://www.kernel.org/pub/linux/utils/kernel/module-init-tools</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 0.9.10
release of
<literal>module-init-tools</literal> is the oldest version that works properly . It is recommended that the latest version of this package be
installed, as new features added to the kernel can be used
by newer versions of this package. Blacklisting modules to prevent them
from being automatically loaded by the <literal>udev</literal> package is
one such option that is present in newer versions of
<literal>module-init-tools</literal>, but not older ones.
</para>
<para>
To determine which version of the <literal>module-init-tools</literal>
package you have on your system, run the following command:
<screen>
$ <userinput>depmod -V</userinput>
</screen>
</para>
</sect2>
<sect2>
<title>Filesystem-specific tools</title>
<para>
A wide range of tools specific to particular filesystems are necessary to
create, format, configure, and fix disk partitions. The
<literal>util-linux</literal> package has a few of these utilities, but
some of the more popular filesystems have separate packages that contain the
necessary programs.
</para>
<sect3>
<title>ext2/ext3/ext4</title>
<para>
The <literal>ext3</literal> and experimental <literal>ext4</literal>
filesystems are upgrades of <literal>ext2</literal> and can be
managed with the same tools; any recent version of an
<literal>ext2</literal>-based tool can work with the other two
filesystems as well.
</para>
<para>
To work with any of these filesystems, you must have the
<literal>e2fsprogs</literal> package.
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://e2fsprogs.sourceforge.net</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the
1.29 release of
<literal>e2fsprogs</literal> is the oldest that works properly with the kernel. It is highly recommended that you use the newest version
in order to take advantage of newer features in the <literal>ext3</literal> and <literal>ext4</literal>
filesystems.
</para>
<para>
To determine which version of <literal>e2fsprogs</literal> you have
on your system, run the following command:
<screen>
$ <userinput>tune2fs</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>JFS</title>
<para>
To use the JFS filesystem from IBM, you must have the <literal>jfsutils</literal> pacakge.
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://jfs.sourceforge.net</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 1.1.3 release of
<literal>jfsutils</literal> is the oldest that works properly with the kernel.
To determine which version of <literal>jfsutils</literal> you have
on your system, run the following command:
<screen>
$ <userinput>fsck.jfs -V</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>ReiserFS</title>
<para>
To use the ReiserFS filesystem, you must have the <literal>reiserfsprogs</literal> package.
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://www.namesys.com/download.html</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 3.6.3 release of
<literal>reiserfsprogs</literal> is the oldest that works properly with the kernel.
To determine which version of <literal>reiserfsprogs</literal> you have
on your system, run the following command:
<screen>
$ <userinput>reiserfsck -V</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>XFS</title>
<para>
To use the XFS filesystem from SGI, you must have the
<literal>xfsprogs</literal> package.
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://oss.sgi.com/projects/xfs</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 2.6.0 release of
<literal>xfsprogs</literal> is the oldest that works properly with the kernel.
To determine which version of <literal>xfsprogs</literal> you have
on your system, run the following command:
<screen>
$ <userinput>xfs_db -V</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>Quotas</title>
<para>
To use the quota functionality of the kernel, you must have the
<literal>quota-tools</literal> package.
<footnote>
<para>
Some distributions, notably Debian, call this package <literal>quota</literal>
instead of <literal>quota-tools</literal>.
</para>
</footnote>
This package includes programs that let you set quotas on users, provide
statistics on the amount of quota being used by different users, and issue
warnings when people get too close to using up their available filesystem
quota.
</para>
<para>
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://sourceforge.net/projects/linuxquota</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 3.09 release of
<literal>quota-tools</literal> is the oldest that works properly with the kernel.
To determine which version of <literal>quota-tools</literal> you have
on your system, run the following command:
<screen>
$ <userinput>quota -V</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>NFS</title>
<para>
To use the NFS filesystem properly, you must have the
<literal>nfs-utils</literal> package.
<footnote>
<para>
Some distributions, notably Debian, call this package
<literal>nfs-common</literal> instead of <literal>nfs-utils</literal>.
</para>
</footnote>
This package includes programs that let you mount NFS partitions as a
client, and run an NFS server.
</para>
<para>
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://nfs.sf.net</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 1.0.5 release of
<literal>nfs-utils</literal> is the oldest that works properly with the kernel
To determine which version of <literal>nfs-utils</literal> you have
on your system, run the following command:
<screen>
$ <userinput>showmount --version</userinput>
</screen>
</para>
</sect3>
</sect2>
<sect2>
<title>Other tools</title>
<para>
There are a few other important programs that are closely tied to the
kernel version. These programs are not usually required in order for the
kernel to work properly, but they enable access to different types of
hardware and functions.
</para>
<sect3>
<title><literal>udev</literal></title>
<para>
<literal>udev</literal> is a program that enables Linux to provide a
persistent device naming system in the <filename>/dev</filename> directory.
It also provides a dynamic <filename>/dev</filename>, much like the
one provided by the older
(and now removed) <literal>devfs</literal> filesystem.
Almost all Linux distributions use <literal>udev</literal> to manage the
<filename>/dev</filename> directory, so it is required in order to properly
boot the machine.
</para>
<para>
Unfortunately, <literal>udev</literal> relies on the structure of
<filename>/sys</filename>, which has been known to change from time to time
with kernel releases. Some of these changes in the past have been known to
break <literal>udev</literal>, so that your machine will not boot properly.
If you have the latest version of <literal>udev</literal> recommended
by your kernel kernel, and have problems with it working properly, please
contact the <literal>udev</literal> developers on the mailing list
available at
<!--
AO: I think role="email" works, but I'm not sure.
-->
<systemitem role="email">[email protected]</systemitem>.
</para>
<para>
It is highly recommended that you use the version of
<literal>udev</literal> that comes with your Linux distribution, as it is
tied into the distribution specific boot process very tightly. But if you
wish to upgrade <literal>udev</literal> on your own, you can find it at
<systemitem role="url">http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 081 release of
<literal>udev</literal> is the oldest that works properly with the kernel.
It is recommended that you use the latest version of
<literal>udev</literal>, because
it will work better with newer kernels, due to changes
in how <literal>udev</literal> and the kernel communicate.
</para>
<para>
To determine which version of <literal>udev</literal> you have
on your system, run the following command:
<screen>
$ <userinput>udevinfo -V</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>Process tools</title>
<para>
The package <literal>procps</literal> includes the commonly used tools
<literal>ps</literal> and <literal>top</literal>, as well as many other
handy tools for managing and monitoring processes running on the system.
</para>
<para>
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">http://procps.sourceforge.net</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 3.2.0 release of
<literal>procps</literal> is the oldest that works properly with the kernel.
To determine which version of <literal>procps</literal> you have
on your system, run the following command:
<screen>
$ <userinput>ps --version</userinput>
</screen>
</para>
</sect3>
<sect3>
<title>PCMCIA tools</title>
<para>
In order to properly use PCMCIA devices with Linux, a userspace helper
program must be used to set up the devices. For older kernel versions,
this program was called <literal>pcmcia-cs</literal>, but that has been
replaced with a much simpler system called <literal>pcmciautils</literal>.
If you wish to use PCMCIA devices, you must have this package installed for
them to work properly.
</para>
<para>
If you wish to download and install this package yourself, you can find it at
<systemitem role="url">ftp://ftp.kernel.org/pub/linux/utils/kernel/pcmcia</systemitem>.
</para>
<para>
As of the 2.6.18 kernel release, the 004 release of
<literal>pcmciautils</literal> is the oldest that works properly with the kernel. But the latest version is recommended in
order to take advantage of newer features in the PCMCIA subsystem, such as
automatic driver loading when new devices are found.
</para>
<para>
To determine which version of <literal>pcmciautils</literal> you have
on your system, run the following command:
<screen>
$ <userinput>pccardctl -V</userinput>
</screen>
</para>
</sect3>
<!-- gkh: Include the other tools not mentioned:
PPP
isdn4k-utils
oprofile
???
Personally, I think we have enough, and have hit the common
things that most people would need to care about.
AO: The only tool I've heard of in the list above is PPP. It is
certainly still useful, but it could be considered a separate
application.
-->
</sect2>
</sect1>
</chapter>
<!-- vim: set ai tw=80 : -->