bigjohn,
NeddySeagoons' Rough Guide to DIY Kernels
Have to hand (or accessable) the following :-
- lspci output
lsmod output
large pot of strong coffee
clean unconfigured kernel tree
cd to the tree, and run one of the configuration tools, in decreasing order of preference
- make xconfig
make gconfig
make menuconfig
make config
Work you way through the list of options, reading the help and drinking the coffee, applying the following rules of thumb:-
- 1. If you need an option to boot, build it into the kernel. Thats (Y) (*) or a tick depending on your make tool.
2. If you need an option after booting, make it a module. Thes (M) (M) or a dot depending on your make tool.
3. If you don't need an option, don't make it at all. Thats (N) ( ) or a blank box depending on your make tool.
4. If you don't understand the help, leave the default alone
We are building a kernel that will not need an initrd file so some examples in ach category are
- 1. Your root filesystem driver. If root (/) is on an ext3 fs then the kernel needs to be able to read ext3 to load any modules. Your SATA / SCSI or IDE chipset driver for the chipset controlling the drive where the root filesystem lives.
2. Things like sound, networking, usb and filesystem types you don't use often
3. ISA bus (if you don't have ISA) The old IDE disk driver, Non IDE CD-ROMS attached to sound cards etc
Good use of the 'No' option can save you a lot of reading, because some Y/N dont actually do anything except show/hide other options. You can save and come back to it where you left off. there is no need to do it in one sitting.
Save your configuration, then build and install the kernel with the following seperate commands
- make
make modules_install
mount /boot (only if you have a seperate /boot partition)
cp arch/i386/boot/bzImage /boot/<nice_meaningful_kernel_name>
Do not use bzImage for <nice_meaningful_kernel_name>, you will really wish you hadn't overwritten your old kernel one day. The
arch/i386 is right for all 32 bit Intel compatible chips. I don't know id AMD_64 is any different.
Now fix grub.conf, so we can choose which kernel to boot, after all, there may be a configuration error in the new one. Open
/boot/grub/grub.conf in the editor of your choice. Copy the block of lines for your most recent kernel (like this) to the end of the file. This example is one of mine
- title=Kernel 2.6.11-gentoo-r4
root (hd0,0)
kernel (hd0,0)/2.6.11-gentoo-r4 root=/dev/md1 hdc=ide-scsi hdd=ide-scsi
Edit the bits in bold in the copy as follows:-
The title= is used in grubs menu and is for you - put anything you like here
The
2.6.11-gentoo-r4 is the name of the kernel file <nice_meaningful_kernel_name>above. Grub will give Error 15 if this is wrong.
If you have some initrd junk, its no longer needed and should be removed.
Now its time to reboot and choose your new entry in grubs menu ....