/[gentoo]/xml/htdocs/doc/en/migration-to-2.6.xml
Gentoo

Contents of /xml/htdocs/doc/en/migration-to-2.6.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations) (download) (as text)
Thu Aug 25 10:59:31 2005 UTC (9 years, 4 months ago) by neysx
Branch: MAIN
Changes since 1.17: +78 -80 lines
File MIME type: application/xml
Improved coding style  **No Content Change**

1 neysx 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3    
4 neysx 1.18 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/migration-to-2.6.xml,v 1.17 2005/08/25 00:52:49 vapier Exp $ -->
5 neysx 1.1
6     <guide link="/doc/en/migration-to-2.6.xml">
7    
8     <title>The complete Gentoo Linux 2.6 migration guide</title>
9    
10     <author title="Author">
11 neysx 1.18 <mail link="dsd@gentoo.org">Daniel Drake</mail>
12 neysx 1.1 </author>
13     <author title="Contributor">
14 neysx 1.18 <mail link="sergey_zlodey@mail.ru">Sergey Galkin</mail>
15 neysx 1.1 </author>
16     <author title="Contributor">
17 neysx 1.18 <mail link="svyatogor@gentoo.org">Sergey Kuleshov</mail>
18 neysx 1.1 </author>
19     <author title="Editor">
20 neysx 1.18 <mail link="neysx@gentoo.org">Xavier Neys</mail>
21 neysx 1.1 </author>
22 bennyc 1.3 <author title="Editor">
23 neysx 1.18 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
24 bennyc 1.3 </author>
25 neysx 1.1
26     <abstract>
27     This document will aid you in the process of migrating from Linux 2.4 to Linux
28 swift 1.9 2.6, devfs to udev, OSS to ALSA, and LVM to LVM2.
29 neysx 1.1 </abstract>
30    
31 vapier 1.17 <version>0.2.7</version>
32     <date>2005-08-24</date>
33 neysx 1.1
34     <chapter>
35     <title>Introduction</title>
36    
37     <section>
38     <title>Whats new in Linux 2.6?</title>
39     <body>
40    
41     <p>
42 neysx 1.18 That is no easy question to answer. Linux 2.6 is the result of over 2 years of
43     rapid development and stabilisation of new features, and is architectually
44 neysx 1.1 quite different from its 2.4 counterpart. Some of the more major changes are
45     listed below:
46     </p>
47    
48     <ul>
49     <li>
50     Scheduler/Interactivity improvements: Linux feels very smooth on desktop
51     systems and copes much better than 2.4 while under load
52     </li>
53     <li>
54     Scalability: Linux now scales much better at both ends - on small embedded
55     devices and also systems with many processors
56     </li>
57     <li>Performance: Throughput from common applications is much improved</li>
58     <li>
59     Hardware support: Linux now supports many more architectures and hardware
60     devices out-of-the-box than any other operating system.
61     </li>
62     </ul>
63    
64     <p>
65     Joseph Pranevich has written a very detailed document, <uri
66     link="http://www.kniggit.net/wwol26.html">The Wonderful World Of Linux
67     2.6</uri> which you may be interested to glance over. If you are interested in
68     the more technical details, you can refer to <uri
69     link="http://www.linux.org.uk/~davej/docs/post-halloween-2.6.txt">The
70     post-halloween document</uri> - but bear in mind that this is somewhat outdated
71     now.
72     </p>
73    
74     </body>
75     </section>
76     <section>
77     <title>What is udev?</title>
78     <body>
79    
80     <p>
81     In the past, Gentoo has instructed users to use <e>devfs</e> for managing the
82     /dev directory, which contains a series of device interfaces to allow system
83     applications to communicate with hardware (through the kernel).
84     </p>
85    
86     <p>
87     <e>devfs</e>, whilst a good concept, has some internal problems, and has been
88 yoswink 1.16 marked obsolete in Linux 2.6.
89 neysx 1.1 </p>
90    
91     <p>
92     <e>udev</e> is the new way of managing device nodes. It addresses issues with
93     previous device managers, and also attempts to solve some other problems.
94     </p>
95    
96     <p>
97     The above may not mean much to you, but fear not, the hard working Gentoo
98     developers have put effort into making the migration from devfs very easy.
99     </p>
100    
101     </body>
102     </section>
103     <section>
104     <title>What is ALSA?</title>
105     <body>
106    
107     <p>
108     With Linux 2.4, chances are that you used OSS (open sound system) drivers to
109     power your sound card. OSS has been replaced by a newer and better set of sound
110     drivers: ALSA.
111     </p>
112    
113     <p>
114     ALSA, the Advanced Linux Sound Architecture, is a new set of sound drivers with
115     a new and improved API, present in the Linux 2.6 kernel. It is backwards
116     compatible with OSS applications, provided that you select the right kernel
117     configuration options!
118     </p>
119    
120     <note>
121     If you do not have any sound/audio hardware, you can safely skip over any
122     ALSA-related instructions in this document.
123     </note>
124    
125     </body>
126     </section>
127 swift 1.9 <section>
128     <title>What is LVM?</title>
129     <body>
130    
131     <p>
132     <e>Logical Volume Management</e> (LVM) exists as set of tools allowing you to
133     manage your disk storage in a very flexible manner. Amongst other things, it
134     allows powerful control over partitions (e.g. resizing without reboot), and
135     makes operations like device changes relatively simple. LVM acts as an
136     alternative to standard partition-based disk management.
137     </p>
138    
139     <p>
140     LVM support has historically been implemented in Linux 2.4. Linux 2.6 features
141     a new version of LVM, named <e>LVM2</e>. The migration process requires you to
142     install new versions of the user-level tools (covered later in this document)
143     but will leave your data intact!
144     </p>
145    
146     <p>
147     <e>If you do not currently use LVM for data-storage management, then LVM2
148     migration does not apply to you.</e> If this is the case, you can safely ignore
149     any parts of this document referencing LVM/LVM2. Upgrading to Linux 2.6 does
150 neysx 1.18 <e>not</e> require you to store your data on LVM partitions - you can keep your
151     data in the standard partition-format as it always has been.
152 swift 1.9 </p>
153    
154     <p>
155     If you are not a LVM user, but you think LVM2 sounds useful for you, you can
156 neysx 1.18 convert your disks to this format at a later date, by following the <uri
157     link="/doc/en/lvm2.xml">Gentoo LVM2 Installation Guide</uri>. For now, lets
158     just concentrate on getting a smooth 2.6 migration underway.
159 swift 1.9 </p>
160    
161     </body>
162     </section>
163 neysx 1.1 </chapter>
164    
165     <chapter>
166     <title>Preparation</title>
167     <section>
168     <title>Get your system up-to-date</title>
169     <body>
170    
171     <p>
172     Some of the changes brought in with Linux 2.6 also required some changes in the
173     base system applications. Before continuing, you should ensure that your system
174     is relatively up-to-date, and to be perfectly sure, you should update all world
175     and system packages where updates are available.
176     </p>
177    
178     <p>
179     In particular, make sure you have the latest stable versions of the following
180     packages:
181     </p>
182    
183     <ul>
184     <li><c>sys-apps/baselayout</c></li>
185     <li><c>sys-apps/util-linux</c></li>
186     <li>
187     <c>sys-kernel/genkernel</c> (only if you wish to use genkernel as opposed
188     to manual configuration)
189     </li>
190     </ul>
191    
192     <pre caption="Updating all world packages">
193 cam 1.11 # <i>emerge --sync</i>
194 neysx 1.1 # <i>emerge -ua world</i>
195     </pre>
196    
197     </body>
198     </section>
199     <section>
200     <title>modutils vs module-init-tools</title>
201     <body>
202    
203     <p>
204     <c>sys-apps/modutils</c> is the package that provides tools such as
205     <c>modprobe</c>, <c>rmmod</c> and <c>insmod</c> for Linux 2.4.
206     </p>
207    
208     <p>
209     Linux 2.6 introduces a new module format, and therefore requires new tools for
210     handling modules. These are bundled up into the
211 neysx 1.18 <c>sys-apps/module-init-tools</c> package.
212     </p>
213 neysx 1.1
214     <p>
215     You should now remove modutils and install module-init-tools:
216     </p>
217    
218     <pre caption="Switching from modutils to module-init-tools">
219 cam 1.11 # <i>emerge --unmerge sys-apps/modutils</i>
220 neysx 1.1 # <i>emerge module-init-tools</i>
221     </pre>
222    
223     <note>
224     Don't worry - even though you have just unmerged modutils, module-init-tools
225 neysx 1.18 provides backwards compatibility for Linux 2.4, so you will still be able to
226     boot into Linux 2.4 and handle modules for that kernel.
227 neysx 1.1 </note>
228    
229     <note>
230     For the above reason, module-init-tools might already be installed and working
231     with your existing Linux 2.4 kernel. In this case, you don't need to worry
232     about this stage - your system is already ready to deal with Linux 2.6 modules.
233     </note>
234    
235     </body>
236     </section>
237     <section>
238     <title>Installing udev</title>
239     <body>
240    
241     <p>
242     There is no configuration involved here. Simply use <c>emerge</c> to install
243     udev:
244     </p>
245    
246     <pre caption="Installing udev">
247     # <i>emerge -a udev</i>
248     </pre>
249    
250 swift 1.7 <p>
251 neysx 1.18 You should now read the <uri link="/doc/en/udev-guide.xml">Gentoo udev
252     Guide</uri> to get a more complete idea about the differences between udev and
253     devfs.
254 swift 1.7 </p>
255    
256 neysx 1.1 </body>
257     </section>
258     <section>
259 swift 1.5 <title>Checking for essential device nodes</title>
260     <body>
261    
262     <p>
263     When the system boots up, the system requires some essential device nodes. As
264     udev is not included in the kernel, it is not activated immediately. To work
265     around this, you must ensure that you have some essential device nodes on your
266     disk.
267     </p>
268    
269     <p>
270     Our installation stage files will have created the required devices during the
271     initial installation. However, some users have reported that this is not the
272     case. We will use this opportunity to check that the device files exist, and
273     create them if they do not.
274     </p>
275    
276     <p>
277     As your existing device manager will be mounted at /dev, we cannot access it
278     directly. So we will bind-mount your root partition to another location and
279     access the /dev directory from there.
280     </p>
281    
282     <pre caption="Bind-mounting your root partition and listing static devices">
283     # <i>mkdir -p /mnt/temp</i>
284     # <i>mount -o bind / /mnt/temp</i>
285     # <i>cd /mnt/temp/dev</i>
286     # <i>ls -l console null</i>
287     </pre>
288    
289     <p>
290     If the above <e>ls</e> command reported that either <c>console</c> or
291     <c>null</c> do not exist, then you must create them yourself, as shown below.
292     </p>
293    
294     <pre caption="Creating the missing console and null nodes">
295     # <i>mknod -m 660 console c 5 1</i>
296     # <i>mknod -m 660 null c 1 3</i>
297     </pre>
298    
299     <p>
300     You should now unmount your bind-mounted root partition, even if you did not
301     have to create those devices:
302     </p>
303    
304     <pre caption="Unmounting the bind-mounted root">
305 swift 1.7 # <i>cd</i>
306 swift 1.5 # <i>umount /mnt/temp</i>
307 swift 1.6 # <i>rmdir /mnt/temp</i>
308 swift 1.5 </pre>
309    
310     </body>
311     </section>
312     <section>
313 neysx 1.1 <title>Installing ALSA utilities</title>
314     <body>
315    
316     <p>
317     ALSA requires you to have some packages installed, so that applications can use
318     the ALSA API. These packages will also allow you to control the mixer and
319     volume levels. Install the required utilities as follows:
320     </p>
321    
322     <pre caption="Installing ALSA utilities and libraries">
323     # <i>emerge -a alsa-lib alsa-utils alsa-tools alsa-headers alsa-oss</i>
324     </pre>
325    
326     </body>
327     </section>
328     </chapter>
329    
330     <chapter>
331     <title>Installing the Linux 2.6 sources</title>
332    
333     <section>
334     <title>Choosing and installing a kernel</title>
335     <body>
336    
337     <p>
338     The first thing you need to do is install sources of a 2.6 kernel of your
339     choice. The two Gentoo-supported 2.6 kernels are currently
340 swift 1.13 <e>gentoo-sources</e> (for desktops) and <e>hardened-dev-sources</e> (for
341 neysx 1.1 servers). There are others available, see the <uri
342     link="/doc/en/gentoo-kernel.xml">Gentoo Linux Kernel Guide</uri> for more
343     choices.
344     </p>
345    
346     <p>
347 swift 1.13 In this guide, we'll use <c>gentoo-sources</c> as an example. Install your
348 neysx 1.1 chosen set of kernel sources using the <c>emerge</c> utility:
349     </p>
350    
351 swift 1.13 <pre caption="Installing gentoo-sources">
352     # <i>emerge -a gentoo-sources</i>
353 neysx 1.1 These are the packages that I would merge, in order:
354     Calculating dependencies ...done!
355 swift 1.13 [ebuild NS ] sys-kernel/gentoo-sources-2.6.10-r4
356 neysx 1.1
357     Do you want me to merge these packages? [Yes/No] <i>y</i>
358     </pre>
359    
360 swift 1.13 <p>
361     When performing the above <c>emerge</c> command, if you find that it wants to
362     install a 2.4 version of gentoo-sources (e.g. <c>gentoo-sources-2.4.26</c>),
363     then it means that the profile you are using is not designed for Linux 2.6
364 neysx 1.18 users. Please follow the <uri link="/doc/en/gentoo-upgrading.xml">Gentoo
365     Upgrading Document</uri> to switch to a 2.6-based profile, and retry installing
366     2.6 kernel sources.
367 swift 1.13 </p>
368    
369 neysx 1.1 </body>
370     </section>
371     <section>
372     <title>Updating the /usr/src/linux symbolic link</title>
373     <body>
374    
375     <p>
376     Various components of the Gentoo utilities rely on /usr/src/linux being a
377     symbolic link to the kernel sources that you are running (or wish to compile
378     against).
379     </p>
380    
381     <p>
382     We will now update our /usr/src/linux link to point at the kernel sources we
383     just installed. Continuing our example:
384     </p>
385    
386     <pre caption="Updating the /usr/src/linux softlink">
387     # <i>cd /usr/src</i>
388 swift 1.13 # <i>ln -sfn linux-2.6.10-gentoo-r4 linux</i>
389 neysx 1.1 </pre>
390    
391     </body>
392     </section>
393     </chapter>
394    
395 swift 1.7 <chapter id="pitfalls">
396 neysx 1.1 <title>Known pitfalls with Linux 2.6 migration</title>
397     <section>
398     <body>
399    
400     <p>
401     Before we get stuck into configuring the kernel, I'll attempt to detail the
402     most common errors that people make when migrating to Linux 2.6, as some of
403     these points will influence the way you configure the new kernel.
404     </p>
405    
406     <note>
407     Not all of these points are relevant at this stage, but I will detail them all
408     here in one place, and you can refer back at your leisure.
409     </note>
410    
411     </body>
412     </section>
413     <section>
414     <title>Don't use "make oldconfig" with a 2.4 .config</title>
415     <body>
416    
417     <note>
418     If you don't understand what this means, don't worry, you won't make this
419     mistake if you follow the rest of this guide correctly.
420     </note>
421    
422     <p>
423     You'll be asked many many questions, since there have been a large amount of
424     changes. Many people who do try a <c>make oldconfig</c> from a 2.4 config end
425     up creating an unworkable kernel (e.g. no output on-screen, no input from
426     keyboard, etc). Please save yourself the trouble, and use the traditional
427     <c>menuconfig</c> configuration method just this once.
428     </p>
429    
430     </body>
431     </section>
432     <section>
433     <title>Don't use ide-scsi for CD/DVD writing</title>
434     <body>
435    
436     <p>
437     In Linux 2.4, the only way to achieve good CD/DVD writing results was to enable
438     the (rather ugly) <c>ide-scsi</c> emulation. Thankfully, the IDE layer in Linux
439     2.6 has been extended to support CD/DVD writers much better.
440     </p>
441    
442     <p>
443     You don't need to enable any extra options to support CD writing. Just be sure
444     <e>not</e> to enable <c>ide-scsi</c> as you used to.
445     </p>
446    
447     </body>
448     </section>
449     <section>
450     <title>PC Speaker is now a configurable option</title>
451     <body>
452    
453     <p>
454     You won't get your normal console beeps (or any response from the PC speaker at
455     all) unless you specifically enable the new PC speaker option
456     (<c>CONFIG_INPUT_PCSPKR</c>):
457     </p>
458    
459     <pre caption="Location of PC speaker option">
460     Device Drivers ---&gt;
461     Input device support ---&gt;
462     [*] Misc
463     &lt;*&gt; PC Speaker support
464     </pre>
465    
466     <note>
467     By "PC speaker", I am referring to the analogue speaker that beeps once when
468     your system is powering up, I am not referring to normal sound hardware used
469     for playing music, etc.
470     </note>
471    
472     </body>
473     </section>
474     <section>
475     <title>New USB Storage block device driver sometimes problematic</title>
476     <body>
477    
478     <p>
479     Very recently, a new USB storage device driver has been added to the kernel.
480     At the time of writing, this driver ("ub") is still in its early stages and
481     some users find it to be unreliable. If you have problems accessing your USB
482     hard disk, USB flash disk, USB card reader, or USB digital camera, then you
483     could try reverting to the older SCSI-style driver:
484     </p>
485    
486     <pre caption="Disabling ub">
487     Device Drivers ---&gt;
488     Block devices ---&gt;
489     &lt; &gt; Low Performance USB Block driver
490     </pre>
491    
492     <note>
493     The older SCSI-style driver (USB Mass Storage support) is enabled by default.
494     It can be found under "Device Drivers --&gt; USB support", but will generally
495     not come into effect while ub is also present.
496     </note>
497    
498     </body>
499     </section>
500     <section>
501     <title>usbdevfs renamed to usbfs</title>
502     <body>
503    
504     <p>
505     If you have edited your <path>/etc/fstab</path> file to customise the way that
506     the USB device filesystem gets mounted, you may have to modify the filesystem
507     type from <e>usbdevfs</e> to <e>usbfs</e>.
508     </p>
509    
510     <note>
511     Recent 2.4 kernels will also allow you to use "usbfs" as well as "usbdevfs", so
512     you aren't breaking any backwards compatibility by doing this.
513     </note>
514    
515     </body>
516     </section>
517     <section>
518     <title>Don't renice X</title>
519     <body>
520    
521     <p>
522     If you are a desktop 2.4 user, you may have hacked your system into running X
523     at a higher priority, as in some cases it seems to provide better desktop
524     performance.
525     </p>
526    
527     <p>
528     There have been many scheduler changes in 2.6 which change this behaviour. If
529     you continue to run X at a higher priority, it will do exactly what it is
530     supposed to (run the <e>display server</e> at a very high priority) and you
531     will notice consequences such as sound stuttering and slow application load
532     times because your CPU is spending too long serving X and only X.
533     </p>
534    
535     <p>
536     In Linux 2.6, you no longer need to renice desktop applications to get good
537     interactivity. Please remove your "niceness" hacks!
538     </p>
539    
540     </body>
541     </section>
542     <section>
543 neysx 1.18 <title>X11 config file should now use /dev/input/mice for PS/2 and USB mice</title>
544 neysx 1.1 <body>
545    
546     <p>
547     One of the changes that a default udev configuration introduces is different
548     organisation of the mouse device nodes. Previously, you would have had nodes
549     such as <path>/dev/psaux</path> and <path>/dev/mouse</path>. You will now have
550     nodes such as <path>/dev/input/mouse0</path>, <path>/dev/input/mouse1</path>,
551     and a collective <path>/dev/input/mice</path> node which combines movements
552     from all mice.
553     </p>
554    
555     <p>
556     Since the old X configurations typically reference <path>/dev/mouse</path> or
557     <path>/dev/psaux</path> then you may get an error similar to the one shown
558     below when you attempt to start X11:
559     </p>
560    
561     <pre caption="Common error when starting X on a udev system for the first time">
562     (EE) xf86OpenSerial: Cannot open device /dev/mouse
563 neysx 1.18 No such file or directory.
564 neysx 1.1 (EE) Mouse0: cannot open input device
565     (EE) PreInit failed for input device "Mouse0"
566     No core pointer
567     </pre>
568    
569     <p>
570     To correct this, open your X11 config in a text editor, and update the mouse
571     <e>InputDevice</e> section to use the <path>/dev/input/mice</path> device. An
572     example is shown below:
573     </p>
574    
575     <pre caption="Opening your X11 config file">
576     # <i>nano -w /etc/X11/xorg.conf</i>
577     </pre>
578    
579     <note>
580     If you are still using XFree86, your config file will be
581     <path>/etc/X11/XF86Config</path>
582     </note>
583    
584     <pre caption="Sample mouse InputDevice section">
585     Section "InputDevice"
586 neysx 1.18 Identifier "Mouse0"
587     Driver "mouse"
588     Option "Protocol" "auto"
589     Option "Device" "/dev/input/mice"
590 neysx 1.1 EndSection
591     </pre>
592    
593 swift 1.12 <note>
594     If you are using a serial mouse, the new device path will be
595     <path>/dev/tts/0</path> instead of <path>/dev/ttyS0</path>.
596     </note>
597    
598 neysx 1.1 </body>
599     </section>
600 swift 1.8 <section>
601     <title>New Serial-ATA (SATA) drivers name the devices differently</title>
602     <body>
603    
604     <p>
605     If you used the original Serial ATA drivers under Linux 2.4, you probably
606     observed your SATA devices having names such as <c>/dev/hde</c>.
607     </p>
608    
609     <p>
610 neysx 1.18 Linux 2.6 introduces some new SATA drivers (libata) which are based on the SCSI
611     subsystem. As these drivers are based on SCSI, your SATA disks will now show up
612     as SCSI devices. Your first SATA disk will be named <c>/dev/sda</c>. You will
613     need to update your <c>/etc/fstab</c> file to reflect this, and you will need
614     to bear this in mind when choosing the root/real_root kernel boot parameter
615     later on.
616 swift 1.8 </p>
617    
618     <note>
619     libata has been backported into recent versions of Linux 2.4, so you may
620     already be familiar with the new device naming.
621     </note>
622    
623     </body>
624     </section>
625     <section>
626     <title>bootsplash no longer maintained</title>
627     <body>
628    
629     <p>
630     If you used the <c>gentoo-sources-2.4</c> kernel, you may have used the
631     <e>bootsplash</e> functionality in order to provide yourself with a colourful
632     framebuffer console.
633     </p>
634    
635     <p>
636     The developer of bootsplash appears to have lost interest in his project, given
637     some design problems. However, Gentoo developer <e>Michal Januszewski</e> is
638     developing a successor, <c>gensplash</c>, which in included in the
639 neysx 1.18 gentoo-sources-2.6 kernel. You can follow Michal's <uri
640     link="http://dev.gentoo.org/~spock/projects/gensplash/archive/gensplash-in-5-easy-steps.txt">
641 swift 1.8 Gensplash in 5 easy steps</uri> document in order to familiarize yourself with
642     how gensplash is operated.
643     </p>
644    
645     </body>
646     </section>
647     <section>
648     <title>I2C drivers now included in the kernel</title>
649     <body>
650    
651     <p>
652     If you use <c>lm-sensors</c> to monitor system temperatures and power levels,
653     you previously needed to install the <c>i2c</c> package in order to provide
654     hardware support.
655     </p>
656    
657     <p>
658     The I2C hardware drivers are now included in the Linux 2.6 kernel, no external
659     i2c package is required. Remember to compile support for your specific I2C
660     devices into the kernel configuration. You will then be able to use
661     <c>lm-sensors</c> as usual.
662     </p>
663    
664     </body>
665     </section>
666    
667    
668 neysx 1.1 </chapter>
669    
670     <chapter id="conf">
671     <title>Configuring, building, and installing the kernel</title>
672     <section>
673     <body>
674    
675     <p>
676     As with Linux 2.4, you have two options for managing your new kernel build.
677     </p>
678    
679     <ol>
680     <li>
681     The default method is to configure your kernel manually. This may seem
682     daunting but is the preferred way as long as you know your system. If you
683     wish to configure your new kernel manually, please continue on to the <uri
684     link="#manual">next chapter</uri>.
685     </li>
686     <li>
687     The alternative option is to use our <c>genkernel</c> utility to
688     automatically configure, compile, and install a kernel for you. If you wish
689     to use <c>genkernel</c> then skip over the next chapter and proceed with
690     <uri link="#genkernel">using genkernel</uri>.
691     </li>
692     </ol>
693    
694     </body>
695     </section>
696     </chapter>
697    
698     <chapter id="manual">
699     <title>Default: Manual configuration</title>
700     <section>
701     <title>Configuring the kernel</title>
702     <body>
703    
704     <p>
705     We'll now get on with configuring the kernel. Open menuconfig in the usual way:
706     </p>
707    
708     <pre caption="Invoking menuconfig">
709     # <i>cd /usr/src/linux</i>
710     # <i>make menuconfig</i>
711     </pre>
712    
713     <p>
714     You will probably be familiar with using menuconfig from configuring 2.4
715     kernels. Fortunately, the front end has barely changed at all, but you will
716     observe much better organisation of kernel options, plus <e>many</e> new
717     options that weren't present in 2.4.
718     </p>
719    
720     <p>
721     Be sure to enable the following important kernel options:
722     </p>
723    
724     <pre caption="Required kernel options">
725     File systems ---&gt;
726     Pseudo Filesystems ---&gt;
727     [*] /proc file system support
728     [*] Virtual memory file system support (former shm fs)
729 neysx 1.18
730 neysx 1.1 <comment>(the following are required for udev):</comment>
731     General setup ---&gt;
732     [*] Support for hot-pluggable devices
733    
734     <comment>(the following are required for ALSA):</comment>
735     Device Drivers ---&gt;
736     Sound ---&gt;
737     &lt;*&gt; Sound card support
738     Advanced Linux Sound Architecture ---&gt;
739     &lt;M&gt; Advanced Linux Sound Architecture
740     &lt;M&gt; Sequencer support
741     &lt;M&gt; OSS Mixer API
742     [*] OSS Sequencer API
743     <comment> (and dont forget to select your soundcard from the submenus!)</comment>
744 swift 1.9
745     <comment>(the following are required if you use LVM for disk management):</comment>
746     Device Drivers ---&gt;
747     Multi-device support (RAID and LVM) ---&gt;
748     [*] Multiple devices driver support (RAID and LVM)
749     &lt;*&gt; Device mapper support
750 neysx 1.1 </pre>
751    
752     <warn>
753     Previously you may have included support for the <path>/dev</path> file system
754     (now marked OBSOLETE). Do not enable devfs support. We have installed udev,
755     which we will be using instead of devfs from now on.
756     </warn>
757    
758     <p>
759     Also, remember to enable support for the filesystems that you use, and the
760     hardware present in your system. Be sure to enable support for the IDE
761     controller on your motherboard if you wish to benefit from fast DMA disk
762     access. Refer to the <uri
763     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
764     Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
765 neysx 1.18 Handbook</uri> for additional guidance here.
766 neysx 1.1 </p>
767    
768     </body>
769     </section>
770     <section>
771     <title>Building the kernel</title>
772     <body>
773    
774     <p>
775     Now that we have configured the kernel, we can start the compilation process:
776     </p>
777    
778     <pre caption="Compiling the kernel source">
779     # <i>make &amp;&amp; make modules_install</i>
780     </pre>
781    
782     <note>
783     You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
784     longer required.
785     </note>
786    
787     <p>
788     Wait for the kernel compilation to complete (and observe the much more readable
789     compilation output).
790     </p>
791    
792     </body>
793     </section>
794     <section>
795     <title>Installing the kernel</title>
796     <body>
797    
798     <p>
799     The next step is mounting your <path>/boot</path> partition and copying the
800     kernel image over. You must then update your bootloader config manually.
801     </p>
802    
803     <pre caption="Installing the kernel">
804     # <i>mount /boot</i>
805 swift 1.13 # <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.10-gentoo-r4</i>
806     # <i>cp System.map /boot/System.map-2.6.10-gentoo-r4</i>
807 neysx 1.1 </pre>
808    
809     <p>
810     Note that the above instructions are examples only, you should follow your
811     usual procedure of updating kernels by following the instructions in the <uri
812     link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
813     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
814     Kernel</uri> chapter).
815     </p>
816    
817     <p>
818     When updating your bootloader config, do not remove the old entry pointing at
819     your 2.4 kernel. This way, you will easily be able to switch between the two if
820     something is not working.
821     </p>
822    
823     <p>
824     Now continue onto the <uri link="#modules">Module Configuration</uri> section.
825     </p>
826    
827     </body>
828     </section>
829     </chapter>
830    
831     <chapter id="genkernel">
832     <title>Alternative: Using genkernel</title>
833     <section>
834     <body>
835    
836     <p>
837     If you prefer to use genkernel instead of manually configuring your kernel, you
838     will be happy to hear that using genkernel to produce 2.6 kernels is very
839     similar to the process you performed when producing your previous 2.4 kernel.
840     </p>
841    
842     <p>
843     You should invoke genkernel as shown below:
844     </p>
845    
846     <pre caption="Invoking genkernel with some common arguments">
847     # <i>genkernel --udev --menuconfig --bootloader=grub all</i>
848     </pre>
849    
850     <p>
851     In the above example, we also take advantage of genkernel features to open
852     menuconfig to allow you to customise the kernel configuration (if you wish),
853 neysx 1.18 and to update the grub bootloader configuration after compilation.
854 neysx 1.1 </p>
855    
856     <p>
857     You should choose genkernel arguments that suit you, but do not forget to
858     include the <c>--udev</c> argument! Refer to the <uri
859     link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
860     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
861     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
862     Handbook</uri> for additional information.
863     </p>
864    
865 swift 1.7 <p>
866 neysx 1.18 If you choose to update your bootloader config yourself, then you must remember
867     to include the <c>udev</c> kernel parameter. A sample <e>grub</e> config
868     section is shown below, but remember to adjust the <e>real_root</e> parameter
869     for your system.
870 swift 1.7 </p>
871    
872     <pre caption="Sample GRUB config for genkernel + udev">
873     title=Gentoo Linux (2.6 kernel)
874     root (hd0,0)
875 swift 1.13 kernel /kernel-2.6.10-gentoo-r4 <i>udev</i> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3
876     initrd /initrd-2.6.10-gentoo-r4
877 swift 1.7 </pre>
878    
879 neysx 1.1 </body>
880     </section>
881     </chapter>
882    
883     <chapter id="modules">
884     <title>Module Configuration</title>
885    
886     <section>
887     <title>Installing external modules</title>
888     <body>
889    
890     <p>
891     Many users will additionally rely on kernel modules that are built outside of
892     the kernel tree. Common examples are the binary ATI and Nvidia graphics
893     drivers. You now need to install those modules, which will compile against the
894     2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
895     <c>emerge packagename</c> for all the external modules you are used to using
896     with 2.4.
897     </p>
898    
899     <p>
900     Refer again to the <uri
901     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
902     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
903     Handbook</uri> for more info.
904     </p>
905    
906     </body>
907     </section>
908     <section>
909     <title>Autoloading modules</title>
910     <body>
911    
912     <p>
913     You may have decided to compile some kernel components as modules (as opposed
914     to compiled directly into the kernel) and would like to have them autoloaded on
915     bootup like you did with 2.4. Also, if you installed any external modules from
916     the portage tree (as described above) you will probably want to autoload them
917     too.
918     </p>
919    
920     <p>
921     You can achieve this similarly as to how you did with 2.4. Simply open up the
922     file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
923     the names of the modules you would like autoloaded.
924     </p>
925    
926     <pre caption="Opening the module autoload list in nano">
927     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
928     </pre>
929    
930     <pre caption="Sample autoload list to load the 3c59x and nvidia modules">
931     # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
932     #
933     # Note that this file is for 2.6 kernels.
934     #
935     # Add the names of modules that you'd like to load when the system
936 neysx 1.18 # starts into this file, one per line. Comments begin with # and
937     # are ignored. Read man modules.autoload for additional details.
938 neysx 1.1
939     3c59x
940     nvidia
941     </pre>
942    
943     </body>
944     </section>
945     </chapter>
946    
947     <chapter>
948 swift 1.9 <title>LVM to LVM2 migration</title>
949     <section>
950     <title>Upgrading to LVM2 tools</title>
951     <body>
952    
953     <note>
954 neysx 1.18 If you do not use LVM to manage your disk storage, you can safely skip this
955     chapter and skip onto the next.
956 swift 1.9 </note>
957    
958     <p>
959     Fortunately, upgrading from the LVM1 user tools to the LVM2 versions is very
960     simple:
961     </p>
962    
963     <pre caption="Upgrading user-tools from LVM1 to LVM2">
964 cam 1.11 # <i>emerge --unmerge lvm-user</i>
965 swift 1.9 # <i>emerge lvm2</i>
966     </pre>
967    
968     <note>
969     The LVM2 tools are fully backwards-compatible with LVM1. Your disk data will
970 neysx 1.18 not be touched. You are not breaking any backwards-compatibility by doing this,
971     you will continue to be able to boot 2.4 as usual.
972 swift 1.9 </note>
973    
974     </body>
975     </section>
976     </chapter>
977    
978     <chapter>
979 neysx 1.1 <title>Booting into Linux 2.6</title>
980     <section>
981     <body>
982    
983     <p>
984     It's now time to boot into Linux 2.6. Close all applications and reboot:
985     </p>
986    
987     <pre caption="Rebooting">
988     # <i>umount /boot</i>
989     # <i>reboot</i>
990     </pre>
991    
992     <p>
993     When you reboot, if you followed this document correctly so far, you will have
994     the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
995     Choose Linux 2.6.
996     </p>
997    
998     <p>
999     Once the system has booted, check that things are working. If you made a
1000 neysx 1.18 mistake in the kernel configuration, don't worry, you can skip back to the <uri
1001     link="#conf">Configuring, building, and installing the kernel</uri> section,
1002     make your change, recompile and install new kernel image, reboot, and try
1003     again!
1004 neysx 1.1 </p>
1005    
1006     </body>
1007     </section>
1008     <section>
1009 swift 1.8 <title>Configuring and unmuting ALSA</title>
1010 neysx 1.1 <body>
1011    
1012     <p>
1013 swift 1.8 We will now complete the ALSA configuration and unmute the audio channels. The
1014     ALSA packages provide a useful utility to make this process relatively simple:
1015     </p>
1016    
1017     <pre caption="Invoking the automatic ALSA configuration utility">
1018     # <i>alsaconf</i>
1019     </pre>
1020    
1021     <p>
1022 neysx 1.18 The process is straightforward: allow the <e>/etc/modules.d/alsa</e> file to be
1023     automatically updated, and then allow ALSA to be reloaded. alsaconf will then
1024     terminate, however you will need to run it multiple times if you have multiple
1025     sound devices installed in your system.
1026 swift 1.8 </p>
1027    
1028     <p>
1029 neysx 1.18 You should now add <c>alsasound</c> to your boot runlevel, so that volumes will
1030     be saved on shutdown and restored on bootup:
1031 neysx 1.1 </p>
1032    
1033 swift 1.8 <pre caption="Adding alsasound to the boot runlevel">
1034     # <i>rc-update add alsasound boot</i>
1035     </pre>
1036    
1037 neysx 1.1 <note>
1038 swift 1.8 The <c>alsaconf</c> utility chooses initial volume levels for your sound
1039     devices. If these are inappropriate, you can modify them at any time with the
1040     <c>alsamixer</c> utility.
1041 neysx 1.1 </note>
1042    
1043     </body>
1044     </section>
1045 swift 1.7 <section>
1046     <title>Any immediate problems?</title>
1047     <body>
1048    
1049     <p>
1050 neysx 1.18 At this stage you should refer back to the <uri link="#pitfalls">Known pitfalls
1051     with Linux 2.6 migration</uri> section which may be helpful with any issues you
1052     encounter immediately.
1053 swift 1.7 </p>
1054    
1055     </body>
1056     </section>
1057 neysx 1.1 </chapter>
1058    
1059     <chapter>
1060     <title>Header files and NPTL</title>
1061     <section>
1062     <body>
1063    
1064     <p>
1065 neysx 1.18 By now you are running Linux 2.6 and hopefully have all issues ironed out. You
1066 neysx 1.1 should now update your Linux kernel header files and re-merge glibc so that
1067     userspace applications can take advantage of new Linux 2.6 features.
1068     </p>
1069    
1070 swift 1.15 <pre caption="Updating to linux-headers">
1071     # <i>emerge -u linux-headers</i>
1072 neysx 1.1 </pre>
1073    
1074     <p>
1075     After updating your headers package, you should generally re-merge glibc.
1076     There is a new feature here that you may be interested in - NPTL. NPTL is a new
1077     threading model present in Linux 2.6, which features much quicker thread create
1078     and destroy times. This won't make much of a difference to most systems, but
1079     you may wish to enable it during this migration process! To enable NPTL, edit
1080     <path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
1081     </p>
1082    
1083     <warn>
1084 swift 1.15 If you choose to also enable the "nptlonly" flag, be aware that you will no
1085     longer be able to boot a 2.4 kernel.
1086 neysx 1.1 </warn>
1087    
1088     <p>
1089     Now re-merge glibc (you should do this even if you did not choose to enable
1090     NPTL).
1091     </p>
1092    
1093     <pre caption="Reinstalling glibc against the new kernel headers">
1094     # <i>emerge -a glibc</i>
1095     </pre>
1096    
1097     <p>
1098     If you enabled NPTL, existing binaries will not use it until they are
1099     recompiled. However, any binaries compiled from this point onwards <e>will</e>
1100     use NPTL. You may wish to recompile all binaries now, e.g.:
1101     </p>
1102    
1103     <pre caption="Recompiling all packages on the system">
1104     # <i>emerge -e world</i>
1105     </pre>
1106    
1107     <p>
1108     Alternatively, you can just let your system "naturally" convert itself to NPTL
1109     as you update to newer versions of packages when they are released.
1110     </p>
1111    
1112     </body>
1113     </section>
1114     </chapter>
1115    
1116     <chapter>
1117     <title>Closing remarks</title>
1118     <section>
1119     <title>Problems?</title>
1120     <body>
1121    
1122     <p>
1123     With the incredible amount of work that went into Linux 2.6, it is sometimes
1124     inevitable that things which used to work fine, no longer function as expected.
1125     </p>
1126    
1127     <p>
1128     If you have any problems with your 2.6 kernel, and you can confirm that this
1129     problem does not exist with Linux 2.4, then please open a bug with us on our
1130     <uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
1131     issue, and if we find that it is a problem in the mainline kernel, we may then
1132     ask you to file a report at the central kernel bugzilla.
1133     </p>
1134    
1135     </body>
1136     </section>
1137     <section>
1138     <title>Conclusion</title>
1139     <body>
1140    
1141     <p>
1142     Hopefully you have just completed a smooth migration and you are enjoying the
1143 swift 1.13 benefits which Linux 2.6 brings over 2.4.
1144     </p>
1145    
1146     <p>
1147 neysx 1.18 I would like to say a word of thanks to the many users who effectively 'tested'
1148     this document while it was in its early stages, and provided feedback about how
1149     the migration process went. Sorry that I did not reply to all the emails (there
1150     were a lot!), but I did read every one, and refined this document where
1151     appropriate. Enjoy your 2.6-enhanced systems :)
1152 neysx 1.1 </p>
1153    
1154     </body>
1155     </section>
1156 swift 1.8 <section>
1157     <title>Removing Linux 2.4 from your system</title>
1158     <body>
1159    
1160     <p>
1161     After you have been running 2.6 for a while, you may decide that you no longer
1162     have any requirement to be able to use Linux 2.4. The steps you can take to
1163 swift 1.9 clean up your system are detailed below. <e>Only follow the procedure in this
1164     section if you are sure that you don't want/need to use 2.4 again!</e>
1165 swift 1.8 </p>
1166    
1167     <p>
1168     The 2.4 kernel source code can be removed, using the emerge utility as usual.
1169     For example, assuming you have 2.4 versions of vanilla-sources and
1170     gentoo-sources installed, you could use the following command to remove them
1171     while keeping the 2.6 versions intact:
1172     </p>
1173    
1174     <pre caption="Example: Removing Linux 2.4 sources">
1175 cam 1.11 # <i>emerge --unmerge =vanilla-sources-2.4.* =gentoo-sources-2.4.*</i>
1176 swift 1.8 </pre>
1177    
1178     <p>
1179     Portage will not completely clean out your 2.4 kernel source installations,
1180     because some temporary files are created during compilation. It is safe to
1181     remove these remnants with the following command:
1182     </p>
1183    
1184     <pre caption="Removing remaining temporary files">
1185     # <i>rm -rf /usr/src/linux-2.4.*</i>
1186     </pre>
1187    
1188     <p>
1189 neysx 1.18 You can additionally remove modules and information files relating to your old
1190     2.4 kernel installations, as these are no longer needed.
1191 swift 1.8 </p>
1192    
1193     <pre caption="Removing previously-installed 2.4 modules">
1194     # <i>rm -rf /lib/modules/2.4.*</i>
1195     </pre>
1196    
1197     <p>
1198 neysx 1.18 The 2.4 kernel binaries you used to boot from can also be safely removed. You
1199     should mount your <c>/boot</c> partition, and remove those images. You should
1200     also update your bootloader configuration so that it no longer references these
1201     deleted kernel images.
1202 swift 1.8 </p>
1203    
1204     <p>
1205 swift 1.10 Some Linux 2.4 users will have previously installed the <c>alsa-driver</c>
1206 swift 1.8 package to benefit from the new audio capabilities included in Linux 2.6. If
1207     you were one of these users, and you followed the advice given earlier in this
1208     document about building ALSA with the 2.6 kernel sources (as opposed to using
1209     the <c>alsa-driver</c> package), then you can safely remove this to prevent
1210     future conflicts.
1211     </p>
1212    
1213     <p>
1214     Additionally, <c>lm-sensors</c> users will have previously used the <c>i2c</c>
1215     package to provide the hardware drivers. As already mentioned, I2C drivers are
1216     now included in the kernel, so this package can also be removed in order to
1217     prevent future conflicts.
1218     </p>
1219    
1220 swift 1.9 <p>
1221     The devfs management daemon, <c>devfsd</c>, can also safely be removed, now
1222     that we are using <c>udev</c> for device management.
1223     </p>
1224    
1225     <pre caption="Removing alsa-driver, i2c, and devfsd">
1226 cam 1.11 # <i>emerge --unmerge alsa-driver i2c devfsd</i>
1227 swift 1.9 </pre>
1228    
1229     <p>
1230     If you are LVM2 user, you may wish to convert your data into the LVM2 data
1231 neysx 1.18 format in order to benefit from the advantages which LVM2 provides. However,
1232     this operation will prevent you from ever accessing your LVM data from a 2.4
1233     kernel. If you want to continue with the conversion (this is totally
1234 swift 1.9 optional!), then you should examine the <c>vgconvert</c> man page for
1235     instructions on how to carry this out. An example is shown below, where
1236     <c>main</c> is the volume group name.
1237     </p>
1238    
1239     <pre caption="Converting a LVM1 volume to LVM2 format">
1240     # <i>vgconvert -M2 main</i>
1241 swift 1.8 </pre>
1242    
1243     </body>
1244     </section>
1245 neysx 1.1 </chapter>
1246     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20