Before rebuilding the kernel, you must have the source available. Download it if you haven't. There's two options for building the kernel, based on you current kernel configuration or based on the default. You can only do a build based on your current configuration if you've rebuilt your kernel before and you saved the configuration file from the previous build. By default the saved configuration file is /usr/src/linux/.config although xconfig has an option to call it something else or you can copy it after. The default config file (for i386 architecture) is /usr/src/linux/arch/i386/defconfig. The build process is slightly different depending on which one you're doing. Both are described below:

 1. cd /usr/src/linux
 2. If the is a first time kernel build or you want to base the build on the
    defaults:
       1. Run make mrproper
       2. Run make xconfig if you are running X, otherwise you'll need to run
          make menuconfig or make config (which is a lot more tedious)
       3. select the options you require for your kernel and select save . A
          .config file will be created .
       4. Run make dep
    Or , if you have a config you want to base it on:
       1. Run make xconfig if you are running X, otherwise run make
          menuconfig and select the option to use your existing configuration
          file.
       2. select the options you require for your kernel and select save . A
          new .config file will be created .
       3. Run make dep
       4. Run make clean
 3. Edit /usr/src/linux/Makefile amending the EXTRAVERSION statement to a
    unique name (This allows you to have the old and new kernel on the system
    at the same time)
 4. Run make bzImage to create the kernel
 5. Run make modules to build any modules
 6. Run make modules_install to copy the modules into place.
 7. cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-version to copy
    the kernel into place,
 8. cp /usr/src/linux/arch/i386/boot/System.mapversion /boot and relink
    System.map to this file.
 9. If you need to load the SCSI or RAID module at boot time run /sbin/
    mkinitrd /boot/newinitrd-image kernel-versionl . lilo.conf should also be
    updated to include this (see below).
10. Edit /etc/lilo.conf to add the new kernel. It is a good idea to leave the
    old kernel there in case of problems. Run /sbin/lilo to update LILO.

You are now ready to reboot.

Recent Changes

Contribute to this wiki

Why not help others by sharing your knowledge? Contribute something to this wiki and join out hall of fame!
Contact us for a user name and password