/[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.8 - (show annotations) (download) (as text)
Sun Jan 9 10:44:44 2005 UTC (9 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.7: +169 -67 lines
File MIME type: application/xml
Huge update thanks to 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.7 2004/12/22 07:52:29 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.2.0</version>
32 <date>2005-01-09</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 for PS/2 and USB
522 mice</title>
523 <body>
524
525 <p>
526 One of the changes that a default udev configuration introduces is different
527 organisation of the mouse device nodes. Previously, you would have had nodes
528 such as <path>/dev/psaux</path> and <path>/dev/mouse</path>. You will now have
529 nodes such as <path>/dev/input/mouse0</path>, <path>/dev/input/mouse1</path>,
530 and a collective <path>/dev/input/mice</path> node which combines movements
531 from all mice.
532 </p>
533
534 <p>
535 Since the old X configurations typically reference <path>/dev/mouse</path> or
536 <path>/dev/psaux</path> then you may get an error similar to the one shown
537 below when you attempt to start X11:
538 </p>
539
540 <pre caption="Common error when starting X on a udev system for the first time">
541 (EE) xf86OpenSerial: Cannot open device /dev/mouse
542 No such file or directory.
543 (EE) Mouse0: cannot open input device
544 (EE) PreInit failed for input device "Mouse0"
545 No core pointer
546 </pre>
547
548 <p>
549 To correct this, open your X11 config in a text editor, and update the mouse
550 <e>InputDevice</e> section to use the <path>/dev/input/mice</path> device. An
551 example is shown below:
552 </p>
553
554 <pre caption="Opening your X11 config file">
555 # <i>nano -w /etc/X11/xorg.conf</i>
556 </pre>
557
558 <note>
559 If you are still using XFree86, your config file will be
560 <path>/etc/X11/XF86Config</path>
561 </note>
562
563 <pre caption="Sample mouse InputDevice section">
564 Section "InputDevice"
565 Identifier "Mouse0"
566 Driver "mouse"
567 Option "Protocol" "auto"
568 Option "Device" "/dev/input/mice"
569 EndSection
570 </pre>
571
572 </body>
573 </section>
574 <section>
575 <title>New Serial-ATA (SATA) drivers name the devices differently</title>
576 <body>
577
578 <p>
579 If you used the original Serial ATA drivers under Linux 2.4, you probably
580 observed your SATA devices having names such as <c>/dev/hde</c>.
581 </p>
582
583 <p>
584 Linux 2.6 introduces some new SATA drivers (libata) which are based on the
585 SCSI subsystem. As these drivers are based on SCSI, your SATA disks will now
586 show up as SCSI devices. Your first SATA disk will be named <c>/dev/sda</c>.
587 You will need to update your <c>/etc/fstab</c> file to reflect this, and you
588 will need to bear this in mind when choosing the root/real_root kernel boot
589 parameter later on.
590 </p>
591
592 <note>
593 libata has been backported into recent versions of Linux 2.4, so you may
594 already be familiar with the new device naming.
595 </note>
596
597 </body>
598 </section>
599 <section>
600 <title>bootsplash no longer maintained</title>
601 <body>
602
603 <p>
604 If you used the <c>gentoo-sources-2.4</c> kernel, you may have used the
605 <e>bootsplash</e> functionality in order to provide yourself with a colourful
606 framebuffer console.
607 </p>
608
609 <p>
610 The developer of bootsplash appears to have lost interest in his project, given
611 some design problems. However, Gentoo developer <e>Michal Januszewski</e> is
612 developing a successor, <c>gensplash</c>, which in included in the
613 gentoo-dev-sources kernel. You can follow Michals
614 <uri link="http://dev.gentoo.org/~spock/projects/gensplash/archive/gensplash-in-5-easy-steps.txt">
615 Gensplash in 5 easy steps</uri> document in order to familiarize yourself with
616 how gensplash is operated.
617 </p>
618
619 </body>
620 </section>
621 <section>
622 <title>I2C drivers now included in the kernel</title>
623 <body>
624
625 <p>
626 If you use <c>lm-sensors</c> to monitor system temperatures and power levels,
627 you previously needed to install the <c>i2c</c> package in order to provide
628 hardware support.
629 </p>
630
631 <p>
632 The I2C hardware drivers are now included in the Linux 2.6 kernel, no external
633 i2c package is required. Remember to compile support for your specific I2C
634 devices into the kernel configuration. You will then be able to use
635 <c>lm-sensors</c> as usual.
636 </p>
637
638 </body>
639 </section>
640
641
642 </chapter>
643
644 <chapter id="conf">
645 <title>Configuring, building, and installing the kernel</title>
646 <section>
647 <body>
648
649 <p>
650 As with Linux 2.4, you have two options for managing your new kernel build.
651 </p>
652
653 <ol>
654 <li>
655 The default method is to configure your kernel manually. This may seem
656 daunting but is the preferred way as long as you know your system. If you
657 wish to configure your new kernel manually, please continue on to the <uri
658 link="#manual">next chapter</uri>.
659 </li>
660 <li>
661 The alternative option is to use our <c>genkernel</c> utility to
662 automatically configure, compile, and install a kernel for you. If you wish
663 to use <c>genkernel</c> then skip over the next chapter and proceed with
664 <uri link="#genkernel">using genkernel</uri>.
665 </li>
666 </ol>
667
668 </body>
669 </section>
670 </chapter>
671
672 <chapter id="manual">
673 <title>Default: Manual configuration</title>
674 <section>
675 <title>Configuring the kernel</title>
676 <body>
677
678 <p>
679 We'll now get on with configuring the kernel. Open menuconfig in the usual way:
680 </p>
681
682 <pre caption="Invoking menuconfig">
683 # <i>cd /usr/src/linux</i>
684 # <i>make menuconfig</i>
685 </pre>
686
687 <p>
688 You will probably be familiar with using menuconfig from configuring 2.4
689 kernels. Fortunately, the front end has barely changed at all, but you will
690 observe much better organisation of kernel options, plus <e>many</e> new
691 options that weren't present in 2.4.
692 </p>
693
694 <p>
695 Be sure to enable the following important kernel options:
696 </p>
697
698 <pre caption="Required kernel options">
699 File systems ---&gt;
700 Pseudo Filesystems ---&gt;
701 [*] /proc file system support
702 [*] Virtual memory file system support (former shm fs)
703
704 <comment>(the following are required for udev):</comment>
705 General setup ---&gt;
706 [*] Support for hot-pluggable devices
707
708 Device Drivers ---&gt;
709 Block devices ---&gt;
710 &lt;*&gt; RAM disk support
711
712 <comment>(the following are required for ALSA):</comment>
713 Device Drivers ---&gt;
714 Sound ---&gt;
715 &lt;*&gt; Sound card support
716 Advanced Linux Sound Architecture ---&gt;
717 &lt;M&gt; Advanced Linux Sound Architecture
718 &lt;M&gt; Sequencer support
719 &lt;M&gt; OSS Mixer API
720 [*] OSS Sequencer API
721 <comment> (and dont forget to select your soundcard from the submenus!)</comment>
722 </pre>
723
724 <warn>
725 Previously you may have included support for the <path>/dev</path> file system
726 (now marked OBSOLETE). Do not enable devfs support. We have installed udev,
727 which we will be using instead of devfs from now on.
728 </warn>
729
730 <p>
731 Also, remember to enable support for the filesystems that you use, and the
732 hardware present in your system. Be sure to enable support for the IDE
733 controller on your motherboard if you wish to benefit from fast DMA disk
734 access. Refer to the <uri
735 link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
736 Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
737 Handbook</uri> for additional guidance here.
738 </p>
739
740 </body>
741 </section>
742 <section>
743 <title>Building the kernel</title>
744 <body>
745
746 <p>
747 Now that we have configured the kernel, we can start the compilation process:
748 </p>
749
750 <pre caption="Compiling the kernel source">
751 # <i>make &amp;&amp; make modules_install</i>
752 </pre>
753
754 <note>
755 You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
756 longer required.
757 </note>
758
759 <p>
760 Wait for the kernel compilation to complete (and observe the much more readable
761 compilation output).
762 </p>
763
764 </body>
765 </section>
766 <section>
767 <title>Installing the kernel</title>
768 <body>
769
770 <p>
771 The next step is mounting your <path>/boot</path> partition and copying the
772 kernel image over. You must then update your bootloader config manually.
773 </p>
774
775 <pre caption="Installing the kernel">
776 # <i>mount /boot</i>
777 # <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.9-gentoo-r2</i>
778 # <i>cp System.map /boot/System.map-2.6.9-gentoo-r2</i>
779 </pre>
780
781 <p>
782 Note that the above instructions are examples only, you should follow your
783 usual procedure of updating kernels by following the instructions in the <uri
784 link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
785 link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
786 Kernel</uri> chapter).
787 </p>
788
789 <p>
790 When updating your bootloader config, do not remove the old entry pointing at
791 your 2.4 kernel. This way, you will easily be able to switch between the two if
792 something is not working.
793 </p>
794
795 <p>
796 Now continue onto the <uri link="#modules">Module Configuration</uri> section.
797 </p>
798
799 </body>
800 </section>
801 </chapter>
802
803 <chapter id="genkernel">
804 <title>Alternative: Using genkernel</title>
805 <section>
806 <body>
807
808 <p>
809 If you prefer to use genkernel instead of manually configuring your kernel, you
810 will be happy to hear that using genkernel to produce 2.6 kernels is very
811 similar to the process you performed when producing your previous 2.4 kernel.
812 </p>
813
814 <p>
815 You should invoke genkernel as shown below:
816 </p>
817
818 <pre caption="Invoking genkernel with some common arguments">
819 # <i>genkernel --udev --menuconfig --bootloader=grub all</i>
820 </pre>
821
822 <p>
823 In the above example, we also take advantage of genkernel features to open
824 menuconfig to allow you to customise the kernel configuration (if you wish),
825 and to update the grub bootloader configuration after compilation.
826 </p>
827
828 <p>
829 You should choose genkernel arguments that suit you, but do not forget to
830 include the <c>--udev</c> argument! Refer to the <uri
831 link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
832 link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
833 Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
834 Handbook</uri> for additional information.
835 </p>
836
837 <p>
838 If you choose to update your bootloader config yourself, then you must
839 remember to include the <c>udev</c> kernel parameter. A sample <e>grub</e>
840 config section is shown below, but remember to adjust the <e>real_root</e>
841 parameter for your system.
842 </p>
843
844 <pre caption="Sample GRUB config for genkernel + udev">
845 title=Gentoo Linux (2.6 kernel)
846 root (hd0,0)
847 kernel /kernel-2.6.9-gentoo-r2 <i>udev</i> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3
848 initrd /initrd-2.6.9-gentoo-r2
849 </pre>
850
851 </body>
852 </section>
853 </chapter>
854
855 <chapter id="modules">
856 <title>Module Configuration</title>
857
858 <section>
859 <title>Installing external modules</title>
860 <body>
861
862 <p>
863 Many users will additionally rely on kernel modules that are built outside of
864 the kernel tree. Common examples are the binary ATI and Nvidia graphics
865 drivers. You now need to install those modules, which will compile against the
866 2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
867 <c>emerge packagename</c> for all the external modules you are used to using
868 with 2.4.
869 </p>
870
871 <p>
872 Refer again to the <uri
873 link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
874 Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
875 Handbook</uri> for more info.
876 </p>
877
878 </body>
879 </section>
880 <section>
881 <title>Autoloading modules</title>
882 <body>
883
884 <p>
885 You may have decided to compile some kernel components as modules (as opposed
886 to compiled directly into the kernel) and would like to have them autoloaded on
887 bootup like you did with 2.4. Also, if you installed any external modules from
888 the portage tree (as described above) you will probably want to autoload them
889 too.
890 </p>
891
892 <p>
893 You can achieve this similarly as to how you did with 2.4. Simply open up the
894 file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
895 the names of the modules you would like autoloaded.
896 </p>
897
898 <pre caption="Opening the module autoload list in nano">
899 # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
900 </pre>
901
902 <pre caption="Sample autoload list to load the 3c59x and nvidia modules">
903 # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
904 #
905 # Note that this file is for 2.6 kernels.
906 #
907 # Add the names of modules that you'd like to load when the system
908 # starts into this file, one per line. Comments begin with # and
909 # are ignored. Read man modules.autoload for additional details.
910
911 3c59x
912 nvidia
913 </pre>
914
915 </body>
916 </section>
917 </chapter>
918
919 <chapter>
920 <title>Booting into Linux 2.6</title>
921 <section>
922 <body>
923
924 <p>
925 It's now time to boot into Linux 2.6. Close all applications and reboot:
926 </p>
927
928 <pre caption="Rebooting">
929 # <i>umount /boot</i>
930 # <i>reboot</i>
931 </pre>
932
933 <p>
934 When you reboot, if you followed this document correctly so far, you will have
935 the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
936 Choose Linux 2.6.
937 </p>
938
939 <p>
940 Once the system has booted, check that things are working. If you made a
941 mistake in the kernel configuration, don't worry, you can skip back to the
942 <uri link="#conf">Configuring, building, and installing the kernel</uri>
943 section, make your change, recompile and install new kernel image, reboot, and
944 try again!
945 </p>
946
947 </body>
948 </section>
949 <section>
950 <title>Configuring and unmuting ALSA</title>
951 <body>
952
953 <p>
954 We will now complete the ALSA configuration and unmute the audio channels. The
955 ALSA packages provide a useful utility to make this process relatively simple:
956 </p>
957
958 <pre caption="Invoking the automatic ALSA configuration utility">
959 # <i>alsaconf</i>
960 </pre>
961
962 <p>
963 The process is straightforward: allow the <e>/etc/modules.d/alsa</e> file to
964 be automatically updated, and then allow ALSA to be reloaded. alsaconf will
965 then terminate, however you will need to run it multiple times if you have
966 multiple sound devices installed in your system.
967 </p>
968
969 <p>
970 You should now add <c>alsasound</c> to your boot runlevel, so that volumes
971 will be saved on shutdown and restored on bootup:
972 </p>
973
974 <pre caption="Adding alsasound to the boot runlevel">
975 # <i>rc-update add alsasound boot</i>
976 </pre>
977
978 <note>
979 The <c>alsaconf</c> utility chooses initial volume levels for your sound
980 devices. If these are inappropriate, you can modify them at any time with the
981 <c>alsamixer</c> utility.
982 </note>
983
984 </body>
985 </section>
986 <section>
987 <title>Any immediate problems?</title>
988 <body>
989
990 <p>
991 At this stage you should refer back to the <uri link="#pitfalls">Known
992 pitfalls with Linux 2.6 migration</uri> section which may be helpful with any
993 issues you encounter immediately.
994 </p>
995
996 </body>
997 </section>
998 </chapter>
999
1000 <chapter>
1001 <title>Header files and NPTL</title>
1002 <section>
1003 <body>
1004
1005 <p>
1006 By now you are running Linux 2.6 and hopefully have all issues ironed out. You
1007 should now update your Linux kernel header files and re-merge glibc so that
1008 userspace applications can take advantage of new Linux 2.6 features.
1009 </p>
1010
1011 <pre caption="Updating to linux26-headers">
1012 # <i>emerge unmerge linux-headers</i>
1013 # <i>emerge linux26-headers</i>
1014 </pre>
1015
1016 <p>
1017 After updating your headers package, you should generally re-merge glibc.
1018 There is a new feature here that you may be interested in - NPTL. NPTL is a new
1019 threading model present in Linux 2.6, which features much quicker thread create
1020 and destroy times. This won't make much of a difference to most systems, but
1021 you may wish to enable it during this migration process! To enable NPTL, edit
1022 <path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
1023 </p>
1024
1025 <warn>
1026 With the current stable glibc ebuilds, you will be unable to boot a 2.4 kernel
1027 after compiling glibc with USE="nptl". Be warned, be careful!
1028 </warn>
1029
1030 <p>
1031 Now re-merge glibc (you should do this even if you did not choose to enable
1032 NPTL).
1033 </p>
1034
1035 <pre caption="Reinstalling glibc against the new kernel headers">
1036 # <i>emerge -a glibc</i>
1037 </pre>
1038
1039 <p>
1040 If you enabled NPTL, existing binaries will not use it until they are
1041 recompiled. However, any binaries compiled from this point onwards <e>will</e>
1042 use NPTL. You may wish to recompile all binaries now, e.g.:
1043 </p>
1044
1045 <pre caption="Recompiling all packages on the system">
1046 # <i>emerge -e world</i>
1047 </pre>
1048
1049 <p>
1050 Alternatively, you can just let your system "naturally" convert itself to NPTL
1051 as you update to newer versions of packages when they are released.
1052 </p>
1053
1054 </body>
1055 </section>
1056 </chapter>
1057
1058 <chapter>
1059 <title>Closing remarks</title>
1060 <section>
1061 <title>Problems?</title>
1062 <body>
1063
1064 <p>
1065 With the incredible amount of work that went into Linux 2.6, it is sometimes
1066 inevitable that things which used to work fine, no longer function as expected.
1067 </p>
1068
1069 <p>
1070 If you have any problems with your 2.6 kernel, and you can confirm that this
1071 problem does not exist with Linux 2.4, then please open a bug with us on our
1072 <uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
1073 issue, and if we find that it is a problem in the mainline kernel, we may then
1074 ask you to file a report at the central kernel bugzilla.
1075 </p>
1076
1077 </body>
1078 </section>
1079 <section>
1080 <title>Conclusion</title>
1081 <body>
1082
1083 <p>
1084 Hopefully you have just completed a smooth migration and you are enjoying the
1085 benefits which Linux 2.6 brings over 2.4. As I mentioned at the start, we are
1086 looking for feedback on this document - even if your migration went perfectly
1087 smoothly. Please <mail link="dsd@gentoo.org">mail me</mail> your feedback so
1088 that we can get this document in perfect shape for when 2005.0 comes around.
1089 Thanks!
1090 </p>
1091
1092 </body>
1093 </section>
1094 <section>
1095 <title>Removing Linux 2.4 from your system</title>
1096 <body>
1097
1098 <p>
1099 After you have been running 2.6 for a while, you may decide that you no longer
1100 have any requirement to be able to use Linux 2.4. The steps you can take to
1101 clean up your system are detailed below. Only follow this section if you are
1102 sure that you don't want/need to use 2.4 again!
1103 </p>
1104
1105 <p>
1106 The 2.4 kernel source code can be removed, using the emerge utility as usual.
1107 For example, assuming you have 2.4 versions of vanilla-sources and
1108 gentoo-sources installed, you could use the following command to remove them
1109 while keeping the 2.6 versions intact:
1110 </p>
1111
1112 <pre caption="Example: Removing Linux 2.4 sources">
1113 # <i>emerge unmerge =vanilla-sources-2.4.* =gentoo-sources-2.4.*</i>
1114 </pre>
1115
1116 <p>
1117 Portage will not completely clean out your 2.4 kernel source installations,
1118 because some temporary files are created during compilation. It is safe to
1119 remove these remnants with the following command:
1120 </p>
1121
1122 <pre caption="Removing remaining temporary files">
1123 # <i>rm -rf /usr/src/linux-2.4.*</i>
1124 </pre>
1125
1126 <p>
1127 You can additionally remove modules and information files relating to your
1128 old 2.4 kernel installations, as these are no longer needed.
1129 </p>
1130
1131 <pre caption="Removing previously-installed 2.4 modules">
1132 # <i>rm -rf /lib/modules/2.4.*</i>
1133 </pre>
1134
1135 <p>
1136 The 2.4 kernel binaries you used to boot from can also be safely removed.
1137 You should mount your <c>/boot</c> partition, and remove those images. You
1138 should also update your bootloader configuration so that it no longer
1139 references these deleted kernel images.
1140 </p>
1141
1142 <p>
1143 Some Linux 2.4 users will have previously installed the <c>alsa-drivers</c>
1144 package to benefit from the new audio capabilities included in Linux 2.6. If
1145 you were one of these users, and you followed the advice given earlier in this
1146 document about building ALSA with the 2.6 kernel sources (as opposed to using
1147 the <c>alsa-driver</c> package), then you can safely remove this to prevent
1148 future conflicts.
1149 </p>
1150
1151 <p>
1152 Additionally, <c>lm-sensors</c> users will have previously used the <c>i2c</c>
1153 package to provide the hardware drivers. As already mentioned, I2C drivers are
1154 now included in the kernel, so this package can also be removed in order to
1155 prevent future conflicts.
1156 </p>
1157
1158 <pre caption="Removing alsa-driver and i2c">
1159 # <i>emerge unmerge alsa-driver i2c</i>
1160 </pre>
1161
1162 </body>
1163 </section>
1164 </chapter>
1165 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20