Infrant Cross Compiler AMI

| | Comments (0) | TrackBacks (0)

Hoping to get myself a python binary that runs on my Infrant NAS device, I built out a cross compiler on an EC2 instance and created an AMI for it. Now I have a python sparc binary compiled on Linux with the Infrant patches for glibc.

And binaries for a number of other things I find useful.

And you can too!

First you need to boot my EC2 image in the 'infrant-crosscompiler' bucket. Just list all the public AMI images and it should show up. I find this FireFox plugin quite handy.

After logging in, just su - infrant and then cat README for an example on how to run ./configure for your source.

Likely the first thing you should also do is edit then execute . setenv.sh. But only if you aren't compiling python, as you must compile a local version first (see below for details).

That's pretty much it. All together it would look like this:

ssh -i .../...pem root@....
su - infrant

wget 'some source tarball'
tar -xzf 'some source tarball'

. setenv.sh

cd 'your source'

./configure --target=$TARGET --with-sysroot=$CROSS --host=$TARGET --prefix=$PREFIX
make
make install

cd $PREFIX

Then tar up that directory tree and pull down onto your Infrant. By default the path is /c/cross/usr/local. This way your installed apps can live on the raid array and survive an image upgrade.

Thanks to this article for providing the necessary instructions for building this out.

If you want to compile python, here's the voodoo. It's mostly based on this article. See that article for extended references on how/why this works and who's responsible, brilliant, all of them.

wget http://whatschrisdoing.com/~lambacck/Python2.5_xcompile.patch
wget http://www.python.org/ftp/python/2.5/Python-2.5.tgz
tar -xzf Python-2.5.tgz
cd Python-2.5
patch -p1 < ../Python2.5_xcompile.patch
./configure
make python Parser/pgen
mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean

. ../setenv.sh
./configure --target=$TARGET --with-sysroot=$CROSS --host=$TARGET --prefix=$PREFIX
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
make install HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=yes
make install HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=yes

Being a capitalist, I would charge a $1 for the use of this AMI. Mostly to feel clever and exercise the novelty of having a Paid AMI (announced in July), but Amazon hasn't given the common man the tools to provide one. After an email to their generic aws contact address, I got a response stating they would get back to me in 3 weeks, and to contact them again if they don't. Whatever...

So, feel free to drop me an email saying your using my AMI, along with any suggestions, so I can count the dollars I didn't make, oh, and keep the image fresh.

0 TrackBacks

Listed below are links to blogs that reference this entry: Infrant Cross Compiler AMI.

TrackBack URL for this entry: http://www.manamplified.org/cgi-bin/mt-tb.cgi/371

Leave a comment