Last modified: Nov. 21, 2011

CIS 191AB
Lab 11: The Linux Kernel

The purpose of this lab is to create a working kernel more recent than 2.6.18 that will boot and run on your cis191B virtual machine. Your goal is to create a kernel that will be larger than your current kernel, but will have to dynamically load fewer modules when it starts; that is, you want to link in the modules (like ext3) that you know you are going to be using. I invite you to play with the .config file - just a little. See if you can configure the ext3.ko and jbd.ko modules to link into the kernel rather than be loadable modules. Have some fun!

Note that you can build the kernel as a regular user, cis191, but to install it, you must use root privilege.

Procedure

  1. Create a disk partition using the remaining free space (~2.5GB), and Format it with an ext3 filesystem. You will use this space to build your kernel.
  2. Download the kernel from www.kernel.org into the home directory of user cis191.
  3. Mount your new filesystem:
    1. Create a directory, using the name of the kernel, in the /usr/src/kernels directory, e.g.
      mkdir /usr/src/kernels/linux-2.6.19
    2. Change the owner and group of that directory to cis191 and cis191
    3. Mount the new filesystem to your mount point:
      mount /dev/sda10 /usr/src/kernels/linux-2.6.19
  4. Extract the tarball into the file system you have just mounted.
  5. Create the .config file at the root of the kernel source tree: linux.2.6.19
  6. Compile and Install the kernel and modules:
    1. make all
    2. make modules_install       # must be root to do this
      Alert: Since your root file system is nearly full, you will have to redirect the modules through a symbolic link:
      mv /lib/modules /var
      ln -s /var/modules /lib/modules
    3. make install           # must be root to do this
  7. Note that the grub.conf file has been modified to include your new kernel.
  8. Reboot to the new kernel and test that it works.

To Turn In

In a file called lab11, I want to see the following configuration files and command output: Turn in lab11 by secure copying it to your home directory on Opus:
scp lab11 logname@opus.cabrillo.edu:lab11