How To Compile A Kernel On The Lab Machines

(Courtesy of Adam Manzanares)

Please note that once users use su to transform into root they will lose read/write access to their home directories. This is to protect students from accessing each other's private work. The problem with this policy is that you will not be able to install the kernel modules if you build the kernel source inside of your home directory. One way to approach this problem is to build the kernel source in a special directory (/kernels) which all users can see. You can move the kernel source into this directory and then su to root and build and compile the source code. You must realize that this is a truly public directory. You must remember to move files from this public location back to your home directory in order to maintain a copy of your work. You must not leave files here that other students can use for their solutions.

If you rebuild the kernel with a configuration that builds the Reiser file system (reiserfs) as a module rather than as part of ther kernel, you are likely to have build/install problems. You can ensure that reiserfs is built as part of the kernel by using make menuconfig as described below. There is a step by step description of steps you should follow to recompile the kernel below.

  1. Copy linux-2.4.20.SuSE.tar.gz from your home directory to /kernels
  2. cd to /kernels
  3. Untar linux-2.4.20.SuSE.tar.gz and cd to the newly created directory
  4. Type make menuconfig, scroll down to file systems hit spacebar, scroll down to reiserfs support and hit space bar, make sure their is an asterisk selected for reiserfs not a M. This builds reiserfs support into the kernel and not as a module. Exit out of menuconfig and save changes
  5. Type make bzImage
  6. Type make modules
  7. su to root and then type make modules_install
  8. Copy arch/i386/boot/bzImage to /boot/>/tt>, and rename bzImage to unique name at this point.
  9. cd to /boot/grub/
  10. Edit the file menu.1st by adding title bzImage kernel (hd0,1)/boot/bzImage root=/dev/hda2 vga=0x31a hdc=ide-scsi hdclun=0 splash=silent showopts replace bzImage by the name you used in step 8.
  11. Reboot the computer