Date with the Gentoo Oxen – Part Quatre

This is already my 4th iteration of “Why I love Gentoo and really enjoy the pain of working with it”. Therefore, I decided to do a brief recap of what changed in my impressions and understanding of this unique and enchanting GNU/Linux distributions. My initial experiments could be easily summed up with a meme we all learned to appreciate in times of anxiety.

ihavenoideaI had no idea what USE flags are or do. Kernel configuration was black magic and so was building a GNU/Linux system from scratch. Yes, I managed to install Arch Linux before trying out Gentoo, but that alone was still insufficient. I might’ve as well went “full throttle” and read the whole Linux From Scratch (LTS) handbook at that point. Come to think of it, LTS ought to be mandatory for achieving computing Zanzara. So, my first (and second, in fact) Gentoo installation was an absolute mess. I wanted to play the “hardcore hacker” and blocked all USE flags from the selected profile via “-*”. This was a bold (read: dumb) move and it quickly spiralled into an oblivion of circular dependencies. My third attempt was a bit less dramatic and besides odd configuration problems, Chromium constantly crashing and unbootable kernels, I could actually use the system I sculpted myself. Vae victus!

Now comes my 4th attempt, which thus far is surprisingly successful. To make my life harder I decided to utilize my spare MacBook (late 2009) with its pesky integrated nVidia and Broadcom wireless. First thing I noticed was that beginning with an Arch Linux liveCD is possibly the easiest way to install Gentoo, believe it or not. 1 tty for messing with partitions and chroot, and 1 tty with links/elinks/lynx displaying the Handbook. Since I installed Gentoo 3 times already, preparing the hard drives and entering the chroot environment was easy enough. Though not designed for Gentoo, Arch has an “arch-chroot” script, which does all of the extra /dev mounting steps and chroot for the user. Furthermore, I never used genkernel extensively so I decided to let it choose some “sane defaults” for me and do its compilation magic. That also gives a reasonable .config to work with later on. The full installation took me 3 mornings and 3 evenings, because of $dayjob. It went quite smoothly and on my 4th morning I was ready to boot into my freshly built environment.

While the installation and initial setup are considered tedious, many steps can be automated with well-designed Shell scripts (see: arch-chroot). Gentoo developers are generally against excessive automation, though for personal use I think it’s perfectly reasonable. When a full installation is complete, cloning it is as simple as preparing a tarball of the whole filesystem or utilizing the power of the “cp” copy command. As usual, I had problems with the Broadcom bcm4322 wireless adapter. Apparently, the default kernel didn’t recognize the chip properly and I had to go through the kernel .config anyway. I guess compiling one’s own kernel is crucial after all. Thankfully, after disabling all of the unnecessary features my system would boot and run twice as fast. Also, the Broadcom adapter was recognized by the b43 driver and works since.

One of the key features of Gentoo are the local and global USE flags. They allow the user to precisely select which components should a particular piece of software have. Firstly, this allows for supreme optimization when targeting embedded systems. Secondly, on servers every overlooked or unmaintained software feature is a potential point of entry for attackers. Thirdly, most GNU/Linux distributions ship software with only the “sane defaults” enabled and we users cannot easily inspect what those defaults are. This is a major problem of the GNU/Linux ecosystem, making comparisons between distributions absolutely impossible. Bearing all of those points in mind I am actually amazed major distributions like Ubuntu or Fedora don’t use Portage for building applications. Don’t want proprietary code in your software – block all related USE flags. Want different system branches (desktop flavors, server, etc.) – generate USE flag profiles. Heck, it’s really that simple!

Despite the obvious advantages, throughout my toils I learned that Gentoo is not for the faint of heart, nor for casual computer users, who just want to browse the Web and enjoy their lives. Also, a decent machine (say, core i*, 4+GB RAM) is a must, otherwise compile times get really annoying. For now I can bear with the drawbacks, since the flexibility of Gentoo is truly worth it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s