Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12th December 2004, 09:33 AM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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

Quote:
-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)
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0

Last edited by cybrjackle; 26th January 2006 at 05:20 PM.
Reply With Quote
  #2  
Old 14th January 2005, 07:33 PM
bärtil Offline
Registered User
 
Join Date: Oct 2004
Posts: 47
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
Reply With Quote
  #3  
Old 24th January 2005, 09:04 PM
haddad Offline
Registered User
 
Join Date: Jun 2004
Posts: 11
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
Reply With Quote
  #4  
Old 24th January 2005, 10:49 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #5  
Old 26th January 2005, 05:30 PM
haddad Offline
Registered User
 
Join Date: Jun 2004
Posts: 11
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
Reply With Quote
  #6  
Old 26th January 2005, 05:52 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
your welcome
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #7  
Old 26th January 2005, 07:17 PM
DigiCrime Offline
Registered User
 
Join Date: Aug 2004
Posts: 23
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
Reply With Quote
  #8  
Old 26th January 2005, 07:43 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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)
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #9  
Old 26th January 2005, 07:45 PM
DigiCrime Offline
Registered User
 
Join Date: Aug 2004
Posts: 23
Thats cool I assume to build one thats non modular would be to just leave that part out when building?
Reply With Quote
  #10  
Old 26th January 2005, 07:53 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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.
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #11  
Old 26th January 2005, 08:17 PM
DigiCrime Offline
Registered User
 
Join Date: Aug 2004
Posts: 23
True, but for sever enviroment, nothing else, no X etc etc it can have an upside on security
Reply With Quote
  #12  
Old 26th January 2005, 08:43 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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 ;-)
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #13  
Old 31st January 2005, 08:39 PM
huckem_420 Offline
Registered User
 
Join Date: Jan 2005
Posts: 35
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?
Reply With Quote
  #14  
Old 31st January 2005, 11:35 PM
cybrjackle Offline
Registered User
 
Join Date: Jan 2004
Posts: 456
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
__________________
aka "jlc" on irc.

Main Desktop:
Rawhide x86_64
MSI K8N NEO2 Platinum
AMD Athlon 64 3200+ Winchester @ 2350MHz
CORSAIR XMS TWINX1024-3200C2 2GB
BFG Nvidia GeForce 6800GT OC @ 370MHz 256MB GDDR3
2x80GB SATA 150 Segate Raid 0
Reply With Quote
  #15  
Old 4th February 2005, 11:21 PM
Lissimore Offline
Registered User
 
Join Date: Feb 2005
Posts: 2
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
Reply With Quote
Reply

Tags
easy, fedora, guide, kernels, rebuilding

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


Current GMT-time: 01:26 (Thursday, 27-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Pad Idan - Kosong Instagram Photos - Joal-Fadiout