recompiling kernel after manually applying the patch

Taking care of your Linux box.

recompiling kernel after manually applying the patch

Postby Saadi » Mon Jul 14, 2003 7:31 pm

how do i recompile my kernel (redhat 8; 2.4.18-14) after modifying base.c file in /usr/src/linux-2.4.18-14/fs/proc/base.c. This patch is meant to increase /proc/cmdline file to parse larger arguments and and it is applied by modifying base.c file. this is just a development machine for testing.

i have changed the base.c (made backup of the file as well) file and here's how I am trying to recompile:

- downloaded the kernel src
- rpm -Uvh kernel.src.rpm
- rpmbuild -ba /usr/src/redhat/SPECS/2.4.18.specs
- make mrproper
- make config
- make dep
- make clean
- make zImage
- make modules
- make modules_install
- modify grub for default kernel is the new kernel
- reboot

please help me if you have any helpful tips for me based on your previous experiences.

the aim is to update the machine using the same kernel with the patch.

will wait for your response deparately.
thank you so much!
Aziz Khawaja
Chicago, Il.
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

Postby fawad » Tue Jul 15, 2003 12:38 am

The sequence is essentially correct, however I have some suggestions to make.

  1. Instead of zImage, make bzImage instead. bzImage builds smaller kernel images which helps because as I recall there's some kinda limitation on the size of the kernel image on the x86.
  2. Instead of setting the new kernel as the default outright, just add the new kernel image in lilo.conf, and run lilo -R <new_entry_name>. This will set the new kernel image as the default for the next boot. That way, if your box is in a remote location, if something goes horribly wrong on reboot and the new kernel refuses to boot, just ask someone with physical access to the box to reboot it. It'll boot back into the original one.
  3. In the makefile for the kernel, change the EXTRAVERSION parameter to something like -LCMD (long commandline). That way, the modules built won't overwrite the non-LCMD kernel modules
  4. Run depmod <new_kernel_version> to make sure the new modules are in the correction condition
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
ICQ: 17672437
Yahoo Messenger: fawad2048
AOL: fawadhalim
Location: Addison, IL

Postby Saadi » Tue Jul 15, 2003 1:03 am

thank you. iam rebuilding it per the instructions. besides, i am using grub.conf which i will be modifying its default number of the kernel. is grub ok to use in rcompilation or is it LILO?
Aziz Khawaja

Chicago, Il.
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 1 guest