troubles building kernel

Jonathan Berry berryja at gmail.com
Sun Jan 30 05:00:58 UTC 2005


On Sat, 29 Jan 2005 20:54:18 -0700, EBEIGHE bicyclewheelers.com
<ebeighe at bicyclewheelers.com> wrote:
> > On Sat, 2005-01-29 at 18:31 -0700, EBEIGHE bicyclewheelers.com wrote:
> >> hi there.
> >> i've never actually built a kernel before, so I'm having newbie
> >> trouble -- I
> >> wonder if some kind soul can set me straight?
> >
> > It would help if you describe the end result that you are trying to
> > accomplish.
> >
> > Are you are simply trying to learn how too build a kernel from source or
> > are you trying to modify something?
> 
> At this stage, just trying to do it for the exerience :-)

Always good to keep learning : ).

> I went through the whole procedure again, this time building and installing
> modules, and got the same failure.
> In any event, I'm not really sure why, but I needed to re-create the initrd.
> I was under the (mistaken) impression that since i was (or thought I was)
> just building an exact replica of the existing kernel I would not need a new
> initrd. But by making a new one, i.e.:
> mkinitrd /boot/initrd-2.6.9-prep 2.6.9-prep
> And using that along with the new kernel everything booted up fine!

So, you were pointing GRUB at the new kernel and old initrd and it
wasn't working?  Making the new initrd seems like the right thing to
do, but it also would make sense if the old one did work.  If you want
to experiment some, maybe try copying the old initrd to
initrd-2.6.9-prep and seeing if maybe the name matters.  As you
experiment, just remember to always keep a working config around so
you can boot again when things go wrong : ).
Your trouble with the modules makes sense since this new kernel would
expect them to be in /lib/modules/2.6.9-prep/ and not
/lib/modules/2.6.9-1.667/ where they were.  You were having the
trouble because of the initrd, but just so you know that you did need
to do the make modules and make modules_install.

> I see where the -prep comes from in the Makefile, but am wondering, why does
> it say that? I would have expected it to be -1.667  Obviously this isn't
> really the makefile that was used to create the vmlinux-2.6.9-1.667 that I
> got when I installed FC3.

This is a part of the version field that doesn't really matter.  It
should be unique to any kernel that you build, ie don't make it
exactly -1.667 since then this kernel will overwrite your current
kernel.  You can edit the Makefile and change it if you want.  I you
rebuild the src.rpm, it gets changed at some point by the scripts that
do the build.

> I am still wondering about system.map file.
> I didn't do anything with that -- yet everything seems ok. is that right?
> I was reading this HOWTO:
> http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#INSTALLATION
> and it talks about copying it /boot and making some link to it. Do I need to
> do that?

Looks like there System.map files in my /boot/ directory.  I'd copy it
over and give it the name System.map-2.6.9-prep (note case).  I think
with Fedora at least you can do make install and it will automatically
set things up for you.  I think this step even creates a GRUB entry.

> 
> Thanks,

I'd suggest also learning about building a kernel RPM as this will do
anything that needs to be done when it is installed and works much
better with Fedora since it is RPM based.  Of course, if you just
wanted to do it by hand first, I understand that.  Here is an example
of how to customize the .config file and rebuild the src.rpm:
http://crab-lab.zool.ohiou.edu/kevin/kernel-compilation-tutorial-en/
I assume your next step will be to try some customization.  Have fun.
By the way, you probably ought to grab the latest kernel as there have
been many updates since the initial FC3.  In fact, if you have not,
update your whole system.

Jonathan




More information about the users mailing list