/[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.15 - (hide annotations) (download) (as text)
Thu Apr 7 18:19:26 2005 UTC (9 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.14: +7 -8 lines
File MIME type: application/xml
Updates to migration guide thanks to dsd

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

  ViewVC Help
Powered by ViewVC 1.1.20