Changes

Jump to: navigation, search

Build system (BELK/BXELK)

1,909 bytes removed, 10:06, 20 July 2017
Setting up the Linux development server environment
==Setting up the Linux development server environment==
During development, user the software developer needs to interact with the target system. This section describes the tools that must be installed and configured on the Linux host system for this purpose.   
===BELK 4.0.0 or newer, BXELK 2.0.0 or newer===
The Thanks to the use of the [[Managed Virtual Machine_(MVM)]] (the Basic version), the process of setting up the Linux development server is dramatically simplified with respect to the previous version versions of the kit. This is due to the use of the [[Managed Virtual Machine_(To put it simply, MVM)]] (the Basic version) that is a virtual machine containing all the tools required for the development of the software running on the target. To install it, please refer to [[VirtualBox_Starting_DVDK_Virtual_Machine#Using_a_.ova_file|this page]].
As described [[Managed_Virtual_Machine_(MVM)#Yocto-based_Linux_distribution|here]], MVM includes the resources–in resources—in terms of network services, cross-toolchain, etc.–to —to implement the development host shown [[Introduction_to_development_environment_(BELK/BXELK)#Overview|here]].
Part of these resources was generated by the Yocto build system, as depicted in the following picture.
TBDThe Yocto-related resources included in the MVM provided with the kit allows the developer to:*Build U-Boot SPL/U-Boot separately*Build the Linux kernel separately*Build user application upon the Yocto SDK*Use a pre-built root file system image*Install on the target pre-built additional packages.
====Pre-built Toolchain====To start developing software for the BORA/BORAX platform, users need The build processes mentioned above make use of a proper toolchain, which can be pre-built or builtcross-from-scratchtoolchain. Building a toolchain from scratch is not a trivial task (though using a recent build system is easier than in the past)To use it, so the recommended approach consists in using a pre-built toolchainshell environment has to be set up properly firstThe toolchain used as a reference for '''BELK-4.0.0''' and '''BXELK-2.0.0''' is builded using Yocto build system. Once the toolchain is installedTo do this, create a a bash script (<code>env.sh</code>) containing just issue the following linescommand:
<pre>
source <path_to_toolchain>/environment-setup-cortexa9hf-neon-xilinx-linux-gnueabiexport CC=gcc# clear LDFLAGS variable otherwise u-boot reports linker errorsunset LDFLAGShome/dvdk/env.sh
</pre>
For example, for the BELK-4.0.0/BXELK-2.0.0 MVM release, the variables are the following:
<pre>
# BELK/BXELK development environment for u-boot/kernel development
source /home/dvdk/bora/sdk/latest/environment-setup-cortexa9hf-neon-xilinx-linux-gnueabiexport CC=gcc# clear LDFLAGS variable otherwise u-boot reports linker errorsunset LDFLAGS</pre>Use the following command For detailed instruction on how to set up the environment shell variables required during the building procedure:<pre>source env.sh</pre> ====Prebuild U-built root file system====Linux needs a root file system: a root file system must contain everything needed to support Boot and the Linux system (applications, settings, data, ..). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the <code>/sbin/init</code>, the first user space process and "father" of all the other processes.For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/. BELK provides a pre-built root file system, that can be used during the evaluation/development phase, since it provides a rich set of packages for working with the BORA platform. Since this pre-built root file system is not generated using the same cross-toolchain used for building the BELK software components, we recommend to choose one of the following options:*if a native compiler is available on the root file system, go for native compilation instead of cross-compilation*when you cross-compile, rely on static linking and avoid dynamic linking against the root file system libraries*build your application using the same cross-toolchain (when available) used for building the root file systemPlease refer to [[Introduction_to_developing_environment_Building_U-Boot_(BELK/BXELK)#Target_root_file_system|this page]] and [[FAQs_Building_Linux_kernel_(BoraBELK/BXELK)#Q:_Why_my_cross-compiled_application_doesn.27t_work_with_the_pre-packaged_root_file_system_provided_with_BELK.3F|this FAQpage]] for further details====U-Boot, Linux kernel and Yocto BSP git repositories====Please note that BELK/BXELK source trees for U-Boot, Linux kernel and Yocto BSP are provided as git repositories, as detailed in the following table.
{| class="wikitable" border="1"
!Component
Please note that git fetch doesn't merge the commits on the current branch. To do that, the developer should run the <code>git merge</code> command or replace the ''fetch-merge'' process with a single <code>git pull</code> command. Please note that the recommended method is the ''fetch-merge'' process. For further information on Git, please refer to the official Git Documentation (http://git-scm.com/documentation).
====Using the pre-packaged git archive (BELK <= 3.0.0 only)====
BELK distribution provides (on request) the tar-gzipped archive of the .git directory of the repositories, so the user can immediately get access to the development trees (for example this is used when corporate security policies don't allow to use the git protocol).
Uncompressing {{ImportantMessage|text=Please note that the archive enables access whole build process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it is discouraged to use the hidden <code>MVM to perform such build.git</code> directories of the repositories; }} As known, Linux needs a root file system to operate: a root file system must contain everything needed to get support the source filesLinux system (applications, settings, data, ..). The root file system is the file system that is contained on the developer must enter same partition on which the project root directory (eg: <code>bora/linux-xlnxis located.git</code>) The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and launch finally launches the <code>git checkout <bora current branch>/sbin/init</code> command, like in the following examplesfirst user space process and "father" of all the other processes.For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/. *For uBELK provides one pre-bootbuilt root file system, that can be used during the evaluation/development phase since it provides a relatively rich set of packages for working with the BORA platform. This root file system is located here: <code>git checkout bora</code>*For linux: home/dvdk/<codetarget_name>git checkout bora</code>Once these steps are completed, rfs/<ukit_name>don't forget to update the repositories</ucode>, as described in [[#U-Boot and Linux git repositories|this section]].  
===BELK version up to 3.0.2, BXELK version up to 1.0.1===
4,650
edits

Navigation menu