Gentoo

There are some sunxi or A10 portage overlays floating around the net.

= Introduction = First a warning, if you are building on a system that has 'lensfun' installed, you cannot build u-boot. [] for example. OpenWRT has the same issue with u-boot.

sunxi-bsp
As descriped in the FirstSteps guide, Gentoo can be used just fine to build the sunxi-bsp. There are some dependencies however. Besides the obvious, git, a cross-compiler is needed. It is possible to use the pre-compiled linaro toolchain, but why would you?

Crosscompiler
Gentoo has the magnificent Embedded Handbook which describes in detail how to setup a cross compiler. The jist of it is emerge crossdev. Once crossdev is installed, it's time to build a crosscompiler. crossdev -S -P -v -t arm-pc-linux-gnueabi

If you wish to use uclibc instead of regular gnu-libc, you can do easily by replacing gnu with uclibc. crossdev -S -P -v -t arm-pc-linux-uclibceabi

This will build a cross-compiler using regular libc and the Embedded ABI (eabi) and by default uses hardfloat. If you wish to use softfloat, call crossdev with 'softfloat' in the vendor field. In the below example we use pc_softfloat but just softfloat is sufficient. crossdev -S -P -v -t arm-pc_softfloat-linux-gnueabi While building gcc with soft-float support is understandable, the A10 has hardfloat support, so usage of softfloats isn't necessary.

Any other combination of course is also possible, like using abi instead of eabi. See crossdev -t help for more information.

The resulting links will be installed into /usr/bin. On the case of an x86_64 host, you can find them on /usr/x86_64-pc-linux-gnu/arm-pc-linux-gnueabi/gcc-bin/

Dependencies
Besides the cross-compiler, u-boot-tool is needed to be able to build u-boot. It is optional for the kernel or any rootfs. Installing the final result onto an SD-Card requires sudo (even when running the final step as root) and sfdisk to partition the SD-Card from the script. Also partprobe is required to be able autodetect the newly created partitions, as sfdisk -R doesn't seem to work on Gentoo.

Building sunxi-bsp
For the rest the FirstSteps guide can be used as you would, just remember to pass CROSS_COMPILE=arm-pc-linux-gnueabi- to any make as a variable, e.g. make CROSS_COMPILE=arm-pc-linux-gnueabi- Equally it is possible to edit the default in the Makefile for the compiler used (not recommended) or install the toolchain as arm-linux-gnueabihf (not recommended either).

Debian
While Gentoo is an awesome distribution, and even using embedded Gentoo is quite possible, it isn't quite the easiest way. Also, having Gentoo natively on the A10 allows either to build all packages on a buildhost and turn Gentoo into a binary distro on the A10 or build natively, which is silly in terms of time used to compile, space required, etc. On the other hand, running embedded Debian isn't so bad, and even on Gentoo, we can use cross-deboostrap!

debootstrap
Debootstrap can be emerged quite easily on Gentoo. It is advised to remove the '-nls' USE flag to save some dependencies. If nls is heavily really required for deboostrap (I don't think the final rootfs is limited by it, but need to confirm) do set the flag of course.