| 1 |
<?xml version='1.0' encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
|
| 3 |
|
| 4 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/migration-to-2.6.xml,v 1.4 2004/11/27 14:19:18 neysx Exp $ -->
|
| 5 |
|
| 6 |
<guide link="/doc/en/migration-to-2.6.xml">
|
| 7 |
|
| 8 |
<title>The complete Gentoo Linux 2.6 migration guide</title>
|
| 9 |
|
| 10 |
<author title="Author">
|
| 11 |
<mail link="dsd@gentoo.org">Daniel Drake</mail>
|
| 12 |
</author>
|
| 13 |
<author title="Contributor">
|
| 14 |
<mail link="sergey_zlodey@mail.ru">Sergey Galkin</mail>
|
| 15 |
</author>
|
| 16 |
<author title="Contributor">
|
| 17 |
<mail link="svyatogor@gentoo.org">Sergey Kuleshov</mail>
|
| 18 |
</author>
|
| 19 |
<author title="Editor">
|
| 20 |
<mail link="neysx@gentoo.org">Xavier Neys</mail>
|
| 21 |
</author>
|
| 22 |
<author title="Editor">
|
| 23 |
<mail link="bennyc@gentoo.org">Benny Chuang</mail>
|
| 24 |
</author>
|
| 25 |
|
| 26 |
<abstract>
|
| 27 |
This document will aid you in the process of migrating from Linux 2.4 to Linux
|
| 28 |
2.6, devfs to udev and OSS to ALSA.
|
| 29 |
</abstract>
|
| 30 |
|
| 31 |
<version>0.1.3</version>
|
| 32 |
<date>2004-11-28</date>
|
| 33 |
|
| 34 |
<chapter>
|
| 35 |
<title>Introduction</title>
|
| 36 |
|
| 37 |
<section>
|
| 38 |
<title>Status of this document</title>
|
| 39 |
<body>
|
| 40 |
|
| 41 |
<p>
|
| 42 |
The migration processes described in this document are not minor changes. This
|
| 43 |
document is in early stages and may be missing some details but hopefully the
|
| 44 |
main things have been covered. If you do try a migration, please <uri
|
| 45 |
link="http://bugs.gentoo.org">report</uri> any problem you might encounter so
|
| 46 |
that we can refine this guide.
|
| 47 |
</p>
|
| 48 |
|
| 49 |
<p>
|
| 50 |
We are planning on making Linux 2.6 the default kernel for when 2005.0 is
|
| 51 |
released (for some arch's). At the same time, we will encourage all existing
|
| 52 |
users of those arch's to upgrade to Linux 2.6, as many will still be running
|
| 53 |
2.4. Your feedback on this document is much appreciated, so that when this
|
| 54 |
time comes, the document can be in good shape for the mass-migration.
|
| 55 |
</p>
|
| 56 |
|
| 57 |
</body>
|
| 58 |
</section>
|
| 59 |
|
| 60 |
<section>
|
| 61 |
<title>Whats new in Linux 2.6?</title>
|
| 62 |
<body>
|
| 63 |
|
| 64 |
<p>
|
| 65 |
That is no easy question to answer. Linux 2.6 is the result of over 2 years
|
| 66 |
of rapid development and stabilisation of new features, and is architectually
|
| 67 |
quite different from its 2.4 counterpart. Some of the more major changes are
|
| 68 |
listed below:
|
| 69 |
</p>
|
| 70 |
|
| 71 |
<ul>
|
| 72 |
<li>
|
| 73 |
Scheduler/Interactivity improvements: Linux feels very smooth on desktop
|
| 74 |
systems and copes much better than 2.4 while under load
|
| 75 |
</li>
|
| 76 |
<li>
|
| 77 |
Scalability: Linux now scales much better at both ends - on small embedded
|
| 78 |
devices and also systems with many processors
|
| 79 |
</li>
|
| 80 |
<li>Performance: Throughput from common applications is much improved</li>
|
| 81 |
<li>
|
| 82 |
Hardware support: Linux now supports many more architectures and hardware
|
| 83 |
devices out-of-the-box than any other operating system.
|
| 84 |
</li>
|
| 85 |
</ul>
|
| 86 |
|
| 87 |
<p>
|
| 88 |
Joseph Pranevich has written a very detailed document, <uri
|
| 89 |
link="http://www.kniggit.net/wwol26.html">The Wonderful World Of Linux
|
| 90 |
2.6</uri> which you may be interested to glance over. If you are interested in
|
| 91 |
the more technical details, you can refer to <uri
|
| 92 |
link="http://www.linux.org.uk/~davej/docs/post-halloween-2.6.txt">The
|
| 93 |
post-halloween document</uri> - but bear in mind that this is somewhat outdated
|
| 94 |
now.
|
| 95 |
</p>
|
| 96 |
|
| 97 |
</body>
|
| 98 |
</section>
|
| 99 |
<section>
|
| 100 |
<title>What is udev?</title>
|
| 101 |
<body>
|
| 102 |
|
| 103 |
<p>
|
| 104 |
In the past, Gentoo has instructed users to use <e>devfs</e> for managing the
|
| 105 |
/dev directory, which contains a series of device interfaces to allow system
|
| 106 |
applications to communicate with hardware (through the kernel).
|
| 107 |
</p>
|
| 108 |
|
| 109 |
<p>
|
| 110 |
<e>devfs</e>, whilst a good concept, has some internal problems, and has been
|
| 111 |
marked obselete in Linux 2.6.
|
| 112 |
</p>
|
| 113 |
|
| 114 |
<p>
|
| 115 |
<e>udev</e> is the new way of managing device nodes. It addresses issues with
|
| 116 |
previous device managers, and also attempts to solve some other problems.
|
| 117 |
</p>
|
| 118 |
|
| 119 |
<p>
|
| 120 |
The above may not mean much to you, but fear not, the hard working Gentoo
|
| 121 |
developers have put effort into making the migration from devfs very easy.
|
| 122 |
</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 |
</chapter>
|
| 151 |
|
| 152 |
<chapter>
|
| 153 |
<title>Preparation</title>
|
| 154 |
<section>
|
| 155 |
<title>Get your system up-to-date</title>
|
| 156 |
<body>
|
| 157 |
|
| 158 |
<p>
|
| 159 |
Some of the changes brought in with Linux 2.6 also required some changes in the
|
| 160 |
base system applications. Before continuing, you should ensure that your system
|
| 161 |
is relatively up-to-date, and to be perfectly sure, you should update all world
|
| 162 |
and system packages where updates are available.
|
| 163 |
</p>
|
| 164 |
|
| 165 |
<p>
|
| 166 |
In particular, make sure you have the latest stable versions of the following
|
| 167 |
packages:
|
| 168 |
</p>
|
| 169 |
|
| 170 |
<ul>
|
| 171 |
<li><c>sys-apps/baselayout</c></li>
|
| 172 |
<li><c>sys-apps/util-linux</c></li>
|
| 173 |
<li>
|
| 174 |
<c>sys-kernel/genkernel</c> (only if you wish to use genkernel as opposed
|
| 175 |
to manual configuration)
|
| 176 |
</li>
|
| 177 |
</ul>
|
| 178 |
|
| 179 |
<pre caption="Updating all world packages">
|
| 180 |
# <i>emerge sync</i>
|
| 181 |
# <i>emerge -ua world</i>
|
| 182 |
</pre>
|
| 183 |
|
| 184 |
</body>
|
| 185 |
</section>
|
| 186 |
<section>
|
| 187 |
<title>modutils vs module-init-tools</title>
|
| 188 |
<body>
|
| 189 |
|
| 190 |
<p>
|
| 191 |
<c>sys-apps/modutils</c> is the package that provides tools such as
|
| 192 |
<c>modprobe</c>, <c>rmmod</c> and <c>insmod</c> for Linux 2.4.
|
| 193 |
</p>
|
| 194 |
|
| 195 |
<p>
|
| 196 |
Linux 2.6 introduces a new module format, and therefore requires new tools for
|
| 197 |
handling modules. These are bundled up into the
|
| 198 |
<c>sys-apps/module-init-tools</c> package. </p>
|
| 199 |
|
| 200 |
<p>
|
| 201 |
You should now remove modutils and install module-init-tools:
|
| 202 |
</p>
|
| 203 |
|
| 204 |
<pre caption="Switching from modutils to module-init-tools">
|
| 205 |
# <i>emerge unmerge sys-apps/modutils</i>
|
| 206 |
# <i>emerge module-init-tools</i>
|
| 207 |
</pre>
|
| 208 |
|
| 209 |
<note>
|
| 210 |
Don't worry - even though you have just unmerged modutils, module-init-tools
|
| 211 |
provides backwards compatibility for Linux 2.4, so you will still be
|
| 212 |
able to boot into Linux 2.4 and handle modules for that kernel.
|
| 213 |
</note>
|
| 214 |
|
| 215 |
<note>
|
| 216 |
For the above reason, module-init-tools might already be installed and working
|
| 217 |
with your existing Linux 2.4 kernel. In this case, you don't need to worry
|
| 218 |
about this stage - your system is already ready to deal with Linux 2.6 modules.
|
| 219 |
</note>
|
| 220 |
|
| 221 |
</body>
|
| 222 |
</section>
|
| 223 |
<section>
|
| 224 |
<title>Installing udev</title>
|
| 225 |
<body>
|
| 226 |
|
| 227 |
<p>
|
| 228 |
There is no configuration involved here. Simply use <c>emerge</c> to install
|
| 229 |
udev:
|
| 230 |
</p>
|
| 231 |
|
| 232 |
<pre caption="Installing udev">
|
| 233 |
# <i>emerge -a udev</i>
|
| 234 |
</pre>
|
| 235 |
|
| 236 |
</body>
|
| 237 |
</section>
|
| 238 |
<section>
|
| 239 |
<title>Checking for essential device nodes</title>
|
| 240 |
<body>
|
| 241 |
|
| 242 |
<p>
|
| 243 |
When the system boots up, the system requires some essential device nodes. As
|
| 244 |
udev is not included in the kernel, it is not activated immediately. To work
|
| 245 |
around this, you must ensure that you have some essential device nodes on your
|
| 246 |
disk.
|
| 247 |
</p>
|
| 248 |
|
| 249 |
<p>
|
| 250 |
Our installation stage files will have created the required devices during the
|
| 251 |
initial installation. However, some users have reported that this is not the
|
| 252 |
case. We will use this opportunity to check that the device files exist, and
|
| 253 |
create them if they do not.
|
| 254 |
</p>
|
| 255 |
|
| 256 |
<p>
|
| 257 |
As your existing device manager will be mounted at /dev, we cannot access it
|
| 258 |
directly. So we will bind-mount your root partition to another location and
|
| 259 |
access the /dev directory from there.
|
| 260 |
</p>
|
| 261 |
|
| 262 |
<pre caption="Bind-mounting your root partition and listing static devices">
|
| 263 |
# <i>mkdir -p /mnt/temp</i>
|
| 264 |
# <i>mount -o bind / /mnt/temp</i>
|
| 265 |
# <i>cd /mnt/temp/dev</i>
|
| 266 |
# <i>ls -l console null</i>
|
| 267 |
</pre>
|
| 268 |
|
| 269 |
<p>
|
| 270 |
If the above <e>ls</e> command reported that either <c>console</c> or
|
| 271 |
<c>null</c> do not exist, then you must create them yourself, as shown below.
|
| 272 |
</p>
|
| 273 |
|
| 274 |
<pre caption="Creating the missing console and null nodes">
|
| 275 |
# <i>mknod -m 660 console c 5 1</i>
|
| 276 |
# <i>mknod -m 660 null c 1 3</i>
|
| 277 |
</pre>
|
| 278 |
|
| 279 |
<p>
|
| 280 |
You should now unmount your bind-mounted root partition, even if you did not
|
| 281 |
have to create those devices:
|
| 282 |
</p>
|
| 283 |
|
| 284 |
<pre caption="Unmounting the bind-mounted root">
|
| 285 |
# <i>umount /mnt/temp</i>
|
| 286 |
</pre>
|
| 287 |
|
| 288 |
</body>
|
| 289 |
</section>
|
| 290 |
<section>
|
| 291 |
<title>Installing ALSA utilities</title>
|
| 292 |
<body>
|
| 293 |
|
| 294 |
<p>
|
| 295 |
ALSA requires you to have some packages installed, so that applications can use
|
| 296 |
the ALSA API. These packages will also allow you to control the mixer and
|
| 297 |
volume levels. Install the required utilities as follows:
|
| 298 |
</p>
|
| 299 |
|
| 300 |
<pre caption="Installing ALSA utilities and libraries">
|
| 301 |
# <i>emerge -a alsa-lib alsa-utils alsa-tools alsa-headers alsa-oss</i>
|
| 302 |
</pre>
|
| 303 |
|
| 304 |
</body>
|
| 305 |
</section>
|
| 306 |
</chapter>
|
| 307 |
|
| 308 |
<chapter>
|
| 309 |
<title>Installing the Linux 2.6 sources</title>
|
| 310 |
|
| 311 |
<section>
|
| 312 |
<title>Choosing and installing a kernel</title>
|
| 313 |
<body>
|
| 314 |
|
| 315 |
<p>
|
| 316 |
The first thing you need to do is install sources of a 2.6 kernel of your
|
| 317 |
choice. The two Gentoo-supported 2.6 kernels are currently
|
| 318 |
<e>gentoo-dev-sources</e> (for desktops) and <e>hardened-dev-sources</e> (for
|
| 319 |
servers). There are others available, see the <uri
|
| 320 |
link="/doc/en/gentoo-kernel.xml">Gentoo Linux Kernel Guide</uri> for more
|
| 321 |
choices.
|
| 322 |
</p>
|
| 323 |
|
| 324 |
<p>
|
| 325 |
In this guide, we'll use <c>gentoo-dev-sources</c> as an example. Install your
|
| 326 |
chosen set of kernel sources using the <c>emerge</c> utility:
|
| 327 |
</p>
|
| 328 |
|
| 329 |
<pre caption="Installing gentoo-dev-sources">
|
| 330 |
# <i>emerge -a gentoo-dev-sources</i>
|
| 331 |
These are the packages that I would merge, in order:
|
| 332 |
Calculating dependencies ...done!
|
| 333 |
[ebuild N ] sys-kernel/gentoo-dev-sources-2.6.9-r2
|
| 334 |
|
| 335 |
Do you want me to merge these packages? [Yes/No] <i>y</i>
|
| 336 |
</pre>
|
| 337 |
|
| 338 |
</body>
|
| 339 |
</section>
|
| 340 |
<section>
|
| 341 |
<title>Updating the /usr/src/linux symbolic link</title>
|
| 342 |
<body>
|
| 343 |
|
| 344 |
<p>
|
| 345 |
Various components of the Gentoo utilities rely on /usr/src/linux being a
|
| 346 |
symbolic link to the kernel sources that you are running (or wish to compile
|
| 347 |
against).
|
| 348 |
</p>
|
| 349 |
|
| 350 |
<p>
|
| 351 |
We will now update our /usr/src/linux link to point at the kernel sources we
|
| 352 |
just installed. Continuing our example:
|
| 353 |
</p>
|
| 354 |
|
| 355 |
<pre caption="Updating the /usr/src/linux softlink">
|
| 356 |
# <i>cd /usr/src</i>
|
| 357 |
# <i>ln -sfn linux-2.6.9-gentoo-r2 linux</i>
|
| 358 |
</pre>
|
| 359 |
|
| 360 |
</body>
|
| 361 |
</section>
|
| 362 |
</chapter>
|
| 363 |
|
| 364 |
<chapter>
|
| 365 |
<title>Known pitfalls with Linux 2.6 migration</title>
|
| 366 |
<section>
|
| 367 |
<body>
|
| 368 |
|
| 369 |
<p>
|
| 370 |
Before we get stuck into configuring the kernel, I'll attempt to detail the
|
| 371 |
most common errors that people make when migrating to Linux 2.6, as some of
|
| 372 |
these points will influence the way you configure the new kernel.
|
| 373 |
</p>
|
| 374 |
|
| 375 |
<note>
|
| 376 |
Not all of these points are relevant at this stage, but I will detail them all
|
| 377 |
here in one place, and you can refer back at your leisure.
|
| 378 |
</note>
|
| 379 |
|
| 380 |
</body>
|
| 381 |
</section>
|
| 382 |
<section>
|
| 383 |
<title>Don't use "make oldconfig" with a 2.4 .config</title>
|
| 384 |
<body>
|
| 385 |
|
| 386 |
<note>
|
| 387 |
If you don't understand what this means, don't worry, you won't make this
|
| 388 |
mistake if you follow the rest of this guide correctly.
|
| 389 |
</note>
|
| 390 |
|
| 391 |
<p>
|
| 392 |
You'll be asked many many questions, since there have been a large amount of
|
| 393 |
changes. Many people who do try a <c>make oldconfig</c> from a 2.4 config end
|
| 394 |
up creating an unworkable kernel (e.g. no output on-screen, no input from
|
| 395 |
keyboard, etc). Please save yourself the trouble, and use the traditional
|
| 396 |
<c>menuconfig</c> configuration method just this once.
|
| 397 |
</p>
|
| 398 |
|
| 399 |
</body>
|
| 400 |
</section>
|
| 401 |
<section>
|
| 402 |
<title>Don't use ide-scsi for CD/DVD writing</title>
|
| 403 |
<body>
|
| 404 |
|
| 405 |
<p>
|
| 406 |
In Linux 2.4, the only way to achieve good CD/DVD writing results was to enable
|
| 407 |
the (rather ugly) <c>ide-scsi</c> emulation. Thankfully, the IDE layer in Linux
|
| 408 |
2.6 has been extended to support CD/DVD writers much better.
|
| 409 |
</p>
|
| 410 |
|
| 411 |
<p>
|
| 412 |
You don't need to enable any extra options to support CD writing. Just be sure
|
| 413 |
<e>not</e> to enable <c>ide-scsi</c> as you used to.
|
| 414 |
</p>
|
| 415 |
|
| 416 |
</body>
|
| 417 |
</section>
|
| 418 |
<section>
|
| 419 |
<title>PC Speaker is now a configurable option</title>
|
| 420 |
<body>
|
| 421 |
|
| 422 |
<p>
|
| 423 |
You won't get your normal console beeps (or any response from the PC speaker at
|
| 424 |
all) unless you specifically enable the new PC speaker option
|
| 425 |
(<c>CONFIG_INPUT_PCSPKR</c>):
|
| 426 |
</p>
|
| 427 |
|
| 428 |
<pre caption="Location of PC speaker option">
|
| 429 |
Device Drivers --->
|
| 430 |
Input device support --->
|
| 431 |
[*] Misc
|
| 432 |
<*> PC Speaker support
|
| 433 |
</pre>
|
| 434 |
|
| 435 |
<note>
|
| 436 |
By "PC speaker", I am referring to the analogue speaker that beeps once when
|
| 437 |
your system is powering up, I am not referring to normal sound hardware used
|
| 438 |
for playing music, etc.
|
| 439 |
</note>
|
| 440 |
|
| 441 |
</body>
|
| 442 |
</section>
|
| 443 |
<section>
|
| 444 |
<title>New USB Storage block device driver sometimes problematic</title>
|
| 445 |
<body>
|
| 446 |
|
| 447 |
<p>
|
| 448 |
Very recently, a new USB storage device driver has been added to the kernel.
|
| 449 |
At the time of writing, this driver ("ub") is still in its early stages and
|
| 450 |
some users find it to be unreliable. If you have problems accessing your USB
|
| 451 |
hard disk, USB flash disk, USB card reader, or USB digital camera, then you
|
| 452 |
could try reverting to the older SCSI-style driver:
|
| 453 |
</p>
|
| 454 |
|
| 455 |
<pre caption="Disabling ub">
|
| 456 |
Device Drivers --->
|
| 457 |
Block devices --->
|
| 458 |
< > Low Performance USB Block driver
|
| 459 |
</pre>
|
| 460 |
|
| 461 |
<note>
|
| 462 |
The older SCSI-style driver (USB Mass Storage support) is enabled by default.
|
| 463 |
It can be found under "Device Drivers --> USB support", but will generally
|
| 464 |
not come into effect while ub is also present.
|
| 465 |
</note>
|
| 466 |
|
| 467 |
</body>
|
| 468 |
</section>
|
| 469 |
<section>
|
| 470 |
<title>usbdevfs renamed to usbfs</title>
|
| 471 |
<body>
|
| 472 |
|
| 473 |
<p>
|
| 474 |
If you have edited your <path>/etc/fstab</path> file to customise the way that
|
| 475 |
the USB device filesystem gets mounted, you may have to modify the filesystem
|
| 476 |
type from <e>usbdevfs</e> to <e>usbfs</e>.
|
| 477 |
</p>
|
| 478 |
|
| 479 |
<note>
|
| 480 |
Recent 2.4 kernels will also allow you to use "usbfs" as well as "usbdevfs", so
|
| 481 |
you aren't breaking any backwards compatibility by doing this.
|
| 482 |
</note>
|
| 483 |
|
| 484 |
</body>
|
| 485 |
</section>
|
| 486 |
<section>
|
| 487 |
<title>Don't renice X</title>
|
| 488 |
<body>
|
| 489 |
|
| 490 |
<p>
|
| 491 |
If you are a desktop 2.4 user, you may have hacked your system into running X
|
| 492 |
at a higher priority, as in some cases it seems to provide better desktop
|
| 493 |
performance.
|
| 494 |
</p>
|
| 495 |
|
| 496 |
<p>
|
| 497 |
There have been many scheduler changes in 2.6 which change this behaviour. If
|
| 498 |
you continue to run X at a higher priority, it will do exactly what it is
|
| 499 |
supposed to (run the <e>display server</e> at a very high priority) and you
|
| 500 |
will notice consequences such as sound stuttering and slow application load
|
| 501 |
times because your CPU is spending too long serving X and only X.
|
| 502 |
</p>
|
| 503 |
|
| 504 |
<p>
|
| 505 |
In Linux 2.6, you no longer need to renice desktop applications to get good
|
| 506 |
interactivity. Please remove your "niceness" hacks!
|
| 507 |
</p>
|
| 508 |
|
| 509 |
</body>
|
| 510 |
</section>
|
| 511 |
<section>
|
| 512 |
<title>X11 config file should now use /dev/input/mice</title>
|
| 513 |
<body>
|
| 514 |
|
| 515 |
<p>
|
| 516 |
One of the changes that a default udev configuration introduces is different
|
| 517 |
organisation of the mouse device nodes. Previously, you would have had nodes
|
| 518 |
such as <path>/dev/psaux</path> and <path>/dev/mouse</path>. You will now have
|
| 519 |
nodes such as <path>/dev/input/mouse0</path>, <path>/dev/input/mouse1</path>,
|
| 520 |
and a collective <path>/dev/input/mice</path> node which combines movements
|
| 521 |
from all mice.
|
| 522 |
</p>
|
| 523 |
|
| 524 |
<p>
|
| 525 |
Since the old X configurations typically reference <path>/dev/mouse</path> or
|
| 526 |
<path>/dev/psaux</path> then you may get an error similar to the one shown
|
| 527 |
below when you attempt to start X11:
|
| 528 |
</p>
|
| 529 |
|
| 530 |
<pre caption="Common error when starting X on a udev system for the first time">
|
| 531 |
(EE) xf86OpenSerial: Cannot open device /dev/mouse
|
| 532 |
No such file or directory.
|
| 533 |
(EE) Mouse0: cannot open input device
|
| 534 |
(EE) PreInit failed for input device "Mouse0"
|
| 535 |
No core pointer
|
| 536 |
</pre>
|
| 537 |
|
| 538 |
<p>
|
| 539 |
To correct this, open your X11 config in a text editor, and update the mouse
|
| 540 |
<e>InputDevice</e> section to use the <path>/dev/input/mice</path> device. An
|
| 541 |
example is shown below:
|
| 542 |
</p>
|
| 543 |
|
| 544 |
<pre caption="Opening your X11 config file">
|
| 545 |
# <i>nano -w /etc/X11/xorg.conf</i>
|
| 546 |
</pre>
|
| 547 |
|
| 548 |
<note>
|
| 549 |
If you are still using XFree86, your config file will be
|
| 550 |
<path>/etc/X11/XF86Config</path>
|
| 551 |
</note>
|
| 552 |
|
| 553 |
<pre caption="Sample mouse InputDevice section">
|
| 554 |
Section "InputDevice"
|
| 555 |
Identifier "Mouse0"
|
| 556 |
Driver "mouse"
|
| 557 |
Option "Protocol" "auto"
|
| 558 |
Option "Device" "/dev/input/mice"
|
| 559 |
EndSection
|
| 560 |
</pre>
|
| 561 |
|
| 562 |
</body>
|
| 563 |
</section>
|
| 564 |
</chapter>
|
| 565 |
|
| 566 |
<chapter id="conf">
|
| 567 |
<title>Configuring, building, and installing the kernel</title>
|
| 568 |
<section>
|
| 569 |
<body>
|
| 570 |
|
| 571 |
<p>
|
| 572 |
As with Linux 2.4, you have two options for managing your new kernel build.
|
| 573 |
</p>
|
| 574 |
|
| 575 |
<ol>
|
| 576 |
<li>
|
| 577 |
The default method is to configure your kernel manually. This may seem
|
| 578 |
daunting but is the preferred way as long as you know your system. If you
|
| 579 |
wish to configure your new kernel manually, please continue on to the <uri
|
| 580 |
link="#manual">next chapter</uri>.
|
| 581 |
</li>
|
| 582 |
<li>
|
| 583 |
The alternative option is to use our <c>genkernel</c> utility to
|
| 584 |
automatically configure, compile, and install a kernel for you. If you wish
|
| 585 |
to use <c>genkernel</c> then skip over the next chapter and proceed with
|
| 586 |
<uri link="#genkernel">using genkernel</uri>.
|
| 587 |
</li>
|
| 588 |
</ol>
|
| 589 |
|
| 590 |
</body>
|
| 591 |
</section>
|
| 592 |
</chapter>
|
| 593 |
|
| 594 |
<chapter id="manual">
|
| 595 |
<title>Default: Manual configuration</title>
|
| 596 |
<section>
|
| 597 |
<title>Configuring the kernel</title>
|
| 598 |
<body>
|
| 599 |
|
| 600 |
<p>
|
| 601 |
We'll now get on with configuring the kernel. Open menuconfig in the usual way:
|
| 602 |
</p>
|
| 603 |
|
| 604 |
<pre caption="Invoking menuconfig">
|
| 605 |
# <i>cd /usr/src/linux</i>
|
| 606 |
# <i>make menuconfig</i>
|
| 607 |
</pre>
|
| 608 |
|
| 609 |
<p>
|
| 610 |
You will probably be familiar with using menuconfig from configuring 2.4
|
| 611 |
kernels. Fortunately, the front end has barely changed at all, but you will
|
| 612 |
observe much better organisation of kernel options, plus <e>many</e> new
|
| 613 |
options that weren't present in 2.4.
|
| 614 |
</p>
|
| 615 |
|
| 616 |
<p>
|
| 617 |
Be sure to enable the following important kernel options:
|
| 618 |
</p>
|
| 619 |
|
| 620 |
<pre caption="Required kernel options">
|
| 621 |
File systems --->
|
| 622 |
Pseudo Filesystems --->
|
| 623 |
[*] /proc file system support
|
| 624 |
[*] Virtual memory file system support (former shm fs)
|
| 625 |
|
| 626 |
<comment>(the following are required for udev):</comment>
|
| 627 |
General setup --->
|
| 628 |
[*] Support for hot-pluggable devices
|
| 629 |
|
| 630 |
Device Drivers --->
|
| 631 |
Block devices --->
|
| 632 |
<*> RAM disk support
|
| 633 |
|
| 634 |
<comment>(the following are required for ALSA):</comment>
|
| 635 |
Device Drivers --->
|
| 636 |
Sound --->
|
| 637 |
<*> Sound card support
|
| 638 |
Advanced Linux Sound Architecture --->
|
| 639 |
<M> Advanced Linux Sound Architecture
|
| 640 |
<M> Sequencer support
|
| 641 |
<M> OSS Mixer API
|
| 642 |
[*] OSS Sequencer API
|
| 643 |
<comment> (and dont forget to select your soundcard from the submenus!)</comment>
|
| 644 |
</pre>
|
| 645 |
|
| 646 |
<warn>
|
| 647 |
Previously you may have included support for the <path>/dev</path> file system
|
| 648 |
(now marked OBSOLETE). Do not enable devfs support. We have installed udev,
|
| 649 |
which we will be using instead of devfs from now on.
|
| 650 |
</warn>
|
| 651 |
|
| 652 |
<p>
|
| 653 |
Also, remember to enable support for the filesystems that you use, and the
|
| 654 |
hardware present in your system. Be sure to enable support for the IDE
|
| 655 |
controller on your motherboard if you wish to benefit from fast DMA disk
|
| 656 |
access. Refer to the <uri
|
| 657 |
link="/doc/en/handbook/handbook-x86.xml?part=1&chap=7">Configuring the
|
| 658 |
Kernel</uri> section of the <uri link="/doc/en/handbook/index.xml">Gentoo
|
| 659 |
Handbook</uri> for additional guidance here.
|
| 660 |
</p>
|
| 661 |
|
| 662 |
</body>
|
| 663 |
</section>
|
| 664 |
<section>
|
| 665 |
<title>Building the kernel</title>
|
| 666 |
<body>
|
| 667 |
|
| 668 |
<p>
|
| 669 |
Now that we have configured the kernel, we can start the compilation process:
|
| 670 |
</p>
|
| 671 |
|
| 672 |
<pre caption="Compiling the kernel source">
|
| 673 |
# <i>make && make modules_install</i>
|
| 674 |
</pre>
|
| 675 |
|
| 676 |
<note>
|
| 677 |
You may recall having to run <c>make dep</c> with Linux 2.4 sources. This is no
|
| 678 |
longer required.
|
| 679 |
</note>
|
| 680 |
|
| 681 |
<p>
|
| 682 |
Wait for the kernel compilation to complete (and observe the much more readable
|
| 683 |
compilation output).
|
| 684 |
</p>
|
| 685 |
|
| 686 |
</body>
|
| 687 |
</section>
|
| 688 |
<section>
|
| 689 |
<title>Installing the kernel</title>
|
| 690 |
<body>
|
| 691 |
|
| 692 |
<p>
|
| 693 |
The next step is mounting your <path>/boot</path> partition and copying the
|
| 694 |
kernel image over. You must then update your bootloader config manually.
|
| 695 |
</p>
|
| 696 |
|
| 697 |
<pre caption="Installing the kernel">
|
| 698 |
# <i>mount /boot</i>
|
| 699 |
# <i>cp arch/i386/boot/bzImage /boot/bzImage-2.6.9-gentoo-r2</i>
|
| 700 |
# <i>cp System.map /boot/System.map-2.6.9-gentoo-r2</i>
|
| 701 |
</pre>
|
| 702 |
|
| 703 |
<p>
|
| 704 |
Note that the above instructions are examples only, you should follow your
|
| 705 |
usual procedure of updating kernels by following the instructions in the <uri
|
| 706 |
link="/doc/en/handbook/index.xml">Gentoo Handbook</uri> (see the <uri
|
| 707 |
link="/doc/en/handbook/handbook-x86.xml?part=1&chap=7">Configuring the
|
| 708 |
Kernel</uri> chapter).
|
| 709 |
</p>
|
| 710 |
|
| 711 |
<p>
|
| 712 |
When updating your bootloader config, do not remove the old entry pointing at
|
| 713 |
your 2.4 kernel. This way, you will easily be able to switch between the two if
|
| 714 |
something is not working.
|
| 715 |
</p>
|
| 716 |
|
| 717 |
<p>
|
| 718 |
Now continue onto the <uri link="#modules">Module Configuration</uri> section.
|
| 719 |
</p>
|
| 720 |
|
| 721 |
</body>
|
| 722 |
</section>
|
| 723 |
</chapter>
|
| 724 |
|
| 725 |
<chapter id="genkernel">
|
| 726 |
<title>Alternative: Using genkernel</title>
|
| 727 |
<section>
|
| 728 |
<body>
|
| 729 |
|
| 730 |
<p>
|
| 731 |
If you prefer to use genkernel instead of manually configuring your kernel, you
|
| 732 |
will be happy to hear that using genkernel to produce 2.6 kernels is very
|
| 733 |
similar to the process you performed when producing your previous 2.4 kernel.
|
| 734 |
</p>
|
| 735 |
|
| 736 |
<p>
|
| 737 |
You should invoke genkernel as shown below:
|
| 738 |
</p>
|
| 739 |
|
| 740 |
<pre caption="Invoking genkernel with some common arguments">
|
| 741 |
# <i>genkernel --udev --menuconfig --bootloader=grub all</i>
|
| 742 |
</pre>
|
| 743 |
|
| 744 |
<p>
|
| 745 |
In the above example, we also take advantage of genkernel features to open
|
| 746 |
menuconfig to allow you to customise the kernel configuration (if you wish),
|
| 747 |
and to update the grub bootloader configuration after compilation.
|
| 748 |
</p>
|
| 749 |
|
| 750 |
<p>
|
| 751 |
You should choose genkernel arguments that suit you, but do not forget to
|
| 752 |
include the <c>--udev</c> argument! Refer to the <uri
|
| 753 |
link="/doc/en/genkernel.xml">Gentoo Linux Genkernel Guide</uri> and the <uri
|
| 754 |
link="/doc/en/handbook/handbook-x86.xml?part=1&chap=7">Configuring the
|
| 755 |
Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
|
| 756 |
Handbook</uri> for additional information.
|
| 757 |
</p>
|
| 758 |
|
| 759 |
</body>
|
| 760 |
</section>
|
| 761 |
</chapter>
|
| 762 |
|
| 763 |
<chapter id="modules">
|
| 764 |
<title>Module Configuration</title>
|
| 765 |
|
| 766 |
<section>
|
| 767 |
<title>Installing external modules</title>
|
| 768 |
<body>
|
| 769 |
|
| 770 |
<p>
|
| 771 |
Many users will additionally rely on kernel modules that are built outside of
|
| 772 |
the kernel tree. Common examples are the binary ATI and Nvidia graphics
|
| 773 |
drivers. You now need to install those modules, which will compile against the
|
| 774 |
2.6 sources found at <path>/usr/src/linux</path>. This is the usual case of
|
| 775 |
<c>emerge packagename</c> for all the external modules you are used to using
|
| 776 |
with 2.4.
|
| 777 |
</p>
|
| 778 |
|
| 779 |
<p>
|
| 780 |
Refer again to the <uri
|
| 781 |
link="/doc/en/handbook/handbook-x86.xml?part=1&chap=7">Configuring the
|
| 782 |
Kernel</uri> chapter of the <uri link="/doc/en/handbook/index.xml">Gentoo
|
| 783 |
Handbook</uri> for more info.
|
| 784 |
</p>
|
| 785 |
|
| 786 |
</body>
|
| 787 |
</section>
|
| 788 |
<section>
|
| 789 |
<title>Autoloading modules</title>
|
| 790 |
<body>
|
| 791 |
|
| 792 |
<p>
|
| 793 |
You may have decided to compile some kernel components as modules (as opposed
|
| 794 |
to compiled directly into the kernel) and would like to have them autoloaded on
|
| 795 |
bootup like you did with 2.4. Also, if you installed any external modules from
|
| 796 |
the portage tree (as described above) you will probably want to autoload them
|
| 797 |
too.
|
| 798 |
</p>
|
| 799 |
|
| 800 |
<p>
|
| 801 |
You can achieve this similarly as to how you did with 2.4. Simply open up the
|
| 802 |
file <path>/etc/modules.autoload.d/kernel-2.6</path> in a text editor and list
|
| 803 |
the names of the modules you would like autoloaded.
|
| 804 |
</p>
|
| 805 |
|
| 806 |
<pre caption="Opening the module autoload list in nano">
|
| 807 |
# <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
|
| 808 |
</pre>
|
| 809 |
|
| 810 |
<pre caption="Sample autoload list to load the 3c59x and nvidia modules">
|
| 811 |
# /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
|
| 812 |
#
|
| 813 |
# Note that this file is for 2.6 kernels.
|
| 814 |
#
|
| 815 |
# Add the names of modules that you'd like to load when the system
|
| 816 |
# starts into this file, one per line. Comments begin with # and
|
| 817 |
# are ignored. Read man modules.autoload for additional details.
|
| 818 |
|
| 819 |
3c59x
|
| 820 |
nvidia
|
| 821 |
</pre>
|
| 822 |
|
| 823 |
</body>
|
| 824 |
</section>
|
| 825 |
<section>
|
| 826 |
<title>Configuring the ALSA modules</title>
|
| 827 |
<body>
|
| 828 |
|
| 829 |
<p>
|
| 830 |
You will have noticed that we chose to compile ALSA as modules. We can now
|
| 831 |
configure ALSA's behaviour easily. However, we also need to configure which
|
| 832 |
modules are to be loaded. Open up <path>/etc/modules.d/alsa</path> in your text
|
| 833 |
editor:
|
| 834 |
</p>
|
| 835 |
|
| 836 |
<pre caption="Opening /etc/modules.d/alsa in nano">
|
| 837 |
# <i>nano -w /etc/modules.d/alsa</i>
|
| 838 |
</pre>
|
| 839 |
|
| 840 |
<p>
|
| 841 |
Now look for the section marked as <e>IMPORTANT</e>. In most cases, you just
|
| 842 |
need to uncomment and modify the snd-card-0 and snd-slot-0 aliases.
|
| 843 |
</p>
|
| 844 |
|
| 845 |
<pre caption="Sample section of /etc/modules.d/alsa">
|
| 846 |
## IMPORTANT:
|
| 847 |
## You need to customise this section for your specific sound card(s)
|
| 848 |
## and then run `update-modules' command.
|
| 849 |
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
|
| 850 |
##
|
| 851 |
## ALSA portion
|
| 852 |
|
| 853 |
# My laptop uses the snd-maestro3 driver
|
| 854 |
alias snd-card-0 snd-maestro3
|
| 855 |
|
| 856 |
## OSS/Free portion
|
| 857 |
|
| 858 |
# Generally all you need to do is uncomment this line:
|
| 859 |
alias sound-slot-0 snd-card-0
|
| 860 |
</pre>
|
| 861 |
|
| 862 |
<p>
|
| 863 |
For more info on which driver name to use, consult the <uri
|
| 864 |
link="/doc/en/alsa-guide.xml">Gentoo Linux ALSA Guide</uri>. Remember to prefix
|
| 865 |
it with <e>snd-</e> in this file.
|
| 866 |
</p>
|
| 867 |
|
| 868 |
<p>
|
| 869 |
Finally, set the <c>alsasound</c> init script to be executed on bootup:
|
| 870 |
</p>
|
| 871 |
|
| 872 |
<pre caption="Adding alsasound to default runlevel">
|
| 873 |
# <i>rc-update add alsasound boot</i>
|
| 874 |
</pre>
|
| 875 |
|
| 876 |
</body>
|
| 877 |
</section>
|
| 878 |
</chapter>
|
| 879 |
|
| 880 |
<chapter>
|
| 881 |
<title>Booting into Linux 2.6</title>
|
| 882 |
<section>
|
| 883 |
<body>
|
| 884 |
|
| 885 |
<p>
|
| 886 |
It's now time to boot into Linux 2.6. Close all applications and reboot:
|
| 887 |
</p>
|
| 888 |
|
| 889 |
<pre caption="Rebooting">
|
| 890 |
# <i>modules-update</i>
|
| 891 |
# <i>umount /boot</i>
|
| 892 |
# <i>reboot</i>
|
| 893 |
</pre>
|
| 894 |
|
| 895 |
<p>
|
| 896 |
When you reboot, if you followed this document correctly so far, you will have
|
| 897 |
the option of either loading Linux 2.4 or Linux 2.6 from your bootloader.
|
| 898 |
Choose Linux 2.6.
|
| 899 |
</p>
|
| 900 |
|
| 901 |
<p>
|
| 902 |
Once the system has booted, check that things are working. If you made a
|
| 903 |
mistake in the kernel configuration, don't worry, you can skip back to the
|
| 904 |
<uri link="#conf">Configuring, building, and installing the kernel</uri>
|
| 905 |
section, make your change, recompile and install new kernel image, reboot, and
|
| 906 |
try again!
|
| 907 |
</p>
|
| 908 |
|
| 909 |
</body>
|
| 910 |
</section>
|
| 911 |
<section>
|
| 912 |
<title>Unmuting ALSA channels</title>
|
| 913 |
<body>
|
| 914 |
|
| 915 |
<p>
|
| 916 |
By default, ALSA channels are muted, so you won't hear anything when you go to
|
| 917 |
play a sound. You need to unmute them now. Run the <c>alsamixer</c> program
|
| 918 |
from a console and use the arrow keys to move around and adjust volumes, and
|
| 919 |
the M key to mute and unmute. Read the <uri
|
| 920 |
link="/doc/en/alsa-guide.xml">Gentoo Linux ALSA Guide</uri> for more complete
|
| 921 |
documentation and other ways to do this.
|
| 922 |
</p>
|
| 923 |
|
| 924 |
<note>
|
| 925 |
The alsasound init script that we put in the default runlevel will save mixer
|
| 926 |
levels on shutdown and restore them on bootup. You won't need to set all these
|
| 927 |
volumes every time you boot!
|
| 928 |
</note>
|
| 929 |
|
| 930 |
</body>
|
| 931 |
</section>
|
| 932 |
</chapter>
|
| 933 |
|
| 934 |
<chapter>
|
| 935 |
<title>Header files and NPTL</title>
|
| 936 |
<section>
|
| 937 |
<body>
|
| 938 |
|
| 939 |
<p>
|
| 940 |
By now you are running Linux 2.6 and hopefully have all issues ironed out. You
|
| 941 |
should now update your Linux kernel header files and re-merge glibc so that
|
| 942 |
userspace applications can take advantage of new Linux 2.6 features.
|
| 943 |
</p>
|
| 944 |
|
| 945 |
<pre caption="Updating to linux26-headers">
|
| 946 |
# <i>emerge unmerge linux-headers</i>
|
| 947 |
# <i>emerge linux26-headers</i>
|
| 948 |
</pre>
|
| 949 |
|
| 950 |
<p>
|
| 951 |
After updating your headers package, you should generally re-merge glibc.
|
| 952 |
There is a new feature here that you may be interested in - NPTL. NPTL is a new
|
| 953 |
threading model present in Linux 2.6, which features much quicker thread create
|
| 954 |
and destroy times. This won't make much of a difference to most systems, but
|
| 955 |
you may wish to enable it during this migration process! To enable NPTL, edit
|
| 956 |
<path>/etc/make.conf</path>, adding <e>nptl</e> to your USE variable.
|
| 957 |
</p>
|
| 958 |
|
| 959 |
<warn>
|
| 960 |
With the current stable glibc ebuilds, you will be unable to boot a 2.4 kernel
|
| 961 |
after compiling glibc with USE="nptl". Be warned, be careful!
|
| 962 |
</warn>
|
| 963 |
|
| 964 |
<p>
|
| 965 |
Now re-merge glibc (you should do this even if you did not choose to enable
|
| 966 |
NPTL).
|
| 967 |
</p>
|
| 968 |
|
| 969 |
<pre caption="Reinstalling glibc against the new kernel headers">
|
| 970 |
# <i>emerge -a glibc</i>
|
| 971 |
</pre>
|
| 972 |
|
| 973 |
<p>
|
| 974 |
If you enabled NPTL, existing binaries will not use it until they are
|
| 975 |
recompiled. However, any binaries compiled from this point onwards <e>will</e>
|
| 976 |
use NPTL. You may wish to recompile all binaries now, e.g.:
|
| 977 |
</p>
|
| 978 |
|
| 979 |
<pre caption="Recompiling all packages on the system">
|
| 980 |
# <i>emerge -e world</i>
|
| 981 |
</pre>
|
| 982 |
|
| 983 |
<p>
|
| 984 |
Alternatively, you can just let your system "naturally" convert itself to NPTL
|
| 985 |
as you update to newer versions of packages when they are released.
|
| 986 |
</p>
|
| 987 |
|
| 988 |
</body>
|
| 989 |
</section>
|
| 990 |
</chapter>
|
| 991 |
|
| 992 |
<chapter>
|
| 993 |
<title>Closing remarks</title>
|
| 994 |
<section>
|
| 995 |
<title>Problems?</title>
|
| 996 |
<body>
|
| 997 |
|
| 998 |
<p>
|
| 999 |
With the incredible amount of work that went into Linux 2.6, it is sometimes
|
| 1000 |
inevitable that things which used to work fine, no longer function as expected.
|
| 1001 |
</p>
|
| 1002 |
|
| 1003 |
<p>
|
| 1004 |
If you have any problems with your 2.6 kernel, and you can confirm that this
|
| 1005 |
problem does not exist with Linux 2.4, then please open a bug with us on our
|
| 1006 |
<uri link="http://bugs.gentoo.org">Bugzilla</uri>. We will investigate the
|
| 1007 |
issue, and if we find that it is a problem in the mainline kernel, we may then
|
| 1008 |
ask you to file a report at the central kernel bugzilla.
|
| 1009 |
</p>
|
| 1010 |
|
| 1011 |
</body>
|
| 1012 |
</section>
|
| 1013 |
<section>
|
| 1014 |
<title>Conclusion</title>
|
| 1015 |
<body>
|
| 1016 |
|
| 1017 |
<p>
|
| 1018 |
Hopefully you have just completed a smooth migration and you are enjoying the
|
| 1019 |
benefits which Linux 2.6 brings over 2.4. As I mentioned at the start, we are
|
| 1020 |
looking for feedback on this document - even if your migration went perfectly
|
| 1021 |
smoothly. Please <mail link="dsd@gentoo.org">mail me</mail> your feedback so
|
| 1022 |
that we can get this document in perfect shape for when 2005.0 comes around.
|
| 1023 |
Thanks!
|
| 1024 |
</p>
|
| 1025 |
|
| 1026 |
</body>
|
| 1027 |
</section>
|
| 1028 |
</chapter>
|
| 1029 |
</guide>
|