Linux kernel

From Christoph's Personal Wiki
Jump to: navigation, search

The kernel is the core piece of the Linux operating system.

  • Current (stable version): 3.4.7 (2012-07-29)


The kernel manages the resources of the Linux OS; such as the following:

  • File management
  • Multitasking
  • Memory management
  • I/O management
  • Process management: /proc/
  • Device management: /dev/
  • Networking support (including IPv4 and IPv6)
  • Virtual memory, shared libraries, demand loading, etc.

The kernel decides who will use these resources, for how long, and when.

Rebuilding kernel from SRPM

Note: some of the paths below include $TOPDIR, which is distribution-dependent and can be further redefined by user. To find out the proper location on your system, issue this command:

rpm --eval "%{_topdir}"

openSUSE 10.2 returns:


Mandriva Linux 2007.1 returns:


Example kernel update protocol

For this example, I will be using Mandriva Linux and updating/upgrading from kernel kernel-smp- to kernel-smp-

The first thing you should do before updating your kernel is to backup your /sbin/*25 files (some distributions omit the "-25" at the end of each name) to a floppy disc (handy for quickly restoring them). These would include:


It wouldn't hurt to also backup your entire /etc directory.

Then, update your old kernel's related rpms:

rpm -Uvh fbgrab-1.0-1mdv2007.0.i586.rpm
rpm -Uvh libgtk-linux-fb-2.0_0-2.4.14-6mdk.i586.rpm
rpm -Uvh bootsplash-3.1.12-0.2.20060mdk.i586.rpm
rpm -Uvh mkinitrd-4.2.17-17.2.20060mdk.i586.rpm
rpm -Uvh module-init-tools-3.2-0.pre8.2.1.20060mdk.i586.rpm
rpm -Uvh aumix-text-2.8-12mdk.i586.rpm
rpm -Uvh sound-scripts-0.35-1mdk.noarch.rpm
rpm -Uvh hotplug-2004_09_23-7mdk.i586.rpm
# Returns clashing dependencies (possible problem source):
#rpm -Uvh udev-068-34mdk.i586.rpm

Now, install (not "upgrade") your new kernel rpm:

# Note: I am NOT using "rpm -Uvh", as I wish to _keep_ the old kernel
# The "smp" RPM is for multi-processor systems
rpm -ivh kernel-smp-


# Linux kernel RPM:
# - kernel (/boot/vmlinux-2.X.XX-X);
# - modules (/lib/modules/2.X.XX-X/...);
# - /boot/; and
# - /boot/module-info-2.X.XX-X

Now, create the initrd image:

/sbin/mkinitrd /boot/initrd-

Edit /etc/lilo.conf and add new/old kernel boots (you want to keep your old kernel, just in case anything goes wrong you can boot your old, working kernel). For an example,

        append="acpi=ht resume=/dev/sda5 splash=silent"
        append="acpi=ht resume=/dev/sda5 splash=silent"

Now commit the changes to lilo:

lilo -v


shutdown -r now

And that should do it.

Possible problems/fixes

If you have problems with any kernel (old, new, or both), here are some possible troubleshooting steps you can take:

  1. Boot in a rescue disk (e.g. Mandrake 10.1 installation CD)
  2. Restore your old /sbin/*25 files from the floppy disc (see above)
  3. Check to make sure your /etc/lilo.conf is pointing to the correct kernels and images.
  4. Then, try rebooting.

Check if your kernel is 32- or 64-bit

$ uname -a

If 32-bit, it will look something like:

Linux hostname 3.8.0-33-generic #48-Ubuntu SMP Wed Oct 23 17:26:34 UTC 2013 i686 i686 i686 GNU/Linux

If 64-bit:

Linux hostname 3.8.0-33-generic #48-Ubuntu SMP Wed Oct 23 17:26:34 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ file /sbin/init
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV)...
# ~OR~
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV)...
$ uname -m
i686    # <- 32-bit
# ~OR~
x86_64  # <- 64-bit
$ arch 
$ getconf LONG_BIT
# ~OR~
if [[ $(getconf LONG_BIT) = "64" ]]; then echo "64-bit kernel"; else echo "32-bit kernel"; fi

Kernel files

Note: These files are found in the /boot directory.

Kernel files
Distribution Kernel file Ram disk
SuSE linux initrd
Mandriva vmlinuz all.rdz
Fedora vmlinuz initrd.img
Knoppix vmlinuz initrd.img
Slackware bzImage initrd.img
Ubuntu vmlinuz initrd.gz
Gentoo gentoo gentoo.igz
Debian vmlinuz initrd.gz

See also

External links