rubysecurity.org

Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
7 January 2012

Compiling the Linux Kernel

by Alpha01

A snob Linux elitist would say, “You can’t call yourself a serious GNU/Linux user if you have never successfully compiled the Linux kernel at least once in your life.”

The following were the steps I made to compile the Linux kernel over 4 years ago (I just happened to find my reference text file that I saved, buried within my home directory).

1). Download kernel source code from https://www.kernel.org.

2). Extract kernel source.

3). Update EXTRAVERSION variable on Makefile.

4). (Only do steps 4 if a previous kernel compilation was made within this source tree) make mrproper (goes through the source tree and cleans out temp files)

make mrproper
make clean

5). make menuconfig (actual configuration of the kernel compilation. Creates .config file)

make menuconfig

6). make (performs the actual compilation. creates bzimage file. makes the modules)

make

7). make modules_install (install modules into /lib/modules)

make modules_install

8). make install (will automatically copy the kernel and initrd file to /boot and modify the boot loader config file)

make install

Reference one liner

make clean dep bzImage modules install modules_install
Tags: [ kernel ]