A Linux User Reference

Search tips
  • search ignores words that are less than 4 characters in length
  • searches are case insensitve
  • if a search does not return anything try it in Boolean mode then Query expansion mode by checking the appropriate radio button e.g. searching for 'cron' in just the Administration category returns nothing - presumably because the 50% threshold is reached. Boolean mode ignores this threshold so a search for 'cron' returns several hits
  • in Boolean mode preceding a word with a '+' means the result must include that word, a '-' means it must not
  • in Boolean mode '+crontab -anacron' means match articles about crontab that DO NOT mention anacron
  • to match a phrase e.g. 'manage system' check the Boolean mode radio button and enclose the phrase in quotes "some phrase ..."
  • in Query expansion mode the search context is expanded beyond the keywords you entered - relevancy of hits may well be degraded



  • Basic introduction
    • primarily down to the distribution, their implementation and how they organise things so as to facilitate upgrades, patching and the like.
    • they often provide several types of kernel images, pre-configured and compiled for different uses e.g. server, desktop, generic ... What type you chose is generally down to the '.iso' image you are installing from.
    • distributions also provide their own tools, packages that are required to be installed for building and customising.
    • you may well have to install a few development packagestools
    • consult your distribution's documentation.

    Distribution independent. Officially released by Linus Torsveld, or by a member of the community appointed by him. The source (and patches) are usually downloaded from, the kernel is configured and compiled.

    Version naming

    All kernels are named according to the following naming standard. This enables each source file to be identified in terms of its position/status within the development and release cycles.

     vmlinuz-<major>.<minor>.<patchlevel>[-<subpatchlevel>[-<optional identifier>]]
     major         Increments in the major release number indicate mayor development changes.
     minor         Indicate significant changes and additions. When taken together they 
                   culminate in a major release.
                   Pre 2.6:
                      Even-numbered minor release nos. => stable kernel e.g. (2.0, 2.2, 2.4)
                      Odd-numbered minor release nos.  => development kernel e.g. (2.1, 2.3, 2.5)
     patchlevel    As patches are applied the patch level is incremented.  Advisable
                   to use the latest patch level.

    2.6 kernels and above

    • All released kernels are considered stable.
    • Once a kernel is released e.g. 2.6.17, developers start working on new features releasing -rc versions (2.6.17-rc1, 2.6.17-rc2, ... ...)
    • As each -rc version is stabilised it is released as a stable version (,, ... ...).
    • When all the development releases are considered stable enough a new kernel version 2.6.18 is released.

    Vanilla install - basic process involves three steps:

    1. configuring
    2. building
    3. installing

    Configuring involves identifying which kernel parameters are required and then enabling, disabling them accordingly.

  • Preparing for > 2.6 kernel vanilla install

    Check that you have the right tools

    On unbunt you may need :

    sudo apt-get install git-core kernel-package fakeroot build-essential ncurses-dev

    You need to check your distribution's documentation for vanilla installs to see which development packages,tools you will need e.g. depending on ubuntu version you may need 'initramfs-tools' as well as the above.

    Get the source tarball - /usr/bin/wget

    $ wget
    --2010-03-25 16:43:36--
    Connecting to||:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 66219178 (63M) [application/x-bzip2]
    Saving to: `linux-'
    100%[========================== / ==============>] 66,219,178  1.16M/s   in 1m 43s
    2010-03-25 16:45:19 (627 KB/s) - `linux-' saved [66219178/66219178]

    Put the kernel tarball in a directory where you have permissions

    $ cp linux- ~/kern_bld

    Unpack and read the README

    $ cd ~/kern_bld
    $ bzip2 -dc linux- | tar xvf -
    $ cd linux-
    $ more README

    Check compiler is at least the minimum version (from README)

    $ gcc --version
    gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
  • Configuring > 2.6 Vanilla kernel

    Vanilla kernels come with default configurations - '${PLATFORM}_defconfig'

    $ ls arch/$ARCH/configs/${PLATFORM}_defconfig
    bigsur_defconfig  generic_defconfig  gensparse_defconfig  sim_defconfig     
    tiger_defconfig   xen_domu_defconfig  zx1_defconfig

    Create a default generic configuration file

    $ make defconfig
      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/basic/docproc
      HOSTLD  scripts/kconfig/conf

    The default configuration file is deteremined by ${PLATFORM}, in this case it is 'x86_64_defconfig'.

    The resulting '.config' file is written out to the build directory.

    $ ls -al
    drwxr-xr-x 25 mark mark   4096 2010-03-15 16:09 arch
    drwxr-xr-x  2 mark mark   4096 2010-03-15 16:09 block
    -rw-r--r--  1 mark mark  69876 2010-03-25 16:58 .config

    Alternative configuration commands

    'make config'                  Plain text interface. 
    'make menuconfig'              Text based colour menus, radiolists & dialogs. 
    'make xconfig'                 X windows (Qt) based configuration tool. 
    'make gconfig'                 X windows (Gtk) based configuration tool. 
    'make oldconfig'               Default all questions based on the contents of your existing 
                                   ./.config file and asking about new config symbols. 
    'make silentoldconfig'         Like above, but avoids cluttering the screen with questions 
                                   already answered.  Additionally updates the dependencies. 
    'make defconfig'               Create a ./.config file by using the default symbol values 
                                   from either arch/$ARCH/defconfig or 
                                   arch/$ARCH/configs/${PLATFORM}_defconfig depending on the 
    'make ${PLATFORM}_defconfig'   Create a ./.config file by using the default symbol values 
                                   from arch/$ARCH/configs/${PLATFORM}_defconfig. 
    'make allyesconfig'            Create a ./.config file by setting symbol values to 'y' 
                                   as much as possible. 
    'make allmodconfig'            Create a ./.config file by setting symbol values to 'm'
                                   as much as possible. 
    'make allnoconfig'             Create a ./.config file by setting symbol values to 'n'
                                   as much as possible. 
    'make randconfig'              Create a ./.config file by setting symbol values to 
                                   random values. 
    'make help'                    List of all available platforms for your architecture.
  • Build the > 2.6 Vanilla kernel

    In your build directory where '.config' is

    $ make
    Kernel: arch/x86/boot/bzImage is ready  (#1)
      Building modules, stage 2.
      MODPOST 2 modules
      CC      arch/x86/kernel/test_nx.mod.o
      LD [M]  arch/x86/kernel/test_nx.ko
      CC      drivers/scsi/scsi_wait_scan.mod.o
      LD [M]  drivers/scsi/scsi_wait_scan.ko
    $ ls -al vmlinux
    -rwxr-xr-x 1 mark mark 20901614 2010-03-25 17:15 vmlinux
    $ ls -al
    -rw-r--r-- 1 mark mark 2162052 2010-03-25 17:15

    'vmlinux' is the newly compiled kernel (default name) - it is usually copied by the install process to the '/boot' directory with a link to '/vmlinuz'.

    '' is a mapping of symbol names to memory addresses. It also should be copied to '/boot'. In a programming context, a symbol is the building block of a program - a variable or function name. Humans tend to use symbols, the kernel addresses. A new file is generated each time a kernel is compiled.

    Though not absolutely necessary for the smooth running of the kernel, not having a '' file may result in some annoying messages. Its main purpose is to aid in debugging.

  • 2.4 (< 2.6) and older kernels

    Clean, configure, compile and install

    $ make clean                   (Cleans up prior object files - a good idea)
    $ make mrproper                ('clean' does not always get rid of all files, this will)
    $ make oldconfig               (Configure the kernel, can use menuconfig, config, xconfig, ...)
    $ make dep                     (Only necessary on 2.4. '.c' files examined for header file
                                    dependencies. '.depend' file is created in each directory.)
    $ make bzImage                 (Builds the base kernel, can also use
                                    'make zImage'      For a small image
                                    'make zlilo'       Install kernel directly within the 
                                                       lilo boot loader
                                     'make zdisk'       To create a bootable floppy)
    $ make modules                 (Builds all configured loadable kernel modules)
    $ sudo make modules_install    (Installs all built modules to /lib/modules/<version>/,
                                    directory leaf is named after the kernel version) 
    $sudo make install             (Install the kernel)

    All commands are run from your build directory's base directory i.e. where the '.config' file is.

  • Problems during the build

    If problems with compiling or the directory you are using has been used before to build a kernel make sure it is 'clean' before starting a new build.

    $ make clean          (Does not remove all stale files e.g. .config file(s))
    $ make mrproper       (Removes all stale .o files, dependencies and .configs)

    Often quicker to clean everything out and start again from fresh ...

  • Install a > 2.6 Vanilla kernel

    Still in the same build directory

    # make modules_install        (Need to be root to install)
    # make install                (ditto)

    'make install' assumes that Lilo or Grub boot manager is being used. LILO needs to be re-run, GRUB does not.

    The build process automatically creates the ramdisk image (initrd). If need to do manually then run 'mkinitrd' - check man pages and section below.

    If you do not run 'make install', copy the kernel image ('vmlinuz' or 'bzImage') and the '' file to /boot/, symlink /boot/vmlinuz to /vmlinuz. Configure the boot loader to call/load the appropriate kernel(s).

    Initial ramdisk

    if required this needs to be created and installed - see articles following this one

    Boot loader

    install or up-date, whichever is required ('grub-install' or 'update-grub')

  • Initial ramdisk
    /sbin/mkinitrd (superceded)

    Superceded in debian, do not know about others

    • if important boot drivers were built as modules e.g. file system drivers, they need to be made available during boot.
    • an 'initial ramdisk' is a means of bootstrapping (aiding the boot process) so that these modules are made available.
    • he 'ramdisk' is a root pseudo-partition that lives only in memory, it is later 'chrooted' to the real disk partition.

    Creating an inital ramdisk - /sbin/mkinitrd

    Creates initial ramdisk images for preloading modules.


    'mkinitrd' checks various files for things likely to be needed for boot. Two such files are:


    These contain options to modules that are to be loaded e.g. lines containing alias scsi_hostadapter, LVM, RAID modules etc..

    mkinitrd [options] <initrd-image> <kernel-version>
    Common options:
     --preload <module>          Load this before others
     --omit-scsi-module          Skip check for scsi module, is loaded after / fs is mounted
     --omit-raid-modules         Skip md checks
     --omit-lvm-modules          Skip LVM modules check i.e. not using/required for boot
     --with=<module>             Include a specific module
     -v                          Verbose
     -f                          Force

    Need cramfs support in kernel, has fewer options, more customisation files.

    Check for cramfs support

    $ grep CRAMFS .config
    # CONFIG_CRAMFS is not set

    Would need to enable the above before compiling if you wish to use.

    Checks the following two files

    /etc/mkinitrd/mkinitrd.conf   - for general behaviour
    /etc/mkinitrd/modules         - for a list of modules to include
    mkinitrd [options] <initrd-image> <module library>
    # mkinitrd -o /boot/initrd-<version> /lib/modules/<version>
  • Initial ramdisk

    Low-level tool for generating an initramfs image - often called by 'update-initramfs'.

    File Description
    /etc/initramfs-tools/initramfs.conf The default configuration file for the script. Configure which modules to load, include BUSYBOX and more
    /etc/initramfs-tools/modules Specified modules will be put in the generated image and loaded when the system boots. The format - one per line - is identical to that of /etc/modules.
    /etc/initramfs-tools/conf.d The conf.d directory allows one to hardcode bootargs at initramfs build time via config snippets. This allows one to set ROOT or RESUME. This is especially useful for bootloaders, which do not pass an root bootarg.
    /etc/initramfs-tools/DSDT.aml If this file exists, it will be appended to the initramfs in a way that causes it to be loaded by ACPI.
    mkinitramfs [-c compress] [-d confdir] [-k] -o outfile [-r root] [-v] [version]
    Some options:
     -c  compress        Override the COMPRESS setting in initramfs.conf.
     -d  confdir         Set an alternate configuration directory.
     -k                  Keep the temporary directory used to make the image.
     -o  outfile         Write the image to outfile.
     -r  root            Override the ROOT setting in initramfs.conf.
     -v                  Set the verbose mode output.
     version             Set the kernel version of the initramfs image (defaults to the running kernel).
    Man page examples

    Create an initramfs for current running kernel

    mkinitramfs -o ~/tmp/initramfs-$(uname -r)

    Create an initramfs for specific kernel and keep builddirs

    mkinitramfs -k -o ~/tmp/initramfs-2.6.21-686 2.6.21-686

    Debug initramfs creation (check out written logfile)

    sh -x mkinitramfs -o ~/tmp/initramfs-$(uname -r) 2> ~/tmp/log

    Ramdisk for vanila kernel example

    sudo mkinitramfs -o /boot/initrd.img-
    sudo update-grub

    'mkinitramfs' run from build directory.