LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2002, 10:17 AM   #1
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Rep: Reputation: 0
Unhappy RedHat 7.1 - Kernel Compile


Currently trying to setup IP masquerade, which requires some kernel configuration. Followed the HOWTO document which seems straight forward, UNTIL I recompile the kernel as follows:

make xconfig/config/menuconfig etc..
make dep
make clean
cp arch/i386/boot/bzImage /boot/<filename>
make modules
make modules_install
vi /etc/lilo.conf to include this image as additional
lilo

Result - machine does not pick various devices i.e. USB and NIC's.

Question : from I what I can gather, first time in make xconfig this is not a reflection of the current configuration of the working kernel. If this is the case how do I find details of the current config?

Cheers
 
Old 01-19-2002, 10:38 AM   #2
bluecadet
Member
 
Registered: Oct 2001
Distribution: MD81 RH71
Posts: 555

Rep: Reputation: 30
firstly, i'm not sure that you do need to reconfigure your kernel for that, the default one *should* be set up for ti already, my redhat 7.1 system was. maybe you'll find it easier using 'firestarter' which sorts ip masq out for you easily.

but your real question... the config of your system *should* be aviable in /boot/config-2.4.7-10 on redhat 7.2 for example, which has kernel 2.4.17-10 on default. It's not that recommended to use an old config for a new kernel as settings do change and such, recompiling the same kernel is fine tho. Your instruction list you've given is totally wrong btw. there's no make bzImage etc...
 
Old 01-19-2002, 10:44 AM   #3
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Original Poster
Rep: Reputation: 0
Sorry, my mistake

Prior to cp command I did...

make bzImage


Secondly, the IP Masquerade HOWTO instructs setting changes for new version of netfilter within the kernel.
 
Old 01-19-2002, 12:43 PM   #4
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Original Poster
Rep: Reputation: 0
After spend a couple of hours searching through the rest of this forum I am at a total lose!

The procedure I'm following matches majority of posts I have read, so the fault must be else where.

Something I didn't mention earlier, when I boot the box on the original Kernel that too has errors with the NIC's.

Should I be looking into module files? (new ground!)

Please help me with this, I've spent the last week solid on this problem, the last thing I want to do revert back to ME!
 
Old 01-20-2002, 06:26 AM   #5
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Original Poster
Rep: Reputation: 0
Sorted!

It seem I had to run the 'make mrproper' command.

I had seen this command mentioned, but the posts I've read refer to this as optional!

My next problem when the new kernel boots it crashes badly. Any ideas how to start troubleshooting (logs etc)?
 
Old 01-20-2002, 06:35 AM   #6
bluecadet
Member
 
Registered: Oct 2001
Distribution: MD81 RH71
Posts: 555

Rep: Reputation: 30
well, if it crashes before it can load the drives it can't put a log file anywhere... you should have a good enough output from the boot up to diagnose what's wrong. you just gotta work through things and suss what it is. if it does get that far, you might have /boot/messages to look at...
 
Old 01-20-2002, 09:14 AM   #7
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for your response.

Bit for detail about my machine :

Dist : RH 7.1
Kernel : 2.4.2
CPU : Athlon 1.2Ghz
RAM : 500Mb

The system crashes at various points, but always after the
screen "Welcome to Red Hat Linux - Pess I for interactive"

Then proceeds to load various services.

Never seems to crash at the same point, must be something I'm missing. I have recompile the kernel with limit support for devices, i.e. no AGP support, no sound etc, but still crashes the same.

The error messages vary aswell and not logged in the messages log. Can't provide details the error scrolls off screen.

I have configure the processor type correctly.

Any ideas?

Last edited by aford; 01-20-2002 at 09:16 AM.
 
Old 02-02-2002, 11:42 AM   #8
aford
LQ Newbie
 
Registered: Jan 2002
Location: England
Distribution: RedHat 7.1
Posts: 11

Original Poster
Rep: Reputation: 0
A final word...

Over the last few weeks trying to resolve the kernel compile issue, I have notice a few people were having the same problem with RH 7.1.

As a result now using SuSE 7.3 following the same procedure above and worked first time!

RH 7.1 does not provide the current config of the kernel anywhere, therefore waste of time and effort!
 
Old 03-07-2002, 12:23 AM   #9
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 92

Rep: Reputation: 15
aford...

I too have spent a whole week on trying to configure IP masq on RH 7.1, but so far still no luck.

I did exactly as the instruction (HOWTO - IP MASQ - from ip masq resource) and after config kernel (to make additional support and features), for some reason, it kept failing to on mi NICs at start up (seems the same has happened to you).

So you decided to go wih SuSE, eh? And when you followed the instructions, it worked like a beauty?

Tell me more about if you could. desbyleo@earthlink.net

Mean while, DOES anyone have any suggestion for someone who wants to stick with RH7.1, but wants to config IP MASQ??
 
Old 03-08-2002, 07:03 PM   #10
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
Compiling a redhat kernel goes a little different than other distro's

You NEED to install the kernel source rpm !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ther are your old .config files

With the command make mrproper the .config file from your current tree is going to be erased

I have done this with redhat 7.2 i guess redhat 7.1 usses linux as the symlink to there kernel tree redhat 7.2 uses linux-2.4 as a symlink
So if you are going to make the symlink in 7.0 or 7.1 you'll need to remove the old one.


Go and download a new kernel say 2.4.18 then copy it to /usr/src

~# cp /home/syl/linux-2.4.18.tar.gz /usr/src

then go to that dir

~# cd /usr/src

Then make a dir called linux-2.4.18

~# mkdir linux-2.4.18

Then make a symlink called linux that directs to the 2.4.18 tree
(if you use 7.1 or 7.0 first remove the linux symlink) ~# rm linux

~# ln -s linux-2.4.18 linux

Then untar the kernel source file

~# tar -xvzf linux-2.4.18.tar.gz

Then cd to the dir linux

~# cd linux

then clean up the place

~# make mrproper

Now you proberly want to use your old kernel settings if so, you can go to the source tree of your current kernel dir with the following command (you'll need to install the kernel source rpm to do this)

~# cd /usr/src/linux-2.4/configs
(linux-2.4) is the symlink redhat 7.2 use for there 2.4 kernel if you are using 7.0 or 7.1 use cd/usr/src/linux-2.2.9/configs or so (look how your tree is named now)

Then you can see that there are some files starting with kernel and ends with .config (you'll need the .config file that suite your configuration ) like athlon cq i686 or something,
Copy that file to the linux tree

~# cp kernel-2.4.9-i686.config /usr/src/linux/.config

Now you can start compiling and installing the kernel with the next commands

~# make menuconfig

select here al the things you'll want or unselect all the things you'll don't want

~# make dep
~# make clean
~# make bzImage (mind the capitol I )
~# make modules
~# make modules_install
~# cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.18
~# mkinitrd /boot/initrd-2.4.18.img 2.4.18
~# cp System.map /boot/System.map-2.4.18

then adjust your /etc/lilo.conf or your /etc/grub.conf file
(use the other kernel entries as an example )

If you have lilo then after adjusting the /etc/lilo.conf file run lilo

~# lilo

Now you can reboot your machine, and if everything has gone well you can use your own compiled kernel

Hope this helped a little

Last edited by Sylhouette; 03-08-2002 at 07:06 PM.
 
Old 03-08-2002, 07:34 PM   #11
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 92

Rep: Reputation: 15
Sylhouette....I needed this answer a week ago!!!!!!

But thanks...

As a matter of fact...in my quest to find such .config files (one that reflects my current system configuration) I simply peered closer at my current kernels src directory (/usr/src/linuz-2.4.2) and and lo-and-behold....there's a config directory.

Looked in there...and such enough....I found xx.config files where xx is "kernel-2.4.2-i386" "-i686" etc....

I looked into the .config file suited for my system (i686), and it sure looks like settings deemed for my system. Although I haven't compiled it yet, your post assures my hunches.

Thanks...it's Friday and I needed this good news badly!

Tell me this:

-You had this in your routine of compiling:
"mkinitrd /boot/initrd-2.4.18.img 2.4.18"
This is the only thing that I haven't done and never seen in anyone's howto or posts.
What exactly is this doing?


Anyhow:

-Are these .config files generated during the installation of linux?

-Are these .config files generic...meaning....does it basically turn on virtually every support, or does it actually only turn on what it sees need to be turned on (based on your system)?

From what I saw, I think it's generic....it turned on support for NICs not installed in my system.

And again, thank you....for some reason, it seemed like no one before me had ever had this very same issue (dealing with .config of my current config on RH 7.1).

Last edited by desbyleo; 03-08-2002 at 07:39 PM.
 
Old 03-09-2002, 04:20 AM   #12
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
I think the kernel*.config files are standard config files used with redhat

So if you use it everithing will work

You can comment out a lot of stuff like SCSI support and al other things you do not need

When you turn it of and it wont work anymore then put it back

Thing s you are not sure about you can leave on, compile the kernel save your .config file that you created and when the kernel works begin again with the new (your own .config) it takes a lot of time but you learn a lot about it.

the mkinitrd command i found in a book RHCE study guide

It has something to do with a ram disk

This is what the book said

The mkinitrd command is used to create an initial RAM disk image for you.
This image is reloaded when the kernel first boots. The initial RAM disk (initrd) is usally used to load essential block devicsuch as SCSI disk drives modules that are not part of a stoch RedHat kernel.


So i gues that this is an answer to the standard kernel question.
If it is not in the standard kernel RedHat puts it in the initrd file (i gues)

Good luck
 
Old 03-11-2002, 01:21 PM   #13
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 92

Rep: Reputation: 15
It sure did work. Compiling from the kernel*.config file found in /usr/src/linux-xx.xx/configs worked without anything failing at boot up.

BE FOR WARNED (as sylhouette mentioned):
-Compile time is increased tremendously.

sylhouette, I will go back and look thru it and turn off thing I know I'm not using...which I figured I was in for (don't like the idea of the grueling time I'll be spending).

TELL ME THIS:
-Have you heard, or tried, using "make oldconfig"?

I ask becuase I've often been told to use this command to generate a .config file of my current system configuration. When I try this, it just goes thru the 100 and so questions of yes and no about my system (half of which I knew nothing about).

Is this the way this is suppose to work? If so, then why have a seperate command sush as "make oldconfig" when it would seem that by just going into xconfig and making the settings there would do the same thing?

The way I imagine this to happen is linux will magically look at my system and figure out what I have and don't have and spit out a .config file for me without having to ask me any questions.


Last edited by desbyleo; 03-11-2002 at 01:47 PM.
 
Old 03-11-2002, 01:52 PM   #14
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
Your welcome

It takes a lot of time i know
But it is worth trying
Now you compile your kernel say 6 times and be happy, next time with kernel 2.6.10 or so you know exactly what you can turn off and save a lot of compiling time.

So you learn a lot about how it works

And sometimes you switch of to much and things will not work anymore but then you get back to your (old) kernel and do it again.

Be careful with the make mrproper command because it deletes your .config

So before compiling it again be sure to copy your .config file to lets say /root

the give make mrproper and then copy it back to /usr/src/linux





But with a Athlon 1,7 Ghz it is done in one hour.


Good luck

Last edited by Sylhouette; 03-11-2002 at 01:58 PM.
 
Old 03-11-2002, 03:03 PM   #15
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 92

Rep: Reputation: 15
Any asnwers to my "make oldconfig" question?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel 2.6.9-5 compile error on RedHat ES 4 TotalDefiance Red Hat 1 10-18-2005 10:37 AM
HELP: RedHat Kernel 2.6.9 Compile Problem. Please help me. strato Linux - Software 1 11-20-2004 11:27 PM
How to compile 2.6 kernel on RedHat Ninja_212 Red Hat 1 03-08-2004 03:18 AM
how to compile the redhat kernel mmoohh Linux - Newbie 5 10-21-2003 08:26 PM
How can I compile a new kernel for Redhat 9? Sgaileach1 Linux - Software 6 07-28-2003 09:40 PM


All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration