/[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.21 - (hide annotations) (download) (as text)
Thu Sep 8 10:32:09 2005 UTC (8 years, 11 months ago) by fox2mike
Branch: MAIN
Changes since 1.20: +10 -10 lines
File MIME type: application/xml
#101398 - Grammatical and spelling fixes, thanks to vanquirius and rane for reporting.

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

  ViewVC Help
Powered by ViewVC 1.1.20