Kernel Build Project

by: burt rosenberg
at: university of miami
date: sep 2015
NAME
    vmlinuz -- the linux kernel
    
SYNOPSIS
    Loaded on boot from /boot/vmlinuz-3.13.11-ckt24-[user]
		
DESCRIPTION
    Build the linux kernel from sources; modify the .config file to personalize the kernel
    name with your user name. E.g. pikachu with logon pika will build vmlinuz-3.13.11-ckt24-pika.
    

HISTORY
    Introduced in CSC-521 061.


BUGS
    
    

Goals

The goals of this project are:

Specific steps

  1. Read and understand Building the Linux Kernel
  2. Beware that older versions of Building the Linux Kernel exist, but only the most recent will be correct.
  3. Copy class/proj3 to [yourdirectory]/proj3; add and commit as "initial commit".
  4. See the uname command in the makefile target test.
  5. Copy the dot-config the the linux source root directory as .config and make oldconfig to install the configuration.
  6. Run make menuconfig and modify the name of the kernel.
  7. Run make ; make modules_install ; make install ;
  8. Reboot on the new kernel, careful to select in the grub menu "Previous Linux Versions".
  9. Add and commit uname.out for a grade by the due date.

Discussion

You may need to reconfigure grub for a verbose boot.

You will have to sudo to become root for make install (at least). I do sudo bash to get a bash shell with root permissions, then inside this shell I make and install the kernel.

The command df (see man df) shows the "disk free" space, but also the most important facts about the file system. File systems are created in disk partitions that are represented as raw devices in the unix /dev directory. The devices contain file systems, because the partition has been formatted, and the file systems are mounted onto mount points in the unix directory tree. The root mount point, also known as "slash", spelled "/", is sort of an exception and is mounted on boot during kernel initialization. (But see discussion of initrd.)

root@opsys-ubuntu:/boot# df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1       33157940 10953344  20497180  35% /
none                   4        0         4   0% /sys/fs/cgroup
udev              978084        4    978080   1% /dev
tmpfs             206512      808    205704   1% /run
none                5120        0      5120   0% /run/lock
none             1032552      156   1032396   1% /run/shm
none              102400       40    102360   1% /run/user
/dev/sr0           56892    56892         0 100% /media/burt/VBOXADDITIONS_4.3.30_101610
root@opsys-ubuntu:/boot# 
The command du (see man du) shows disk usage. Look at /lib/modules with du to see if the module directories are making sense. Here is my /boot directory:
root@opsys-ubuntu:/boot# du /boot/*
1240	abi-3.19.0-25-generic
116	config-3.13.11-ckt24-csc421
180	config-3.19.0-25-generic
4840	grub
108064	initrd.img-3.13.11-ckt24-csc421
18912	initrd.img-3.19.0-25-generic
176	memtest86+.bin
176	memtest86+.elf
176	memtest86+_multiboot.bin
2488	System.map-3.13.11-ckt24-csc421
2812	System.map-3.19.0-25-generic
5252	vmlinuz-3.13.11-ckt24-csc421
6048	vmlinuz-3.19.0-25-generic
If df shows /boot as "Mounted on" on its own line, then your Ubuntu install as decided to give you a small, dedicated boot partition. This partition is small, so you must delete old kernels as you go along, or the partition will fill.

The /lib/modules directory must have a subdirectory matching the version suffix of your kernel, else you will fail to boot the new kernel (but you can still boot the default, generic kernel).

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

author: burton rosenberg
created: 20 sep 2015
update: 20 sep 2015