Lab2 - Configure Linux Kernel

Objective: Configure Linux Kernel

Requirements:

  1. Vmware Player / Vmware Server / VMware Workstation
  2. CentOS 5.3 linux

Procedure:

  • Following procedure is useful for configuring your Linux kernel to add or remove modules based on requirements. It is very important and basic step when you are going to use Linux kernel for embedded devices or Cell Phones.

Linux Kernel configuration

  • To be able to perform a successful kernel configuration using make xconfig, you will need to install the following packages:
$ yum install qt-devel # This is only necessary if you wish to use make xconfig instead of make gconfig or make menuconfig
  • I already installed this package during kernel upgradation.
  • Then I remove previously taken snapshots of CentOS created by VMware workstation. Then take a new snapshot, so if any problem occurs later during configuration process then you can revert to the previous working linux snapshot.

Snapshot 1

  • Then go to the directory /usr/src/linux-2.6.20.1/ using following command to reconfigure the linux kernel.
$ cd /usr/src/linux-2.6.20.1/

Snapshot 2

  • Then for administrative privilege type the following command and enter the password when it is asked.
$ su
  • Then type the following command that will open the Graphical User Interface (GUI) to configure the kernel. The opened window looks like Snapshot 3.
$ make xconfig

Snapshot 3

  • I want to install the USB Gadgets module in my linux kernel. You can find it inside USB Gadget support which is shown in following Snapshot 4.

Snapshot 4

  • Enable this module by clicking the blank square besides Support for USB Gadgets. It gives you options as shown in following Snapshot 5.

Snapshot 5

  • Then click on the General Setup and then double click on the Local version-append to kernel release in right panel. It opens a rectangle window inside the right panel where you can type the name of the newly configured kernel. It is shown in following Snapshot 6 in red circle.

Snapshot 6

  • Then press enter and it shows the following window with red circle for modified part.

Snapshot 7

  • Save the changes in configuration and return to shell window.

Snapshot 8

  • Then type “make” command to compile the kernel to generate the executable code.
$ make

Snapshot 9

  • Type the following command to compile modules.
$ make modules

Snapshot 10

  • Type the following command to copy a module to a target directory.
$ make modules_install

Snapshot 11

  • Type the following command to install an executable code.
$ make install

Snapshot 12

  • Following Snapshot shows booting a linux kernel with newly added configuration.

Snapshot 13