/[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.6 - (hide annotations) (download) (as text)
Sun Nov 28 15:19:20 2004 UTC (9 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.5: +3 -2 lines
File MIME type: application/xml
Remove /mnt/temp after (ab)using it ;) Thanks to cam`_ for noticing

1 neysx 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3    
4 swift 1.6 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/migration-to-2.6.xml,v 1.5 2004/11/28 14:26:04 swift 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     <mail link="dsd@gentoo.org">Daniel Drake</mail>
12     </author>
13     <author title="Contributor">
14     <mail link="sergey_zlodey@mail.ru">Sergey Galkin</mail>
15     </author>
16     <author title="Contributor">
17     <mail link="svyatogor@gentoo.org">Sergey Kuleshov</mail>
18     </author>
19     <author title="Editor">
20     <mail link="neysx@gentoo.org">Xavier Neys</mail>
21     </author>
22 bennyc 1.3 <author title="Editor">
23     <mail link="bennyc@gentoo.org">Benny Chuang</mail>
24     </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     2.6, devfs to udev and OSS to ALSA.
29     </abstract>
30    
31 swift 1.6 <version>0.1.4</version>
32 swift 1.5 <date>2004-11-28</date>
33 neysx 1.1
34     <chapter>
35     <title>Introduction</title>
36    
37     <section>
38     <title>Status of this document</title>
39     <body>
40    
41     <p>
42     The migration processes described in this document are not minor changes. This
43     document is in early stages and may be missing some details but hopefully the
44     main things have been covered. If you do try a migration, please <uri
45     link="http://bugs.gentoo.org">report</uri> any problem you might encounter so
46     that we can refine this guide.
47     </p>
48    
49     <p>
50     We are planning on making Linux 2.6 the default kernel for when 2005.0 is
51     released (for some arch's). At the same time, we will encourage all existing
52     users of those arch's to upgrade to Linux 2.6, as many will still be running
53     2.4. Your feedback on this document is much appreciated, so that when this
54     time comes, the document can be in good shape for the mass-migration.
55     </p>
56    
57     </body>
58     </section>
59    
60     <section>
61     <title>Whats new in Linux 2.6?</title>
62     <body>
63    
64     <p>
65     That is no easy question to answer. Linux 2.6 is the result of over 2 years
66     of rapid development and stabilisation of new features, and is architectually
67     quite different from its 2.4 counterpart. Some of the more major changes are
68     listed below:
69     </p>
70    
71     <ul>
72     <li>
73     Scheduler/Interactivity improvements: Linux feels very smooth on desktop
74     systems and copes much better than 2.4 while under load
75     </li>
76     <li>
77     Scalability: Linux now scales much better at both ends - on small embedded
78     devices and also systems with many processors
79     </li>
80     <li>Performance: Throughput from common applications is much improved</li>
81     <li>
82     Hardware support: Linux now supports many more architectures and hardware
83     devices out-of-the-box than any other operating system.
84     </li>
85     </ul>
86    
87     <p>
88     Joseph Pranevich has written a very detailed document, <uri
89     link="http://www.kniggit.net/wwol26.html">The Wonderful World Of Linux
90     2.6</uri> which you may be interested to glance over. If you are interested in
91     the more technical details, you can refer to <uri
92     link="http://www.linux.org.uk/~davej/docs/post-halloween-2.6.txt">The
93     post-halloween document</uri> - but bear in mind that this is somewhat outdated
94     now.
95     </p>
96    
97     </body>
98     </section>
99     <section>
100     <title>What is udev?</title>
101     <body>
102    
103     <p>
104     In the past, Gentoo has instructed users to use <e>devfs</e> for managing the
105     /dev directory, which contains a series of device interfaces to allow system
106     applications to communicate with hardware (through the kernel).
107     </p>
108    
109     <p>
110     <e>devfs</e>, whilst a good concept, has some internal problems, and has been
111     marked obselete in Linux 2.6.
112     </p>
113    
114     <p>
115     <e>udev</e> is the new way of managing device nodes. It addresses issues with
116     previous device managers, and also attempts to solve some other problems.
117     </p>
118    
119     <p>
120     The above may not mean much to you, but fear not, the hard working Gentoo
121     developers have put effort into making the migration from devfs very easy.
122     </p>
123    
124     </body>
125     </section>
126     <section>
127     <title>What is ALSA?</title>
128     <body>
129    
130     <p>
131     With Linux 2.4, chances are that you used OSS (open sound system) drivers to
132     power your sound card. OSS has been replaced by a newer and better set of sound
133     drivers: ALSA.
134     </p>
135    
136     <p>
137     ALSA, the Advanced Linux Sound Architecture, is a new set of sound drivers with
138     a new and improved API, present in the Linux 2.6 kernel. It is backwards
139     compatible with OSS applications, provided that you select the right kernel
140     configuration options!
141     </p>
142    
143     <note>
144     If you do not have any sound/audio hardware, you can safely skip over any
145     ALSA-related instructions in this document.
146     </note>
147    
148     </body>
149     </section>
150     </chapter>
151    
152     <chapter>
153     <title>Preparation</title>
154     <section>
155     <title>Get your system up-to-date</title>
156     <body>
157    
158     <p>
159     Some of the changes brought in with Linux 2.6 also required some changes in the
160     base system applications. Before continuing, you should ensure that your system
161     is relatively up-to-date, and to be perfectly sure, you should update all world
162     and system packages where updates are available.
163     </p>
164    
165     <p>
166     In particular, make sure you have the latest stable versions of the following
167     packages:
168     </p>
169    
170     <ul>
171     <li><c>sys-apps/baselayout</c></li>
172     <li><c>sys-apps/util-linux</c></li>
173     <li>
174     <c>sys-kernel/genkernel</c> (only if you wish to use genkernel as opposed
175     to manual configuration)
176     </li>
177     </ul>
178    
179     <pre caption="Updating all world packages">
180     # <i>emerge sync</i>
181     # <i>emerge -ua world</i>
182     </pre>
183    
184     </body>
185     </section>
186     <section>
187     <title>modutils vs module-init-tools</title>
188     <body>
189    
190     <p>
191     <c>sys-apps/modutils</c> is the package that provides tools such as
192     <c>modprobe</c>, <c>rmmod</c> and <c>insmod</c> for Linux 2.4.
193     </p>
194    
195     <p>
196     Linux 2.6 introduces a new module format, and therefore requires new tools for
197     handling modules. These are bundled up into the
198     <c>sys-apps/module-init-tools</c> package. </p>
199    
200     <p>
201     You should now remove modutils and install module-init-tools:
202     </p>
203    
204     <pre caption="Switching from modutils to module-init-tools">
205 swift 1.5 # <i>emerge unmerge sys-apps/modutils</i>
206 neysx 1.1 # <i>emerge module-init-tools</i>
207     </pre>
208    
209     <note>
210     Don't worry - even though you have just unmerged modutils, module-init-tools
211 bennyc 1.3 provides backwards compatibility for Linux 2.4, so you will still be
212 neysx 1.1 able to boot into Linux 2.4 and handle modules for that kernel.
213     </note>
214    
215     <note>
216     For the above reason, module-init-tools might already be installed and working
217     with your existing Linux 2.4 kernel. In this case, you don't need to worry
218     about this stage - your system is already ready to deal with Linux 2.6 modules.
219     </note>
220    
221     </body>
222     </section>
223     <section>
224     <title>Installing udev</title>
225     <body>
226    
227     <p>
228     There is no configuration involved here. Simply use <c>emerge</c> to install
229     udev:
230     </p>
231    
232     <pre caption="Installing udev">
233     # <i>emerge -a udev</i>
234     </pre>
235    
236     </body>
237     </section>
238     <section>
239 swift 1.5 <title>Checking for essential device nodes</title>
240     <body>
241    
242     <p>
243     When the system boots up, the system requires some essential device nodes. As
244     udev is not included in the kernel, it is not activated immediately. To work
245     around this, you must ensure that you have some essential device nodes on your
246     disk.
247     </p>
248    
249     <p>
250     Our installation stage files will have created the required devices during the
251     initial installation. However, some users have reported that this is not the
252     case. We will use this opportunity to check that the device files exist, and
253     create them if they do not.
254     </p>
255    
256     <p>
257     As your existing device manager will be mounted at /dev, we cannot access it
258     directly. So we will bind-mount your root partition to another location and
259     access the /dev directory from there.
260     </p>
261    
262     <pre caption="Bind-mounting your root partition and listing static devices">
263     # <i>mkdir -p /mnt/temp</i>
264     # <i>mount -o bind / /mnt/temp</i>
265     # <i>cd /mnt/temp/dev</i>
266     # <i>ls -l console null</i>
267     </pre>
268    
269     <p>
270     If the above <e>ls</e> command reported that either <c>console</c> or
271     <c>null</c> do not exist, then you must create them yourself, as shown below.
272     </p>
273    
274     <pre caption="Creating the missing console and null nodes">
275     # <i>mknod -m 660 console c 5 1</i>
276     # <i>mknod -m 660 null c 1 3</i>
277     </pre>
278    
279     <p>
280     You should now unmount your bind-mounted root partition, even if you did not
281     have to create those devices:
282     </p>
283    
284     <pre caption="Unmounting the bind-mounted root">
285     # <i>umount /mnt/temp</i>
286 swift 1.6 # <i>rmdir /mnt/temp</i>
287 swift 1.5 </pre>
288    
289     </body>
290     </section>
291     <section>
292 neysx 1.1 <title>Installing ALSA utilities</title>
293     <body>
294    
295     <p>
296     ALSA requires you to have some packages installed, so that applications can use
297     the ALSA API. These packages will also allow you to control the mixer and
298     volume levels. Install the required utilities as follows:
299     </p>
300    
301     <pre caption="Installing ALSA utilities and libraries">
302     # <i>emerge -a alsa-lib alsa-utils alsa-tools alsa-headers alsa-oss</i>
303     </pre>
304    
305     </body>
306     </section>
307     </chapter>
308    
309     <chapter>
310     <title>Installing the Linux 2.6 sources</title>
311    
312     <section>
313     <title>Choosing and installing a kernel</title>
314     <body>
315    
316     <p>
317     The first thing you need to do is install sources of a 2.6 kernel of your
318     choice. The two Gentoo-supported 2.6 kernels are currently
319     <e>gentoo-dev-sources</e> (for desktops) and <e>hardened-dev-sources</e> (for
320     servers). There are others available, see the <uri
321     link="/doc/en/gentoo-kernel.xml">Gentoo Linux Kernel Guide</uri> for more
322     choices.
323     </p>
324    
325     <p>
326     In this guide, we'll use <c>gentoo-dev-sources</c> as an example. Install your
327     chosen set of kernel sources using the <c>emerge</c> utility:
328     </p>
329    
330     <pre caption="Installing gentoo-dev-sources">
331     # <i>emerge -a gentoo-dev-sources</i>
332     These are the packages that I would merge, in order:
333     Calculating dependencies ...done!
334     [ebuild N ] sys-kernel/gentoo-dev-sources-2.6.9-r2
335    
336     Do you want me to merge these packages? [Yes/No] <i>y</i>
337     </pre>
338    
339     </body>
340     </section>
341     <section>
342     <title>Updating the /usr/src/linux symbolic link</title>
343     <body>
344    
345     <p>
346     Various components of the Gentoo utilities rely on /usr/src/linux being a
347     symbolic link to the kernel sources that you are running (or wish to compile
348     against).
349     </p>
350    
351     <p>
352     We will now update our /usr/src/linux link to point at the kernel sources we
353     just installed. Continuing our example:
354     </p>
355    
356     <pre caption="Updating the /usr/src/linux softlink">
357     # <i>cd /usr/src</i>
358 neysx 1.4 # <i>ln -sfn linux-2.6.9-gentoo-r2 linux</i>
359 neysx 1.1 </pre>
360    
361     </body>
362     </section>
363     </chapter>
364    
365     <chapter>
366     <title>Known pitfalls with Linux 2.6 migration</title>
367     <section>
368     <body>
369    
370     <p>
371     Before we get stuck into configuring the kernel, I'll attempt to detail the
372     most common errors that people make when migrating to Linux 2.6, as some of
373     these points will influence the way you configure the new kernel.
374     </p>
375    
376     <note>
377     Not all of these points are relevant at this stage, but I will detail them all
378     here in one place, and you can refer back at your leisure.
379     </note>
380    
381     </body>
382     </section>
383     <section>
384     <title>Don't use "make oldconfig" with a 2.4 .config</title>
385     <body>
386    
387     <note>
388     If you don't understand what this means, don't worry, you won't make this
389     mistake if you follow the rest of this guide correctly.
390     </note>
391    
392     <p>
393     You'll be asked many many questions, since there have been a large amount of
394     changes. Many people who do try a <c>make oldconfig</c> from a 2.4 config end
395     up creating an unworkable kernel (e.g. no output on-screen, no input from
396     keyboard, etc). Please save yourself the trouble, and use the traditional
397     <c>menuconfig</c> configuration method just this once.
398     </p>
399    
400     </body>
401     </section>
402     <section>
403     <title>Don't use ide-scsi for CD/DVD writing</title>
404     <body>
405    
406     <p>
407     In Linux 2.4, the only way to achieve good CD/DVD writing results was to enable
408     the (rather ugly) <c>ide-scsi</c> emulation. Thankfully, the IDE layer in Linux
409     2.6 has been extended to support CD/DVD writers much better.
410     </p>
411    
412     <p>
413     You don't need to enable any extra options to support CD writing. Just be sure
414     <e>not</e> to enable <c>ide-scsi</c> as you used to.
415     </p>
416    
417     </body>
418     </section>
419     <section>
420     <title>PC Speaker is now a configurable option</title>
421     <body>
422    
423     <p>
424     You won't get your normal console beeps (or any response from the PC speaker at
425     all) unless you specifically enable the new PC speaker option
426     (<c>CONFIG_INPUT_PCSPKR</c>):
427     </p>
428    
429     <pre caption="Location of PC speaker option">
430     Device Drivers ---&gt;
431     Input device support ---&gt;
432     [*] Misc
433     &lt;*&gt; PC Speaker support
434     </pre>
435    
436     <note>
437     By "PC speaker", I am referring to the analogue speaker that beeps once when
438     your system is powering up, I am not referring to normal sound hardware used
439     for playing music, etc.
440     </note>
441    
442     </body>
443     </section>
444     <section>
445     <title>New USB Storage block device driver sometimes problematic</title>
446     <body>
447    
448     <p>
449     Very recently, a new USB storage device driver has been added to the kernel.
450     At the time of writing, this driver ("ub") is still in its early stages and
451     some users find it to be unreliable. If you have problems accessing your USB
452     hard disk, USB flash disk, USB card reader, or USB digital camera, then you
453     could try reverting to the older SCSI-style driver:
454     </p>
455    
456     <pre caption="Disabling ub">
457     Device Drivers ---&gt;
458     Block devices ---&gt;
459     &lt; &gt; Low Performance USB Block driver
460     </pre>
461    
462     <note>
463     The older SCSI-style driver (USB Mass Storage support) is enabled by default.
464     It can be found under "Device Drivers --&gt; USB support", but will generally
465     not come into effect while ub is also present.
466     </note>
467    
468     </body>
469     </section>
470     <section>
471     <title>usbdevfs renamed to usbfs</title>
472     <body>
473    
474     <p>
475     If you have edited your <path>/etc/fstab</path> file to customise the way that
476     the USB device filesystem gets mounted, you may have to modify the filesystem
477     type from <e>usbdevfs</e> to <e>usbfs</e>.
478     </p>
479    
480     <note>
481     Recent 2.4 kernels will also allow you to use "usbfs" as well as "usbdevfs", so
482     you aren't breaking any backwards compatibility by doing this.
483     </note>
484    
485     </body>
486     </section>
487     <section>
488     <title>Don't renice X</title>
489     <body>
490    
491     <p>
492     If you are a desktop 2.4 user, you may have hacked your system into running X
493     at a higher priority, as in some cases it seems to provide better desktop
494     performance.
495     </p>
496    
497     <p>
498     There have been many scheduler changes in 2.6 which change this behaviour. If
499     you continue to run X at a higher priority, it will do exactly what it is
500     supposed to (run the <e>display server</e> at a very high priority) and you
501     will notice consequences such as sound stuttering and slow application load
502     times because your CPU is spending too long serving X and only X.
503     </p>
504    
505     <p>
506     In Linux 2.6, you no longer need to renice desktop applications to get good
507     interactivity. Please remove your "niceness" hacks!
508     </p>
509    
510     </body>
511     </section>
512     <section>
513     <title>X11 config file should now use /dev/input/mice</title>
514     <body>
515    
516     <p>
517     One of the changes that a default udev configuration introduces is different
518     organisation of the mouse device nodes. Previously, you would have had nodes
519     such as <path>/dev/psaux</path> and <path>/dev/mouse</path>. You will now have
520     nodes such as <path>/dev/input/mouse0</path>, <path>/dev/input/mouse1</path>,
521     and a collective <path>/dev/input/mice</path> node which combines movements
522     from all mice.
523     </p>
524    
525     <p>
526     Since the old X configurations typically reference <path>/dev/mouse</path> or
527     <path>/dev/psaux</path> then you may get an error similar to the one shown
528     below when you attempt to start X11:
529     </p>
530    
531     <pre caption="Common error when starting X on a udev system for the first time">
532     (EE) xf86OpenSerial: Cannot open device /dev/mouse
533     No such file or directory.
534     (EE) Mouse0: cannot open input device
535     (EE) PreInit failed for input device "Mouse0"
536     No core pointer
537     </pre>
538    
539     <p>
540     To correct this, open your X11 config in a text editor, and update the mouse
541     <e>InputDevice</e> section to use the <path>/dev/input/mice</path> device. An
542     example is shown below:
543     </p>
544    
545     <pre caption="Opening your X11 config file">
546     # <i>nano -w /etc/X11/xorg.conf</i>
547     </pre>
548    
549     <note>
550     If you are still using XFree86, your config file will be
551     <path>/etc/X11/XF86Config</path>
552     </note>
553    
554     <pre caption="Sample mouse InputDevice section">
555     Section "InputDevice"
556     Identifier "Mouse0"
557     Driver "mouse"
558     Option "Protocol" "auto"
559     Option "Device" "/dev/input/mice"
560     EndSection
561     </pre>
562    
563     </body>
564     </section>
565     </chapter>
566    
567     <chapter id="conf">
568     <title>Configuring, building, and installing the kernel</title>
569     <section>
570     <body>
571    
572     <p>
573     As with Linux 2.4, you have two options for managing your new kernel build.
574     </p>
575    
576     <ol>
577     <li>
578     The default method is to configure your kernel manually. This may seem
579     daunting but is the preferred way as long as you know your system. If you
580     wish to configure your new kernel manually, please continue on to the <uri
581     link="#manual">next chapter</uri>.
582     </li>
583     <li>
584     The alternative option is to use our <c>genkernel</c> utility to
585     automatically configure, compile, and install a kernel for you. If you wish
586     to use <c>genkernel</c> then skip over the next chapter and proceed with
587     <uri link="#genkernel">using genkernel</uri>.
588     </li>
589     </ol>
590    
591     </body>
592     </section>
593     </chapter>
594    
595     <chapter id="manual">
596     <title>Default: Manual configuration</title>
597     <section>
598     <title>Configuring the kernel</title>
599     <body>
600    
601     <p>
602     We'll now get on with configuring the kernel. Open menuconfig in the usual way:
603     </p>
604    
605     <pre caption="Invoking menuconfig">
606     # <i>cd /usr/src/linux</i>
607     # <i>make menuconfig</i>
608     </pre>
609    
610     <p>
611     You will probably be familiar with using menuconfig from configuring 2.4
612     kernels. Fortunately, the front end has barely changed at all, but you will
613     observe much better organisation of kernel options, plus <e>many</e> new
614     options that weren't present in 2.4.
615     </p>
616    
617     <p>
618     Be sure to enable the following important kernel options:
619     </p>
620    
621     <pre caption="Required kernel options">
622     File systems ---&gt;
623     Pseudo Filesystems ---&gt;
624     [*] /proc file system support
625     [*] Virtual memory file system support (former shm fs)
626    
627     <comment>(the following are required for udev):</comment>
628     General setup ---&gt;
629     [*] Support for hot-pluggable devices
630    
631     Device Drivers ---&gt;
632     Block devices ---&gt;
633     &lt;*&gt; RAM disk support
634    
635     <comment>(the following are required for ALSA):</comment>
636     Device Drivers ---&gt;
637     Sound ---&gt;
638     &lt;*&gt; Sound card support
639     Advanced Linux Sound Architecture ---&gt;
640     &lt;M&gt; Advanced Linux Sound Architecture
641     &lt;M&gt; Sequencer support
642     &lt;M&gt; OSS Mixer API
643     [*] OSS Sequencer API
644     <comment> (and dont forget to select your soundcard from the submenus!)</comment>
645     </pre>
646    
647     <warn>
648     Previously you may have included support for the <path>/dev</path> file system
649     (now marked OBSOLETE). Do not enable devfs support. We have installed udev,
650     which we will be using instead of devfs from now on.
651     </warn>
652    
653     <p>
654     Also, remember to enable support for the filesystems that you use, and the
655     hardware present in your system. Be sure to enable support for the IDE
656     controller on your motherboard if you wish to benefit from fast DMA disk
657     access. Refer to the <uri
658     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
659     Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
660     Handbook</uri> for additional guidance here.
661     </p>
662    
663     </body>
664     </section>
665     <section>
666     <title>Building the kernel</title>
667     <body>
668    
669     <p>
670     Now that we have configured the kernel, we can start the compilation process:
671     </p>
672    
673     <pre caption="Compiling the kernel source">
674     # <i>make &amp;&amp; make modules_install</i>
675     </pre>
676    
677     <note>
678     You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
679     longer required.
680     </note>
681    
682     <p>
683     Wait for the kernel compilation to complete (and observe the much more readable
684     compilation output).
685     </p>
686    
687     </body>
688     </section>
689     <section>
690     <title>Installing the kernel</title>
691     <body>
692    
693     <p>
694     The next step is mounting your <path>/boot</path> partition and copying the
695     kernel image over. You must then update your bootloader config manually.
696     </p>
697    
698     <pre caption="Installing the kernel">
699     # <i>mount /boot</i>
700     # <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.9-gentoo-r2</i>
701     # <i>cp System.map /boot/System.map-2.6.9-gentoo-r2</i>
702     </pre>
703    
704     <p>
705     Note that the above instructions are examples only, you should follow your
706     usual procedure of updating kernels by following the instructions in the <uri
707     link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
708     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
709     Kernel</uri> chapter).
710     </p>
711    
712     <p>
713     When updating your bootloader config, do not remove the old entry pointing at
714     your 2.4 kernel. This way, you will easily be able to switch between the two if
715     something is not working.
716     </p>
717    
718     <p>
719     Now continue onto the <uri link="#modules">Module Configuration</uri> section.
720     </p>
721    
722     </body>
723     </section>
724     </chapter>
725    
726     <chapter id="genkernel">
727     <title>Alternative: Using genkernel</title>
728     <section>
729     <body>
730    
731     <p>
732     If you prefer to use genkernel instead of manually configuring your kernel, you
733     will be happy to hear that using genkernel to produce 2.6 kernels is very
734     similar to the process you performed when producing your previous 2.4 kernel.
735     </p>
736    
737     <p>
738     You should invoke genkernel as shown below:
739     </p>
740    
741     <pre caption="Invoking genkernel with some common arguments">
742     # <i>genkernel --udev --menuconfig --bootloader=grub all</i>
743     </pre>
744    
745     <p>
746     In the above example, we also take advantage of genkernel features to open
747     menuconfig to allow you to customise the kernel configuration (if you wish),
748     and to update the grub bootloader configuration after compilation.
749     </p>
750    
751     <p>
752     You should choose genkernel arguments that suit you, but do not forget to
753     include the <c>--udev</c> argument! Refer to the <uri
754     link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
755     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
756     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
757     Handbook</uri> for additional information.
758     </p>
759    
760     </body>
761     </section>
762     </chapter>
763    
764     <chapter id="modules">
765     <title>Module Configuration</title>
766    
767     <section>
768     <title>Installing external modules</title>
769     <body>
770    
771     <p>
772     Many users will additionally rely on kernel modules that are built outside of
773     the kernel tree. Common examples are the binary ATI and Nvidia graphics
774     drivers. You now need to install those modules, which will compile against the
775     2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
776     <c>emerge packagename</c> for all the external modules you are used to using
777     with 2.4.
778     </p>
779    
780     <p>
781     Refer again to the <uri
782     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
783     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
784     Handbook</uri> for more info.
785     </p>
786    
787     </body>
788     </section>
789     <section>
790     <title>Autoloading modules</title>
791     <body>
792    
793     <p>
794     You may have decided to compile some kernel components as modules (as opposed
795     to compiled directly into the kernel) and would like to have them autoloaded on
796     bootup like you did with 2.4. Also, if you installed any external modules from
797     the portage tree (as described above) you will probably want to autoload them
798     too.
799     </p>
800    
801     <p>
802     You can achieve this similarly as to how you did with 2.4. Simply open up the
803     file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
804     the names of the modules you would like autoloaded.
805     </p>
806    
807     <pre caption="Opening the module autoload list in nano">
808     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
809     </pre>
810    
811     <pre caption="Sample autoload list to load the 3c59x and nvidia modules">
812     # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
813     #
814     # Note that this file is for 2.6 kernels.
815     #
816     # Add the names of modules that you'd like to load when the system
817     # starts into this file, one per line. Comments begin with # and
818     # are ignored. Read man modules.autoload for additional details.
819    
820     3c59x
821     nvidia
822     </pre>
823    
824     </body>
825     </section>
826     <section>
827     <title>Configuring the ALSA modules</title>
828     <body>
829    
830     <p>
831     You will have noticed that we chose to compile ALSA as modules. We can now
832     configure ALSA's behaviour easily. However, we also need to configure which
833     modules are to be loaded. Open up <path>/etc/modules.d/alsa</path> in your text
834     editor:
835     </p>
836    
837     <pre caption="Opening /etc/modules.d/alsa in nano">
838     # <i>nano -w /etc/modules.d/alsa</i>
839     </pre>
840    
841     <p>
842     Now look for the section marked as <e>IMPORTANT</e>. In most cases, you just
843     need to uncomment and modify the snd-card-0 and snd-slot-0 aliases.
844     </p>
845    
846     <pre caption="Sample section of /etc/modules.d/alsa">
847     ## IMPORTANT:
848     ## You need to customise this section for your specific sound card(s)
849     ## and then run `update-modules' command.
850     ## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
851     ##
852     ## ALSA portion
853    
854     # My laptop uses the snd-maestro3 driver
855     alias snd-card-0 snd-maestro3
856    
857     ## OSS/Free portion
858    
859     # Generally all you need to do is uncomment this line:
860     alias sound-slot-0 snd-card-0
861     </pre>
862    
863     <p>
864     For more info on which driver name to use, consult the <uri
865     link="/doc/en/alsa-guide.xml">Gentoo Linux ALSA Guide</uri>. Remember to prefix
866     it with <e>snd-</e> in this file.
867     </p>
868    
869     <p>
870     Finally, set the <c>alsasound</c> init script to be executed on bootup:
871     </p>
872    
873     <pre caption="Adding alsasound to default runlevel">
874     # <i>rc-update add alsasound boot</i>
875     </pre>
876    
877     </body>
878     </section>
879     </chapter>
880    
881     <chapter>
882     <title>Booting into Linux 2.6</title>
883     <section>
884     <body>
885    
886     <p>
887     It's now time to boot into Linux 2.6. Close all applications and reboot:
888     </p>
889    
890     <pre caption="Rebooting">
891     # <i>modules-update</i>
892     # <i>umount /boot</i>
893     # <i>reboot</i>
894     </pre>
895    
896     <p>
897     When you reboot, if you followed this document correctly so far, you will have
898     the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
899     Choose Linux 2.6.
900     </p>
901    
902     <p>
903     Once the system has booted, check that things are working. If you made a
904     mistake in the kernel configuration, don't worry, you can skip back to the
905     <uri link="#conf">Configuring, building, and installing the kernel</uri>
906     section, make your change, recompile and install new kernel image, reboot, and
907     try again!
908     </p>
909    
910     </body>
911     </section>
912     <section>
913     <title>Unmuting ALSA channels</title>
914     <body>
915    
916     <p>
917     By default, ALSA channels are muted, so you won't hear anything when you go to
918     play a sound. You need to unmute them now. Run the <c>alsamixer</c> program
919     from a console and use the arrow keys to move around and adjust volumes, and
920     the M key to mute and unmute. Read the <uri
921     link="/doc/en/alsa-guide.xml">Gentoo Linux ALSA Guide</uri> for more complete
922     documentation and other ways to do this.
923     </p>
924    
925     <note>
926     The alsasound init script that we put in the default runlevel will save mixer
927     levels on shutdown and restore them on bootup. You won't need to set all these
928     volumes every time you boot!
929     </note>
930    
931     </body>
932     </section>
933     </chapter>
934    
935     <chapter>
936     <title>Header files and NPTL</title>
937     <section>
938     <body>
939    
940     <p>
941     By now you are running Linux 2.6 and hopefully have all issues ironed out. You
942     should now update your Linux kernel header files and re-merge glibc so that
943     userspace applications can take advantage of new Linux 2.6 features.
944     </p>
945    
946     <pre caption="Updating to linux26-headers">
947 swift 1.2 # <i>emerge unmerge linux-headers</i>
948 neysx 1.1 # <i>emerge linux26-headers</i>
949     </pre>
950    
951     <p>
952     After updating your headers package, you should generally re-merge glibc.
953     There is a new feature here that you may be interested in - NPTL. NPTL is a new
954     threading model present in Linux 2.6, which features much quicker thread create
955     and destroy times. This won't make much of a difference to most systems, but
956     you may wish to enable it during this migration process! To enable NPTL, edit
957     <path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
958     </p>
959    
960     <warn>
961     With the current stable glibc ebuilds, you will be unable to boot a 2.4 kernel
962     after compiling glibc with USE="nptl". Be warned, be careful!
963     </warn>
964    
965     <p>
966     Now re-merge glibc (you should do this even if you did not choose to enable
967     NPTL).
968     </p>
969    
970     <pre caption="Reinstalling glibc against the new kernel headers">
971     # <i>emerge -a glibc</i>
972     </pre>
973    
974     <p>
975     If you enabled NPTL, existing binaries will not use it until they are
976     recompiled. However, any binaries compiled from this point onwards <e>will</e>
977     use NPTL. You may wish to recompile all binaries now, e.g.:
978     </p>
979    
980     <pre caption="Recompiling all packages on the system">
981     # <i>emerge -e world</i>
982     </pre>
983    
984     <p>
985     Alternatively, you can just let your system "naturally" convert itself to NPTL
986     as you update to newer versions of packages when they are released.
987     </p>
988    
989     </body>
990     </section>
991     </chapter>
992    
993     <chapter>
994     <title>Closing remarks</title>
995     <section>
996     <title>Problems?</title>
997     <body>
998    
999     <p>
1000     With the incredible amount of work that went into Linux 2.6, it is sometimes
1001     inevitable that things which used to work fine, no longer function as expected.
1002     </p>
1003    
1004     <p>
1005     If you have any problems with your 2.6 kernel, and you can confirm that this
1006     problem does not exist with Linux 2.4, then please open a bug with us on our
1007     <uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
1008     issue, and if we find that it is a problem in the mainline kernel, we may then
1009     ask you to file a report at the central kernel bugzilla.
1010     </p>
1011    
1012     </body>
1013     </section>
1014     <section>
1015     <title>Conclusion</title>
1016     <body>
1017    
1018     <p>
1019     Hopefully you have just completed a smooth migration and you are enjoying the
1020     benefits which Linux 2.6 brings over 2.4. As I mentioned at the start, we are
1021     looking for feedback on this document - even if your migration went perfectly
1022     smoothly. Please <mail link="dsd@gentoo.org">mail me</mail> your feedback so
1023     that we can get this document in perfect shape for when 2005.0 comes around.
1024     Thanks!
1025     </p>
1026    
1027     </body>
1028     </section>
1029     </chapter>
1030     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20