Everybody's Favourite, Kernel Recompilation

Posted on 2001-06-06
Last Modified: 2010-04-20

I have decided to recompile my linux kernel and, unsurprisingley, I'm having trouble. At the moment I am running 2.4.3 with Mandrake 8.0. I tried to recompile 2.4.3 and the image compiled correctly but it wouldn't compile some modules (ethernet drivers). The image would boot, but without the modules it was no use to me. So I decided to give up on that and download 2.4.5. This compiles, modules and all. However when I tried to boot from the image it got as far as

LILO: linux2.4.5
Uncompressing kernel... ok running linux (or something like that)

At this point the computer just hangs. It seems tome like there is nothing wrong with the compile, but maybe I'm not setting it up to boot correctly. Does this sound right? I have tried

#cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz
#cp /usr/src/linux/ /boot/
#vi lilo.conf




I have also tried,

#cd /usr/src/linux
#installkernel bzImage /usr/src/linux/

Have I missed anything out of this? Is there something moreI need to do to get a new kernel to boot?

Thanks for your time.


Question by:GilesB
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Expert Comment

ID: 6164597
Well, what you've done is rather dangerous!
I normally install the new kernel along side the old one so that if something goes wrong with the new one, you just boot with the old.
Here's how;
Download the kernel code, unpak it to say /opt/newkernel.
Now, cd /opt/newkernel
From within X, make xconfig
Select all the options you want compiled into the new kernel, save and exit
make dep
make modules
make modules_install
make bzImage

Now, when finished,
cp /opt/newkernel/arch/i386/boot/bzImage /boot/bzImage

Now, just edit your lilo.conf file as follow

*keep the existing stuff as is*
Just add to the bottom


save & exit,
run lilo and voila!
Now when booting up you will see you have two options, your original "Linux"
AND the linux2.4.5

This way, should you bugger things up, you can just re-boot with the original and try again.

You shouldn't do anything with system map or EVER write over the boot image currently in use.

You probably already bunged things up on that system and will most probably have to re-install the system, except if you have a boot floppy.

Author Comment

ID: 6167024
Thanks for this. However I didn't overwrite anything and I haven't bunged up the system. I did leave my old kernel bootable. To make things simple I didn't type the full lilo.conf and just wrote the commands as if I had wanted to overwrite everything (the end result is the same). In reality it was more like

#cp bzImage /boot/vmlinuz-2.4.5
#cp /boot/

So there is no need for concern there :) However the problem remains that my new kernel won't boot. Anybody experienced anything like this before? (see above)


LVL 17

Accepted Solution

psimation earned 250 total points
ID: 6167559
If you can still boot with the old kernel, it usually means one thing, you didn't make all the correct choices when selecting the kernel parameters. I suggest running make xconfig again and carefully go through the list of kernel parameters.
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  


Expert Comment

ID: 6180324
DId you compile it for console support on serial device? That could cause it to look like it hangs after the kernel uncompresses, because it changes to output on the serial device.

That option is under ''Character devices"...

Expert Comment

ID: 6220133
Did you compile the kernel for the right CPU type?  2.4 defaults to P2s.


Expert Comment

ID: 6270243
when you compile a new kernel make sure that your sevices are in the kernel and (if you want) the drive can be a module. ie; networking should not be a module but you can make the NIC card drive one if you want. Most of the time i like to make the base stuff that dont change much part of the kernel and them the stuff that can cause problems like sound a module.

Check your mobo and like above the cpu. also read all the help file and go with the recommended setting if you don't know what to do. don't get to worryed about the size of the kernel untill you can get it to work. then start to play with it and slowly cut the fat out. ckeck and see if there is a Linux Users Group in your area as some one to walk you though it a few time makes all the difference in the world.

just my two cents


Expert Comment

ID: 6309868
How old is your version of lilo?  Versions before 21 were not able to boot the kernel image if it happened to appear on the disk on cylinders above 1024.  The new compiled image may well be above that limit.  Try lilo -V and see what you get; upgrade if necessary.

Expert Comment

ID: 6311777
maybe you can try Grub instead of lilo
ps: kernel 2.4.7 is out

Expert Comment

ID: 6424281
Agree with comotai & psimation.
First glance shows the comotai comment.
More can be the trouble as psimation suggested

Expert Comment

ID: 7024807
You have 16 open questions today, some of which date back to the year 2000, all need your attention.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder, Mindphaser or I will return to finalize these as soon as possible if after 7 days no response by the Asker.  EXPERTS-->  please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link 
------> POINTS FOR EXPERTS awaiting comments are listed in the links below (Part 1) (Part 2)
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange

Expert Comment

ID: 7330901
Question abandoned; force-accepted.

CS Moderator

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question