/[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.7 - (show annotations) (download) (as text)
Wed Dec 22 07:52:29 2004 UTC (10 years ago) by swift
Branch: MAIN
Changes since 1.6: +38 -5 lines
File MIME type: application/xml
Updates by Daniel Drake

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

  ViewVC Help
Powered by ViewVC 1.1.20