| 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/2.5 --> |
| 6 |
|
| 7 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-kernel.xml,v 1.41 2011/12/13 20:30:54 swift Exp $ --> |
| 8 |
|
| 9 |
<sections> |
| 10 |
|
| 11 |
<version>12</version> |
| 12 |
<date>2012-02-22</date> |
| 13 |
|
| 14 |
<section> |
| 15 |
<title>Timezone</title> |
| 16 |
<body> |
| 17 |
|
| 18 |
<p> |
| 19 |
You first need to select your timezone so that your system knows where it is |
| 20 |
located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy |
| 21 |
it to <path>/etc/localtime</path>. Please avoid the |
| 22 |
<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not |
| 23 |
indicate the expected zones. For instance, <path>GMT-8</path> is in fact |
| 24 |
GMT+8. |
| 25 |
</p> |
| 26 |
|
| 27 |
<pre caption="Setting the timezone information"> |
| 28 |
# <i>ls /usr/share/zoneinfo</i> |
| 29 |
<comment>(Suppose you want to use Europe/Brussels)</comment> |
| 30 |
# <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i> |
| 31 |
<comment>(Next set the timezone)</comment> |
| 32 |
# <i>echo "Europe/Brussels" > /etc/timezone</i> |
| 33 |
</pre> |
| 34 |
|
| 35 |
</body> |
| 36 |
</section> |
| 37 |
<section> |
| 38 |
<title>Installing the Sources</title> |
| 39 |
<subsection> |
| 40 |
<title>Choosing a Kernel</title> |
| 41 |
<body> |
| 42 |
|
| 43 |
<p> |
| 44 |
The core around which all distributions are built is the Linux kernel. It is the |
| 45 |
layer between the user programs and your system hardware. Gentoo provides its |
| 46 |
users several possible kernel sources. A full listing with description is |
| 47 |
available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel |
| 48 |
Guide</uri>. |
| 49 |
</p> |
| 50 |
|
| 51 |
<p> |
| 52 |
For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c> |
| 53 |
(kernel source patched for extra features). |
| 54 |
</p> |
| 55 |
|
| 56 |
<p> |
| 57 |
Choose your kernel source and install it using <c>emerge</c>. |
| 58 |
</p> |
| 59 |
|
| 60 |
<pre caption="Installing a kernel source"> |
| 61 |
# <i>emerge gentoo-sources</i> |
| 62 |
</pre> |
| 63 |
|
| 64 |
<p> |
| 65 |
When you take a look in <path>/usr/src</path> you should see a symlink called |
| 66 |
<path>linux</path> pointing to your kernel source. In this case, the installed |
| 67 |
kernel source points to <c>linux-<keyval id="kernel-version"/></c>. Your version |
| 68 |
may be different, so keep this in mind. |
| 69 |
</p> |
| 70 |
|
| 71 |
<pre caption="Viewing the kernel source symlink"> |
| 72 |
# <i>ls -l /usr/src/linux</i> |
| 73 |
lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -> linux-<keyval id="kernel-version"/> |
| 74 |
</pre> |
| 75 |
|
| 76 |
<p> |
| 77 |
Now it is time to configure and compile your kernel source. |
| 78 |
</p> |
| 79 |
|
| 80 |
</body> |
| 81 |
</subsection> |
| 82 |
</section> |
| 83 |
<section> |
| 84 |
<title>Manual Configuration</title> |
| 85 |
<subsection> |
| 86 |
<title>Introduction</title> |
| 87 |
<body> |
| 88 |
|
| 89 |
<p> |
| 90 |
Manually configuring a kernel is often seen as the most difficult procedure a |
| 91 |
Linux user ever has to perform. Nothing is less true -- after configuring a |
| 92 |
couple of kernels you don't even remember that it was difficult ;) |
| 93 |
</p> |
| 94 |
|
| 95 |
<p> |
| 96 |
However, one thing <e>is</e> true: you must know your system when you start |
| 97 |
configuring a kernel manually. Most information can be gathered by emerging |
| 98 |
pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now |
| 99 |
be able to use <c>lspci</c> within the chrooted environment. You may safely |
| 100 |
ignore any <e>pcilib</e> warnings (like pcilib: cannot open |
| 101 |
/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run |
| 102 |
<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. |
| 103 |
You can also run <c>lsmod</c> to see what kernel modules the Installation CD |
| 104 |
uses (it might provide you with a nice hint on what to enable). |
| 105 |
</p> |
| 106 |
|
| 107 |
<p> |
| 108 |
Now go to your kernel source directory and execute <c>make menuconfig</c>. This |
| 109 |
will fire up an ncurses-based configuration menu. |
| 110 |
</p> |
| 111 |
|
| 112 |
<pre caption="Invoking menuconfig"> |
| 113 |
# <i>cd /usr/src/linux</i> |
| 114 |
# <i>make menuconfig</i> |
| 115 |
</pre> |
| 116 |
|
| 117 |
<p> |
| 118 |
You will be greeted with several configuration sections. We'll first list some |
| 119 |
options you must activate (otherwise Gentoo will not function, or not function |
| 120 |
properly without additional tweaks). |
| 121 |
</p> |
| 122 |
|
| 123 |
</body> |
| 124 |
</subsection> |
| 125 |
<subsection> |
| 126 |
<title>Activating Required Options</title> |
| 127 |
<body> |
| 128 |
|
| 129 |
<p> |
| 130 |
First, we set up the proper cross compilation settings to make sure that the |
| 131 |
Linux kernel is built for the correct system type. To do so, set the |
| 132 |
<e>Cross-compiler tool prefix</e> to <c>sparc64-unknown-linux-gnu-</c> |
| 133 |
(including the trailing dash): |
| 134 |
</p> |
| 135 |
|
| 136 |
<pre caption="Identifying the proper cross compilation platform"> |
| 137 |
General setup ---> |
| 138 |
(<i>sparc64-unknown-linux-gnu-</i>) Cross-compiler tool prefix |
| 139 |
</pre> |
| 140 |
|
| 141 |
<p> |
| 142 |
Then 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> and <c>/proc |
| 145 |
file system</c>: |
| 146 |
</p> |
| 147 |
|
| 148 |
<pre caption="Selecting necessary file systems"> |
| 149 |
File systems ---> |
| 150 |
Pseudo Filesystems ---> |
| 151 |
[*] /proc file system support |
| 152 |
[*] Virtual memory file system support (former shm fs) |
| 153 |
|
| 154 |
<comment>(Select one or more of the following options as needed by your system)</comment> |
| 155 |
<*> Ext3 journalling file system support |
| 156 |
<*> Second extended fs support |
| 157 |
</pre> |
| 158 |
|
| 159 |
<p> |
| 160 |
If you are using PPPoE to connect to the Internet or you are using a dial-up |
| 161 |
modem, you will need the following options in the kernel: |
| 162 |
</p> |
| 163 |
|
| 164 |
<pre caption="Selecting PPPoE necessary drivers"> |
| 165 |
Device Drivers ---> |
| 166 |
Networking support ---> |
| 167 |
<*> PPP (point-to-point protocol) support |
| 168 |
<*> PPP support for async serial ports |
| 169 |
<*> PPP support for sync tty ports |
| 170 |
</pre> |
| 171 |
|
| 172 |
<p> |
| 173 |
The two compression options won't harm but are not definitely needed, neither |
| 174 |
does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c> |
| 175 |
when configured to do kernel mode PPPoE. |
| 176 |
</p> |
| 177 |
|
| 178 |
<p> |
| 179 |
Now activate the correct bus-support: |
| 180 |
</p> |
| 181 |
|
| 182 |
<pre caption="Activating SBUS/UPA"> |
| 183 |
Console drivers ---> |
| 184 |
Frame-buffer support ---> |
| 185 |
[*] SBUS and UPA framebuffers |
| 186 |
[*] Creator/Creator3D support <comment>(Only for UPA slot adapter used in many Ultras)</comment> |
| 187 |
[*] CGsix (GX,TurboGX) support <comment>(Only for SBUS slot adapter used in many SPARCStations)</comment> |
| 188 |
</pre> |
| 189 |
|
| 190 |
<p> |
| 191 |
Of course you want support for the OBP: |
| 192 |
</p> |
| 193 |
|
| 194 |
<pre caption="Activating OBP Support"> |
| 195 |
Misc Linux/SPARC drivers ---> |
| 196 |
[*] /dev/openprom device support |
| 197 |
</pre> |
| 198 |
|
| 199 |
<p> |
| 200 |
You will also need SCSI-specific support: |
| 201 |
</p> |
| 202 |
|
| 203 |
<pre caption="Activating SCSI-specific support"> |
| 204 |
SCSI support ---> |
| 205 |
SCSI low-level drivers ---> |
| 206 |
<*> Sparc ESP Scsi Driver <comment>(Only for SPARC ESP on-board SCSI adapter)</comment> |
| 207 |
<*> PTI Qlogic, ISP Driver <comment>(Only for SBUS SCSI controllers from PTI or QLogic)</comment> |
| 208 |
<*> SYM53C8XX Version 2 SCSI support <comment>(Only for Ultra 60 on-board SCSI adapter)</comment> |
| 209 |
</pre> |
| 210 |
|
| 211 |
<p> |
| 212 |
To support your network card, select one of the following: |
| 213 |
</p> |
| 214 |
|
| 215 |
<pre caption="Activating networking support"> |
| 216 |
Network device support ---> |
| 217 |
Ethernet (10 or 100Mbit) ---> |
| 218 |
<*> Sun LANCE support <comment>(Only for SPARCStation, older Ultra systems, and as Sbus option)</comment> |
| 219 |
<*> Sun Happy Meal 10/100baseT support <comment>(Only for Ultra; also supports "qfe" quad-ethernet on PCI and Sbus)</comment> |
| 220 |
<*> DECchip Tulip (dc21x4x) PCI support <comment>(For some Netras, like N1)</comment> |
| 221 |
Ethernet (1000Mbit) ---> |
| 222 |
<*> Broadcom Tigon3 support <comment>(Modern Netra, Sun Fire machines)</comment> |
| 223 |
</pre> |
| 224 |
|
| 225 |
<p> |
| 226 |
When you have a 4-port Ethernet machine (10/100 or 10/100/1000) the port order |
| 227 |
is different from the one used by Solaris. You can use <c>sys-apps/ethtool</c> |
| 228 |
to check the port link status. |
| 229 |
</p> |
| 230 |
|
| 231 |
<p> |
| 232 |
If you're using a qla2xxx disk controller, you'll need to use a 2.6.27 kernel or |
| 233 |
newer, and you'll also need to emerge <c>sys-block/qla-fc-firmware</c>. Next, |
| 234 |
run <c>make menuconfig</c> and navigate to the Device Drivers section. You'll |
| 235 |
need to add support for loading external firmware. |
| 236 |
</p> |
| 237 |
|
| 238 |
<pre caption="Enabling external firmware"> |
| 239 |
Device Drivers ---> |
| 240 |
Generic Driver Options ---> |
| 241 |
() External firmware blobs to build into the kernel binary |
| 242 |
() Firmware blobs root directory |
| 243 |
</pre> |
| 244 |
|
| 245 |
<p> |
| 246 |
Set "External firmware blobs" to <path>ql2200_fw.bin</path> and "Firmware blobs |
| 247 |
root directory" to <path>/lib/firmware</path>. |
| 248 |
</p> |
| 249 |
|
| 250 |
<p> |
| 251 |
When you're done configuring your kernel, continue with <uri |
| 252 |
link="#compiling">Compiling and Installing</uri>. However, after having |
| 253 |
compiled the kernel, check its size: |
| 254 |
</p> |
| 255 |
|
| 256 |
<pre caption="Check kernel size"> |
| 257 |
# <i>ls -lh vmlinux</i> |
| 258 |
-rw-r--r-- 1 root root 2.4M Oct 25 14:38 vmlinux |
| 259 |
</pre> |
| 260 |
|
| 261 |
<p> |
| 262 |
If the (uncompressed) size is bigger than 7.5 MB, reconfigure your kernel until |
| 263 |
it doesn't exceed these limits. One way of accomplishing this is by having most |
| 264 |
kernel drivers compiled as modules. Ignoring this can lead to a non-booting |
| 265 |
kernel. |
| 266 |
</p> |
| 267 |
|
| 268 |
<p> |
| 269 |
Also, if your kernel is just a tad too big, you can try stripping it using the |
| 270 |
<c>strip</c> command: |
| 271 |
</p> |
| 272 |
|
| 273 |
<pre caption="Stripping the kernel"> |
| 274 |
# <i>strip -R .comment -R .note vmlinux</i> |
| 275 |
</pre> |
| 276 |
|
| 277 |
</body> |
| 278 |
</subsection> |
| 279 |
<subsection id="compiling"> |
| 280 |
<title>Compiling and Installing</title> |
| 281 |
<body> |
| 282 |
|
| 283 |
<p> |
| 284 |
Now that your kernel is configured, it is time to compile and install it. Exit |
| 285 |
the configuration and start the compilation process: |
| 286 |
</p> |
| 287 |
|
| 288 |
<pre caption="Compiling the kernel"> |
| 289 |
# <i>make && make modules_install</i> |
| 290 |
</pre> |
| 291 |
|
| 292 |
<p> |
| 293 |
When the kernel has finished compiling, copy the kernel image to |
| 294 |
<path>/boot</path>. |
| 295 |
</p> |
| 296 |
|
| 297 |
<pre caption="Installing the kernel"> |
| 298 |
# <i>cp arch/sparc/boot/image /boot/<keyval id="kernel-name"/></i> |
| 299 |
</pre> |
| 300 |
|
| 301 |
<p> |
| 302 |
Now continue with <uri link="#kernel_modules">Kernel Modules</uri>. |
| 303 |
</p> |
| 304 |
|
| 305 |
</body> |
| 306 |
</subsection> |
| 307 |
</section> |
| 308 |
<section id="kernel_modules"> |
| 309 |
<title>Kernel Modules</title> |
| 310 |
|
| 311 |
<subsection> |
| 312 |
<include href="hb-install-kernelmodules.xml"/> |
| 313 |
</subsection> |
| 314 |
|
| 315 |
</section> |
| 316 |
</sections> |