Problem REcompiling the kernel optimized for k8

Support for the other architectures (X86_64, IA-64, and PowerPC)
azzamite
Posts: 50
Joined: 2008/02/07 23:11:17

Problem REcompiling the kernel optimized for k8

Post by azzamite » 2008/06/09 15:27:46

Hi there,
I'm trying to recompile my kernel but optimized for amd k8, I've followed the instructions in the wiki
http://wiki.centos.org/HowTos/Custom_Kernel
the only thing I did after [b]make oldconfig[/b] was to [b]change the processor arch to k8[/b].
I used the [b]kernel-2.6.18-x86_64.config[/b] since I didn't find one for amd or k8.
I kept the coment at the beginning of the .config file as [b]# x86_64[/b]

I haven't read the thing about making rpms as user ('hope that's not the problem),

The thing kept compiling for about 10 minutes and then rose the next error:
[code]<<much compilation output>>
nm: drivers/isdn/hardware/built-in.o: no symbols
nm: drivers/message/built-in.o: no symbols
+ echo '**** kABI checking is enabled in kernel SPEC file. ****'
**** kABI checking is enabled in kernel SPEC file. ****
+ chmod 0755 /home/farfan/rpmbuild/SOURCES/check-kabi
+ '[' -e /home/farfan/rpmbuild/SOURCES/Module.kabi_x86_64 ']'
+ cp /home/farfan/rpmbuild/SOURCES/Module.kabi_x86_64 /var/tmp/kernel-2.6.18-53.1.21.el5.zatan-
root/Module.kabi
+ /home/farfan/rpmbuild/SOURCES/check-kabi -k /var/tmp/kernel-2.6.18-53.1.21.el5.zatan-root/Mod
ule.kabi -s Module.symvers
*** ERROR - ABI BREAKAGE WAS DETECTED ***

The following symbols have been changed (this will cause an ABI breakage):

inet_twsk_deschedule
vfs_getattr
ipv6_get_saddr
inet_csk_listen_start
-----------<<the list continues>>----------
skb_append_datato_frags
ip_nat_protocol_register
__inet_lookup_listener

+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.70147 (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.70147 (%build)
[/code]

rpm-tmp.70147 loocks like a shell script to me

Any ideas?

User avatar
toracat
Forum Moderator
Posts: 7386
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Problem REcompiling the kernel optimized for k8

Post by toracat » 2008/06/09 16:09:10

Check out this thread. When Alan comes online, he will provide more detailed explanations, I'm sure.

azzamite
Posts: 50
Joined: 2008/02/07 23:11:17

Re: Problem REcompiling the kernel optimized for k8

Post by azzamite » 2008/06/09 16:39:46

[quote]
toracat wrote:
Check out this thread. When Alan comes online, he will provide more detailed explanations, I'm sure.[/quote]
which thread?

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Problem REcompiling the kernel optimized for k8

Post by AlanBartlett » 2008/06/09 17:27:02

You've done nothing wrong! :-)

If you are running the 64-bit version of [b]CentOS[/b], then you are correct in choosing the [b]kernel-2.6.18-x86_64.config[/b] file.

To save yourself some time, append the following line to your [b].rpmmacros[/b] file:

[b]%_enable_debug_packages 0[/b]

For your build command, please use:

[b]rpmbuild -bb --target=`uname -r` --with baseonly --without kabichk kernel-2.6.spec[/b]

The important command line flag is [b]--without kabichk[/b]. As you have made a rather major change to the configuration file, the kernel you are attempting to build will not match the published kABI metadata and so a kABI breakage will occur. This is exactly what you are seeing. The [b]--without kabichk[/b] command line option turns off the checking and will allow your kernel build to complete.

I'm assuming you just want the base kernel? If not and you want them all, remove the [b]--with baseonly[/b] option.

Please let us know how things progress.

azzamite
Posts: 50
Joined: 2008/02/07 23:11:17

Re: Problem REcompiling the kernel optimized for k8

Post by azzamite » 2008/06/09 18:23:50

That didn't work, here is the output:
[code]
rpmbuild -bb --target=`uname -r` --without kabichk kernel-2.6.spec
Building target platforms: 2.6.18-53.1.21.el5
Building for target 2.6.18-53.1.21.el5
error: Architecture is not included: 2.6.18[/code]

I thought it whould be because there is no kernel config for k8 so I did
[b]cp kernel-2.6.18-x86_64.config kernel-2.6.18-k8.config[/b]
in the SOURCES directory, I also tried with the fist line in
~/rpmbuild/SOURCES/kernel-2.6.18-{x86_64|k8}.config as [b]# x86_64[/b] and [b]# k8[/b]

and tried executing
rpmbuild -bb --target=`uname -r` --without kabichk kernel-2.6.spec
rpmbuild -bb --target=k8 --without kabichk kernel-2.6.spec

Befor that, I deleted the rpmbuild tree and started anew.

Something else I can try?

User avatar
toracat
Forum Moderator
Posts: 7386
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Problem REcompiling the kernel optimized for k8

Post by toracat » 2008/06/09 18:31:36

[quote]
azzamite wrote:
[quote]
toracat wrote:
Check out this thread. When Alan comes online, he will provide more detailed explanations, I'm sure.[/quote]
which thread?[/quote]
Sorry, I forgot to paste the thread URL. Now that Alan has been helping you, it doesn't matter but I meant to quote:

http://www.centos.org/modules/newbb/viewtopic.php?topic_id=13904&forum=37&post_id=47348#forumpost47348

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Problem REcompiling the kernel optimized for k8

Post by AlanBartlett » 2008/06/09 19:11:23

[quote]I thought it whould be because there is no kernel config for k8 so I did
cp kernel-2.6.18-x86_64.config kernel-2.6.18-k8.config
in the SOURCES directory, I also tried with the fist line in
~/rpmbuild/SOURCES/kernel-2.6.18-{x86_64|k8}.config as # x86_64 and # k8[/quote]
That is your problem. If you would care to read the spec file ([b]~/rpmbuild/SPECS/kernel-2.6.spec[/b]) you will see that your method will not work.

[quote]Something else I can try?[/quote]
Yes. What does [b]uname -r[/b] return on your system? [b]x86_64[/b]?

With a freshly established build tree, please:

(1) [b]cd ~/rpmbuild/BUILD/ker*/lin*/[/b]
(2) [b]cp /boot/config-`uname -r` .config[/b]
(3) [b]make oldconfig[/b]
(4) [b]make menuconfig[/b] # change the processor, as you require
(5) insert the "magic line" at the head of the [b].config[/b] file: [b]# x86_64[/b]
(6) [b]cp .config ~/rpmbuild/SOURCES/kernel-2.6.18-x86_64.config[/b]
(7) [b]cd ~/rpmbuild/SPECS/[/b]
(8) edit the kernel-2.6.spec file. Define [b]buildid[/b]. Comment out the relevant lines.
(9) [b]rpmbuild -bb --target=x86_64 --without kabichk kernel-2.6.spec 2> LOG.err | tee LOG[/b]

([i]¡Ay, caramba![/i], as [b]Bart Simpson[/b] has been known to say. :-D )

azzamite
Posts: 50
Joined: 2008/02/07 23:11:17

Re: Problem REcompiling the kernel optimized for k8

Post by azzamite » 2008/06/09 20:22:26

[quote]
AlanJBartlett wrote:
[quote]I thought it whould be because there is no kernel config for k8 so I did
cp kernel-2.6.18-x86_64.config kernel-2.6.18-k8.config
in the SOURCES directory, I also tried with the fist line in
~/rpmbuild/SOURCES/kernel-2.6.18-{x86_64|k8}.config as # x86_64 and # k8[/quote]
That is your problem. If you would care to read the spec file ([b]~/rpmbuild/SPECS/kernel-2.6.spec[/b]) you will see that your method will not work.[/quote]
Hey, hod on, I didn't do that to bother you, I thought that [b]whould[/b] help.
Also, I did that [u]after[/u] [b]rpmbuild -bb --target=`uname -r` --without kabichk kernel-2.6.spec[/b] failed giving that error.

So I edited rpmbuild/SPECS/kernel-2.6.spec and put this:
# Control whether we perform a compat. check against published ABI.
%define with_kabichk %{?_without_kabichk: 0} %{?!_without_kabichk: 0}

And compiled with [b]rpmbuild -bb --target=`uname -m` kernel-2.6.spec[/b]
it's being almos 2 hours so far, so I think it may finish.

mmmmmmmmm

Then again, giving another read at your post [b](#4)[/b] you wrote:
rpmbuild -bb --target=`uname [b]-r[/b]` --with baseonly --without kabichk kernel-2.6.spec
[b]instead of[/b]
rpmbuild -bb --target=`uname [b]-m[/b]` --with baseonly --without kabichk kernel-2.6.spec

But tanks anyway, if my newly compilled kernel works I'll upload (any subjection where to?) in case someone else want to give it a try.

azzamite
Posts: 50
Joined: 2008/02/07 23:11:17

Re: Problem REcompiling the kernel optimized for k8

Post by azzamite » 2008/06/10 00:27:05

These are the images I compiled:
5e5ba62d0927e8aceaccead3ca0f119b [url=http://www.keepmyfile.com/download/5e5ba62249785]kernel-2.6.18-53.1.21.el5.ng_evangelion.x86_64.rpm[/url]
ae5254d149f99901577196f6360e2509 [url=http://www.keepmyfile.com/download/ae52542249786]kernel-devel-2.6.18-53.1.21.el5.ng_evangelion.x86_64.rpm[/url]
2a341e06fa039b2f8df4dd96b3268d95 [url=http://www.keepmyfile.com/download/2a341e2249781]kernel-headers-2.6.18-53.1.21.el5.ng_evangelion.x86_64.rpm[/url]

Either I did something wrong or I wasted my time :-(

I was expecting to see [b]sse3[/b] in /proc/cpuinfo, but there is nothing, the command
[b]grep sse -i /proc/cpuinfo[/b] loocks exactly the same from my and from cento's kernel.
[code]grep sse -i /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx
mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy misalignsse
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx
mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy misalignsse[/code]

Also, there is only between 1% and 3% of performance gain executing glxgears as you can see in [url=http://img107.imageshack.us/img107/9216/mykernelby6.jpg]this shot[/url],
the numbers in calc are the output of glxgears, the full output can be seen in kwrite.

pcsx2 doesn't seems to recognize sse3 either.

Conclution: [b]this experiment was a failure[/b] :cry:

Note for me: I can disable the building of the debug and xen kernel from the spec, saving up to 66% of compilation time.

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Problem REcompiling the kernel optimized for k8

Post by AlanBartlett » 2008/06/10 00:53:47

[b]D'oh[/b]. :oops:

You're absolutely right. In post #4 I wrote

[quote]rpmbuild -bb --target=[b]`uname -r`[/b] --with baseonly --without kabichk kernel-2.6.spec[/quote]
which is quite wrong! My apologies. I should have written:

[b]rpmbuild -bb --target=[i]`uname -m`[/i] --with baseonly --without kabichk kernel-2.6.spec[/b]

as you quite correctly noticed. The command line I mentioned at point (9) in post #7 is, however, correct:

[b]rpmbuild -bb --target=x86_64 --without kabichk kernel-2.6.spec 2> LOG.err | tee LOG[/b]

There is no need to edit that line ([b]%define with_kabichk %{?_without_kabichk: 0} %{?!_without_kabichk: 1}[/b]) in the spec file, the command line option [b]--without kabichk[/b] takes care of it.

For completeness, I will confess to making another error, this time in post #7. I wrote

[quote]What does [b]uname -r[/b] return on your system? x86_64?[/quote]
when it should have been [b]uname -m[/b].

As you can see, I have been thoroughly mixing up my command line arguments to [b]uname[/b]. There's no real excuse for it apart from the fact that I was rushing to give you a reply and was relying entirely on my memory rather than looking at my hardcopy of the Wiki article. (Which is now covered in pencilled editorial notes, ready for the next update.)

As for the time of a build process, I have found that a [i]--with baseonly[/i] build will take me between 3 & 3.5 hours. Building the entire kernel set will probably take you all night (I always advise people to perform kernel builds overnight & not to sit watching it), possibly taking in excess of 12 hours. It all depends upon your processor speed.

If you split the [i]standard output[/i] and the [i]standard error[/i] into two separate streams and save both into their own logfiles, it does make it easier to review the build process upon termination - hence my recommendation of the command line:

[b]rpmbuild -bb --target=x86_64 --without kabichk kernel-2.6.spec 2> LOG.err | tee LOG[/b]

Please let us ([b]toracat[/b] & [b]me[/b]) know how you get on.

Post Reply

Return to “CentOS 5 - X86_64,s390(x) and PowerPC Support”