Changes

Jump to: navigation, search

Advanced use of Yocto build system (BELK/BXELK)

7 bytes removed, 11:18, 30 October 2015
no edit summary
*Make sure that all the prerequisites are met
*Initialize the build environment, as described in [[#Initializing the build environment|here]].
*Optionally ensure the <code>conf/local.conf</code> configuration file, which is found in the Build Directory, is set up how you want it. This file defines many aspects of the build environment including the target machine architecture through the <code>MACHINE</code> variable, the development machine's processor use through the <code>BB_NUMBER_THREADS</code> and <code>PARALLEL_MAKE</code> variables, and a centralized tarball download directory through the <code>DL_DIR</code> variable.*Build the image using the <code>bitbake</code> command. For more information about BitBake, please refer to the BitBake User Manual.
==Prerequisites==
The following prerequisites are required and only . They need to be done onceonly.
Some generic development tools are required on the host Linux machine:
*<code>git</code>*<code>curl</code>*<code>build-essential</code>*<code>diffstat</code>*<code>texinfo</code>*<code>gawk</code>*<code>chrpath</code>*<code>ia32-libs </code> (if the host machine is running a 64-bit OS)*<code>python-m2crypto</code>.
These packages can be installed with the following command:
<code>sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm</code>.It is also recommended to switch the system shell from Ubuntu's standard dash to more universal bash:<code>:~$ sudo dpkg-reconfigure dash</code>
==Initializing the build environment==
In the BELK, we have simplified the Yocto initialization phase, relying on the <code>repo </code> tool and on a BORA bsp BSP git repository, so that the initialization can be completed with a few commands as reported below:<pre>
:~$ mkdir belk && cd belk
:~/belk$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
:~/belk$ ./repo init -u git@git.dave.eu:dave/bora/bora-bsp.git -b bora
:~/belk$ ./repo sync
</pre>
==Build the Yocto image==
Please note that even building the basic root file system requires a few hours to complete the process on a mid-hi range desktop PC (4-6 cores, 8-12 GiB RAM), also depending on the Internet connection speed (all source are fetched from the network). Nearly 20GiB of disk space is required for the build.
Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:
<pre>
:~$ cd ~/belk
:~/belk$ source bora-bsp-init-env.sh build
:~/belk/build$ bitbake base-rootfs-image
Please note that even the basic root file system requires a few hours to build on a mid-hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build</pre>. The resulting files (kernel, devicetree and u-boot binaries, plus .tar.gz root file system) will then be available inside <code>build/tmp/deploy/images/bora</code>.
==Build additional packages==
To build additional packages the user must first enter the directory where the <code>bora-bsp-init-env.sh </code> is placed and source it:<pre>
:~$ cd ~/belk
:~/belk$ source bora-bsp-init-env.sh build
</pre>And then he/she can run any of the bitbake commands:<pre>
:~/belk/build$ bitbake memtester
</pre>The resulting packages (the default format is ipk) can be found inside <code>build/tmp/deploy/ipk</code>.
4,650
edits

Navigation menu