LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   How do i re-compile the MDK 9.0 KERNEL? (https://www.linuxquestions.org/questions/mandriva-30/how-do-i-re-compile-the-mdk-9-0-kernel-84813/)

apostglen46 08-23-2003 05:08 AM

How do i re-compile the MDK 9.0 KERNEL?
 
I want to recompile my (existing) kernel for architecture "athlon" so i can install the nForce2 drivers from nVIDIA.com.

MasterC 08-23-2003 09:02 AM

Hi! :)

You can either:
Install the kernel sources from your install CD's, this kernel will have a lot of patch levels that might be of use to you;
OR
You can go to www.kernel.org and grab the latest STABLE kernel.

Let's assume you wanna use the one off your CD's. So, locate the package:
kernel-source-2.4.19-16mdk
And install it:
urpmi kernel-source-2.4.19-16mdk

Now, if you look in /usr/src you should see 2 new entries:
Code:

lrwxr-xr-x    1 root    root          18 Dec 14  2002 linux -> linux-2.4.19-16mdk/
drwxr-xr-x  18 root    root        4096 May  4 23:10 linux-2.4.19-16mdk/

The 'linux' entry is simply a symlink to the other directory, that contains the actual kernel source. This symlink is created to assist when compiling applications against your kernel version, so the applications know what you have going on with your kernel and such.

Ok, so let's get started:

Fire up a terminal, and as root type:
cd /usr/src/linux
Then:
make xconfig

This will bring up the configuration screen for compiling a kernel. You can choose to load the current kernel's config (Load an existing configuration) which should be living at:
/boot/config-2.4.19-16mdk

So go ahead and load that up, then get started on making the necessary changes you are looking for. Be careful, since this is likely your first compile, make a few changes at a time. This may seem tedious, but will help you to see when you make a bad change. Save the kernel each time, make an entry in LILO (I'll describe this better below) and then test the new kernel. Go back, make a few more changes, rinse and repeat ;)

If you get a complaint/error when you type 'make xconfig' feel free to post it up, or resolve the missing dependency(ies) and continue on.

After you are finished making all the changes you want to make to the kernel, save your final config to an "alternate" file, I'd say for uniformity:
/boot/config-2.4.19-custom

And now we need to edit the boot loader.

I'm going to reboot into Mandrake real quick so I can give the specific instructions for the rest of this.

Cool

MasterC 08-23-2003 09:27 AM

After you finish each configuration of the kernel, you'll need to do a few things. Save and exit the configurations screen, and type:
make dep &&
make clean &&
make modules &&
mv /lib/modules/2.4.19-16mdk /lib/modules/2.4.19-16mdk.old &&
make modules_install &&
make bzImage

This should take a good amount of time, even on a fast system. Once it finishes (post up any errors if you get them) you should have a kernel image smiling back at you, let's copy it to the /boot directory:
cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.19-custom
And make an initrd image:
cd /boot
mkinitrd /boot/initrd-2.4.19-custom vmlinuz-2.4.19-custom

And finally, the System.map:
cp /usr/src/linux/System.map /boot/System.map-2.4.19-custom

Fire up the Mandrake Control Center, and click 'boot' followed by Boot Config.

Click the Configure button on the right side of the screen, and we should now be in the LILO configuration menu.

Click OK on the first screen, we don't need to edit any part of the global portion of the config.

On the second screen, click "Add" Then click "Linux"

Choose an appropriate label, maybe "CustomKernel" for now. Make sure it's obviously named to show that it's not the original kernel.
The next line is the kernel image we specified above:
/boot/vmlinuz-2.4.19-custom

Root should remain the default

Append. This should have at the very least:
quiet devfs=mount

Video Mode, leave blank

And initrd should be what we made above:
/boot/initrd-2.4.19-custom

Click OK, then DONE

Now we should be back to the Mandrake Control Center. Click OK, then close it.

Reboot, and you should have the new entry for the new kernel.

Now, follow the instructions on NVIDIA's website to compile the NForce drivers.

Cool


All times are GMT -5. The time now is 03:01 PM.