LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Red Hat custom Kernel compilation mini-How-To for Red Hat 8-9 (https://www.linuxquestions.org/questions/red-hat-31/red-hat-custom-kernel-compilation-mini-how-to-for-red-hat-8-9-a-91503/)

gonniff 09-24-2003 05:04 AM

I've tried the steps outlined here as well as the steps in the Kernel-Howto, but it still fails to work correctly in RH 9.

I decided to get back to basics and did the following:

cd /usr/src/linux

make clean
make mrproper
make clean
(as stated in the Kernel-Howto)

make oldconfig

make dep

make bzImage

make modules

make modules_install

cd /lib/modules

mkinitrd 2.4.8.20GB.img 2.4.8.20GB/

then

cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-new-kernel

cp /lib/module/2.4.8.20GB.img /boot/new-kernel.img

cp /usr/src/linux/.config /boot/config-new-kernel

cp /usr/src/linux/System.map /boot/System.map-new-kernel

Then, I include the new image in /etc/lilo.conf and run lilo

lilo

lilo -q

linux*
new-kernel

And at reboot, I select the new-kernel from the list of two kernels.

This then either ends in a kernel panic or it loads, but gives failure messages about it not supporting reiserfs, ext3, etc.

I would have thought that doing the make oldconfig would have taken the settings for the default, working kernel and then let me just proceed to build a copy of it.

Can anyone shed light on where I've gone wrong?

Thanks.

PS - I've done this with an installation of SuSE 8.2, but mkinitrd failed to run.

I went through all the other steps and rebooted to the new kernel option and it panicked.

But when I went back to /etc/lilo.conf and included the path for the working initrd image, it booted fine and runs fine.

Hmmmm....

Gramphos 09-24-2003 06:56 AM

If I use LOLO instead of Grub Will I need to o any configuration for the new kernel to get into the boot menu?

Gramphos 09-24-2003 10:08 AM

I figured that I had to run lilo -v to make it work.

Thetargos 09-24-2003 11:21 AM

Usually the installkernel program will take care of that.

Thetargos 09-24-2003 11:25 AM

Quote:

Originally posted by gonniff

And at reboot, I select the new-kernel from the list of two kernels.

This then either ends in a kernel panic or it loads, but gives failure messages about it not supporting reiserfs, ext3, etc.

I would have thought that doing the make oldconfig would have taken the settings for the default, working kernel and then let me just proceed to build a copy of it.

Can anyone shed light on where I've gone wrong?

Thanks.

PS - I've done this with an installation of SuSE 8.2, but mkinitrd failed to run.

I went through all the other steps and rebooted to the new kernel option and it panicked.

But when I went back to /etc/lilo.conf and included the path for the working initrd image, it booted fine and runs fine.

Hmmmm....

If I understand correctly, you are trying to compile a 2.4.8 kernel?? You want to do a kenel downgrade??

In any case you should have no problem compiling the kenrel, but the problem regarding the panics seems to me like you have enabled some EXPERIMENTAL driver into the kenrel or in the modules. If you are using the LowLatency patch, you may need to re-nice some of the services the kernel starts, otherwise they will seg-fault. What does the panic say?? does it give any info at all (a dump core or something?) You may have hit a kernel bug rather than a compilation per se problem.

For the ReiserFS and EXT3 problem: Did you enabled support for those FS in the FS section? either as modules or into the kernel?

Gramphos 09-24-2003 11:49 AM

Quote:

Originally posted by Thetargos
Usually the installkernel program will take care of that.
It didn't do that for me. If you use GRUB you wouldn't need to rewrite the MBR as the configfile is read, but with lilo you will have to. (At least I had to)

Thetargos 09-24-2003 11:53 AM

So doing a 'make install' did not work for ya with LILO?? that is a good addition to be made :cool:

Gramphos 09-24-2003 11:59 AM

The /etc/lilo.conf got updated by make install, but I had to execude lilo -v to update the boot sector accordingly.

But it's one more command to be run. So it's an addition needed for LILO.

velska 09-25-2003 06:24 AM

kernel compilation/install errors
 
Okay, here's me, one experience richer: I compiled my own kernel. Too bad it was a dud :scratch:

I move that we start another thread called "kernel compilation/install errors". That way this thread don't get too far out of hand... be a good addition to this, though.

So I'll post my error messages and problems there!

meeshka 09-27-2003 06:17 AM

Hi there.

I finally got time to recompile my kernel with low latency and openmosix support - all went well so thanks again Thetargos.

One question I have. I need to rebuild my drivers for ALSA and was trying to do it from the source RPM. I tried:

rpmbuild --rebuild --target i686 --define 'kernel 2.4.22' alsa-driver-0.9.6-1.fr.src.rpm

but it came back with the error message:

error: Failed build dependencies:
kernel-source = 2.4.22 is needed by alsa-driver-0.9.6-1.fr


Is there something else i'll need to download or will I need to compile all the ALSA stuff from source for the new kernel?

Cheers.

christer 09-27-2003 10:47 AM

I printed & tried following your instructions on my system. I did a COMPLETE installation.

When I try to run the command 'make xconfig/config/menuconfig' I get an error:

make: *** No rule to make target 'xconfig'. Stop.

Suggestions?

Thetargos 09-27-2003 01:35 PM

Quote:

Originally posted by meeshka
Hi there.

I finally got time to recompile my kernel with low latency and openmosix support - all went well so thanks again Thetargos.

One question I have. I need to rebuild my drivers for ALSA and was trying to do it from the source RPM. I tried:

rpmbuild --rebuild --target i686 --define 'kernel 2.4.22' alsa-driver-0.9.6-1.fr.src.rpm

but it came back with the error message:

error: Failed build dependencies:
kernel-source = 2.4.22 is needed by alsa-driver-0.9.6-1.fr


Is there something else i'll need to download or will I need to compile all the ALSA stuff from source for the new kernel?

Cheers.

Your welcome! :D :o

For ALSA, just download the latest source packages from alsa-project.org, and compile them. Download all the packages, and install in this order:
alsa-lib
alsa-utils
alsa-oss
alsa-driver

to install just untar the tarballs (tar -jxvf <alsapackage>) change to the directory of the package and:
Code:

./configre
make
make install

preferrably as root (make install should *always* be done as root).

For your driver, just add these options to the ./configure script:
Code:

./configure --help
To find out what is the name for the module for your card, and alternatively you may do this (if you want, of course!)
Code:

./configure --with-cards=emu10k1 --with-oss=yes --with-sequencer=yes
In the example above, I have stated to compile drivers for only the emu10k1 based card (in this case my card), the oss option is to add oss compatibilty to the driver (to play virtually any games) and the sequencer option is to activate MIDI support.

After you install you will see that the channels are muted, you unmute the channes by running the alsamixer command, but before that, make sure you run the makesnddevices script from the driver top level direcotry, otherwise the mixer will not be able to start. Another thing, you can add the alsasound init script to your init sequence, by
Code:

chkconfig --add alsasound
Then start it by:
Code:

service alsasound start
Enjoy!

PS: Check the alsa-project page for refferences on specific card model and the modules options for modules.conf!!!, this is very important!

Thetargos 09-27-2003 01:43 PM

Quote:

Originally posted by christer
I printed & tried following your instructions on my system. I did a COMPLETE installation.

When I try to run the command 'make xconfig/config/menuconfig' I get an error:

make: *** No rule to make target 'xconfig'. Stop.

Suggestions?

Are you sure you are under the directory linux-2.4.22?? Altenatively you may update your symlinks like this:

Code:

$ su
password:
# cd /usr/src/
# rm -f linux-2.4
# ln -s linux-2.4.22 linux-2.4
# cd linux-2.4
# make xconfig


meeshka 09-28-2003 10:11 PM

Hey Thetargos,

I already had ALSA working for the 2.4.18 kernel. I installed the packages from the rpms at freshrpms.net (I had to rebuild the src rpm for kernel-module-alsa for that specific kernel)

I was just wondering if there was a quick way to rebuild the kernel-module-alsa source rpm for the new kernel.

Cheers.

Thetargos 09-29-2003 01:11 AM

I have no experience with source rpm's for ALSA. I've always installed it from tarball, it allows (or at least, that is what I think) more control over the the compilation, like the fact that I wouldn't want the whole bunch of drivers compiled in, or to let me add or remove certain feature (like MIDI or AC97). So I'd rather download a newer rpm or simply install the latest sources. It'd be nice to have the guys from freshrpms to lend us the .spec file so we could build the rpms from within the already compiled code in the pure sources.


All times are GMT -5. The time now is 10:02 AM.