Click to See Complete Forum and Search --> : Kernel Compiling on Red Hat 9
Tzar Kastik
11-03-2003, 06:50 PM
Hi. I am trying to compile the latest 2.4 kernel (2.4.22) for a red hat 9 system. I can follow the instructions in the README until the bzImage is made. After that the README gets a little vague for me ( and "Mastering Red Hat 9" is also very very vague at this point ).
The instructions to follow are (#1 is from the README, #2 & #3 are from Mastering Red Hat 9):
1) Take the bzImage file from ~/linux-2.4.22/arch/i386/boot and copy it into /boot
(the README then goes on to describe how to get LILO to find the new kernel....not much help as im using grub)
2) Rename it to vmlinuz-2.4.22extraname
3) Make initial ram disk with the command (no idea which directory to run this from - no mention of it in either text)
# /sbin/mkinitrd /boot/initrd-2.4.22extraname.img 2.4.22extraname
(this is exactly how its written in the book ........what/where is the second parameter???)
Oh, and im using grub as my bootloader, so help on adding the new kernel to it would be appreciated.
Thanks!
Thrasher
11-03-2003, 07:03 PM
Here is my experience with this:
After you have copied the bzImage to /boot
on RedHat systems you need to
make install
when that is finished, just reboot and you will see the new kernel (probably with a name given by RedHat.)
by using the make install command, you dont need to edit the grub.conf
Tzar Kastik
11-03-2003, 07:11 PM
Thanks. Tried that and it almost worked :rolleyes: , only the Initial RAM disk image failed to be created. I get the error:
sh -x ./install.sh 2.4.22test bzImage /home/me/linux-2.4.22/System.map ""
+ '[' -x /root/bin/installkernel ']'
+ '[' -x /sbin/installkernel ']'
+ exec /sbin/installkernel 2.4.22test bzImage /home/me/linux-2.4.22/System.ma
p ''
/lib/modules/2.4.22test is not a directory.
mkinitrd failed
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/me/linux-2.4.22/arch/i386/boot'
make: *** [install] Error 2
Thrasher
11-03-2003, 07:18 PM
You were logged on as root weren't you?
Sorry had to ask.
If that didnt do it, its beyond me.
fatTrav
11-04-2003, 01:28 AM
hmm. i used the config file from /boot and tweaked that a bit and followed the make dep, make clean, make bzImage, make modules, make modules_install, and then make install and the kernel compiled with no fuss.
if you use the config file as-is from /boot then you outta have no problems with 2.4.22. make install takes care of the fussy stuff like moving things and editing Grub.
i know i've had issues at times comiling kernels and i've found it to be easiest to start from scratch each time I screw up.
(edit) you can use the redhat update to get redhat's latest custom kernel. i believe one of the main differences in the redhat one is how threads are handled. the redhat one uses the nptl stuff from the 2.6 series where as that is not included in the 2.4.22 kernel. if i am wrong someone point this out!!
hope this helped
travis
rbrimhall
11-04-2003, 01:48 AM
/lib/modules/2.4.22test is not a directory.
mkinitrd failed
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/me/linux-2.4.22/arch/i386/boot'
make: *** [install] Error 2
The image failed to make because there were no modules found in /lib/modules/2.4.22test.... this would only happen if you did not append "test" into the Makefile under extra= before make modules modules_install install... and I would highly recommend using a current kernel config as mentioned by fattrav... it has eased recompiling kernels... also you'll need to edit /boot/grub/grub.conf after make install to point the new kernel to your root dir... ie replace root=Label/ with root=/dev/hdxx
hope this helps.
Zubir
11-04-2003, 02:12 AM
get on google, and type "redhat rawhide." go through the pages until you find the i386 rpm's, then download kernel 2.4.22-blah blah, and it's source .rpm.
open a terminal, su to root, cd to the directory you downloaded the .rpm's to, then type:
rpm -ivh kernel*
after that finishes, reboot. you will see a list of kernels, but the new one will NOT be the default. pick the new kernel. after the desktop loads, open the terminal again, su to root, then type:
emacs /boot/grub/grub.conf
you will then see a page with the kernels listed. change the value in the line that says "default" to "0." click "file," then "save current buffer."
reboot, then you have redhat 9, with a 2.4.22-whatever kernel with no compiling.
Tzar Kastik
11-04-2003, 11:38 AM
My fault! I didnt do "make modules" and "make modules_install". The kernel README was a bit misleading though. It said "If you configured any of the parts of the kernel as `modules', you
will have to do "make modules" followed by "make modules_install". I didnt specify any modules (although there might have been some by default that i didnt see), so i skipped it. Now i know better.
Thanks for the help guys!
Tzar Kastik
11-04-2003, 02:39 PM
Argh. Spoke too soon. On booting i get:
VFS: Cannot open root device "LABEL=/" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
grub.conf contains:
title Red Hat Linux (2.4.22test)
root (hd0,0)
kernel /vmlinuz-2.4.22grum ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.22test.img
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8.img
The 2.4.20-8 kernel works fine. What could be causing the problem? I have no idea.
fatTrav
11-04-2003, 05:08 PM
Try:
title Red Hat Linux (2.4.22test)
root (hd0,0)
kernel /vmlinuz-2.4.22grum ro root=/dev/hda3 hdc=ide-scsi
initrd /initrd-2.4.22test.img
where hda3 is your root drive. (df -h outta tell you which partition is your / partition)
i've had the LABEL thing screw up a few times before and i just leave it out and no more worries about that panic.