/[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.26 - (hide annotations) (download) (as text)
Wed Jan 2 00:33:02 2008 UTC (6 years, 6 months ago) by nightmorph
Branch: MAIN
Changes since 1.25: +5 -6 lines
File MIME type: application/xml
updated 2.6 migration guide, bug 198821

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

  ViewVC Help
Powered by ViewVC 1.1.20