I’ve just finished the shutdown of my Raspberry Pi Gentoo installation box.
I did something of a “shortcut” via the directions here:
Install Gentoo on Raspberry Pi 2 / 3 + USB Hardrive
This method uses a NOOBS install of Raspbian as the host to install Gentoo onto a USB Hardrive. It is quick & simple, providing a working Gentoo install with the least pain in the shortest time possible.
Please read ALL the instructions before attempting this install
This install method leaves NOOBS and Raspbian on the SD Card as the ultimate Rescue Disc (dual boot).
The install is quick and easy, using the stable Raspberry Pi Foundation Kernel off the SD-Card. No Kernel Compile required.
You’ll also end up with a machine theoretically fractionally faster because it everything will be compiled for ARMv7a_hardFP unlike other distros which are all compiled for the older ARMv6. I also provide an optional Stage-3 compiled for NEON vpf4 to enable all Hardware Acceleration, current-armv7a_neonvfpv4_hardfp.
What follows is How I Did It …. Every instruction has been copy pasted directly from my install. I then re-installed a couple of times following and these instructions to check they are “correct”. If you spot mistakes or can suggest improvements, please contact me.
The install falls roughly into 3 categories or stages.
Booting Raspbian Desktop to partition & format the USB Hardrive
Download Base Files System, portage Package Stuff
chroot to sort the configs, such as set the keyboard, date, and such like.
Rapsberry Pi 2 / 3
8Gb Micro SD card with NOOBS
I did change the mix some. For example, I didn’t need to swap from the strange US keyboard to the UK one ;-)
I also didn’t use their install path of /mnt/genoot as ‘genoot’ is just rude ;-) I just put it in /gentoo and ran with it.
The other thing that I “changed up” was some of the order. They have you make an SD card Raspbian, then use it to format your disk and such. I just used my extant Arch system to launch gparted for the partitioning stuff, then downloaded the Gentoo Tarball into it and unpacked. It really doesn’t matter how the disk partion gets made, or how the bits get onto it…
I used “his” build from here:
[DIR] Parent Directory –
[TXT] Raspberry-Pi-2.txt 22-Apr-2016 18:53 223
[ ] stage3-armv7a_neonvfpv4_hardfp-20160421.tar.bz2 22-Apr-2016 17:04 218M
[ ] stage3-armv7a_neonvfpv4_hardfp-20160421.tar.bz2.CONTENTS 22-Apr-2016 17:05 4.6M
[ ] stage3-armv7a_neonvfpv4_hardfp-20160421.tar.bz2.DIGESTS 22-Apr-2016 17:05 1.2K
[ ] stage3-raspberry-pi-2.tar.bz2 22-Apr-2016 17:04 218M
[ ] stage3-raspberry-pi-2.tar.bz2.CONTENTS 22-Apr-2016 17:05 4.6M
[ ] stage3-raspberry-pi-2.tar.bz2.DIGESTS 22-Apr-2016 17:05 1.2K
In particular that “neon” tar.bz2 wad. The “neon” processor is a dinky vector unit in the ARM chip that does something like a half dozen SIMD (Single Instruction Multiple Data) parallel math chunks at once. The page goes into reasonable depth about it. The short form is it speeds up sound and video at the expense of not being exactly IEEE spec precision. I’m OK with that on this system. (I’d likely choose the other way if making a Temperature Model Validation system as I’d need to avoid the accusation that I was the source of math drift…)
In general, his directions are “spot on” and you can just cookbook what he says. My only real complaint is that after repeatedly having my fingers type vi commands as soon as I thought to do something, and having “nano” not take well to that, I decided to install vi. On Gentoo that is done via: “emerge vim” (and then waiting several minutes while “stuff happens”…)
This method of install avoids a kernel build since it reuses the Raspbian Kernel. That’s OK, sort of. Especially just for a ‘first taste’. BUT: It means that I’m running a hybrid system where, as he points out, compiling and installing something like the X-windows system might be a bit off. It also means that the kernel was not complied with all the goodies and flags set for optimal use under Gentoo. I’ll worry about that next week…
So on my “todo list” is “make a Gentoo Kernel using this Gentoo and swap them”. Likely about a day in about a week. Maybe. (Depends on if I actually notice any issues, or not ;-)
At the end of a 1/2 day of adding source packages and building them, I’ve got a command line prompt and a lot of “always there” utilities and stuff that are missing. This is normal. Eventually I’ll make a “build script” for adding all that stuff, too, but just realize the basic install is pretty basic. No X-windows, no browsers, no LibreOffice, etc. etc. That’s why I’m doing this posting from Arch instead.
The build process is not as user hostile as I’d expected, but not something a noobie will love to see the first time. In many ways, it is a like “pacman” or “apt-get” in having a simple command line and easy recipes. OTOH, you get screen after screen of “stuff” that will be meaningless to most folks who don’t regularly compile systems and applications source on Linux / Unix boxes. Yes, you can just ignore it… but then what’s the point of compilation on your box? Might as well just download a binary built for it… (For someone “like me”. the advantage is that I can read that stuff and see what code tosses lots of warnings, that you mostly ignore anyway, and set custom compile flags as I like it. Things like that “neon” and optimizer directives for things like memory vs speed.)
It is longer to add a package. Sometimes significantly. Oddly, most of the added time is in the emerge “setting up to make” steps and not in the actual compile times. The “cc” stages past quickly.
While I’m up ‘relatively quickly’ and that means I can “assess and move on” quickly, I’ve also built in a time deficit of “build and swap kernels” of about 6 to 8 hours for “someday” and potentially can’t get an X-window environment running until I do that. (There is a bit of a ‘here there be dragons’ about compiling X without the kernel swap in the pages, but that might just be ‘reasonable paranoia’ as opposed to real data… so I’m going to try it anyway ;-)
It is afflicted with color. The vi (vim) editor uses “helpful colors” to show you what different lines do, and incidentally make it near impossible for me to read the comments in a file as dark blue on black is, er, a challenge… Your command prompt has colors. The ls has colors… Yeah, I know, I can “fix it”, but just wish it was B/W by default.
The Good Bits
The UK Ginger page specifically shows how to set the compiler flag to use multiple cores. I did, and it did. At times, the usage meter in the upper right corner pegged at 100% for a few minutes. ( I was chroot Gentoo in one window, but inside an Arch X-widow wrapper, so had the meter running ;-)
This is Very Good News. This is the same box that would crash on 100% CPU under Debian. This IMHO shows it is NOT the chip (SOC ARM) that has an issue. It just cranked right on through the big compiles. I intend to do more extended parallel processing tests on Gentoo, as that is a particular interest of mine.
It uses the v7 and Neon bits. Every bit of optimization helps, and starting off by using all your instruction set and all your hardware math coprocessors is a good thing.
It looks like anything you want is available as a source package and is one “emerge foo” away. Just need to make that shopping list and wait while they compile. I now have a ‘someday’ project of finding out how much work it is to duplicate the source archive. In a really paranoid world, you grab a mirror of the source archive using somewhere that is hard to bugger (like a public access point or fresh bought wifi hotspot not tied to your name). Now anyone watching “your pipe” doesn’t know to redirect that ‘fetch’ to their buggered versions. From that point forward, you run builds from your own, private, source mirror and it can’t be intercepted. Not worried about that now, but someday maybe. Yes, you also do all the compares of hashes and validation of keys and all… but it is nice to only do that once, not on each package build.
It seems fast and snappy. Yes, all I had was one terminal open (even after the reboot to live). No testing yet, but just an impression.
I really like that they have you do a “chroot” into it under Raspbian. Indirectly you get instruction in how to be running Raspbian, then swap to Gentoo on the fly… Nice.
I really like they have you install to a USB disk. I used a real USB hard disk, but a stick would work too. Lets you leave the world of “SD card wear and corruption issues” if you like. I also suspect that the whole ‘write to disk’ stuff will be much faster (no more writing a 10kb block to change 1 byte…) There is just something more “right” about having a Linux running from a hard disk with real swap ;-) And likely faster too.
Overall the feel is ‘familiar’. Things like the init system is where it ought to be, and you edit the files I know and love to change settings. “Everything you know is right”, as opposed to what SystemD did to things.
The general impression is that this is a place where some folks with skilz live, and they have kept it tidy.
I likely have a couple of more days before I can launch a browser and post a comment. A long list of things (many unknown to me at the moment) will need to be installed first. This is a “bootstraps up” operation, not a prepackaged Ubuntu Snuggle Bunny. Puppy has me up and working in about a 10 minute install. This is likely to be 2 or 3 days to finally done. BUT, it will be done the way I like it, and with pretty much all hardware optimizations turned on.
For the next few weeks, at least, it will only be an “occasional runner” and most of what I’m doing will be from Arch. Arch is in some ways 1/2 way from Debian to Gentoo. It starts out command line only, like Gentoo, but you are about a 2 minute “pacman -S” away from X and a few more to a browser of your choice. Gentoo is a day or two instead. Raspbian is quick out of the box, but I’ve “had issues” with things like OpenMP being doggy, crashing when I ran all 4 cores to the wall (likely a memory manager issue), and being increasingly SystemD “Experienced Admin Hostile”. I’m just getting tired of “I’ll just add a line to…” turning into a few hours of “WTF, where did they hide THAT config.”
For now, I’d suggest Arch as the “1/2 way to techland” happy medium. Gentoo for the “done systems admin before and I like it” folks. Puppy made a strong showing in the latest build, so somebody was busy fixing it up. The graphics ar less crayon 3rd grade and more colored pencil Junior College Art Class. And Chrome works! It’s the only place on the Pi where I’ve found a working Chrome browser (so far… now that they have it working, the others ought to pick up the fixes quick). It is now my “go-to quick boot to check something” choice. Debian is good for folks wanting to just follow what the most folks are doing. More likely the “advice” you want will be on line somewhere (HOWEVER: there will now be two sets of advice… the pre-SystemD in large measure, and the “SystemD is different” slowly building). Ubuntu? Fedora? Both well made and for folks who like their particular styles. Ubuntu is a cleaned up Debian with Mint desktop added. Fedora is in corporate coat and tie and doesn’t want you messing around changing things from “their way”, yet when I need a tool to ‘just work’ like gparted, that’s the one I booted.
I will tend to use all of them at various times, since this is what I do for a living, and knowing them all is important to me. Also, too, each one has their own flavor, and sometimes you just want one over the other…
Per a Build Base: Right now, the short list is Arch, Gentoo, and LFS. I don’t have a favorite yet. I need to do a LFS build first, so I know what I’m comparing. Next week sometime. Gentoo is clearly in the “Yeah, it works, I can start from here” bucket. Arch is in the “I can probably start from here… where are those sources?”. Arch also may (probably will?) drop support for SysVinit “soon” as they have committed to SystemD (and I’m not); so it is less likely long term. Finally, LFS has sidestepped SystemD saying that it was causing so much change every day it was impossible to keep up (which is sort of my impression). However, I don’t know if ALL source packages are available to build a full service LFS box. Things like LibreOffice and Gimp? Don’t know… So some exploration needed there. For now “Gentoo will do it” and I need to finish a systems build out, then test drive it for a week or two to know keep vs toss.
That’s where I got to. More as more happens ;-)