PDA

View Full Version : FC5 - 'How To Compile A Kernel - The Fedora Way'


Linocks
19th November 2006, 03:45
I am a Newbie & I have probably bitten off more than I can chew :eek: but I am trying to complete your 'How To Compile A Kernel - The Fedora Way' and I have got to the section where I vi kernel-2.6.specs. When I do this I get an empty file. I enter the text as per your 'Howto' but then I get the below message : -

[root@localhost SPECS]# rpmbuild -bp kernel-2.6.spec
error: Name field must be present in package: (main package)
error: Version field must be present in package: (main package)
error: Release field must be present in package: (main package)
error: Summary field must be present in package: (main package)
error: Group field must be present in package: (main package)
error: License field must be present in package: (main package)
[root@localhost SPECS]#

Where have I gone wrong?:confused:

My aim is to install a LAMP server on a machine for which I have built a good 'foundation'. That is why I decided to undertake this task and not just use the DVD from my LXF Magazine! Your assistance is highly appreciated.:)

falko
20th November 2006, 12:48
Can you run
ls -l
in the SPECS directory? What's the output?

Linocks
20th November 2006, 21:47
The output is as per below : -

[root@BASE-ECS SPECS]# ls -al
total 128
drwxr-xr-x 2 root root 4096 Nov 19 20:42 .
drwxr-xr-x 7 root root 4096 Nov 19 18:25 ..
-rw-r--r-- 1 root root 103145 Oct 16 19:30 kernel-2.6.spec
[root@BASE-ECS SPECS]#

BUT..........

I should tell you that I started all over again and it worked this time so it would appear that I missed something initially or .......... I don't know :confused: because it was empty before. Notwithstanding same, I continued following your instructions and after applying the patch I got this error message : -

Patch #211 (linux-2.6-x86-unwinder-fixes.patch):
+ patch -p1 -s
+ echo 'Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):'
Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):
+ patch -p1 -s
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n
1 out of 1 hunk ignored -- saving rejects to file drivers/block/DAC960.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)

(I have only copied the last few lines of the output - I downloaded and applied patch-2.6.18.2.bz2. Honest! :( ). So I ask myself (or anyone else for that matter)..... What now?!?

falko
21st November 2006, 15:48
BUT..........

I should tell you that I started all over again and it worked this time so it would appear that I missed something initially or .......... I don't know :confused: because it was empty before. Notwithstanding same, I continued following your instructions and after applying the patch I got this error message : -

Patch #211 (linux-2.6-x86-unwinder-fixes.patch):
+ patch -p1 -s
+ echo 'Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):'
Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):
+ patch -p1 -s
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n
1 out of 1 hunk ignored -- saving rejects to file drivers/block/DAC960.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)

(I have only copied the last few lines of the output - I downloaded and applied patch-2.6.18.2.bz2. Honest! :( ). So I ask myself (or anyone else for that matter)..... What now?!?This is described in chapter 2.3 Patch The Kernel on http://www.howtoforge.com/kernel_compilation_fedora

Linocks
23rd November 2006, 01:20
This is described in chapter 2.3 Patch The Kernel on http://www.howtoforge.com/kernel_compilation_fedora

Sorry Falko, what are you saying? The output means nothing to me. When following your instructions I actually copy the commands as they appear in your instructions in order to prevent typos.

Have I omitted (or included) something I shouldn't have? I also, prior to asking for further assistance, tried both options from the output (i.e. the [y] & the [n] to see if they would generate different results.

I refer to the below : -

Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n

I am prepared to start all over again if you think that will help. I did follow the instructions (I think) at Section 2.3.:o

falko
24th November 2006, 15:07
These errors and the solution are exactly what I describe in my tutorial. Please try to read it carefully.

Patch #211 (linux-2.6-x86-unwinder-fixes.patch):
+ patch -p1 -s
+ echo 'Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):'
Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):
+ patch -p1 -s
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n
1 out of 1 hunk ignored -- saving rejects to file drivers/block/DAC960.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.18720 (%prep)What you have to do now is to comment out the patch #300.

Linocks
23rd December 2006, 22:36
These errors and the solution are exactly what I describe in my tutorial. Please try to read it carefully.

What you have to do now is to comment out the patch #300.


Thank you again!! :o

Cerberus
10th April 2007, 12:34
Hi All :D , I'm "Cerberus", i'am a new Linux distro-yer from Indonesia
I red your e-article about building rpm from linux kernel (using fedora way), that's very usefull for me...but i've collected some questions related to your article:

1. In order to build kernel-*.i686.rpm (for i686 arch) i used:

rpmbuild -bp --target=i686 kernel-2.6.spec

after that, i followed all your step from your article

BUT the result STILL JUST for i386 architecture (nothing ini i686 directory, i also did it for i586 arch)
Please give me some solutions about that problem.

BUT (again) Before that step:
- i didnt patch with the newest version but directly ran rpmbuild -bp --target=i686 kernel-2.6.spec
- i use the kernel configuration file (from knoppix) and saved it to .config
(i already changed the processor firmware type to Pentium-Pro and choosed the PC Compatible)

2. :cool: how to eliminate the "release" field?

e.g: my new kernel name is kernel-2.6.18-Cerberus-1.i386.rpm, how to eliminate the "-1" string?

Thanks alot, and i realy realy need your help

falko
11th April 2007, 16:06
1. In order to build kernel-*.i686.rpm (for i686 arch) i used:

rpmbuild -bp --target=i686 kernel-2.6.spec

after that, i followed all your step from your article

BUT the result STILL JUST for i386 architecture (nothing ini i686 directory, i also did it for i586 arch)
Please give me some solutions about that problem.

BUT (again) Before that step:
- i didnt patch with the newest version but directly ran rpmbuild -bp --target=i686 kernel-2.6.spec
- i use the kernel configuration file (from knoppix) and saved it to .config
(i already changed the processor firmware type to Pentium-Pro and choosed the PC Compatible)
Is your system a i686 system? What's the output of uname -a?

Cerberus
13th April 2007, 07:41
This is uname -a result

[root@xtimata]# uname -a
Linux xtimata 2.6.18_XTIMATA_2.1 #2 Mon Apr 9 21:28:44 WIT 2007 i686 i686 i386 GNU/Linux

falko
14th April 2007, 13:36
Looks ok. Maybe you have to modify the SPEC file do that it use i686 instead of i386? :confused:

Cerberus
16th April 2007, 04:59
ok,...or maybe there's another switch for make rpm to build i586/i686?

When i ran "make rpm", it showed that the procedure made kernel.spec which doesnt contain buildarch i686

which SPEC do i have to modify: the kernel-2.6.spec or the kernel.spec which generated by "make rpm" procedure (or i have to modify the "spec file" generator file?) ?

Thanx, again... :rolleyes:

falko
17th April 2007, 11:21
which SPEC do i have to modify: the kernel-2.6.spec or the kernel.spec which generated by "make rpm" procedure (or i have to modify the "spec file" generator file?) ?
I think you should try to modify the kernel-2.6.spec file.
But maybe something else works, too:
During make menuconfig you can specify the processor architecture for which you want to build the kernel (don't know in which submennu that is hidden, though). Maybe you should try that first.

Cerberus
18th April 2007, 08:41
O...w :eek:
i told you that i used konppix' .config file to reduce the modules size BUT actualy i just moved from 386 (in knoppix' config) to Pentium-Pro (for my new kernel), OKAY i'll try to change the processor type to 586 or 686...

I'll tell you the result a.s.a.p.

Thanx a lot :D

rizo
18th April 2007, 19:19
this guide (http://www.howtoforge.com/kernel_compilation_fedora) isnt doing it for me. the kernel rpm doesn't work like other kernel rpms such as from fedora, atrpms or linuxant plus its missing the kernel-devel package.

applying patches isn't working for me either, always get [nonint_oldconfig] errors when trying to build

really needs to be updated to really compile w/ patches the fedora way :confused:

falko
19th April 2007, 13:35
really needs to be updated to really compile w/ patches the fedora way :confused:
It'S working for me exactly the way I wrote it. If the RPM way doesn'T work for you, you can still take the "traditional way". :)

rizo
19th April 2007, 18:50
It'S working for me exactly the way I wrote it. If the RPM way doesn'T work for you, you can still take the "traditional way". :)
its not that the rpm doesnt work (with the exception of needing to create initrd and manually updating grub conf), but it's missing the devel package which is needed to make the nvidia module or others. applying the 16K stack and hdaps patches via the spec file breaks the process too.