Click to See Complete Forum and Search --> : kernel compile and /lib/modules


grcunningham
05-28-2004, 11:01 AM
hi...ive looked all over and cant find an answer

im compiling my first kernel. Rather than jump to
2.6(i'm at 2.4.20 now), I decided just to go with
2.4.26 (i was worried about package deps with 2.6)
im using the kernel rebuild instructions at http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
I download and extract.....ok
make mrproper....ok
make xconfig.....ok
make dep....ok
make clean....ok
make bzImage....ok
make modules....ok
make modules_install....ok
now it says that i should create an initial Ramdisk using:
mkinitrd /boot/initrd-2.4.26.img 2.4.26
when i do this it says that /lib/modules/2.4.26 isnt a dir???
i look in /lib/modules, and it is 2.4.262 ????
im not sure what to do at this point, so i change mkinitrd
to match the 262 directory, like so
mkinitrd /boot/initrd-2.4.262.img 2.4.262.

now it tells me to copy bzImage and System map, and
create a link, like so:

cp arch/i386/boot/bzImage /boot/bzImage-KERNEL_VERSION

cp System.map /boot/System.map-KERNEL_VERSION

ln -s /boot/System.map-KERNEL_VERSION /boot/System.map

now I'm really confused, since im not sure how the module dir fits in (do I use 2.4.26 or 2.4.262?)

I use 2.4.26...seems ok

now I configure Grub
title Test Kernel(2.4.26)
root (hd0,1)
kernel /boot/bzImage-2.4.26 ro root=LABEL=/
initrd /boot/initrd-2.4.26.img

and reboot...

when i try the test kernel it says File not found
I check in /boot, and bzImage-2.4.26 is there, but
I have System.map-2.4.26 and System.map-2.4.262

I just decide I made a mistake somewhere, so I clean
all the new files from /boot and /lib/modules
and just start over
save old config
make mrproper
etc.etc.etc

now ive just finished make modules_install
and checked lib/modules...its once again 2.4.262
(this is where my machine is waiting right now)
so the mkinitrd wont work the way it is written:
the exact line in the manual:
mkinitrd /boot/initrd-2.6.0.img 2.6.0
the last time I changed both to 2.4.24..didnt work
changed both to 2.4.262..worked but wouldnt boot
should I just change one? or could something
else be wrong?

sorry the post is so long, just wanted to give as much
info as possible.
thanks

janet loves bill
05-28-2004, 12:09 PM
Originally posted by grcunningham


/boot/bzImage-KERNEL_VERSION



this should be................

/boot/vmlinuz-KERNEL_VERSION

grcunningham
05-28-2004, 01:00 PM
i think i just realized what happened...in the manual it
says

Inside the Linux source directory is the default Makefile. This file is used by the make utility to compile the Linux sources. The first few lines of the Makefile contains some versioning information:

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 22
EXTRAVERSION = -1


Note that there is an additional EXTRAVERSION field. To prevent overwriting any existing kernel modules on the system we will change this EXTRAVERSION to something unique. When the final installation steps are run, kernel module files will then get written to /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$EXTRAVERSION.

i thought this had to be "unique", so i made the
EXTRAVERSION= 2
which appended the 2 to the modules dir name

dddduuuuuuuhhhhhhhhhh!!!!!!!


I'll try it again and use my brain this time....
thanks.

mdwatts
05-28-2004, 01:29 PM
Originally posted by grcunningham
i think i just realized what happened...in the manual it
says

EXTRAVERSION = -1


Note that there is an additional EXTRAVERSION field.

I'll try it again and use my brain this time....


You beat me to it as I was about to suggest you have a look in Makefile for EXTRAVERSION.

Either way, I must commend you for finding the solution on your own. Not only are you compiling your first kernel, but you also took the time to fully read the documentation which enabled you to troubleshoot and find the solution yourself. Well done!!

BTW... You did use your brain the first time. We could actually create a kernel compiling how-to from what you posted. :cool: