Everybody's Favourite, Kernel Recompilation


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/System.map /boot/System.map
#vi lilo.conf




I have also tried,

#cd /usr/src/linux
#installkernel bzImage /usr/src/linux/System.map

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.


Who is Participating?
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.
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.
GilesBAuthor Commented:
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 System.map /boot/System.map-2.4.5

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)


Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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"...
Did you compile the kernel for the right CPU type?  2.4 defaults to P2s.

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

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.
maybe you can try Grub instead of lilo
ps: kernel 2.4.7 is out
Agree with comotai & psimation.
First glance shows the comotai comment.
More can be the trouble as psimation suggested
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.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

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
http://www.experts-exchange.com/commspt/Q.20277028.html (Part 1)
http://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=20295853 (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
Question abandoned; force-accepted.

CS Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.