Search ServerWatch
Search ServerWatch
Search ServerWatch



Become a Marketplace Partner

  • Partner With Us















Linux 2.6: Revved and Ready for the Enterprise?

Enterprise Unix Roundup: A Taste of Linux Kernel 2.6

ServerWatch > Tutorials

April 13, 2004
Linux 2.6: Compiling and Installing
By Carla Schroder

We recently highlighted some of the new features of the Linux 2.6 kernel. Now, we'll look at the process of compiling and installing a new kernel safely, without overwriting the existing kernel.

You can install as many kernels as you like on a Linux system, and select the one you want to run at boot time. This makes it easy to test different kernels, and different kernel configurations, with particular sets of hardware or applications. The wise network admin always tests new kernels before running them on production machines.

Being able to compile, upgrade, modify, and test new kernels is a useful skill to have. It's not that difficult &$151; Linux is designed to be modular, so you can plug in or remove bits as you need. A typical general-purpose Linux distribution lards the kernel with all kinds of things you'll never need, so you'll often see a performance gain after configuring and re-compiling your stock kernel.

Get a Pre-Fab Kernel to Play With

Look to your own distribution for already-built kernels. SUSE, Mandrake, and Red Hat customize their kernels extensively, while other distributions don't mess with them quite as much. If you're looking to reduce potential troubles, stick to your distribution packages. For example, Red Hat users can use up2date to automatically download and install new kernels. up2date will configure the bootloader to boot the new kernel by default. It will not replace the old kernel, and both will be in the boot menu. If, instead, you download and install a kernel RPM, be sure to install it with rpm -i, not rpm -U, because the -i flag will install the new kernel without touching the old one. The -U flag will overwrite the existing kernel. Debian users need look no further than apt-get install kernel-image-2.6.x.

Customizing a Kernel

You'll need the kernel source code to compile and customize a kernel. Again, you can look to your own distribution for kernel sources, so you can customize the kernel and still have the benefits of any vendor modifications. Each distribution has its own method for customizing kernels, so be sure to check the documentation for your distribution.

Or, if you wish to try a plain-vanilla, unmodified kernel, go to the motherlode at The Linux Kernel Archives.

Hardware Requirements

Compiling a Linux kernel takes a bit of muscle, and a lot of disk space. Use a machine with at least a 500 MHz CPU, 128 MB of RAM, and a good 500 MB of free disk space. The build process needs a lot of room, so you'll get most of that disk space back. When it's completed, the 2.6 kernel takes up as much as 40 MB, and kernel sources as much as 80 MB. You can get away with using a slower CPU and less RAM, it will just take a lot longer. There is also the option of building kernels on fast machines to use on less-powerful machines.

Software Requirements

Kernel compilation is fussy about the tools used. Here's the major software requirements from the Documentation/Changes file, which you'll find in the kernel tarball.

Gnu C 2.95.3 # gcc --version
Gnu make 3.78 # make --version
binutils 2.12 # ld -v
util-linux 2.10 # fdformat --version
module-init-tools 0.9.10 # depmod -V
e2fsprogs 1.29 # tune2fs
jfsutils 1.1.3 # fsck.jfs -V
reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
xfsprogs 2.6.0 # xfs_db -V
pcmcia-cs 3.1.21 # cardmgr -V
quota-tools 3.09 # quota -V
PPP 2.4.0 # pppd --version
isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
nfs-utils 1.0.5 # showmount --version
procps 3.1.13 # ps --version
oprofile 0.5.3 # oprofiled --version

It's important to pay attention to these, especially gcc. If you compile your new kernel with any other version of gcc, you'll probably get errors. Most newer Linux distributions ship with gcc 3.x. You can have more than one version of gcc installed on your system. Install gcc 2.95.3, without overwriting your existing gcc installation, then invoke it with

# gcc -V 2.95.3

Note that you can safely ignore any unneeded components. For example, if you're not running quota, you won't need to update quota-tools, even if it's on your system. If you're not using the JFS filesystem, you won't need jfsutils. And so forth. These items matter only if you're using them. The most important programs are gcc, Gnu make, binutils, util-linux, and module-init-tools because they relate directly to kernel-building.

>> Downloading and Installing

This article was originally published on CrossNodes.

Go to page 1  2  


Discuss this article
Tools:
Add serverwatch.com to your favorites
Add serverwatch.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x

Tutorials Archives




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES