[ale] Building kernels w/ Redhat
David A. De Graaf
dad at datix.2y.net
Mon Oct 13 12:27:21 EDT 2003
On Sun, Oct 12, 2003 at 04:59:49PM -0400, matty91 at bellsouth.net wrote:
> Does anyone have a set of instructions to build customized kernels on
> Redhat linux systems? Do folks use rpm to build a kernel from a SPEC file,
> or the old make menuconfig ... mechnism?
>
I routinely have to rebuild kernels for my Red Hat systems because I
have a PCI-PCMCIA bridge adapter for a wireless card which requires
David Hinds' pcmcia-cs package instead of the kernel pcmcia package.
Here are the notes I wrote to myself, so I don't forget...
Kernel Building
Be sure kernel-source is installed
rpm -q kernel kernel-source
and see that it's there
For the benefit of the pcmcia-cs package configurator, make linux be a
symlink to the current source tree:
cd /usr/src
ln -s linux-2.4.18-10 linux
cd /usr/src/linux-2.4.18-10
Start cleanly
make mrproper
Get a standard .config from configs for the HW
cp configs/kernel-2.4.18-athlon.config .config
Choose kernel features; run any of three pgms
make config - cmd line
make menuconfig - text menus
make xconfig - X
Make whatever changes you like, including none, then exit & save
To use the pcmcia package:
turn PCMCIA off
Give the new kernel a suitable name. Edit Makefile, eg,
for an i586-based, NoPCMCIA:
EXTRAVERSION=-10nPfrSWN
Make the kernel
This can be done in rapid sequence in a single command line:
( time make dep clean bzImage modules modules_install install ) \
2>&1 | tee mk1nPfrswn.out
This will create the new vmlinuz and initrd files and a new paragraph
in /boot/grub/grub.conf, but will not make it the default boot.
Verify that /boot contains both files and edit grub.conf to change the
default.
If necessary, in /boot, make sure the initrd image was created.
If not, create a new initrd image:
mkinitrd initrd-2.4.18-10nPfrSWN.img 2.4.18-10nPfrSWN
Verify that /boot/grub/grub.conf uses all the ingredients:
title Red Hat Linux (2.4.18-10nPfrSWN)
root (hd0,0)
kernel /boot/vmlinuz-2.4.18-10nPfrSWN ro root=/dev/sda1
initrd /boot/initrd-2.4.18-10nPfrSWN.img
pcmcia
If the pcmcia package is needed to handle, eg, the PCI-PCMCIA bridge,
build it now.
Make sure to use the new kernel source tree and new modules.
FreeSWAN
In /usr/src, unpak and build...
REBOOT
Make a new emergency boot disk
mkbootdisk 2.4.18-10nPfrSWN
--
David A. De Graaf DATIX, Inc. Hendersonville, NC
dad~@~datix~.~2y~.~net (828) 696-8646; fax (828) 694-1037
More information about the Ale
mailing list