Linux DevCenter    
 Published on Linux DevCenter (
 See this if you're having trouble printing code examples

Gentoo Linux Reloaded

by Daniel Robbins

Hi there. I'm sure many of you know that in addition to writing Linux articles, I'm also very involved in a free software project called Gentoo Linux. In this article, I'll try to explain what Gentoo Linux is all about and also tantilize you with all the neat things we have in the works for Gentoo Linux 1.4, which we're currently developing and should be available from our Web site (at by the time you read this article. So, what is unique about Gentoo Linux? Here are the answers.

Introducing Gentoo Linux

Gentoo Linux is a fast, modern distribution with a clean and flexible design. In this respect, Gentoo may appeal to Slackware, Linux From Scratch or BSD users. Unlike most Linux distros, Gentoo has a package system reminiscent of BSD's ports. Available packages are distributed as source, in the form of "ebuild" auto-build scripts, which are kept continually up-to-date by the Gentoo Linux development team.

Portage, our ports system, is really the heart of Gentoo Linux. Portage allows you to set up Gentoo Linux the way you like it, with the optimization settings that you want, and with optional build-time functionality (like GNOME, KDE, MySQL, ALSA, LDAP support, etc.) enabled or disabled as you desire. If you don't want GNOME on your system, your apps won't have optional GNOME support enabled, and if you do, then they will. We prefer to think of Gentoo Linux as a meta-distribution or Linux technology engine. You decide what kind of system you want, and Portage will create it for you.

Here's a snapshot of Ferry Meyndert's Gentoo Linux GNOME2 desktop. Ferry (also known as MOrpheus) is responsible for a lot of the security work for Gentoo Linux:

A GNOME 2 desktop running under Gentoo Linux

We maintain an official Gentoo Linux Portage tree that contains the most recent versions of our ebuild autobuild scripts. By updating your Portage tree, you gain instant access to the latest and greatest Linux technologies and applications. Tell Portage what ebuild you'd like to install, and Portage will auto-download, unpack, patch, configure, compile, and install the package. Thanks to Portage auto-dependency resolution, you can install KDE 3.0 or GNOME 2.0 by typing in a single command. The resulting binaries will be optimized, customized, and installed to your exact specifications.

Social Contract

Another important aspect of Gentoo Linux is our social contract, closely modeled after that of the Debian project. This contract ensures that Gentoo Linux is and will remain free software, that developers will release all their contributions to Gentoo Linux under the GNU General Public License, and that Gentoo Linux will never depend upon a proprietary piece of software. In addition, our social contract sets certain standards for developer interaction with the larger, free software community, including collaborating with others outside the project, sending bug reports and improvments to the "upstream" authors, and properly documenting our efforts. Finally, our social contract ensures that we will have a bug report database that's open to the public.

Gentoo Linux 1.4

Now let's take a look at what Gentoo Linux 1.4 offers. The 1.4 release includes many significant improvements.

Probably the most significant change is Gentoo Linux 1.4's use of gcc 3.2 rather than 2.95.3. With gcc 3.2 come a host of performance improvements, including full support the for Athlon, Athlon XP, Pentium III, Pentium 4 and PowerPC G4 processors. This also includes support for the MMX, SSE SSE2, 3DNow! and AltiVec instruction sets. The gcc-3.2 also produces significantly tighter code than the gcc 2.95.x series and even the 3.1 series of compilers. It is now possible to optimize your Gentoo system fully for Pentium 4 and Athlon XP CPUs by using the -march=pentium4 -march=athlon-xp gcc settings respectively.

Combined with gcc 3.2, Gentoo Linux 1.4 supports the following architectures and CPU types:

Currently, Gentoo Linux for the Alpha Processor is maturing at an incredible pace. At the time this article was written, XFree86 4.2, GNOME 2 and the Gimp run on the Alpha. For our official 1.4 release, it's very likely that we will even have a Gentoo/Alpha bootable installation CD. The initial port of Gentoo Linux to the Alpha Processor was completed by our lead Alpha developer (Bjoern Brauel) in just two days.

Fast Installation: The Reference Platform

In past releases, the Gentoo Linux installation process involved building at least part of Gentoo Linux directly from source. For Gentoo Linux 1.4, we now offer a full binary Gentoo Linux "reference platform" that installs in minutes. We have clearly and carefully defined our binary reference platform to provide a set of reasonable build-time defaults for users who want to get Gentoo Linux up and running as quickly as possible. Thanks to the Gentoo Linux reference platform, a full installation of Gentoo Linux--including XFree86, GNOME, KDE and OpenOffice--can be completed in under an hour.

Our new reference platform is also a great help for VARs, since it allows them to provide a reasonably configured Gentoo Linux system for their customers easily and efficiently.

A Modern, High-performance Kernel

Gentoo Linux 1.4 also contains a new high-performance kernel for x86 systems. Some of our users prefer running stock, -ac, Red Hat, or Mandrake kernels, which are also fully supported. In fact, we provide ebuilds for vanilla and Red Hat kernel sources as a convenience for our users. That said, many have come to appreciate the Gentoo-sources kernel, which includes several patches to improve performance, scalability, functionality, and hardware compatibility.

Our new kernel is based upon 2.4.19 and includes Robert Love's preemptive kernel and scheduler-hints patches, Ingo Molnar's O(1) scheduler and smptimers patches, and Rik van Riel's reverse mapping patches, for enhanced responsiveness and scalability under high loads and in high-end multiprocessor systems.

We provide IBM's EVMS (Enterprise Volume Management System) support. EVMS is an excellent storage management system providing a single modular API that supports nearly all of Linux's storage technologies. You can find out more about IBM EVMS at the EVMS SourceForge site.

Related Reading

Running Linux
By Matt Welsh, Matthias Kalle Dalheimer, Terry Dawson, Lar Kaufman

The kernel contains extensive filesystem technology support including ext2, ext3, ReiserFS, XFS LVM, software RAID, JFS and EVMS. In addition to kernel support, Gentoo Linux's new LiveCD supports using all these storage technologies during the initial installation process, so that configuring your system to have a root EVMS or XFS filesystem is fully supported.

The new Gentoo Linux kernel also includes Andrea Archangeli's excellent 3.5GB user address space patch. This patch allows users to customize how Linux divides the system's user and kernel address space. Normally, there is a 3-to-1 ratio between user and kernel memory. A 32-bit Linux kernel thus can only "see" up to 960MB (~1GB) of RAM, with user processes accessing up to 3GB of virtual memory. By using a 3.5U/0.5K or 2U/2K divide, users can choose a balance that better suits the intended use and hardware configuration of their system. For example, a 2U/2K divide will allow a 32-bit Linux kernel to "see" 1960MB of RAM (~2GB) even without enabling "highmem" support. Alternately, a 3.5U/0.5K split plus highmem support can allow VM-hungry applications to access up to 3.5GB of virtual memory while still allowing (thanks to highmem) access to multiple gigabytes of physical RAM. This patch is tremendously helpful for developers who push 32-bit systems to their limits. This patch is also invaluable for those writing applications that need to access more than 3GB of virtual memory. For those interested in trying out this patch, you can find it in one of the kernel directories at

There are several other miscellaneous features, such as the grsecurity security system, the excellent HTB3 QoS code, gcc-3 support, and a handful of various hardware compatibility tweaks (SiS 740/961 chipset support, Pentium 4/Xeon hardware detection fixes, and some VIA chipset fixes). NFS TCP support and updates and the FreeS/WAN IPSec implementation will also be popular.

Portage Improvements

The Portage system has been improved extensively since the 1.2 release, especially in its performance. By using extensive internal caching and external metadata caching, the new profiler-optimized Portage is now up to 100 times faster in common, day-to-day use. Here is a comprehensive list of additional major improvements since the Gentoo Linux 1.2 release:

New "LiveCD"

Gentoo Linux 1.4 features a new "liveCD" installation CD that will boot into a full runtime version of Gentoo Linux. Because of this, this CD not only serves as an ideal platform for installing Gentoo Linux, but also makes an ideal rescue/repair CD and portable Gentoo-Linux-on-a-CD system.

The CD provides a full suite of Linux tools and a familiar Gentoo environment with near-zero RAM overhead thanks to tmpfs. Tools on the CD include fdisk, ext2, ext3, XFS, ReiserFS filesystem tools, EVMS tools ("evmsn"), parted, and many, many more.

And a "GameCD"

To promote accelerated OpenGL gaming under Linux, we used our LiveCD as the foundation for a fully self-hosted GameCD featuring the Unreal Tournament 2003 Demo. Our Unreal Tournament 2003 Gentoo LiveCD allows you to play the Unreal Tournament 2003 Demo using any modern PC with an NVIDIA GeForce 2 or greater graphics card and a CD-ROM drive. It has full networking, complete OSS sound support, and additional Creative Soundblaster Live! and Audigy support included, allowing for the full gaming experience including LAN/Internet play, EAX environmental audio, and 3D accelerated OpenGL graphics. Weighing in at approximately 220MB, the CD also serves as a fully-functional Gentoo Linux installation CD. If you're interested in trying our our GameCD, the best way to do so is to visit our GameCD page and download the most recent version listed there.

Accelerated OpenGL gaming (Unreal Tournament 2003) on the GameCD

The Unreal Tournament 2003 Gentoo LiveCD is an ideal way to play Unreal Tournament 2003 on network machines that are normally used for other tasks, such as in computer labs and offices after hours. We plan to refine our ut2003 CD, developing it into a full-fledged Linux gaming platform. It's a great way to promote the use of Linux and Linux gaming in general.

Extensive Updates to Portage

Gentoo Linux 1.4 also includes countless improvements to our Portage tree, the repository that houses all our ebuild scripts. Currently, we have over 2400 ebuild scripts, including full support for GNOME 2, KDE 3.0.3 and 3.1-beta1 (possibly 3.1 if it's ready), and XFree86 4.2.

That's it for this article. In the next article join me as we take an inside look at Gentoo Linux 1.4. See you then :)


Learn more about Gentoo Linux at

View the Gentoo Linux Social Contract.

Read a interview with Daniel Robbins.

View screenshots of other Gentoo Linux users and developers.

Copyright © 2009 O'Reilly Media, Inc.