BOINC x86 on 64bit

This page describes how to get an x86 version of Boinc running on an x86-64 system.

Why?
BOINC detects the GCC tuple used to compile it, and tells projects what it is so they can send the correct application. However, a number of projects have applications designed for 32-bit x86 without a 64-bit version. The result is that if BOINC is compiled on a 64-bit system, it will send the wrong tuple, and the application server will not distribute the application to it.

The way to get around this is to compile a 32-bit version of BOINC and run it in a jailroot, allowing the 32-bit applications to run in 32-bit compatible mode.

Overview
These instructions assume the user does not have a multilib profile enabled. If they did, they might become simpler, but should work anyway.

In general, here are the steps:


 * 1) Create a chrooted, 32-bit system.
 * 2) Compile BOINC and dependencies within that system.
 * 3) Create a jail root to run BOINC in.
 * 4) Copy BOINC and dependencies to the jailroot.
 * 5) Set up BOINC to the project.
 * 6) Start BOINC in the jailroot as user nobody.

Creating a 32-bit base system
This should be familiar to anyone who has installed Gentoo. Instructions are something like this:


 * 1) Create a new directory, say /var/boinc/newroot (referred to the rest of this tutorial).
 * 2) Download the latest i686/x86 stage 3 tarball and portage snapshot from your favorite mirror.
 * 3) Unpack it into a new root:

Now that you have a new root directory for a 32-bit system, enter a chroot and configure it:

Initial steps
Now you should be inside the chrooted enviornment. First, edit /etc/make.conf and do three things:


 * 1) Make sure that the CHOST variable is set to i686-pc-linux-gnu. The generic x86 stage 3 has it set differently. If it is, you may need to run in order to recompile necessary libraries.
 * 2) Check your use flags. Most notably, the zlib use flag and any networking related USE flag (ipv6, ssl, etc.) should be set the same as the 64-bit enviornment. Failure to do this may result in DNS, networking, or compression problems from BOINC later.
 * 3) Set your RSYNC and MAKEOPTS flags as desired.

Then, sync your portage tree:

If you got the latest version of portage, it shouldn't take too long.

Installing the necessary libraries
BOINC requires several packages not installed by default. They should be emerged now:

These will be copied to the jailroot at a later time.

Compiling BOINC
Rather than actually installing it, the ebuild utility will only prepare it for installation. This is because the files will only be copied to a jailroot later, and the chrooted system will not be preserved.

This should run successfully, leaving you with the image directory /var/tmp/portage/sci-misc/boinc-6.4.5-r1/image.

Now, exit the chrooted enviornment.

Installing the jailroot
Create a directory for the jailroot, such as /var/boinc/jailroot.

Copy all necessary libraries:

Copy necessary configuration files:

Add a limited version of the passwd and hosts file as follows:

Fool BOINC with a static version of the process and memory information.

Now copy the certificate list to the jailroot (for SSL):

Copy over the BOINC installed files themselves:

Also, create a directory for it to run in. If this isn't done, then it will run in the jailroot, and in searching for its files will segfault or run out of file handles.

And finally, fix permissions so that the nobody user (who will be running BOINC) can have full access:

Once the files are copied over, the 32-bit chrooted system is no longer necessary, and can be deleted.

Running BOINC
The way to run boinc_cmd and boinc_client (see manual pages for arguments) is to do this:

Where the BOINC_ARGS shell variable is set to the daemon's arguments.

The init script provided with the BOINC package will not work without modification outside the scope of this article.

Attaching to a project
Either a GUI tool or the command line tool can be used to configure BOINC. However, the command line tool must be run in the chrooted enviornment: