| 1 |
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
|
| 3 |
|
| 4 |
<!-- The content of this document is licensed under the CC-BY-SA license -->
|
| 5 |
<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
|
| 6 |
|
| 7 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.10 2004/08/30 17:44:00 neysx Exp $ -->
|
| 8 |
|
| 9 |
<sections>
|
| 10 |
<section>
|
| 11 |
<title>Timezone</title>
|
| 12 |
<body>
|
| 13 |
|
| 14 |
<p>
|
| 15 |
You first need to select your timezone so that your system knows where it is
|
| 16 |
located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a
|
| 17 |
symlink to <path>/etc/localtime</path> using <c>ln</c>:
|
| 18 |
</p>
|
| 19 |
|
| 20 |
<pre caption="Setting the timezone information">
|
| 21 |
# <i>ls /usr/share/zoneinfo</i>
|
| 22 |
<comment>(Suppose you want to use GMT)</comment>
|
| 23 |
# <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
|
| 24 |
</pre>
|
| 25 |
|
| 26 |
</body>
|
| 27 |
</section>
|
| 28 |
<section>
|
| 29 |
<title>Installing the Sources</title>
|
| 30 |
<subsection>
|
| 31 |
<title>Choosing a Kernel</title>
|
| 32 |
<body>
|
| 33 |
|
| 34 |
<p>
|
| 35 |
The core around which all distributions are built is the Linux kernel. It is the
|
| 36 |
layer between the user programs and your system hardware. Gentoo provides its
|
| 37 |
users several possible kernel sources. A full listing with description is
|
| 38 |
available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
|
| 39 |
Guide</uri>.
|
| 40 |
</p>
|
| 41 |
|
| 42 |
<p>
|
| 43 |
For PPC you can choose between <c>development-sources</c> and
|
| 44 |
<c>gentoo-dev-sources</c> (both 2.6 kernels). The latter is available when you
|
| 45 |
perform a networkless installation. Beside those there is special
|
| 46 |
kernel-2.6-patchset for the Pegasos: <c>pegasos-dev-sources</c>. So let's
|
| 47 |
continue with <c>emerge</c>'ing the kernel sources:
|
| 48 |
</p>
|
| 49 |
|
| 50 |
<pre caption="Installing a kernel source">
|
| 51 |
# <i>emerge gentoo-dev-sources</i>
|
| 52 |
</pre>
|
| 53 |
|
| 54 |
<p>
|
| 55 |
When you take a look in <path>/usr/src</path> you should see a symlink called
|
| 56 |
<path>linux</path> pointing to your kernel source:
|
| 57 |
</p>
|
| 58 |
|
| 59 |
<pre caption="Viewing the kernel source symlink">
|
| 60 |
# <i>ls -l /usr/src/linux</i>
|
| 61 |
lrwxrwxrwx 1 root root 12 Jul 10 10:55 /usr/src/linux -> linux-2.6.7-r9
|
| 62 |
</pre>
|
| 63 |
|
| 64 |
<p>
|
| 65 |
If this isn't the case (i.e. the symlink points to a different kernel source)
|
| 66 |
change the symlink before you continue:
|
| 67 |
</p>
|
| 68 |
|
| 69 |
<pre caption="Changing the kernel source symlink">
|
| 70 |
# <i>rm /usr/src/linux</i>
|
| 71 |
# <i>cd /usr/src</i>
|
| 72 |
# <i>ln -s linux-2.6.7-r9 linux</i>
|
| 73 |
</pre>
|
| 74 |
|
| 75 |
<p>
|
| 76 |
Now it is time to configure and compile your kernel source. All architectures
|
| 77 |
can use <c>genkernel</c> for this, which will build a generic kernel as used
|
| 78 |
by the LiveCD. We explain the "manual" configuration first though, as it is
|
| 79 |
the best way to optimize your environment.
|
| 80 |
</p>
|
| 81 |
|
| 82 |
<p>
|
| 83 |
Continue now with <uri link="#manual">Manual Configuration</uri>.
|
| 84 |
</p>
|
| 85 |
|
| 86 |
</body>
|
| 87 |
</subsection>
|
| 88 |
</section>
|
| 89 |
<section id="manual">
|
| 90 |
<title>Manual Configuration</title>
|
| 91 |
<subsection>
|
| 92 |
<title>Introduction</title>
|
| 93 |
<body>
|
| 94 |
|
| 95 |
<p>
|
| 96 |
Manually configuring a kernel is often seen as the most difficult procedure a
|
| 97 |
Linux user ever has to perform. Nothing is less true -- after configuring a
|
| 98 |
couple of kernels you don't even remember that it was difficult ;)
|
| 99 |
</p>
|
| 100 |
|
| 101 |
<p>
|
| 102 |
However, one thing <e>is</e> true: you must know your system when you start
|
| 103 |
configuring a kernel manually. Most information can be gathered by viewing the
|
| 104 |
contents of <path>/proc/pci</path> (or by using <c>lspci</c> if available). You
|
| 105 |
can also run <c>lsmod</c> to see what kernel modules the LiveCD uses (it might
|
| 106 |
provide you with a nice hint on what to enable).
|
| 107 |
</p>
|
| 108 |
|
| 109 |
<p>
|
| 110 |
Now go to your kernel source directory and execute <c>make menuconfig</c>. This
|
| 111 |
will fire up an ncurses-based configuration menu.
|
| 112 |
</p>
|
| 113 |
|
| 114 |
<pre caption="Invoking menuconfig">
|
| 115 |
# <i>cd /usr/src/linux</i>
|
| 116 |
# <i>make menuconfig</i>
|
| 117 |
</pre>
|
| 118 |
|
| 119 |
<p>
|
| 120 |
You will be greeted with several configuration sections. We'll first list some
|
| 121 |
options you must activate (otherwise Gentoo will not function, or not function
|
| 122 |
properly without additional tweaks).
|
| 123 |
</p>
|
| 124 |
|
| 125 |
</body>
|
| 126 |
</subsection>
|
| 127 |
<subsection>
|
| 128 |
<title>Activating Required Options</title>
|
| 129 |
<body>
|
| 130 |
|
| 131 |
<p>
|
| 132 |
First of all, activate the use of development and experimental code/drivers.
|
| 133 |
You need this, otherwise some very important code/drivers won't show up:
|
| 134 |
</p>
|
| 135 |
|
| 136 |
<pre caption="Selecting experimental code/drivers">
|
| 137 |
Code maturity level options --->
|
| 138 |
[*] Prompt for development and/or incomplete code/drivers
|
| 139 |
</pre>
|
| 140 |
|
| 141 |
<p>
|
| 142 |
Now go to <c>File Systems</c> and select support for the filesystems you use.
|
| 143 |
<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
|
| 144 |
able to mount your partitions. Also select <c>Virtual memory</c>, <c>/proc
|
| 145 |
file system</c>, <c>/dev file system</c> + <c>Automatically mount at boot</c>:
|
| 146 |
</p>
|
| 147 |
|
| 148 |
<pre caption="Selecting necessary file systems">
|
| 149 |
File systems --->
|
| 150 |
Pseudo Filesystems --->
|
| 151 |
[*] /proc file system support
|
| 152 |
[*] /dev file system support (OBSOLETE)
|
| 153 |
[*] Automatically mount at boot
|
| 154 |
[*] Virtual memory file system support (former shm fs)
|
| 155 |
|
| 156 |
<comment>(Select one or more of the following options as needed by your system)</comment>
|
| 157 |
<*> Reiserfs support
|
| 158 |
<*> Ext3 journalling file system support
|
| 159 |
<*> Second extended fs support
|
| 160 |
<*> XFS filesystem support
|
| 161 |
</pre>
|
| 162 |
|
| 163 |
<p>
|
| 164 |
If you are using PPPoE to connect to the Internet or you are using a dial-up
|
| 165 |
modem, you will need the following options in the kernel:
|
| 166 |
</p>
|
| 167 |
|
| 168 |
<pre caption="Selecting PPPoE necessary drivers">
|
| 169 |
Device Drivers --->
|
| 170 |
Networking support --->
|
| 171 |
<*> PPP (point-to-point protocol) support
|
| 172 |
<*> PPP support for async serial ports
|
| 173 |
<*> PPP support for sync tty ports
|
| 174 |
</pre>
|
| 175 |
|
| 176 |
<p>
|
| 177 |
The two compression options won't harm but are not definitely needed, neither
|
| 178 |
does the <c>PPP over Ethernet</c> option, that might only be used by
|
| 179 |
<c>rp-pppoe</c> when configured to do kernel mode PPPoE.
|
| 180 |
</p>
|
| 181 |
|
| 182 |
<p>
|
| 183 |
If you require it, don't forget to include support in the kernel for your
|
| 184 |
ethernet card.
|
| 185 |
</p>
|
| 186 |
|
| 187 |
<p>
|
| 188 |
Disable ADB raw keycodes:
|
| 189 |
</p>
|
| 190 |
|
| 191 |
<pre caption="Disabling ADB raw keycodes">
|
| 192 |
Macintosh Device Drivers --->
|
| 193 |
[ ] Support for ADB raw keycodes
|
| 194 |
</pre>
|
| 195 |
|
| 196 |
<p>
|
| 197 |
Also choose the correct RTC support (<e>disable</e> the <c>Enhanced RTC</c>
|
| 198 |
option):
|
| 199 |
</p>
|
| 200 |
|
| 201 |
<pre caption="Activating the correct RTC option">
|
| 202 |
Character devices --->
|
| 203 |
[ ] Enhanced RTC
|
| 204 |
|
| 205 |
General setup --->
|
| 206 |
[*] Support for /dev/rtc
|
| 207 |
</pre>
|
| 208 |
|
| 209 |
<p>
|
| 210 |
Users of OldWorld machines will want HFS support so they can copy compiled
|
| 211 |
kernels to the MacOS partition.
|
| 212 |
</p>
|
| 213 |
|
| 214 |
<pre caption="Activating HFS support">
|
| 215 |
File Systems --->
|
| 216 |
[*] HFS Support
|
| 217 |
</pre>
|
| 218 |
|
| 219 |
<p>
|
| 220 |
When you're done configuring your kernel, continue with <uri
|
| 221 |
link="#compiling">Compiling and Installing</uri>.
|
| 222 |
</p>
|
| 223 |
|
| 224 |
</body>
|
| 225 |
</subsection>
|
| 226 |
<subsection id="compiling">
|
| 227 |
<title>Compiling and Installing</title>
|
| 228 |
<body>
|
| 229 |
|
| 230 |
<p>
|
| 231 |
Now that your kernel is configured, it is time to compile and install it. Exit
|
| 232 |
the configuration and run the commands which will compile the kernel:
|
| 233 |
</p>
|
| 234 |
|
| 235 |
<pre caption="Compiling the kernel">
|
| 236 |
# <i>make all && make modules_install</i>
|
| 237 |
</pre>
|
| 238 |
|
| 239 |
<p>
|
| 240 |
When the kernel has finished compiling, copy the kernel image to
|
| 241 |
<path>/boot</path>.
|
| 242 |
</p>
|
| 243 |
|
| 244 |
<pre caption="Installing the kernel">
|
| 245 |
<comment>replace 2.6.7 with your kernel-version</comment>
|
| 246 |
(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.7</i>
|
| 247 |
(Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.7</i>
|
| 248 |
</pre>
|
| 249 |
|
| 250 |
<p>
|
| 251 |
Also don't forget to copy over the system map:
|
| 252 |
</p>
|
| 253 |
|
| 254 |
<pre caption="Copying the system map">
|
| 255 |
# <i>cp System.map /boot/System.map-2.6.7</i>
|
| 256 |
</pre>
|
| 257 |
|
| 258 |
<p>
|
| 259 |
It is also wise to copy over your kernel configuration file to
|
| 260 |
<path>/boot</path>, just in case :)
|
| 261 |
</p>
|
| 262 |
|
| 263 |
<pre caption="Backing up your kernel configuration">
|
| 264 |
# <i>cp .config /boot/config-2.6.7</i>
|
| 265 |
</pre>
|
| 266 |
|
| 267 |
<p>
|
| 268 |
Now continue with <uri link="#kernel_modules">Installing Separate Kernel
|
| 269 |
Modules</uri>.
|
| 270 |
</p>
|
| 271 |
|
| 272 |
</body>
|
| 273 |
</subsection>
|
| 274 |
</section>
|
| 275 |
<section id="kernel_modules">
|
| 276 |
<title>Installing Separate Kernel Modules</title>
|
| 277 |
<!--
|
| 278 |
<subsection>
|
| 279 |
<title>Installing Extra Modules</title>
|
| 280 |
<body>
|
| 281 |
|
| 282 |
<p>
|
| 283 |
If appropriate, you should emerge ebuilds for any additional hardware that is
|
| 284 |
on your system. Here is a list of kernel-related ebuilds that you could emerge:
|
| 285 |
</p>
|
| 286 |
|
| 287 |
<table>
|
| 288 |
<tcolumn width="1in"/>
|
| 289 |
<tcolumn width="4in"/>
|
| 290 |
<tcolumn width="2in"/>
|
| 291 |
<tr>
|
| 292 |
<th>Ebuild</th>
|
| 293 |
<th>Purpose</th>
|
| 294 |
<th>Command</th>
|
| 295 |
</tr>
|
| 296 |
</table>
|
| 297 |
|
| 298 |
<p>
|
| 299 |
Beware though, some of these ebuilds might deal with big dependencies. To verify
|
| 300 |
what packages will be installed by emerging an ebuild, use <c>emerge
|
| 301 |
- -pretend</c>. For instance, for the <c>xfree-drm</c> package:
|
| 302 |
</p>
|
| 303 |
|
| 304 |
<pre caption="View full installation package listing">
|
| 305 |
# <i>emerge - -pretend xfree-drm</i>
|
| 306 |
</pre>
|
| 307 |
|
| 308 |
</body>
|
| 309 |
</subsection>
|
| 310 |
-->
|
| 311 |
<subsection>
|
| 312 |
<title>Configuring the Modules</title>
|
| 313 |
<body>
|
| 314 |
|
| 315 |
<p>
|
| 316 |
You should list the modules you want automatically loaded in
|
| 317 |
<path>/etc/modules.autoload.d/kernel-2.6</path>.
|
| 318 |
You can add extra options to the modules too if you want.
|
| 319 |
</p>
|
| 320 |
|
| 321 |
<p>
|
| 322 |
To view all available modules, run the following <c>find</c> command. Don't
|
| 323 |
forget to substitute "<kernel version>" with the version of the kernel you
|
| 324 |
just compiled:
|
| 325 |
</p>
|
| 326 |
|
| 327 |
<pre caption="Viewing all available modules">
|
| 328 |
# <i>find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko'</i>
|
| 329 |
</pre>
|
| 330 |
|
| 331 |
<p>
|
| 332 |
For instance, to automatically load the <c>3c59x.o</c> module, edit the
|
| 333 |
<path>kernel-2.6</path> file and enter the module
|
| 334 |
name in it.
|
| 335 |
</p>
|
| 336 |
|
| 337 |
<pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
|
| 338 |
# <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
|
| 339 |
</pre>
|
| 340 |
|
| 341 |
<pre caption="/etc/modules.autoload.d/kernel-2.6">
|
| 342 |
3c59x
|
| 343 |
</pre>
|
| 344 |
|
| 345 |
<p>
|
| 346 |
Now run <c>modules-update</c> to commit your changes to the
|
| 347 |
<path>/etc/modules.conf</path> file:
|
| 348 |
</p>
|
| 349 |
|
| 350 |
<pre caption="Running modules-update">
|
| 351 |
# <i>modules-update</i>
|
| 352 |
</pre>
|
| 353 |
|
| 354 |
<p>
|
| 355 |
Continue the installation with <uri link="?part=1&chap=8">Configuring
|
| 356 |
your System</uri>.
|
| 357 |
</p>
|
| 358 |
|
| 359 |
</body>
|
| 360 |
</subsection>
|
| 361 |
</section>
|
| 362 |
</sections>
|