/[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.17 - (hide annotations) (download) (as text)
Thu Aug 25 00:52:49 2005 UTC (9 years, 6 months ago) by vapier
Branch: MAIN
Changes since 1.16: +4 -8 lines
File MIME type: application/xml
RAM disk support isnt required for udev so remove it from the kernel listing #103422 maxwang_tw@yahoo.com

1 neysx 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3    
4 vapier 1.17 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/migration-to-2.6.xml,v 1.16 2005/05/16 22:33:30 yoswink 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 vapier 1.17 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
24 bennyc 1.3 </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 vapier 1.17 <version>0.2.7</version>
32     <date>2005-08-24</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 yoswink 1.16 marked obsolete in Linux 2.6.
89 neysx 1.1 </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     <comment>(the following are required for ALSA):</comment>
737     Device Drivers ---&gt;
738     Sound ---&gt;
739     &lt;*&gt; Sound card support
740     Advanced Linux Sound Architecture ---&gt;
741     &lt;M&gt; Advanced Linux Sound Architecture
742     &lt;M&gt; Sequencer support
743     &lt;M&gt; OSS Mixer API
744     [*] OSS Sequencer API
745     <comment> (and dont forget to select your soundcard from the submenus!)</comment>
746 swift 1.9
747     <comment>(the following are required if you use LVM for disk management):</comment>
748     Device Drivers ---&gt;
749     Multi-device support (RAID and LVM) ---&gt;
750     [*] Multiple devices driver support (RAID and LVM)
751     &lt;*&gt; Device mapper support
752 neysx 1.1 </pre>
753    
754     <warn>
755     Previously you may have included support for the <path>/dev</path> file system
756     (now marked OBSOLETE). Do not enable devfs support. We have installed udev,
757     which we will be using instead of devfs from now on.
758     </warn>
759    
760     <p>
761     Also, remember to enable support for the filesystems that you use, and the
762     hardware present in your system. Be sure to enable support for the IDE
763     controller on your motherboard if you wish to benefit from fast DMA disk
764     access. Refer to the <uri
765     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
766     Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
767     Handbook</uri> for additional guidance here.
768     </p>
769    
770     </body>
771     </section>
772     <section>
773     <title>Building the kernel</title>
774     <body>
775    
776     <p>
777     Now that we have configured the kernel, we can start the compilation process:
778     </p>
779    
780     <pre caption="Compiling the kernel source">
781     # <i>make &amp;&amp; make modules_install</i>
782     </pre>
783    
784     <note>
785     You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
786     longer required.
787     </note>
788    
789     <p>
790     Wait for the kernel compilation to complete (and observe the much more readable
791     compilation output).
792     </p>
793    
794     </body>
795     </section>
796     <section>
797     <title>Installing the kernel</title>
798     <body>
799    
800     <p>
801     The next step is mounting your <path>/boot</path> partition and copying the
802     kernel image over. You must then update your bootloader config manually.
803     </p>
804    
805     <pre caption="Installing the kernel">
806     # <i>mount /boot</i>
807 swift 1.13 # <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.10-gentoo-r4</i>
808     # <i>cp System.map /boot/System.map-2.6.10-gentoo-r4</i>
809 neysx 1.1 </pre>
810    
811     <p>
812     Note that the above instructions are examples only, you should follow your
813     usual procedure of updating kernels by following the instructions in the <uri
814     link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
815     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
816     Kernel</uri> chapter).
817     </p>
818    
819     <p>
820     When updating your bootloader config, do not remove the old entry pointing at
821     your 2.4 kernel. This way, you will easily be able to switch between the two if
822     something is not working.
823     </p>
824    
825     <p>
826     Now continue onto the <uri link="#modules">Module Configuration</uri> section.
827     </p>
828    
829     </body>
830     </section>
831     </chapter>
832    
833     <chapter id="genkernel">
834     <title>Alternative: Using genkernel</title>
835     <section>
836     <body>
837    
838     <p>
839     If you prefer to use genkernel instead of manually configuring your kernel, you
840     will be happy to hear that using genkernel to produce 2.6 kernels is very
841     similar to the process you performed when producing your previous 2.4 kernel.
842     </p>
843    
844     <p>
845     You should invoke genkernel as shown below:
846     </p>
847    
848     <pre caption="Invoking genkernel with some common arguments">
849     # <i>genkernel --udev --menuconfig --bootloader=grub all</i>
850     </pre>
851    
852     <p>
853     In the above example, we also take advantage of genkernel features to open
854     menuconfig to allow you to customise the kernel configuration (if you wish),
855     and to update the grub bootloader configuration after compilation.
856     </p>
857    
858     <p>
859     You should choose genkernel arguments that suit you, but do not forget to
860     include the <c>--udev</c> argument! Refer to the <uri
861     link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
862     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
863     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
864     Handbook</uri> for additional information.
865     </p>
866    
867 swift 1.7 <p>
868     If you choose to update your bootloader config yourself, then you must
869     remember to include the <c>udev</c> kernel parameter. A sample <e>grub</e>
870     config section is shown below, but remember to adjust the <e>real_root</e>
871     parameter for your system.
872     </p>
873    
874     <pre caption="Sample GRUB config for genkernel + udev">
875     title=Gentoo Linux (2.6 kernel)
876     root (hd0,0)
877 swift 1.13 kernel /kernel-2.6.10-gentoo-r4 <i>udev</i> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3
878     initrd /initrd-2.6.10-gentoo-r4
879 swift 1.7 </pre>
880    
881 neysx 1.1 </body>
882     </section>
883     </chapter>
884    
885     <chapter id="modules">
886     <title>Module Configuration</title>
887    
888     <section>
889     <title>Installing external modules</title>
890     <body>
891    
892     <p>
893     Many users will additionally rely on kernel modules that are built outside of
894     the kernel tree. Common examples are the binary ATI and Nvidia graphics
895     drivers. You now need to install those modules, which will compile against the
896     2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
897     <c>emerge packagename</c> for all the external modules you are used to using
898     with 2.4.
899     </p>
900    
901     <p>
902     Refer again to the <uri
903     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=7">Configuring the
904     Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
905     Handbook</uri> for more info.
906     </p>
907    
908     </body>
909     </section>
910     <section>
911     <title>Autoloading modules</title>
912     <body>
913    
914     <p>
915     You may have decided to compile some kernel components as modules (as opposed
916     to compiled directly into the kernel) and would like to have them autoloaded on
917     bootup like you did with 2.4. Also, if you installed any external modules from
918     the portage tree (as described above) you will probably want to autoload them
919     too.
920     </p>
921    
922     <p>
923     You can achieve this similarly as to how you did with 2.4. Simply open up the
924     file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
925     the names of the modules you would like autoloaded.
926     </p>
927    
928     <pre caption="Opening the module autoload list in nano">
929     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
930     </pre>
931    
932     <pre caption="Sample autoload list to load the 3c59x and nvidia modules">
933     # /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
934     #
935     # Note that this file is for 2.6 kernels.
936     #
937     # Add the names of modules that you'd like to load when the system
938     # starts into this file, one per line. Comments begin with # and
939     # are ignored. Read man modules.autoload for additional details.
940    
941     3c59x
942     nvidia
943     </pre>
944    
945     </body>
946     </section>
947     </chapter>
948    
949     <chapter>
950 swift 1.9 <title>LVM to LVM2 migration</title>
951     <section>
952     <title>Upgrading to LVM2 tools</title>
953     <body>
954    
955     <note>
956     If you do not use LVM to manage your disk storage, you can safely skip
957     this chapter and skip onto the next.
958     </note>
959    
960     <p>
961     Fortunately, upgrading from the LVM1 user tools to the LVM2 versions is very
962     simple:
963     </p>
964    
965     <pre caption="Upgrading user-tools from LVM1 to LVM2">
966 cam 1.11 # <i>emerge --unmerge lvm-user</i>
967 swift 1.9 # <i>emerge lvm2</i>
968     </pre>
969    
970     <note>
971     The LVM2 tools are fully backwards-compatible with LVM1. Your disk data will
972     not be touched. You are not breaking any backwards-compatibility by doing
973     this, you will continue to be able to boot 2.4 as usual.
974     </note>
975    
976     </body>
977     </section>
978     </chapter>
979    
980     <chapter>
981 neysx 1.1 <title>Booting into Linux 2.6</title>
982     <section>
983     <body>
984    
985     <p>
986     It's now time to boot into Linux 2.6. Close all applications and reboot:
987     </p>
988    
989     <pre caption="Rebooting">
990     # <i>umount /boot</i>
991     # <i>reboot</i>
992     </pre>
993    
994     <p>
995     When you reboot, if you followed this document correctly so far, you will have
996     the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
997     Choose Linux 2.6.
998     </p>
999    
1000     <p>
1001     Once the system has booted, check that things are working. If you made a
1002     mistake in the kernel configuration, don't worry, you can skip back to the
1003     <uri link="#conf">Configuring, building, and installing the kernel</uri>
1004     section, make your change, recompile and install new kernel image, reboot, and
1005     try again!
1006     </p>
1007    
1008     </body>
1009     </section>
1010     <section>
1011 swift 1.8 <title>Configuring and unmuting ALSA</title>
1012 neysx 1.1 <body>
1013    
1014     <p>
1015 swift 1.8 We will now complete the ALSA configuration and unmute the audio channels. The
1016     ALSA packages provide a useful utility to make this process relatively simple:
1017     </p>
1018    
1019     <pre caption="Invoking the automatic ALSA configuration utility">
1020     # <i>alsaconf</i>
1021     </pre>
1022    
1023     <p>
1024     The process is straightforward: allow the <e>/etc/modules.d/alsa</e> file to
1025     be automatically updated, and then allow ALSA to be reloaded. alsaconf will
1026     then terminate, however you will need to run it multiple times if you have
1027     multiple sound devices installed in your system.
1028     </p>
1029    
1030     <p>
1031     You should now add <c>alsasound</c> to your boot runlevel, so that volumes
1032     will be saved on shutdown and restored on bootup:
1033 neysx 1.1 </p>
1034    
1035 swift 1.8 <pre caption="Adding alsasound to the boot runlevel">
1036     # <i>rc-update add alsasound boot</i>
1037     </pre>
1038    
1039 neysx 1.1 <note>
1040 swift 1.8 The <c>alsaconf</c> utility chooses initial volume levels for your sound
1041     devices. If these are inappropriate, you can modify them at any time with the
1042     <c>alsamixer</c> utility.
1043 neysx 1.1 </note>
1044    
1045     </body>
1046     </section>
1047 swift 1.7 <section>
1048     <title>Any immediate problems?</title>
1049     <body>
1050    
1051     <p>
1052     At this stage you should refer back to the <uri link="#pitfalls">Known
1053     pitfalls with Linux 2.6 migration</uri> section which may be helpful with any
1054     issues you encounter immediately.
1055     </p>
1056    
1057     </body>
1058     </section>
1059 neysx 1.1 </chapter>
1060    
1061     <chapter>
1062     <title>Header files and NPTL</title>
1063     <section>
1064     <body>
1065    
1066     <p>
1067     By now you are running Linux 2.6 and hopefully have all issues ironed out. You
1068     should now update your Linux kernel header files and re-merge glibc so that
1069     userspace applications can take advantage of new Linux 2.6 features.
1070     </p>
1071    
1072 swift 1.15 <pre caption="Updating to linux-headers">
1073     # <i>emerge -u linux-headers</i>
1074 neysx 1.1 </pre>
1075    
1076     <p>
1077     After updating your headers package, you should generally re-merge glibc.
1078     There is a new feature here that you may be interested in - NPTL. NPTL is a new
1079     threading model present in Linux 2.6, which features much quicker thread create
1080     and destroy times. This won't make much of a difference to most systems, but
1081     you may wish to enable it during this migration process! To enable NPTL, edit
1082     <path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
1083     </p>
1084    
1085     <warn>
1086 swift 1.15 If you choose to also enable the "nptlonly" flag, be aware that you will no
1087     longer be able to boot a 2.4 kernel.
1088 neysx 1.1 </warn>
1089    
1090     <p>
1091     Now re-merge glibc (you should do this even if you did not choose to enable
1092     NPTL).
1093     </p>
1094    
1095     <pre caption="Reinstalling glibc against the new kernel headers">
1096     # <i>emerge -a glibc</i>
1097     </pre>
1098    
1099     <p>
1100     If you enabled NPTL, existing binaries will not use it until they are
1101     recompiled. However, any binaries compiled from this point onwards <e>will</e>
1102     use NPTL. You may wish to recompile all binaries now, e.g.:
1103     </p>
1104    
1105     <pre caption="Recompiling all packages on the system">
1106     # <i>emerge -e world</i>
1107     </pre>
1108    
1109     <p>
1110     Alternatively, you can just let your system "naturally" convert itself to NPTL
1111     as you update to newer versions of packages when they are released.
1112     </p>
1113    
1114     </body>
1115     </section>
1116     </chapter>
1117    
1118     <chapter>
1119     <title>Closing remarks</title>
1120     <section>
1121     <title>Problems?</title>
1122     <body>
1123    
1124     <p>
1125     With the incredible amount of work that went into Linux 2.6, it is sometimes
1126     inevitable that things which used to work fine, no longer function as expected.
1127     </p>
1128    
1129     <p>
1130     If you have any problems with your 2.6 kernel, and you can confirm that this
1131     problem does not exist with Linux 2.4, then please open a bug with us on our
1132     <uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
1133     issue, and if we find that it is a problem in the mainline kernel, we may then
1134     ask you to file a report at the central kernel bugzilla.
1135     </p>
1136    
1137     </body>
1138     </section>
1139     <section>
1140     <title>Conclusion</title>
1141     <body>
1142    
1143     <p>
1144     Hopefully you have just completed a smooth migration and you are enjoying the
1145 swift 1.13 benefits which Linux 2.6 brings over 2.4.
1146     </p>
1147    
1148     <p>
1149     I would like to say a word of thanks to the many users who effectively
1150     'tested' this document while it was in its early stages, and provided feedback
1151     about how the migration process went. Sorry that I did not reply to all the
1152     emails (there were a lot!), but I did read every one, and refined this
1153     document where appropriate. Enjoy your 2.6-enhanced systems :)
1154 neysx 1.1 </p>
1155    
1156     </body>
1157     </section>
1158 swift 1.8 <section>
1159     <title>Removing Linux 2.4 from your system</title>
1160     <body>
1161    
1162     <p>
1163     After you have been running 2.6 for a while, you may decide that you no longer
1164     have any requirement to be able to use Linux 2.4. The steps you can take to
1165 swift 1.9 clean up your system are detailed below. <e>Only follow the procedure in this
1166     section if you are sure that you don't want/need to use 2.4 again!</e>
1167 swift 1.8 </p>
1168    
1169     <p>
1170     The 2.4 kernel source code can be removed, using the emerge utility as usual.
1171     For example, assuming you have 2.4 versions of vanilla-sources and
1172     gentoo-sources installed, you could use the following command to remove them
1173     while keeping the 2.6 versions intact:
1174     </p>
1175    
1176     <pre caption="Example: Removing Linux 2.4 sources">
1177 cam 1.11 # <i>emerge --unmerge =vanilla-sources-2.4.* =gentoo-sources-2.4.*</i>
1178 swift 1.8 </pre>
1179    
1180     <p>
1181     Portage will not completely clean out your 2.4 kernel source installations,
1182     because some temporary files are created during compilation. It is safe to
1183     remove these remnants with the following command:
1184     </p>
1185    
1186     <pre caption="Removing remaining temporary files">
1187     # <i>rm -rf /usr/src/linux-2.4.*</i>
1188     </pre>
1189    
1190     <p>
1191     You can additionally remove modules and information files relating to your
1192     old 2.4 kernel installations, as these are no longer needed.
1193     </p>
1194    
1195     <pre caption="Removing previously-installed 2.4 modules">
1196     # <i>rm -rf /lib/modules/2.4.*</i>
1197     </pre>
1198    
1199     <p>
1200     The 2.4 kernel binaries you used to boot from can also be safely removed.
1201     You should mount your <c>/boot</c> partition, and remove those images. You
1202     should also update your bootloader configuration so that it no longer
1203     references these deleted kernel images.
1204     </p>
1205    
1206     <p>
1207 swift 1.10 Some Linux 2.4 users will have previously installed the <c>alsa-driver</c>
1208 swift 1.8 package to benefit from the new audio capabilities included in Linux 2.6. If
1209     you were one of these users, and you followed the advice given earlier in this
1210     document about building ALSA with the 2.6 kernel sources (as opposed to using
1211     the <c>alsa-driver</c> package), then you can safely remove this to prevent
1212     future conflicts.
1213     </p>
1214    
1215     <p>
1216     Additionally, <c>lm-sensors</c> users will have previously used the <c>i2c</c>
1217     package to provide the hardware drivers. As already mentioned, I2C drivers are
1218     now included in the kernel, so this package can also be removed in order to
1219     prevent future conflicts.
1220     </p>
1221    
1222 swift 1.9 <p>
1223     The devfs management daemon, <c>devfsd</c>, can also safely be removed, now
1224     that we are using <c>udev</c> for device management.
1225     </p>
1226    
1227     <pre caption="Removing alsa-driver, i2c, and devfsd">
1228 cam 1.11 # <i>emerge --unmerge alsa-driver i2c devfsd</i>
1229 swift 1.9 </pre>
1230    
1231     <p>
1232     If you are LVM2 user, you may wish to convert your data into the LVM2 data
1233     format in order to benefit from the advantages which LVM2 provides.
1234     However, this operation will prevent you from ever accessing your LVM data
1235     from a 2.4 kernel. If you want to continue with the conversion (this is totally
1236     optional!), then you should examine the <c>vgconvert</c> man page for
1237     instructions on how to carry this out. An example is shown below, where
1238     <c>main</c> is the volume group name.
1239     </p>
1240    
1241     <pre caption="Converting a LVM1 volume to LVM2 format">
1242     # <i>vgconvert -M2 main</i>
1243 swift 1.8 </pre>
1244    
1245     </body>
1246     </section>
1247 neysx 1.1 </chapter>
1248     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20