FC5 - 'How To Compile A Kernel - The Fedora Way'

Discussion in 'Kernel Questions' started by Linocks, Nov 19, 2006.

  1. Linocks

    Linocks New Member

    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 : -

    Code:
    [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.:)
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Can you run
    Code:
    ls -l
    in the SPECS directory? What's the output?
     
  3. Linocks

    Linocks New Member

    'How To Compile A Kernel - The Fedora Way'

    The output is as per below : -

    Code:
    [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 : -

    Code:
    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?!?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    This is described in chapter 2.3 Patch The Kernel on http://www.howtoforge.com/kernel_compilation_fedora
     
  5. Linocks

    Linocks New Member

    'How To Compile A Kernel - The Fedora Way'

    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 : -

    Code:
    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.:eek:
     
  6. falko

    falko Super Moderator Howtoforge Staff

    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.
     
  7. Linocks

    Linocks New Member


    Thank you again!! :eek:
     
  8. Cerberus

    Cerberus New Member

    Still cannot build the i586/i686 arch

    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
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Is your system a i686 system? What's the output of
    Code:
    uname -a
    ?
     
  10. Cerberus

    Cerberus New Member

    uname -a result

    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
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. Maybe you have to modify the SPEC file do that it use i686 instead of i386? :confused:
     
  12. Cerberus

    Cerberus New Member

    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:
     
  13. falko

    falko Super Moderator Howtoforge Staff

    I think you should try to modify the kernel-2.6.spec file.
    But maybe something else works, too:
    During
    Code:
    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.
     
  14. Cerberus

    Cerberus New Member

    Okay..I'll Try

    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
     
  15. rizo

    rizo New Member

    this guide 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:
     
  16. falko

    falko Super Moderator Howtoforge Staff

    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". :)
     
  17. rizo

    rizo New Member

    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.
     

Share This Page