gentoo image builder script


3 posts
by kelnos » Mon Dec 24, 2012 8:03 am
Hey all -- so instead of looking around to see if there was already an active Gentoo RPi community, I foolishly went and did a bunch of the legwork myself. At any rate, I thought I'd share in case this is useful to anyone:

https://github.com/kelnos/genberrypi-builder

Basically you just run the script, and in the end (after a *very* long wait), you get a SD card image you can write out to an SD card to boot Gentoo. It's not perfect, and updates to packages in Portage might break it, but I've successfully built a few images using it.

I also didn't know about media-libs/raspberrypi-userland, and have included my own sys-libs/rpi-userland. It can build either from the 'master' or 'next' branch of the raspberrypi/userland repo on GitHub. If you choose to build the experimental stuff, it'll also build the 3.6.x kernel instead of the 'stable' 3.2.x kernel.

One of the things I've definitely done differently from the official raspberypi-userland ebuild is I install all the libraries and headers to /usr instead of /opt/vc. I really don't see a reason to use /opt/vc, esp since it's all built from source. The GL (etc.) libraries are also all managed with eselect-opengl (though there's a hack in there because eselect-opengl freaks out if there's no libGL.so, which of course we don't have on the RPi).

There's a fairly extensive README to get you started if you want to play with it.

Anyway, as I said, I hope people find it useful... at the very least, I learned a bit about how the RPi is set up by messing around with it.
Posts: 1
Joined: Mon Dec 24, 2012 7:56 am
by cil8 » Sun Jan 27, 2013 9:06 pm
Running Gentoo on RPi is somehow a nonsense, so... I decided to run your script. :-)

After more than 6 hours, I get this:

Code: Select all
Assembling root filesystem

Unpacking stage3 tarball... done.
Unpacking portage snapshot... done.
/var/tmp/portage/genberrypi-builder/overlays/rootfs /var/tmp/portage/genberrypi-builder
Copying rootfs overlay... done.
/var/tmp/portage/genberrypi-builder
/var/tmp/portage/genberrypi-builder/out/src/linux /var/tmp/portage/genberrypi-builder
Installing kernel modules & firmware... done.
/var/tmp/portage/genberrypi-builder
chroot: failed to run command 'emerge': No such file or directory


and there's no image in ./out/build . What am I doing wrong?

Another question: why 'sudo' is required even if the script is supposed to be run as root?
Posts: 89
Joined: Tue Feb 14, 2012 10:47 am
by baldyza » Sun Feb 10, 2013 7:03 pm
kelnos wrote:One of the things I've definitely done differently from the official raspberypi-userland ebuild is I install all the libraries and headers to /usr instead of /opt/vc. I really don't see a reason to use /opt/vc, esp since it's all built from source. The GL (etc.) libraries are also all managed with eselect-opengl (though there's a hack in there because eselect-opengl freaks out if there's no libGL.so, which of course we don't have on the RPi).

Nice work, one reason I can think of to keep or link /opt/vc is so gentoo is compatible with other RPi distributions. Being able to use eselect-opengl is a big win, how about submitting it to the raspberypi-userland maintainer?
Posts: 37
Joined: Fri Sep 21, 2012 11:23 am