Template:Glsdk building yocto fs

=Building Yocto Filesystem=

Please ensure that the setup.sh script is run as described in Starting your software development section and answer 'yes' to fetch-sources prompt. Before building the filesystem, ensure that the svn, http, ftp and git proxies are set correctly. Refer to the following link for these settings https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy.

Add the Linaro cross-compile toolchain path in the PATH environment variable. host $ export PATH=/bin:$PATH

Run this command to as a one-time setup for the yocto build

host $ cd $INSTALL_DIR

'''NOTE: # Prior to running the setup-yocto.sh script, make sure that GCC Linaro cross compiler installation path and the CCS binary is downloaded into a particular directory # Update the ./bin/setup-yocto.sh file to indicate this path, the default path is set to /sdk/tools and this may vary on every machine. '''

host $ ./bin/setup-yocto.sh

For building core sdk, run the build-core-sdk.sh passing machine name as an argument.

host $ cd yocto-layers

Create a downloads directory (if building using Yocto for the first time), where the Yocto build will place the downloads. Note the path of the directory. host $ mkdir downloads

NOTE: Please pass the same downloads directory path to the following build-script when prompted

host $ ./build-core-sdk.sh dra7xx-evm

These scripts will build the tisdk-rootfs-image.

After build is complete the generated images can be found in yocto-layers/build/arago-tmp-external-linaro-toolchain/deploy/images/

Note: The build does not generate a uenv.txt. You need to copy it from the prebuilt binaries in the release.

Modifying source code and rebuilding a component
Once the Yocto setup is complete developers would like to modify a certain component source code and rebuild it. The source code for the generic components like omapdrmtest can be found in ${INSTALL_DIR}/yocto-layers/build/arago-tmp-external-linaro-toolchain/work/cortexa15hf-neon-linux-gnueabi/ Steps to rebuild: 1. Modify the source of the component in its work area 2. cd to yocto-layers host $ cd ${INSTALL_DIR}/yocto-layers 3. export PATH if not done previously: host $ export PATH=/bin:$PATH 4. Run one/combination of the folowing tasks: a. To configure and compile with the latest changes in the work area: host $ ./build-specific-recipe.sh  -f -c configure  host $ ./build-specific-recipe.sh  -f -c compile  For example, if the omapdrmtest source is modified and you want to generate only the binaries for dra7xx-evm, the compile task should suffice: host $ ./build-specific-recipe.sh  -f -c compile omapdrmtest The binaries will be present in the same folder as the source files. b. To generate .ipk package in addition to the binaries, following additional tasks need to be run after above steps: host $ ./build-specific-recipe.sh  -f -c install  host $ ./build-specific-recipe.sh  -f -c package  host $ ./build-specific-recipe.sh  -f -c package_write_ipk  This will generate .ipk packages for the recipe. They can be found in the deploy-ipks folder of the work area of the recipe. The .ipk packages can be copied and installed on the target by: target $ opkg install  This approach is useful in the case of recipes that generate a large number of binaries, that are difficult to copy manually, like gst-plugins-bad. c. During building and debugging the kernel or kernel modules, the compile_kmodules task needs to be executed that generates kernel modules. host $ ./build-specific-recipe.sh  -f -c compile_kmodules 

For a complete set of tasks that a specific recipe executes during its build, please refer to the log.task_order in the temp folder of the component. Pass the relevant tasks to build-specific-recipe.sh for required outcome.

5. For a robust solution, once the change in source area is tested with the above steps, please update the recipe. a. create a patch of the change b. copy it in the folder where the recipe is present c. add the patch name in the SRC_URI variable in the recipe The build-specific-recipe.sh recognizes the change in the recipe and builds it if required.

To build a specific component after recipe is updated, use the build-specific-recipe.sh

host $ ./build-specific-recipe.sh <MACHINE-NAME> <RECIPE NAME>

For example to build omapdrmtest: host $ ./build-specific-recipe.sh <MACHINE-NAME> omapdrmtest

MACHINE-NAME can be either omap5-evm or dra7xx-evm

To clean a specific component: host $ ./clean-specific-recipe.sh <MACHINE-NAME> <RECIPE NAME>