Contents
This page continues an earlier thread for re-building the SLES 10 kernel . As with SLES 10, here we'll show it's easy to re-build the SLES 11 distro kernel if you're careful with the details.
First things first.
As always.. a warning.
Re-building and re-booting a distro kernel is conceptually, and in practice, a fairly easy thing to do. But it is also very easy to mess up your system with a single simple typo, with the practical consequences that you may need to reinstall your system. Being unable to re-boot a shared system where someone else has data that wasn't backed up is a "most unpleasant" feeling.
 | Be Wary
First. We strongly urge you to practice these steps on a victim system, where you have no problems what-so-ever of completely reinstalling the system. A "victim system" means there is nothing of importance on the system. No important data. No critical users or applications. No key work-in-progress.
Second. These steps are provided simply as a step-by-step guide of how several of us re-built the kernel in the labs on freshly installed victim systems. We most-certainly are not the official source for the right steps, nor do we claim this will work for everyone, and you should not expect any level of support from us on this.
Third. This should be intuitive, but amazingly-enough often isn't clearly understood. So we'll say it here explicitly. If you re-build your own kernel and you use that kernel, you have invalidated any hope for "official support" from your service provider while using that kernel. |
SLES 11. Find the kernel-source "src.rpm"
On SLES 11, there are two DVD iso images.
- SLES-11-DVD-ppc64-GM-DVD1.iso
- SLES-11-DVD-ppc64-GM-DVD2.iso
If you mount the second DVD, it has the "source" files. Here we assume you've downloaded the DVD iso images to a local directory, let's say: /usr/local/iso
You'll need the *.src.rpm file.
This rpm cleverly doesn't show up as installed if you do a rpm -qa | grep kernel-source. To tell whether you have installed the package, look under /usr/src/packages/SPECS. If there's nothing there, then you have not installed the correct rpm.
Install the kernel-source "src.rpm"
You want the "src.rpm", not just the ".rpm" file.
Copy the "spec" file from SOURCES over to the SPECS sub-directory.
Edit the ppc64 "spec" file to add a unique identifier
Change the Release identifier from "5" to something like "5.001"
to
Save and file.
Note the current kernel level...
rpmbuild -ba kernel-ppc64.spec
rpmbuild is the clever step that packages all of the patches that constitute the "whole" of the kernel.
Now you need the SLES 11 SDK iso image.
Try again (noticing that there is no such thing as a kernel-dummy rpm file).
Eh?
From the README.SUSE file in /usr/src/packages/SOURCES
Ok. Comment out that line.
We're ready to go. But before we start, we want to modify the "spec" file to compile in parallel.
vi kernel-ppc64.spec
- After the "build_flavor" line, add a line to define "jobs" to be the number of available CPUs.
Try again.
Building in parallel
Quick tangent.
To confirm you're building in parallel, in a separate window fire up "top" and press the "1" key. Here's an example of an 8 core (16 CPUs with SMT on) Power 6 system running SLES 11.
top - 09:51:50 up 17:30, 2 users, load average: 20.87, 8.87, 3.80
Tasks: 277 total, 19 running, 256 sleeping, 0 stopped, 2 zombie
Cpu0 : 41.5%us, 3.4%sy, 0.0%ni, 12.4%id, 6.1%wa, 0.0%hi, 0.0%si, 36.5%st
Cpu1 : 52.8%us, 2.1%sy, 0.0%ni, 8.4%id, 0.0%wa, 0.0%hi, 0.3%si, 36.4%st
Cpu2 : 55.7%us, 1.3%sy, 0.0%ni, 7.4%id, 0.0%wa, 0.0%hi, 0.0%si, 35.6%st
Cpu3 : 40.4%us, 2.4%sy, 0.0%ni, 21.0%id, 0.0%wa, 0.0%hi, 0.0%si, 36.2%st
Cpu4 : 45.3%us, 3.7%sy, 0.0%ni, 13.9%id, 0.0%wa, 0.0%hi, 0.3%si, 36.8%st
Cpu5 : 49.2%us, 1.6%sy, 0.0%ni, 12.4%id, 0.0%wa, 0.0%hi, 0.0%si, 36.8%st
Cpu6 : 48.7%us, 2.1%sy, 0.0%ni, 4.7%id, 0.5%wa, 0.0%hi, 0.0%si, 43.9%st
Cpu7 : 46.8%us, 1.8%sy, 0.0%ni, 6.3%id, 0.0%wa, 0.0%hi, 0.0%si, 45.0%st
Cpu8 : 46.1%us, 3.2%sy, 0.0%ni, 10.0%id, 0.0%wa, 0.0%hi, 0.0%si, 40.8%st
Cpu9 : 48.2%us, 2.4%sy, 0.0%ni, 8.9%id, 0.0%wa, 0.0%hi, 0.0%si, 40.5%st
Cpu10 : 50.4%us, 1.8%sy, 0.0%ni, 6.8%id, 2.6%wa, 0.3%hi, 0.0%si, 38.1%st
Cpu11 : 45.3%us, 2.4%sy, 0.0%ni, 10.8%id, 2.4%wa, 0.0%hi, 0.0%si, 39.2%st
Cpu12 : 51.7%us, 2.6%sy, 0.0%ni, 9.5%id, 0.0%wa, 0.0%hi, 0.0%si, 36.1%st
Cpu13 : 41.2%us, 3.4%sy, 0.0%ni, 18.7%id, 0.0%wa, 0.0%hi, 0.0%si, 36.7%st
Cpu14 : 55.5%us, 1.8%sy, 0.0%ni, 10.3%id, 0.0%wa, 0.3%hi, 0.0%si, 32.1%st
Cpu15 : 39.4%us, 2.9%sy, 0.0%ni, 24.3%id, 0.0%wa, 0.0%hi, 0.0%si, 33.4%st
Mem: 130335424k total, 19881792k used, 110453632k free, 1300288k buffers
Swap: 4096384k total, 0k used, 4096384k free, 17655936k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15460 root 20 0 192m 180m 9664 R 64 0.1 0:07.15 cc1
20488 root 20 0 67520 61m 9664 R 30 0.0 0:01.13 cc1
21028 root 20 0 50304 39m 9664 R 13 0.0 0:00.48 cc1
21114 root 20 0 50176 45m 9664 R 10 0.0 0:00.39 cc1
21236 root 20 0 50112 44m 9664 R 7 0.0 0:00.27 cc1
21251 root 20 0 49280 33m 9664 R 6 0.0 0:00.24 cc1
21332 root 20 0 49216 36m 8384 R 5 0.0 0:00.19 cc1
21386 root 20 0 49216 30m 9664 R 5 0.0 0:00.19 cc1
21313 root 20 0 36160 28m 9472 R 4 0.0 0:00.17 cc1
21267 root 20 0 49216 29m 9600 R 4 0.0 0:00.16 cc1
21374 root 20 0 32832 27m 9664 R 3 0.0 0:00.12 cc1
21401 root 20 0 32768 25m 7360 R 2 0.0 0:00.09 cc1
21346 root 20 0 32768 24m 7360 R 2 0.0 0:00.08 cc1
21425 root 20 0 32832 20m 7360 R 2 0.0 0:00.06 cc1
3 root RT -5 0 0 0 S 0 0.0 0:00.07 migration/0
90 root 20 0 0 0 0 S 0 0.0 0:06.30 pdflush
15481 root 20 0 16512 11m 4096 S 0 0.0 0:00.04 as
18123 root 20 0 7232 4288 3072 S 0 0.0 0:00.01 make
18300 root 20 0 7232 4352 3072 S 0 0.0 0:00.02 make
19403 root 20 0 7232 4416 3072 D 0 0.0 0:00.01 make
19487 root 20 0 7232 4224 3072 S 0 0.0 0:00.01 make
19611 root 20 0 7232 4224 3072 S 0 0.0 0:00.01 make
1 root 20 0 3648 1088 832 S 0 0.0 0:01.83 init
Install the newly built kernel.
So then we can install the new kernel rpm.
We recommend that you reboot to this kernel and confirm that it boots correctly.
We recommend that you do NOT change the default boot kernel, leaving the test kernel as an alternative choice.
Building a recent mainline kernel
For completeness, here's the quick steps for building a mainline kernel.
Go to kernel.org, download a stable or recent kernel. For example, at the time this is being
written, the current mainline kernel is 2.6.32.rc7 and the current stable kernel is 2.6.31.6.
In this example, we download the current mainline kernel
Quick steps are available here: http://kernelnewbies.org/KernelBuild
Assuming you've built the SLES 11 kernel above, an interesting exercise is to look at the
differences in the two .config files - the primary one used by SLES 11 and the .config file created for the mainline kernel.
The mainline kernel version
Compare the two
For the build..
If running under ABAT, use
Note that with the 2.6.32.rc7 kernel, for the kernel performance events config flags
|
|