7.4. Compilation

It is important to be sure that your /usr/include/asm, and /usr/include/linux subdirectories are just symlinks to the kernel sources.

  1. The asm, and linux subdirectories are a soft link to the real include kernel source header directories needed for our Linux architecture, for example /usr/src/linux/include/asm-i386 for asm. Type the following commands on your terminal:

    
             [root@deep ]/src#cd /usr/include/
                 [root@deep ] /include#rm -rf  asm linux
                 [root@deep ] /include#ln -s  /usr/src/linux/include/asm-i386 asm
                 [root@deep ] /include#ln -s  /usr/src/linux/include/linux  linux
                 
    This is a very important part of the configuration; we remove the asm, and linux directories under /usr/include then build a new links that point to the same name directories under the new Linux kernel source version directory. The include directory contains important header files needed by your Linux kernel and programs to be able to compile on your system.

  2. Make sure you have no stale .o files and dependencies lying around. Type the following commands on your terminal:

    
             [root@deep ] /include#cd /usr/src/linux/
                 [root@deep ] /linux#make mrproper
                 

    Note: These two steps above simply clean up anything that might have accidentally been left in the source tree by the development team.

    You should now have the sources correctly installed. You can configure the Linux kernel in one of three ways.

    • The first method is to use the make config command. It provides you with a text-based interface for answering all the configuration options. You are prompted for all the options you need to set up your kernel.

    • The second method is to use the make menuconfig command, which provides all the kernel options in an easy-to-use menu.

    • The third is to use the make xconfig command, which provides a full graphical interface to all the kernel options.

  3. For configuration, you will use the make config command because we have not installed the XFree86 window Interface on our Linux server. Type the following commands on your terminal to load the kernel configuration:

    
             [root@deep] /#cd /usr/src/linux/ (if you are not already in this directory).
                 [root@deep ] /linux#make config
                 rm -f include/asm
                 ( cd include ; ln -sf asm-i386 asm)
                 /bin/sh scripts/Configure arch/i386/config.in
                 #
                 # Using defaults found in arch/i386/defconfig
                 #