Lab2 - Configure Linux Kernel
Objective: Configure Linux Kernel
- Vmware Player / Vmware Server / VMware Workstation
- CentOS 5.3 linux
- 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.
- Then go to the directory /usr/src/linux-126.96.36.199/ using following command to reconfigure the linux kernel.
$ cd /usr/src/linux-188.8.131.52/
- Then for administrative privilege type the following command and enter the password when it is asked.
- 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
- 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.
- Enable this module by clicking the blank square besides Support for USB Gadgets. It gives you options as shown in following 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.
- Then press enter and it shows the following window with red circle for modified part.
- Save the changes in configuration and return to shell window.
- Then type “make” command to compile the kernel to generate the executable code.
- Type the following command to compile modules.
$ make modules
- Type the following command to copy a module to a target directory.
$ make modules_install
- Type the following command to install an executable code.
$ make install
- Following Snapshot shows booting a linux kernel with newly added configuration.