Everybody's Favourite, Kernel Recompilation

Posted on 2001-06-06
Medium Priority
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/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.


Question by:GilesB
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 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)


LVL 17

Accepted Solution

psimation earned 1000 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.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.


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.  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

Expert Comment

ID: 7330901
Question abandoned; force-accepted.

CS Moderator

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month5 days, 4 hours left to enroll

601 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