If you are running the Linux distribution in TI’s Processor SDK, you’ve probably noticed that adding new packages using the apt-get utility is not an option. This post will show you how to use existing BitBake recipes and the OpenEmbedded framework to create software packages and install them on your BeagleBone Black.
The TI provided Linux distribution and Software Development Kit for the BeagleBone Black is created and packaged using the OpenEmbedded framework. In order to keep the file system size to a minimum, only a subset of the available packages are in the pre-built file system images. The ‘tree‘ program is an example of a package that does not exist on the BeagleBone Black out-of-the-box.
So, let’s build the ‘tree’ package and install it on our BeagleBone Black. The following steps come mainly from this wiki page and are being performed on a Ubuntu 14.04 development machine for the 126.96.36.199 version of the Linux Processor SDK.
Prepare your Ubuntu development machine to build packages:
sudo apt-get install git build-essential python diffstat texinfo gawk chrpath dos2unix wget unzip socat doxygen libc6:i386 libncurses5:i386 libstdc++6:i386 libz1:i386
tar -Jxvf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz -C $HOME
git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk_3_0_0_4
./oe-layertool-setup.sh -f configs/processor-sdk/processor-sdk-03.00.00.04-config.txt
Take a look inside the ‘configs/processor-sdk/processor-sdk-03.00.00.04-config.txt’ file we used above. This file contains a list of repositories along with specific branch names and commit IDs. The ‘oe-layertool-setup.sh’ script goes through this list of repositories, downloads them to the ’tisdk_3_0_0_4/sources/’ directory, and then checks out the commit ID specified in the configuration file. These repositories are full of BitBake recipes that specify the build process for everything from an individual package all the way up to a full SDK. The ‘processor-sdk-03.00.00.04.txt’ file also allows our Ubuntu development machine to return to the exact state of the repositories as when the Linux Processor SDK v188.8.131.52 was created so we can ensure that any packages we build will be compatible with our BeagleBone Black (since it using the file system provided in the Linux Processor SDK v184.108.40.206).
At this point, your Ubuntu development machine has all of the tools and repositories that it needs to BitBake new packages for the BeagleBone Black. The following steps can now be used to build any package that has an existing BitBake recipe in any of the repositories in the ’tisdk_3_0_0_4/sources/’ directory. Let’s BitBake the tree package:
sudo dpkg-reconfigure dash
(Select "no" when prompted)
MACHINE=am335x-evm bitbake tree
Now that we have built the tree package, we need to take the corresponding ipk file and copy it over to our BeagleBone Black and install it:
scp tree_1.7.0-r0_cortexa8hf-neon.ipk email@example.com:/home/root/
opkg install tree_1.7.0-r0_cortexa8hf-neon.ipk
That’s it! Now you have the tree program on your BeagleBone Black and you have the ability to BitBake hundreds of other packages. If you’d like to build and install a different package, just rerun the BitBake command, copy the ipk file to your BeagleBone Black, and install it using opkg.