Installing Gentoo on a vintage Thinkpad T60
I installed Gentoo Linux on my vintage Thinkpad. This particular device has a rather colourful history. In mid 2015 I recovered it from an e-waste pile at my workplace and brought it back to life. In the years since, it’s been a playground of sorts. In five years it’s had four editions of Windows, three versions of BSD, exotic operating systems like Redox and ReactOS, and of course dozens of different Linux distributions. For the last couple weeks I have been using the system to experiment with Gentoo on a lower powered system.
Now, typicaly people use Gentoo on systems where power is in abundance. It seems like a natural fit, since compiling all the software yourself requires a fast computer to finish the buidl in a reasonable time. On the other side of the coin, slower computers can also benefit from natively built software. If you have the patience, there are some benefits to installing only what you need and removing unneeded features at build time.
To keep some sanity, I opted to use binary versions of some packages:
Between the two, I could save about 10 hours of compile time! And, frankly… I suck at compiling kernels. I seem to frequently get lost in
menuconfig and miss important items. That’s one thing I’m happy to leave to the experts.
And of course, just for fun I decided to install chromium from source. Chromium (the open-source core of the Google Chrome browser) is absolutely massive, being quite possibly one of the most complex pieces of software ever made. Compiling Chromium is no small feat. Just look at Chromium’s build infrastructure, https://www.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot
The specs of my trusty rusty T60 are quite palty. With a meager 3 GB of memory (4G installed, but the BIOS only uses 3!) and a once mighty Intel Centrino T5600 (1.83 GHz) dual core processor, nothing comes easily. My first attempt at building chromium had only the 3 GB of system memory and a small 1G swap file, and after about 8 hours ran out of memory invoking OOMKiller and failing to build.
Not to be bested, I
dd’d the drive to an SSD and carved off some drive space for a larger swap partition rather than a small swap file. With 10Gi, I felt prepared.
$ free -h total used free shared buff/cache available Mem: 2.9Gi 112Mi 1.8Gi 14Mi 997Mi 2.5Gi Swap: 10Gi 63Mi 10Gi
After more than 72 hours, this build failed as well. After grokking some of the compile output I opted to disable some of the chromium features using USE flags:
/etc/portage/package.use/chromium.conf www-client/chromium -hangouts -proprietary-codecs -widevine -official
By disabling some proprietary codecs & DRM and google integration, the build should be substantially shorter and less likely to fail. And indeed, the next attempt was successful!
$ sudo genlop -t chromium * www-client/chromium Thu Nov 5 06:56:54 2020 >>> www-client/chromium-86.0.4240.111-r1 merge time: 2 days, 17 hours, 31 minutes and 12 seconds.
After the install was complete, I can say that chromium felt much snappier than the binary packaged version and appeared to use much less memory. Of course, I did end up using the binary package for Firefox instead of chromium as it fit nicely in the 3G of system memory.
So, while this wasn’t exactly a groundbreaking project, it was interesting to see just how important swap space is. And of course, the zen of installing massive software products.