[WBEL-users] How to recompile my kernel

Phil Schaffner Philip.R.Schaffner@NASA.gov
Tue, 26 Oct 2004 21:42:22 -0400


On Tue, 2004-10-26 at 18:20 +0100, Conor Wynne wrote:
> > I''ve wbel 3.0 respin 1 ...How to recompile to add some modules
> > _______________________________________________
> > Whitebox-users mailing list
> > Whitebox-users@beau.org
> > http://beau.org/mailman/listinfo/whitebox-users
> 
> What exaactly do you wish to compile?
> rpm -q kernel-source
> 
> Assuming its installed, cd /usr/src/linux; make menuconfig (Leave to
> simmer for 30 minutes and add salt to taste), make dep bzImage modules
> modules_install
> 
> Go and have a cuppa and once finished;
> 
> mkinitrd -v /boot/initrd-new.img 2.4.21-xxxx (where xxx is you new kernel
> modules --> /lib/modules/xxxxx)
> 
> Add a new bootloader entry and reboot.


Or, some like "make rpm" - also allows building in user space, often
recommended.  See http://www.rpm.org/hintskinks/buildtree/

In any case, probably want to start with "make mrproper".  Here's my
procedure for a "custom" kernel...
-------------------------------------------------------------------
# cat ~/bin/make_linux
#!/bin/bash
# /root/bin/make_linux
# Kernel build steps:
#   1. Unpack the sources or install kernel-source<version>.i386.rpm
#      and cd to source directory (ex: "cd /usr/src/linux-2.6.5-1.358")
#   2. make mrproper
#   3. Recommended - copy the .config file from configs/ or from your
#      old linux kernel source tree to new kernel tree (may save time,
#      if you want to reuse the old settings).
#      (ex: "cp cp configs/kernel-2.6.5-i686.config .config")
#      then "make oldconfig" (twice may help)
#   4. make xconfig (or gconfig for 2.6.x)
#   5. make dep (not required for 2.6 kernels)
#   6. make
#   7. make bzImage
#   8. make modules
#   9. make modules_install
#  10. make install
#  11. configure LILO or GRUB.
#  12. Optional - make clean (If you want to free up disk space)
# This script implements steps 6-11 for FC2

(make && make bzImage && make modules && make modules_install && make
install) >& /tmp/MakeKernel.log
-------------------------------------------------------------------

Phil