Distribution Watch: Gentoo Linux

By: Dee-Ann LeBlanc
Monday, April 15, 2002 10:29:29 AM EST
URL: http://www.linuxplanet.com/linuxplanet/reviews/4149/1/

Introducing Gentoo Linux 1.1a

Gentoo Linux is a relative newcomer to the world of Linux distributions. Rather than trying to be everything to everyone, this distro is tightly targeted at software developers and network administrators, which means that the new or even average Linux user may not be too interested in trying it out.

You won't know Gentoo Linux 1.1a for its installer bells and whistles. That's not expected after all, not for an audience that's more concerned with what's going on under the hood than the flashy racing stripes and spoiler. What you do get is a distribution built mostly from source code, optimized to your personal specifications, and one killer tool for handling compiles and development: Portage (a French word meaning "carrying," often referring to carrying your canoe across a stretch of land before putting it in the next stretch of water).

Portage is best described by the Gentoo Linux team, themselves: "Portage is a true ports system in the tradition of BSD ports, but is Python-based and sports a number of advanced features including dependencies, fine-grained package management, "fake" (OpenBSD-style) installs, path sandboxing, safe unmerging, system profiles, virtual packages, config file management, and more."

If I was a software developer, this is a distribution I'd watch.

Supported Platforms

The Gentoo Linux distribution is specifically designed for the x86 architecture, so you'll need a PC for this one. You can't use antiquated hardware but you don't have to have the latest and greatest either:

  • CPU of 486 or higher
  • 64 MB of RAM or more

As usual, the faster the CPU and the more RAM you have, the happier you'll probably be.

Getting Gentoo Linux 1.1a

There's a bit of strategy involved in getting Gentoo Linux. It's important to remember that Gentoo is specifically designed for software developers, consultants, and power users who like to have heavy control over their environments. With this in mind, you have two options when it comes to downloading the files required to install Gentoo Linux 1.1a.

Option 1 involves downloading the 16 MB burnable CD-ROM image gentoo-ix86-1.1a.iso. This is the route I chose to take, since I suspect most people trying out Gentoo Linux will be doing so in order to control their environment, and this option gives you the most control by having you actually build the rest of the distribution by hand. You also get the latest versions of all packages by using this method.

Option 2 is only available if you have a 686 (Pentium Pro) or faster. If this is the case for you, and either you are having a hard time getting Gentoo Linux 1.1a to build on your hardware or you don't want to deal with the time it takes to do so--even on a fast connection and with a fast machine it can take hours--then you'll want to get gentoo-i686-1.1a.iso and follow the installation instructions for this combination instead of the instructions I'm following.

What's Different

There are quite a number of differences between Gentoo Linux and the mainstream Linux distributions. If you come from the days where we had to install Linux in many ways by hand then some of what you'll see in the installation section will be familiar. Still, things are far more automated than "the old days." Rather than having a pile of disks to work with there's a bootable CD-ROM. You don't have to manually place most files, either, the first chunk are included on the CD-ROM, while the rest are downloaded during the install process (the Gentoo FAQ at the Gentoo web site, www.gentoo.org, addresses what to do if downloading during the installation is not feasible).

Other differences include:

  • You're not installing from pre-made packages (and I'm not just referring to the installation). Instead, you're compiling from source. Even if you get the second option with most of Gentoo already on CD-ROM you still have some compilations to go through. * A highly configurable build environment and package manager named Portage. Since Portage is available during the installation process, you can use it from the start to set various factors for your Gentoo Linux distribution as a whole. Later, when you're working with your full system, you can set up a cascade of configuration files that override each other, the global file being overridden by any file that refers more specifically to the package you're building. For more on Portage, see the manual at the Gentoo Linux web site (www.gentoo.org).
  • Quick, simple commands for upgrading your system and its components.

There are many more differences between Gentoo Linux 1.1a and the more mainstream Linux distributions, but these are the big ones. If you're curious, take a look through the web site and documentation, or even try out Gentoo yourself.

Installing Gentoo Linux 1.1a

Installing Gentoo Linux 1.1a is an involved process if it goes wrong, and just a step by step by the numbers if it goes right. You'll see what I mean as I walk you through my own experience. I started of course by choosing which installation route I wanted to take. As I mentioned before, I like to try the methods that the target market are most likely to use, so I decided that I'd go through the whole build process. Perhaps that was my mistake.

The Gentoo CD-ROM images are fairly small since so much code is downloaded. The instructions seem pretty complicated at first, especially for those of us too used to nicely automated installations, but when you take them one step at a time they're pretty clear.

I started with the old standards. Popped the CD-ROM into my test machine's CD-ROM drive, rebooted, changed the BIOS to boot from CD-ROM, and rebooted again. I press Enter at the boot prompt and then again for PCI autodetection (a nice luxury), and soon I'm at the Install/Rescue screen and I press Enter to get the command prompt.

So far, so good. Since my PCI Ethernet card was autodetected, it turns out that I didn't have to manually deal with the network card module. A quick lsmod confirmed that the module was loaded automatically once it was detected, so I proceeded past the PCMCIA and SCSI sections since my test machine doesn't have either of those, and connecting with DHCP from there was a breeze.

If you've ever wondered about the pluses and minuses of ext2, ext3, ReiserFS, and XFS, the Gentoo Linux installation document has an excellent writeup. I chose ext3 for my boot and root partitions, and of course swap for the swap partition, not much choice there. Fortunately I can use fdisk in my sleep, because creating the partitions involves navigating this lovely tool without instructions. I don't even forget to press t before saving out and set the swap partition to type 82 (Linux swap).

Building the filesystems definitely reminds me of "the old days," aside from the ext3 journalling flag. Made the swap filesystem on the swap partition, the ext3 filesystem on the /boot and root filesystems, and then activated the swap partition. Now I've got to add the mount points and actually pull these partitions onto the filesystem, and the order in the instructions is important. First I create /mnt/gentoo and mount /dev/hdb3 as /mnt/gentoo. The reason the instructions say to do do both of these first is that it's a bit hard to create /mnt/gentoo/boot in /mnt/gentoo if you haven't actually mounted /mnt/gentoo. So, then I create mount points, mount the partitions, and then mount the Gentoo CD-ROM. From here I can untar its contents (the stage 1 tbz file in my case), making sure to use the flags specified in the installation document, mount the proc filesystem, and copy the /etc/resolv.conf created when I made my DHCP connection into the Gentoo filesystem.

Next the instructions say to do a chroot, which means telling Linux to use a new spot as the root of its filesystem, so I make /mnt/gentoo my new base point before running env-update, a custom tool that re-loads your shell and other configuration files in case any changes were made by other software.

I finally hit my first snag when I type source /etc/profile. I get a make.profile error that suggests running emerge sync, so I do that and wait while lots of text scrolls by (techie-speak for I think it downloaded something but I can't quite remember), re-run env-update for my own comfort levels, and then execute the master user profile. But, the prompt doesn't change like the instructions say it should.

Well, nothing to do but move on and see if the rest of the process works from here. I type emerge rsync like the instructions say but emerge sync did most of the work already, so rather than taking a while downloading and compiling software, I just get a summary printout. That's okay. Next step is to edit the master compile configuration file with the nano editor, which (no surprise) turns out to be much like the pico editor. I'm not a programmer by trade so it takes me a moment to mentally process the options, and I select one that should be pretty flexible. Once I save out the file I change to the proper directory and type the big command: scripts/bootstrap.sh. Since the instructions say it's time to go find something to do, I naively walk away and figure I'll check back in an hour or two. Big mistake, but I won't realize why for a few days. Seems I get to deal with a particularly annoying bug that only one other person had mentioned in the Gentoo Bugzilla entries: the installation locking up. I came back to a blank screen and had to reboot the machine from the tower, Ctrl-Alt-Del did not work.

I got held up for quite a while on this one. I tried a number of different settings in /etc/make.conf, thinking that perhaps some of the configuration options just weren't compatible with my hardware set. About five times through and every time it hung in about the same place, hard to tell exactly where, but sometime during the bootstrap process. Finally, I decided to compile for a 586 instead of a 686, and sat and watched over the process like a hawk without allowing it to get idle enough to black out the screen. Oddly, it worked. This was a relief since Bugzilla had no solutions to suggest!

Now I was finally able to proceed to the next step, which led to the next long download and build process, this time for the main system. After a couple of hours of not letting the system go idle too long, this step ends with a segmentation fault. That's a bit unnerving! But, I plod on, typing emerge sys-kernel/linux-sources. That proceeds just fine so I reason that I must be okay.

So now I've got the kernel sources. I change to /usr/src/linux and type make menuconfig to go to the ol familiar kernel configuration curses menu interface. Once I make a few changes and save out of that, I type the convoluted item mentioned in the instructions:


make dep && make clean bzImage modules modules_install

This sequence is just all of the kernel compilation options in a row on the same command line. Once again, as this process ends I get a set of errors, but I'll keep going since none of the errors have been fatal yet. I don't have an original /boot/bzImage so I don't have to move that file, I just have to copy the new bzImage into place. Uh oh, no bzImage at all, so this last error really was a problem. I go in and edit the kernel options again (superstition) and then retype the long set of compile instructions from earlier--well, okay, I use the up arrow to pull them back up. Phew, this looks like it finished properly. Sure enough, I'm able to copy bzImage over. I decide to go with metalog since I haven't tried that one yet, so I emerge it, and then use rc-update to add metalog to the boot routine.
Things go downhill pretty fast from here. I get some more configuration files edited, GRUB gives me attitude and refuses to cooperate, the machine can't boot properly because somehow the mount command never got installed (oops, perhaps one of those failed commands from earlier), but there's a nice maintenance login so I log in as root. Oddly I have the mount man page, so I use find to see where the mount command is to see if this is just a path problem, but it's really not there. Then it turns out I have a read-only filesystem.

Okay, I'm an adventurous sort, I rebooted with the rescue CD-ROM, found that mount was in the util-linux package, used emerge to install and compile mount, rebooted, found myself in a much better state, but ... no. After a week of fussing on and off with this distribution, I just am not going to be able to get it installed in time for this review. While I'll likely turn around and try out the lessons I've learned along the way to give it another go, for now I have to say that not being able to get this sucker installed has been a frustrating experience, to say the least.

Configuring Gentoo Linux 1.1a

While I was unable to get Gentoo installed enough to configure it, I took a look through the documentation and ironically am able to go through the motions with the rescue CD-ROM mounted. The overall configuration process is pretty similar to the install. If you want a package, say in my case I wanted to install GNOME, you just type emerge gnome and Gentoo goes and gets all of the necessary source from its download site and then compiles it using your pre-set preferences from earlier. Running Gentoo Linux 1.1a

As you might guess, I don't have an incredible amount to say about what it's like to run Gentoo Linux. The command line interface is colorful, from what I was able to access. There's the same easy to follow boot sequence as each of the daemons and processes starts, with the green [OK] and the red failure markers. If you prefer the GUI environment then you can certainly set yourself up in that direction too, installing KDE or GNOME pretty easily and going from there.

One thing you'll want to investigate further is the Portage tool, if you at all are into programming.

Wrapping Up

Okay, I have a few issues with Gentoo Linux 1.1a. I don't mind having to go through all the commands. After all, this is a distribution for developers and if you want close control over your system you have to give up on some of the flashy widgets, so I expected that. The documentation is even pretty good, though I got to trusting it too much and didn't read the very fine print in the kernel compilation section, causing myself some headaches by not including features that Gentoo requires.

Now, with all that said, one of my biggest beefs is that I had to do a lot of things multiple times even if the install went perfectly right. I have to edit /etc/fstab to set it up manually after I went through the trouble of setting up the filesystem the way I wanted it during the installation, I have to set up the Ethernet card module information in a file after I went through the trouble of activating it manually, and there are a lot of other bits and pieces that really should be a bit better taken care of behind the scenes.

Obviously my biggest problem with Gentoo Linux 1.1a was that it just didn't get along with my test machine. That part's forgivable for such a young distribution, but after spending a good amount of time popping in and out of the rescue state trying to get everything fixed I have to say that I don't think Gentoo is quite there yet. I'll give it another try when the next version comes out.

You might think after losing so much time on this one I'd dislike Gentoo, but actually, I think this distribution is one to watch for the developer community. It's got some bugs to iron out but the Portage tool in and of itself makes adding packages from source pretty simple, when it works! If you're a developer or are just very fond of distributions where you basically roll your own, then you might want to check this one out. Hopefully it will get along better with your hardware than it did with mine.

Copyright Jupitermedia Corp. All Rights Reserved.