<---- template headericclude ----->
Rebuilding Fedora Kernels easy guide.
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 13 12311 ... LastLast
Results 1 to 15 of 195
  1. #1
    cybrjackle Guest

    Rebuilding Fedora Kernels guide.

    This should be fairly simple rebuild of the kernel. I always use my user to build kernels so this guide is going to focus on doing it as "me" not "root". If you don't know how to build rpms as your user, follow this guide:

    How-To create rpmbuild dir
    ---------------------------------------------------------------------------------------------------------------------------------

    1.) choose your weapon by grabbing one of the .src.rpm's:

    Fedora Core 4 - latest

    Rawhide - latest

    ACkernel - latest

    2.) Install it:
    Code:
    $ rpm -ivh kernel-2.6.9-1.1021_FC4.src.rpm
    3.) Change to your rpmbuild dir and patch it with fedora's kernel patches:
    Code:
    $ cd ~/rpmbuild/SPECS/
    $ rpmbuild -bp kernel-2.6.spec
    you might have to build with arch specific
    $ rpmbuild -bp --target=i686 kernel-2.6.spec
    
    target can = i386 i586 i686 x86_64
    *note from man rpmbuild

    -bp Executes the "%prep" stage from the spec file. Normally this
    involves unpacking the sources and applying any patches.

    4.) Change to the build dir and config or add more patches to your kerenl

    Code:
    $ cd ~/rpmbuild/BUILD/kernel-2.6.9/linux-2.6.9
    $ vi Makefile   <-- edit "EXTRAVERSION ="  with something fancy like "EXTRAVERSION = -justin"
    $ make menuconfig
    *Note*
    If your up to this point, you probably know what your doing with "menuconfig" so get rid of what you don't want, If you don't know what your doing, run and hide or play around tell you break some stuff Also, before the menuconfig, you could add more patches if your feeling good about your self.

    5.) Build the kernel with rpm ( keeps your rpmdb clean and you can pass out your kerenls to the neighbors)
    Code:
    time make rpm
    (time is just to tell you how slow your system is)

    6.) Install your new kernel (after "make rpm" it willl tell you exactly were it placed it)
    Code:
    $ cd ~/rpmbuild/RPMS/x86_64   <--- your dir will be different depending on the <arch>  i386/i686 ...
    $ rpm -ivh <new-kernel-here>
    7.) Check grub. (some odd reason there kernel wont "always" add it self to grub with you build it your self, odd I know, its a crap shoot)

    Code:
    $ sudo more /boot/grub/grub.conf    <--- change to root with "su -" if you don't use sudo
    If you don't see your kernel in there, look at /boot

    Code:
    $ ls -ltr /boot
    The newest kernel/initrd will be at the bottom of the list and you can confirm by name and date when it was added. Then just edit your grub.conf to look like your previous entry's but with the new names. Whatever you do, "DO NOT DELETE" your old ones! Keep a backup of your old kernels, to be able to boot to if your new one doesn't work. If you use Nvidia cards with 3D dirivers, you can do one of 2 things. either replace /etc/X11/xorg.conf "nvidia" with "nv" then reboot or just boot to run level 3 and then run your nvidida.run again. vi /etc/inittab and change "id:5:initdefault:" to "id:3:initdefault:" Whatever floats your boat or a 3,4 and 5 step a few others will tell you about

    8.) reboot

    This should be pretty simple, this is just kind of a primer, you can go more in depth if you like, ( i do) just wanted to give you a place to start and have the lovely Fedora patched kernel. Patches can be a good thing , haveing your kernel patched with Fedora's patches is even a better idea, (specially if your running SELinux)

    When I want some fun in my life and nothing better to do, I'll patch up my kernel and then add mm/ck/cko/nitro patches to the kernel. (only one, don't get to insane)
    Last edited by cybrjackle; 26th January 2006 at 05:20 PM.

  2. #2
    bärtil Guest
    Thanx!! Somehow for me it wants to use default i386, but i want i686.. i make it
    Code:
    rpmbuild -bp --target=i686 kernel-2.6.spec

  3. #3
    haddad Guest
    Hi

    I followed these instructions step by step and I ended up with three files with the new kernel in the /boot directory, the initrd-*.img file was not there.

    I didnt have any errors in the process

    Can someone help me please?

    Thanks

  4. #4
    cybrjackle Guest
    Let say you have the following kernel in your /boot dir
    Code:
    vmlinuz-2.6.9-1.667
    To get an initrd you would do the following
    Code:
    mkinitrd /boot/initrd-2.6.9-1.667.img 2.6.9-1.667
    What is in your boot?

    What this is really looking for is what is in your /lib/modules

  5. #5
    haddad Guest
    Quote Originally Posted by cybrjackle
    Let say you have the following kernel in your /boot dir
    Code:
    vmlinuz-2.6.9-1.667
    To get an initrd you would do the following
    Code:
    mkinitrd /boot/initrd-2.6.9-1.667.img 2.6.9-1.667
    That did it

    Thanks

  6. #6
    cybrjackle Guest
    your welcome

  7. #7
    DigiCrime Guest
    Simple Request Would be nice to build a monilithic kernel, and turn it into an RPM but id settle on a how to on how to build one from kernel.org just for starters

  8. #8
    cybrjackle Guest
    Quote Originally Posted by DigiCrime
    Simple Request Would be nice to build a monilithic kernel, and turn it into an RPM but id settle on a how to on how to build one from kernel.org just for starters
    If your asking how to build a kernel.rpm that is simply get your config ready and "make rpm" from the dir you are in (ie. /usr/src/linux)

  9. #9
    DigiCrime Guest
    Thats cool I assume to build one thats non modular would be to just leave that part out when building?

  10. #10
    cybrjackle Guest
    Quote Originally Posted by DigiCrime
    Thats cool I assume to build one thats non modular would be to just leave that part out when building?
    A non modular kernel would probably be more like when selecting "stuff" in your kernel, you sould choose everything to be[*] instead of [M] So you would simply build everything into it. I wouldn't recommend this, just because a modular design has many advantages, but you can certianly build one and play with it.

  11. #11
    DigiCrime Guest
    True, but for sever enviroment, nothing else, no X etc etc it can have an upside on security

  12. #12
    cybrjackle Guest
    Quote Originally Posted by DigiCrime
    True, but for sever enviroment, nothing else, no X etc etc it can have an upside on security
    true that ;-)

  13. #13
    huckem_420 Guest
    hey, if I am using Fedora Core 3, and I just right clcik and click open with package installer, will that do essentially the same thing?

  14. #14
    cybrjackle Guest
    Quote Originally Posted by huckem_420
    hey, if I am using Fedora Core 3, and I just right clcik and click open with package installer, will that do essentially the same thing?
    afaik, not .src.rpm's the package installer is for regualr .rpm

  15. #15
    Lissimore Guest
    Quote Originally Posted by cybrjackle
    If your asking how to build a kernel.rpm that is simply get your config ready and "make rpm" from the dir you are in (ie. /usr/src/linux)
    Now, building the kernel works nicely.... booting a monolithic kernel without the module loader... does not work nicely.

    I'm trying to get the sysinit scripts straightened out for monolithic kernels that don't have the module loader enabled.

    I've got 2 kernels both the exact same except, one with the loader one without it. The one with the loader boots fine... the one without kernel panics on:
    Cannot open initial console

    Anyone have any ideas ?

    D. Lissimore

Page 1 of 13 12311 ... LastLast

Similar Threads

  1. Making music in Fedora with Rosegarden and fluidsynth (Easy guide)
    By sideways in forum Guides & Solutions (Not For Questions)
    Replies: 23
    Last Post: 20th September 2009, 10:44 PM
  2. Iptables (easy, quick, clean and short as possible) guide
    By alpha645 in forum Guides & Solutions (Not For Questions)
    Replies: 8
    Last Post: 3rd June 2008, 11:12 AM
  3. The easy guide to media installation - No Arch
    By K1u in forum Guides & Solutions (Not For Questions)
    Replies: 1
    Last Post: 12th October 2007, 04:20 AM
  4. Trying to Follow "Rebuilding Fedora Kernels easy guide."
    By hfcdocsis in forum Guides & Solutions (Not For Questions)
    Replies: 2
    Last Post: 9th June 2005, 06:29 PM
  5. Rebuilding Fedora CDs guide
    By Jman in forum Links
    Replies: 1
    Last Post: 14th July 2004, 09:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]