Solved

Everybody's Favourite, Kernel Recompilation

Posted on 2001-06-06
11
406 Views
Last Modified: 2010-04-20
Hi,

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

image=/boot/vmlinuz
label=linux2.4.5
root=/dev/hda1
read-only

:wq

#lilo

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.

-Giles

0
Comment
Question by:GilesB
11 Comments
 
LVL 17

Expert Comment

by:psimation
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

image=/boot/bzImage
label=linux2.4.5
root=/dev/hda1
read-only

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

Author Comment

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

Thanks

-Giles
0
 
LVL 17

Accepted Solution

by:
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.
0
 
LVL 3

Expert Comment

by:comotai
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"...
0
 
LVL 4

Expert Comment

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

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Expert Comment

by:m931a2
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

mark
0
 
LVL 4

Expert Comment

by:kiffney
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.
0
 
LVL 1

Expert Comment

by:Whale
ID: 6311777
maybe you can try Grub instead of lilo
ps: kernel 2.4.7 is out
0
 
LVL 1

Expert Comment

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

Expert Comment

by:Moondancer
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.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
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.
http://www.experts-exchange.com/questions/Q.11552798.html
http://www.experts-exchange.com/questions/Q.11563418.html
http://www.experts-exchange.com/questions/Q.11648078.html
http://www.experts-exchange.com/questions/Q.20126111.html
http://www.experts-exchange.com/questions/Q.20127045.html
http://www.experts-exchange.com/questions/Q.20127782.html
http://www.experts-exchange.com/questions/Q.20130915.html
http://www.experts-exchange.com/questions/Q.20240934.html
http://www.experts-exchange.com/questions/Q.20241790.html
http://www.experts-exchange.com/questions/Q.20243441.html
http://www.experts-exchange.com/questions/Q.20245798.html
http://www.experts-exchange.com/questions/Q.20245796.html
http://www.experts-exchange.com/questions/Q.20265935.html
http://www.experts-exchange.com/questions/Q.20272321.html
http://www.experts-exchange.com/questions/Q.20291423.html

To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20259387.html

*****  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
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
------> 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.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7330901
Question abandoned; force-accepted.

Netminder
CS Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now