/[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.13 - (hide annotations) (download) (as text)
Sat Apr 2 08:44:44 2005 UTC (9 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.12: +33 -42 lines
File MIME type: application/xml
#77441 - Sorry dsd, indeed, forgot this one

1 neysx 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3    
4 swift 1.13 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/migration-to-2.6.xml,v 1.12 2005/02/07 19:23:22 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.13 <version>0.2.4</version>
32     <date>2005-04-02</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     <uri link="http://www.gentoo.org/proj/en/releng/release/2005.0/releng/profile-update.xml">
367     2005.0 profile update document</uri> to switch to a 2.6-based profile, and
368     retry installing 2.6 kernel sources.
369     </p>
370    
371 neysx 1.1 </body>
372     </section>
373     <section>
374     <title>Updating the /usr/src/linux symbolic link</title>
375     <body>
376    
377     <p>
378     Various components of the Gentoo utilities rely on /usr/src/linux being a
379     symbolic link to the kernel sources that you are running (or wish to compile
380     against).
381     </p>
382    
383     <p>
384     We will now update our /usr/src/linux link to point at the kernel sources we
385     just installed. Continuing our example:
386     </p>
387    
388     <pre caption="Updating the /usr/src/linux softlink">
389     # <i>cd /usr/src</i>
390 swift 1.13 # <i>ln -sfn linux-2.6.10-gentoo-r4 linux</i>
391 neysx 1.1 </pre>
392    
393     </body>
394     </section>
395     </chapter>
396    
397 swift 1.7 <chapter id="pitfalls">
398 neysx 1.1 <title>Known pitfalls with Linux 2.6 migration</title>
399     <section>
400     <body>
401    
402     <p>
403     Before we get stuck into configuring the kernel, I'll attempt to detail the
404     most common errors that people make when migrating to Linux 2.6, as some of
405     these points will influence the way you configure the new kernel.
406     </p>
407    
408     <note>
409     Not all of these points are relevant at this stage, but I will detail them all
410     here in one place, and you can refer back at your leisure.
411     </note>
412    
413     </body>
414     </section>
415     <section>
416     <title>Don't use "make oldconfig" with a 2.4 .config</title>
417     <body>
418    
419     <note>
420     If you don't understand what this means, don't worry, you won't make this
421     mistake if you follow the rest of this guide correctly.
422     </note>
423    
424     <p>
425     You'll be asked many many questions, since there have been a large amount of
426     changes. Many people who do try a <c>make oldconfig</c> from a 2.4 config end
427     up creating an unworkable kernel (e.g. no output on-screen, no input from
428     keyboard, etc). Please save yourself the trouble, and use the traditional
429     <c>menuconfig</c> configuration method just this once.
430     </p>
431    
432     </body>
433     </section>
434     <section>
435     <title>Don't use ide-scsi for CD/DVD writing</title>
436     <body>
437    
438     <p>
439     In Linux 2.4, the only way to achieve good CD/DVD writing results was to enable
440     the (rather ugly) <c>ide-scsi</c> emulation. Thankfully, the IDE layer in Linux
441     2.6 has been extended to support CD/DVD writers much better.
442     </p>
443    
444     <p>
445     You don't need to enable any extra options to support CD writing. Just be sure
446     <e>not</e> to enable <c>ide-scsi</c> as you used to.
447     </p>
448    
449     </body>
450     </section>
451     <section>
452     <title>PC Speaker is now a configurable option</title>
453     <body>
454    
455     <p>
456     You won't get your normal console beeps (or any response from the PC speaker at
457     all) unless you specifically enable the new PC speaker option
458     (<c>CONFIG_INPUT_PCSPKR</c>):
459     </p>
460    
461     <pre caption="Location of PC speaker option">
462     Device Drivers ---&gt;
463     Input device support ---&gt;
464     [*] Misc
465     &lt;*&gt; PC Speaker support
466     </pre>
467    
468     <note>
469     By "PC speaker", I am referring to the analogue speaker that beeps once when
470     your system is powering up, I am not referring to normal sound hardware used
471     for playing music, etc.
472     </note>
473    
474     </body>
475     </section>
476     <section>
477     <title>New USB Storage block device driver sometimes problematic</title>
478     <body>
479    
480     <p>
481     Very recently, a new USB storage device driver has been added to the kernel.
482     At the time of writing, this driver ("ub") is still in its early stages and
483     some users find it to be unreliable. If you have problems accessing your USB
484     hard disk, USB flash disk, USB card reader, or USB digital camera, then you
485     could try reverting to the older SCSI-style driver:
486     </p>
487    
488     <pre caption="Disabling ub">
489     Device Drivers ---&gt;
490     Block devices ---&gt;
491     &lt; &gt; Low Performance USB Block driver
492     </pre>
493    
494     <note>
495     The older SCSI-style driver (USB Mass Storage support) is enabled by default.
496     It can be found under "Device Drivers --&gt; USB support", but will generally
497     not come into effect while ub is also present.
498     </note>
499    
500     </body>
501     </section>
502     <section>
503     <title>usbdevfs renamed to usbfs</title>
504     <body>
505    
506     <p>
507     If you have edited your <path>/etc/fstab</path> file to customise the way that
508     the USB device filesystem gets mounted, you may have to modify the filesystem
509     type from <e>usbdevfs</e> to <e>usbfs</e>.
510     </p>
511    
512     <note>
513     Recent 2.4 kernels will also allow you to use "usbfs" as well as "usbdevfs", so
514     you aren't breaking any backwards compatibility by doing this.
515     </note>
516    
517     </body>
518     </section>
519     <section>
520     <title>Don't renice X</title>
521     <body>
522    
523     <p>
524     If you are a desktop 2.4 user, you may have hacked your system into running X
525     at a higher priority, as in some cases it seems to provide better desktop
526     performance.
527     </p>
528    
529     <p>
530     There have been many scheduler changes in 2.6 which change this behaviour. If
531     you continue to run X at a higher priority, it will do exactly what it is
532     supposed to (run the <e>display server</e> at a very high priority) and you
533     will notice consequences such as sound stuttering and slow application load
534     times because your CPU is spending too long serving X and only X.
535     </p>
536    
537     <p>
538     In Linux 2.6, you no longer need to renice desktop applications to get good
539     interactivity. Please remove your "niceness" hacks!
540     </p>
541    
542     </body>
543     </section>
544     <section>
545 swift 1.8 <title>X11 config file should now use /dev/input/mice for PS/2 and USB
546     mice</title>
547 neysx 1.1 <body>
548    
549     <p>
550     One of the changes that a default udev configuration introduces is different
551     organisation of the mouse device nodes. Previously, you would have had nodes
552     such as <path>/dev/psaux</path> and <path>/dev/mouse</path>. You will now have
553     nodes such as <path>/dev/input/mouse0</path>, <path>/dev/input/mouse1</path>,
554     and a collective <path>/dev/input/mice</path> node which combines movements
555     from all mice.
556     </p>
557    
558     <p>
559     Since the old X configurations typically reference <path>/dev/mouse</path> or
560     <path>/dev/psaux</path> then you may get an error similar to the one shown
561     below when you attempt to start X11:
562     </p>
563    
564     <pre caption="Common error when starting X on a udev system for the first time">
565     (EE) xf86OpenSerial: Cannot open device /dev/mouse
566     No such file or directory.
567     (EE) Mouse0: cannot open input device
568     (EE) PreInit failed for input device "Mouse0"
569     No core pointer
570     </pre>
571    
572     <p>
573     To correct this, open your X11 config in a text editor, and update the mouse
574     <e>InputDevice</e> section to use the <path>/dev/input/mice</path> device. An
575     example is shown below:
576     </p>
577    
578     <pre caption="Opening your X11 config file">
579     # <i>nano -w /etc/X11/xorg.conf</i>
580     </pre>
581    
582     <note>
583     If you are still using XFree86, your config file will be
584     <path>/etc/X11/XF86Config</path>
585     </note>
586    
587     <pre caption="Sample mouse InputDevice section">
588     Section "InputDevice"
589     Identifier "Mouse0"
590     Driver "mouse"
591     Option "Protocol" "auto"
592     Option "Device" "/dev/input/mice"
593     EndSection
594     </pre>
595    
596 swift 1.12 <note>
597     If you are using a serial mouse, the new device path will be
598     <path>/dev/tts/0</path> instead of <path>/dev/ttyS0</path>.
599     </note>
600    
601 neysx 1.1 </body>
602     </section>
603 swift 1.8 <section>
604     <title>New Serial-ATA (SATA) drivers name the devices differently</title>
605     <body>
606    
607     <p>
608     If you used the original Serial ATA drivers under Linux 2.4, you probably
609     observed your SATA devices having names such as <c>/dev/hde</c>.
610     </p>
611    
612     <p>
613     Linux 2.6 introduces some new SATA drivers (libata) which are based on the
614     SCSI subsystem. As these drivers are based on SCSI, your SATA disks will now
615     show up as SCSI devices. Your first SATA disk will be named <c>/dev/sda</c>.
616     You will need to update your <c>/etc/fstab</c> file to reflect this, and you
617     will need to bear this in mind when choosing the root/real_root kernel boot
618     parameter later on.
619     </p>
620    
621     <note>
622     libata has been backported into recent versions of Linux 2.4, so you may
623     already be familiar with the new device naming.
624     </note>
625    
626     </body>
627     </section>
628     <section>
629     <title>bootsplash no longer maintained</title>
630     <body>
631    
632     <p>
633     If you used the <c>gentoo-sources-2.4</c> kernel, you may have used the
634     <e>bootsplash</e> functionality in order to provide yourself with a colourful
635     framebuffer console.
636     </p>
637    
638     <p>
639     The developer of bootsplash appears to have lost interest in his project, given
640     some design problems. However, Gentoo developer <e>Michal Januszewski</e> is
641     developing a successor, <c>gensplash</c>, which in included in the
642 swift 1.13 gentoo-sources-2.6 kernel. You can follow Michal's
643 swift 1.8 <uri link="http://dev.gentoo.org/~spock/projects/gensplash/archive/gensplash-in-5-easy-steps.txt">
644     Gensplash in 5 easy steps</uri> document in order to familiarize yourself with
645     how gensplash is operated.
646     </p>
647    
648     </body>
649     </section>
650     <section>
651     <title>I2C drivers now included in the kernel</title>
652     <body>
653    
654     <p>
655     If you use <c>lm-sensors</c> to monitor system temperatures and power levels,
656     you previously needed to install the <c>i2c</c> package in order to provide
657     hardware support.
658     </p>
659    
660     <p>
661     The I2C hardware drivers are now included in the Linux 2.6 kernel, no external
662     i2c package is required. Remember to compile support for your specific I2C
663     devices into the kernel configuration. You will then be able to use
664     <c>lm-sensors</c> as usual.
665     </p>
666    
667     </body>
668     </section>
669    
670    
671 neysx 1.1 </chapter>
672    
673     <chapter id="conf">
674     <title>Configuring, building, and installing the kernel</title>
675     <section>
676     <body>
677    
678     <p>
679     As with Linux 2.4, you have two options for managing your new kernel build.
680     </p>
681    
682     <ol>
683     <li>
684     The default method is to configure your kernel manually. This may seem
685     daunting but is the preferred way as long as you know your system. If you
686     wish to configure your new kernel manually, please continue on to the <uri
687     link="#manual">next chapter</uri>.
688     </li>
689     <li>
690     The alternative option is to use our <c>genkernel</c> utility to
691     automatically configure, compile, and install a kernel for you. If you wish
692     to use <c>genkernel</c> then skip over the next chapter and proceed with
693     <uri link="#genkernel">using genkernel</uri>.
694     </li>
695     </ol>
696    
697     </body>
698     </section>
699     </chapter>
700    
701     <chapter id="manual">
702     <title>Default: Manual configuration</title>
703     <section>
704     <title>Configuring the kernel</title>
705     <body>
706    
707     <p>
708     We'll now get on with configuring the kernel. Open menuconfig in the usual way:
709     </p>
710    
711     <pre caption="Invoking menuconfig">
712     # <i>cd /usr/src/linux</i>
713     # <i>make menuconfig</i>
714     </pre>
715    
716     <p>
717     You will probably be familiar with using menuconfig from configuring 2.4
718     kernels. Fortunately, the front end has barely changed at all, but you will
719     observe much better organisation of kernel options, plus <e>many</e> new
720     options that weren't present in 2.4.
721     </p>
722    
723     <p>
724     Be sure to enable the following important kernel options:
725     </p>
726    
727     <pre caption="Required kernel options">
728     File systems ---&gt;
729     Pseudo Filesystems ---&gt;
730     [*] /proc file system support
731     [*] Virtual memory file system support (former shm fs)
732    
733     <comment>(the following are required for udev):</comment>
734     General setup ---&gt;
735     [*] Support for hot-pluggable devices
736    
737     Device Drivers ---&gt;
738     Block devices ---&gt;
739     &lt;*&gt; RAM disk support
740    
741     <comment>(the following are required for ALSA):</comment>
742     Device Drivers ---&gt;
743     Sound ---&gt;
744     &lt;*&gt; Sound card support
745     Advanced Linux Sound Architecture ---&gt;
746     &lt;M&gt; Advanced Linux Sound Architecture
747     &lt;M&gt; Sequencer support
748     &lt;M&gt; OSS Mixer API
749     [*] OSS Sequencer API
750     <comment> (and dont forget to select your soundcard from the submenus!)</comment>
751 swift 1.9
752     <comment>(the following are required if you use LVM for disk management):</comment>
753     Device Drivers ---&gt;
754     Multi-device support (RAID and LVM) ---&gt;
755     [*] Multiple devices driver support (RAID and LVM)
756     &lt;*&gt; Device mapper support
757 neysx 1.1 </pre>
758    
759     <warn>
760     Previously you may have included support for the <path>/dev</path> file system
761     (now marked OBSOLETE). Do not enable devfs support. We have installed udev,
762     which we will be using instead of devfs from now on.
763     </warn>
764    
765     <p>
766     Also, remember to enable support for the filesystems that you use, and the
767     hardware present in your system. Be sure to enable support for the IDE
768     controller on your motherboard if you wish to benefit from fast DMA disk
769     access. Refer to the <uri
770     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
771     Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
772     Handbook</uri> for additional guidance here.
773     </p>
774    
775     </body>
776     </section>
777     <section>
778     <title>Building the kernel</title>
779     <body>
780    
781     <p>
782     Now that we have configured the kernel, we can start the compilation process:
783     </p>
784    
785     <pre caption="Compiling the kernel source">
786     # <i>make &amp;&amp; make modules_install</i>
787     </pre>
788    
789     <note>
790     You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
791     longer required.
792     </note>
793    
794     <p>
795     Wait for the kernel compilation to complete (and observe the much more readable
796     compilation output).
797     </p>
798    
799     </body>
800     </section>
801     <section>
802     <title>Installing the kernel</title>
803     <body>
804    
805     <p>
806     The next step is mounting your <path>/boot</path> partition and copying the
807     kernel image over. You must then update your bootloader config manually.
808     </p>
809    
810     <pre caption="Installing the kernel">
811     # <i>mount /boot</i>
812 swift 1.13 # <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.10-gentoo-r4</i>
813     # <i>cp System.map /boot/System.map-2.6.10-gentoo-r4</i>
814 neysx 1.1 </pre>
815    
816     <p>
817     Note that the above instructions are examples only, you should follow your
818     usual procedure of updating kernels by following the instructions in the <uri
819     link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
820     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
821     Kernel</uri> chapter).
822     </p>
823    
824     <p>
825     When updating your bootloader config, do not remove the old entry pointing at
826     your 2.4 kernel. This way, you will easily be able to switch between the two if
827     something is not working.
828     </p>
829    
830     <p>
831     Now continue onto the <uri link="#modules">Module Configuration</uri> section.
832     </p>
833    
834     </body>
835     </section>
836     </chapter>
837    
838     <chapter id="genkernel">
839     <title>Alternative: Using genkernel</title>
840     <section>
841     <body>
842    
843     <p>
844     If you prefer to use genkernel instead of manually configuring your kernel, you
845     will be happy to hear that using genkernel to produce 2.6 kernels is very
846     similar to the process you performed when producing your previous 2.4 kernel.
847     </p>
848    
849     <p>
850     You should invoke genkernel as shown below:
851     </p>
852    
853     <pre caption="Invoking genkernel with some common arguments">
854     # <i>genkernel --udev --menuconfig --bootloader=grub all</i>
855     </pre>
856    
857     <p>
858     In the above example, we also take advantage of genkernel features to open
859     menuconfig to allow you to customise the kernel configuration (if you wish),
860     and to update the grub bootloader configuration after compilation.
861     </p>
862    
863     <p>
864     You should choose genkernel arguments that suit you, but do not forget to
865     include the <c>--udev</c> argument! Refer to the <uri
866     link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
867     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
868     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
869     Handbook</uri> for additional information.
870     </p>
871    
872 swift 1.7 <p>
873     If you choose to update your bootloader config yourself, then you must
874     remember to include the <c>udev</c> kernel parameter. A sample <e>grub</e>
875     config section is shown below, but remember to adjust the <e>real_root</e>
876     parameter for your system.
877     </p>
878    
879     <pre caption="Sample GRUB config for genkernel + udev">
880     title=Gentoo Linux (2.6 kernel)
881     root (hd0,0)
882 swift 1.13 kernel /kernel-2.6.10-gentoo-r4 <i>udev</i> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3
883     initrd /initrd-2.6.10-gentoo-r4
884 swift 1.7 </pre>
885    
886 neysx 1.1 </body>
887     </section>
888     </chapter>
889    
890     <chapter id="modules">
891     <title>Module Configuration</title>
892    
893     <section>
894     <title>Installing external modules</title>
895     <body>
896    
897     <p>
898     Many users will additionally rely on kernel modules that are built outside of
899     the kernel tree. Common examples are the binary ATI and Nvidia graphics
900     drivers. You now need to install those modules, which will compile against the
901     2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
902     <c>emerge packagename</c> for all the external modules you are used to using
903     with 2.4.
904     </p>
905    
906     <p>
907     Refer again to the <uri
908     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
909     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
910     Handbook</uri> for more info.
911     </p>
912    
913     </body>
914     </section>
915     <section>
916     <title>Autoloading modules</title>
917     <body>
918    
919     <p>
920     You may have decided to compile some kernel components as modules (as opposed
921     to compiled directly into the kernel) and would like to have them autoloaded on
922     bootup like you did with 2.4. Also, if you installed any external modules from
923     the portage tree (as described above) you will probably want to autoload them
924     too.
925     </p>
926    
927     <p>
928     You can achieve this similarly as to how you did with 2.4. Simply open up the
929     file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
930     the names of the modules you would like autoloaded.
931     </p>
932    
933     <pre caption="Opening the module autoload list in nano">
934     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
935     </pre>
936    
937     <pre caption="Sample autoload list to load the 3c59x and nvidia modules">
938     # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
939     #
940     # Note that this file is for 2.6 kernels.
941     #
942     # Add the names of modules that you'd like to load when the system
943     # starts into this file, one per line. Comments begin with # and
944     # are ignored. Read man modules.autoload for additional details.
945    
946     3c59x
947     nvidia
948     </pre>
949    
950     </body>
951     </section>
952     </chapter>
953    
954     <chapter>
955 swift 1.9 <title>LVM to LVM2 migration</title>
956     <section>
957     <title>Upgrading to LVM2 tools</title>
958     <body>
959    
960     <note>
961     If you do not use LVM to manage your disk storage, you can safely skip
962     this chapter and skip onto the next.
963     </note>
964    
965     <p>
966     Fortunately, upgrading from the LVM1 user tools to the LVM2 versions is very
967     simple:
968     </p>
969    
970     <pre caption="Upgrading user-tools from LVM1 to LVM2">
971 cam 1.11 # <i>emerge --unmerge lvm-user</i>
972 swift 1.9 # <i>emerge lvm2</i>
973     </pre>
974    
975     <note>
976     The LVM2 tools are fully backwards-compatible with LVM1. Your disk data will
977     not be touched. You are not breaking any backwards-compatibility by doing
978     this, you will continue to be able to boot 2.4 as usual.
979     </note>
980    
981     </body>
982     </section>
983     </chapter>
984    
985     <chapter>
986 neysx 1.1 <title>Booting into Linux 2.6</title>
987     <section>
988     <body>
989    
990     <p>
991     It's now time to boot into Linux 2.6. Close all applications and reboot:
992     </p>
993    
994     <pre caption="Rebooting">
995     # <i>umount /boot</i>
996     # <i>reboot</i>
997     </pre>
998    
999     <p>
1000     When you reboot, if you followed this document correctly so far, you will have
1001     the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
1002     Choose Linux 2.6.
1003     </p>
1004    
1005     <p>
1006     Once the system has booted, check that things are working. If you made a
1007     mistake in the kernel configuration, don't worry, you can skip back to the
1008     <uri link="#conf">Configuring, building, and installing the kernel</uri>
1009     section, make your change, recompile and install new kernel image, reboot, and
1010     try again!
1011     </p>
1012    
1013     </body>
1014     </section>
1015     <section>
1016 swift 1.8 <title>Configuring and unmuting ALSA</title>
1017 neysx 1.1 <body>
1018    
1019     <p>
1020 swift 1.8 We will now complete the ALSA configuration and unmute the audio channels. The
1021     ALSA packages provide a useful utility to make this process relatively simple:
1022     </p>
1023    
1024     <pre caption="Invoking the automatic ALSA configuration utility">
1025     # <i>alsaconf</i>
1026     </pre>
1027    
1028     <p>
1029     The process is straightforward: allow the <e>/etc/modules.d/alsa</e> file to
1030     be automatically updated, and then allow ALSA to be reloaded. alsaconf will
1031     then terminate, however you will need to run it multiple times if you have
1032     multiple sound devices installed in your system.
1033     </p>
1034    
1035     <p>
1036     You should now add <c>alsasound</c> to your boot runlevel, so that volumes
1037     will be saved on shutdown and restored on bootup:
1038 neysx 1.1 </p>
1039    
1040 swift 1.8 <pre caption="Adding alsasound to the boot runlevel">
1041     # <i>rc-update add alsasound boot</i>
1042     </pre>
1043    
1044 neysx 1.1 <note>
1045 swift 1.8 The <c>alsaconf</c> utility chooses initial volume levels for your sound
1046     devices. If these are inappropriate, you can modify them at any time with the
1047     <c>alsamixer</c> utility.
1048 neysx 1.1 </note>
1049    
1050     </body>
1051     </section>
1052 swift 1.7 <section>
1053     <title>Any immediate problems?</title>
1054     <body>
1055    
1056     <p>
1057     At this stage you should refer back to the <uri link="#pitfalls">Known
1058     pitfalls with Linux 2.6 migration</uri> section which may be helpful with any
1059     issues you encounter immediately.
1060     </p>
1061    
1062     </body>
1063     </section>
1064 neysx 1.1 </chapter>
1065    
1066     <chapter>
1067     <title>Header files and NPTL</title>
1068     <section>
1069     <body>
1070    
1071     <p>
1072     By now you are running Linux 2.6 and hopefully have all issues ironed out. You
1073     should now update your Linux kernel header files and re-merge glibc so that
1074     userspace applications can take advantage of new Linux 2.6 features.
1075     </p>
1076    
1077     <pre caption="Updating to linux26-headers">
1078 cam 1.11 # <i>emerge --unmerge linux-headers</i>
1079 neysx 1.1 # <i>emerge linux26-headers</i>
1080     </pre>
1081    
1082     <p>
1083     After updating your headers package, you should generally re-merge glibc.
1084     There is a new feature here that you may be interested in - NPTL. NPTL is a new
1085     threading model present in Linux 2.6, which features much quicker thread create
1086     and destroy times. This won't make much of a difference to most systems, but
1087     you may wish to enable it during this migration process! To enable NPTL, edit
1088     <path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
1089     </p>
1090    
1091     <warn>
1092     With the current stable glibc ebuilds, you will be unable to boot a 2.4 kernel
1093     after compiling glibc with USE="nptl". Be warned, be careful!
1094     </warn>
1095    
1096     <p>
1097     Now re-merge glibc (you should do this even if you did not choose to enable
1098     NPTL).
1099     </p>
1100    
1101     <pre caption="Reinstalling glibc against the new kernel headers">
1102     # <i>emerge -a glibc</i>
1103     </pre>
1104    
1105     <p>
1106     If you enabled NPTL, existing binaries will not use it until they are
1107     recompiled. However, any binaries compiled from this point onwards <e>will</e>
1108     use NPTL. You may wish to recompile all binaries now, e.g.:
1109     </p>
1110    
1111     <pre caption="Recompiling all packages on the system">
1112     # <i>emerge -e world</i>
1113     </pre>
1114    
1115     <p>
1116     Alternatively, you can just let your system "naturally" convert itself to NPTL
1117     as you update to newer versions of packages when they are released.
1118     </p>
1119    
1120     </body>
1121     </section>
1122     </chapter>
1123    
1124     <chapter>
1125     <title>Closing remarks</title>
1126     <section>
1127     <title>Problems?</title>
1128     <body>
1129    
1130     <p>
1131     With the incredible amount of work that went into Linux 2.6, it is sometimes
1132     inevitable that things which used to work fine, no longer function as expected.
1133     </p>
1134    
1135     <p>
1136     If you have any problems with your 2.6 kernel, and you can confirm that this
1137     problem does not exist with Linux 2.4, then please open a bug with us on our
1138     <uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
1139     issue, and if we find that it is a problem in the mainline kernel, we may then
1140     ask you to file a report at the central kernel bugzilla.
1141     </p>
1142    
1143     </body>
1144     </section>
1145     <section>
1146     <title>Conclusion</title>
1147     <body>
1148    
1149     <p>
1150     Hopefully you have just completed a smooth migration and you are enjoying the
1151 swift 1.13 benefits which Linux 2.6 brings over 2.4.
1152     </p>
1153    
1154     <p>
1155     I would like to say a word of thanks to the many users who effectively
1156     'tested' this document while it was in its early stages, and provided feedback
1157     about how the migration process went. Sorry that I did not reply to all the
1158     emails (there were a lot!), but I did read every one, and refined this
1159     document where appropriate. Enjoy your 2.6-enhanced systems :)
1160 neysx 1.1 </p>
1161    
1162     </body>
1163     </section>
1164 swift 1.8 <section>
1165     <title>Removing Linux 2.4 from your system</title>
1166     <body>
1167    
1168     <p>
1169     After you have been running 2.6 for a while, you may decide that you no longer
1170     have any requirement to be able to use Linux 2.4. The steps you can take to
1171 swift 1.9 clean up your system are detailed below. <e>Only follow the procedure in this
1172     section if you are sure that you don't want/need to use 2.4 again!</e>
1173 swift 1.8 </p>
1174    
1175     <p>
1176     The 2.4 kernel source code can be removed, using the emerge utility as usual.
1177     For example, assuming you have 2.4 versions of vanilla-sources and
1178     gentoo-sources installed, you could use the following command to remove them
1179     while keeping the 2.6 versions intact:
1180     </p>
1181    
1182     <pre caption="Example: Removing Linux 2.4 sources">
1183 cam 1.11 # <i>emerge --unmerge =vanilla-sources-2.4.* =gentoo-sources-2.4.*</i>
1184 swift 1.8 </pre>
1185    
1186     <p>
1187     Portage will not completely clean out your 2.4 kernel source installations,
1188     because some temporary files are created during compilation. It is safe to
1189     remove these remnants with the following command:
1190     </p>
1191    
1192     <pre caption="Removing remaining temporary files">
1193     # <i>rm -rf /usr/src/linux-2.4.*</i>
1194     </pre>
1195    
1196     <p>
1197     You can additionally remove modules and information files relating to your
1198     old 2.4 kernel installations, as these are no longer needed.
1199     </p>
1200    
1201     <pre caption="Removing previously-installed 2.4 modules">
1202     # <i>rm -rf /lib/modules/2.4.*</i>
1203     </pre>
1204    
1205     <p>
1206     The 2.4 kernel binaries you used to boot from can also be safely removed.
1207     You should mount your <c>/boot</c> partition, and remove those images. You
1208     should also update your bootloader configuration so that it no longer
1209     references these deleted kernel images.
1210     </p>
1211    
1212     <p>
1213 swift 1.10 Some Linux 2.4 users will have previously installed the <c>alsa-driver</c>
1214 swift 1.8 package to benefit from the new audio capabilities included in Linux 2.6. If
1215     you were one of these users, and you followed the advice given earlier in this
1216     document about building ALSA with the 2.6 kernel sources (as opposed to using
1217     the <c>alsa-driver</c> package), then you can safely remove this to prevent
1218     future conflicts.
1219     </p>
1220    
1221     <p>
1222     Additionally, <c>lm-sensors</c> users will have previously used the <c>i2c</c>
1223     package to provide the hardware drivers. As already mentioned, I2C drivers are
1224     now included in the kernel, so this package can also be removed in order to
1225     prevent future conflicts.
1226     </p>
1227    
1228 swift 1.9 <p>
1229     The devfs management daemon, <c>devfsd</c>, can also safely be removed, now
1230     that we are using <c>udev</c> for device management.
1231     </p>
1232    
1233     <pre caption="Removing alsa-driver, i2c, and devfsd">
1234 cam 1.11 # <i>emerge --unmerge alsa-driver i2c devfsd</i>
1235 swift 1.9 </pre>
1236    
1237     <p>
1238     If you are LVM2 user, you may wish to convert your data into the LVM2 data
1239     format in order to benefit from the advantages which LVM2 provides.
1240     However, this operation will prevent you from ever accessing your LVM data
1241     from a 2.4 kernel. If you want to continue with the conversion (this is totally
1242     optional!), then you should examine the <c>vgconvert</c> man page for
1243     instructions on how to carry this out. An example is shown below, where
1244     <c>main</c> is the volume group name.
1245     </p>
1246    
1247     <pre caption="Converting a LVM1 volume to LVM2 format">
1248     # <i>vgconvert -M2 main</i>
1249 swift 1.8 </pre>
1250    
1251     </body>
1252     </section>
1253 neysx 1.1 </chapter>
1254     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20