/[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.25 - (show annotations) (download) (as text)
Wed Jan 2 00:24:34 2008 UTC (6 years, 11 months ago) by nightmorph
Branch: MAIN
Changes since 1.24: +1 -4 lines
File MIME type: application/xml
minor coding stuff, no content change

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

  ViewVC Help
Powered by ViewVC 1.1.20