AI OS compilation history
From AlwaysInnovating
This page describes the old tutorial to cross compile AIOS. Read the new page here.
Note: If you don't want to use OpenEmbedded, you can also build separately the kernel with u-boot and x-load, following these instructions.
If you're looking at building your own application rather than the whole AIOS, please follow this tutorial.
Setting Up the Build Environment
In order to compile the AI OS, you need to follow those steps on an Ubuntu 9.04 x86 machine:
You need to install the required packages for Openembedded:
sudo -s apt-get install sed wget cvs subversion git-core coreutils unzip texi2html texinfo libsdl1.2-dev \ docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ libxml2-utils \ python-psyco docbook python-gobject-dev python-gtk2-dev m4 git subversion mercurial gtk-doc-tools \ tofrodos comerr-dev bitbake uboot-mkimage exit
You also need to install bitbake version 1.8.18 or latet. Debian/Ubuntu Packages Source.
Check that /bin/sh (ls -l /bin/sh) is not symbolically linked to dash. "dash" is a POSIX compliant shell that is much smaller than "bash" -- however some broken shell scripts still make use of bash extensions while calling into /bin/sh. To work around this issue call "sudo dpkg-reconfigure dash" and select No when it asks you to install dash as /bin/sh.
To cross-compile eog on Openembedded, you need the following fix on your Ubuntu 9.04, 9.10, 10.04 x86 machine:
sudo -s cd /usr/share/pygtk/2.0 ln -s /usr/share/pygobject/2.0/codegen/ codegen exit
Additionally for Ubuntu 9.10, you need to do the following:
sudo -s apt-get install gcc-4.3 g++-4.3 cpp-4.3 ln -sf /usr/bin/gcc-4.3 /usr/bin/gcc ln -sf /usr/bin/g++-4.3 /usr/bin/g++ ln -sf /usr/bin/cpp-4.3 /usr/bin/cpp exit
You need as well to append the following line to /etc/sysctl.conf on 9.04 or 9.10, then reboot:
vm.mmap_min_addr = 0
You need to clone the ai openembedded tree. It needs to be in a /OE folder as there are a few absolute paths:
sudo -s mkdir /OE chown your_username:your_username /OE exit cd /OE mkdir /OE/TI mkdir /OE/private git clone git://git.alwaysinnovating.com/ai.openembedded.dev mkdir /OE/build cp -a /OE/ai.openembedded.dev/ai/conf/ /OE/ai.openembedded.dev/ai/source-me.txt /OE/build
Building Images
You can now launch the compilation (don't run bitbake as root):
cd /OE/build source /OE/build/source-me.txt bitbake -k --verbose ai-dev-image
Building the image will require about 150GB of disk space. You can reduce this to about 30GB by adding
INHERIT += "rm_work"
to build/conf/local.conf. This will remove unnecessary files after building a package.
Building Packages
Building individual packages for distribution or testing is certainly possible:
cd /OE/build source /OE/build/source-me.txt bitbake ai-daemon
Constructed .ipk files can be found under /OE/build/tmp/deploy/glibc/ipk/armv7a/*.ipk
