LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RedHat 7.1 - Kernel Compile (https://www.linuxquestions.org/questions/linux-newbie-8/redhat-7-1-kernel-compile-12115/)

aford 01-19-2002 09:17 AM

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

bluecadet 01-19-2002 09:38 AM

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

aford 01-19-2002 09:44 AM

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.

aford 01-19-2002 11:43 AM

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!

aford 01-20-2002 05:26 AM

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)?

bluecadet 01-20-2002 05:35 AM

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

aford 01-20-2002 08:14 AM

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?

aford 02-02-2002 10:42 AM

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!

desbyleo 03-06-2002 11:23 PM

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

Sylhouette 03-08-2002 06:03 PM

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

desbyleo 03-08-2002 06:34 PM

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

Sylhouette 03-09-2002 03:20 AM

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

desbyleo 03-11-2002 12:21 PM

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.


Sylhouette 03-11-2002 12:52 PM

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


Good luck

desbyleo 03-11-2002 02:03 PM

Any asnwers to my "make oldconfig" question?


All times are GMT -5. The time now is 12:15 AM.