Open main menu

DAVE Developer's Wiki β

Changes

Managed Virtual Machine (MVM)

7,096 bytes removed, 17:28, 31 October 2023
FAQs
====Yocto-based Linux distribution====
 The typical development/deployment process basically consists of two stages: * editing/building/debugging code: during this stage, the target is connected via Ethernet LAN to host machine and is configured to ** Retrieve binary images (i.e. Linux kernel) via TFTP protocol** Mount the development root file system via NFS protocol. This root file system is physically in the file system of the host machine as depicted [[Deploying_Embedded_Linux_Systems#The_development_environment|here]].* deployment: the goal of this stage is to configure the target for normal operation, that is out of the development environment. A target root file system - optimized in terms of memory footprint - is used. This root file system is stored on target's non-volatile memory. To implement this workflow, MVM provides* TFTP server with <code>/tftpboot</code> as root directory [1]* NFS server configured to export <code>/home</code> on <code>192.168.0.0/24</code> network without root squash. [1]* target't development root file systems in <code>/home/dvdk/<target_name>/rfs/<kit_name></code>* cross-tool chain*Yocto SDK for cross-building (<code>/home/dvdk/<target_name>/sdk/<kit_name>/sysroots/</code>** by default, cross-tool chain is installed in <code>/home/dvdk/<targetname>/sdk/latest</code>. <code><targetname></code> is the name of the actual hardware platform (i.e. <code>lynx</code>, <code>axelulite</code> etc.).* target-specific sources** U-Boot bootloader** Linux kernel* [[Debugging_with_Eclipse_(MVM)|Eclipse/ADT integrated development environment]]. Part of these resources was generated by the Yocto build system, as depicted in the following picture.  [[File:Belk-yocto.png|thumb|center|600px|Simplified flow of Yocto-based building process]]  The Yocto-related resources included in the MVM allows the developer to:*Build U-Boot SPL/U-Boot individually*Build the Linux kernel individually*Build the Yocto BSP image, including the U-Boot, the Linux kernel, and the target root file system*Build the user application upon the Yocto SDK*Use a pre-built root file system image*Install on the target pre-built additional packages. These build processes make use of a pre-built cross-toolchain. To use it, the shell environment has to be set up properly first. To do this, just issue the following command:<pre>source /home/dvdk/env.sh</pre>  {{ImportantMessage|text=Technically speaking, the developer can run a Yocto-based full build process to (re)generate all the pre-built objects included in the MVM. However, this 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 MVM to perform such build. Using a physical machine is recommended instead. For more details on this, please refer to the specific documentation of your kit related to the advanced use of Yocto build system.}}   [1] For more details about TFTP and NFS servers on host side, please refer to this [[Setting_up_tftp_and_nfs|page]]. =====Building Yocto BSP images including the U-Boot, the Linux kernel, and the target root file system=====As known, Linux needs a root file system to operate: a root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). 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/. In general, the kit supports several root file system images. These images are generated by the BSP build process along with the U-Boot binary file and the Linux kernel image. The typical root file system images available are the following:*<code><target_name>-image</code> or <code><target_name>-core-image</code>**This is a minimal image that can be used as starting point for the production file system.*<code><target_name>-image-networking</code>**This is like the minimal image with the addition of the most common packages used to implement networking applications.*<code><target_name>-image-devel</code>**This is an image that includes a rich set of packages convenient for the development stage. Usually, the memory footprint of this image is significantly greater than the other ones.MVM includes one (or more) pre-built images. They are located here: <code>/home/dvdk/<target_name>/rfs/<kit_name></code>. Kit specific documentation describes how to build such images. The development kits that are based on Yocto are also released along with a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the <code>smart</code> tool. Please refer to the specific documentation of your kit to have more information about the use of this tool. For each supported target root file system image, there is an associated SDK. The pre-built SDKs included in the MVM are located here: <code>/home/dvdk/<target_name>/sdk</code>. The specific documentation of your kit indicates how to generate the SDKs. About C/C++ application development and debugging, please refer to [[Debugging_with_Eclipse_(MVM)Working_with_the_Yocto_build_system|this page]]. =====Building U-Boot and Linux kernel without Yocto build system=====In some cases, it is convenient to build the U-Boot and/or the Linux kernel without invoking the Yocto build system. For detailed instructions on how to build the U-Boot and the Linux kernel this way, please refer to the specific documentation of your kit. By default, the source files are installed in the following directories:*U-Boot: <code>/home/dvdk/<target_name>/u-boot</code>*Linux kernel: <code>/home/dvdk/<target_name>/linux</code>*MVM: <code>/home/dvdk/<target_name>/mvm/</code>.U-Boot and Linux sources were retrieved from public git repositories, during the creation process of the MVM. Again, the specific documentation of your kit indicates the addresses of these repositories.  {{ImportantMessage|text=Please note that access to DAVE Embedded Systems' git repositories is granted to development kit's owners only. Please refer to [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get access.}}  These sources can be kept in sync and up to date with DAVE Embedded Systems' repositories.Once the git account has been enabled, the developer can:*clone the repository with the <code>git clone <git_remote_repository></code> command *synchronize a source tree entering the repository directory and launching the <code>git fetch origin</code> command.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).  
====Android-based Linux distribution====
This section will be completed in a future version of this article.
*** change, depending on PC configuration, number of CPUs and/or RAM size
*** uncomment and set ip_adress to VM's ip address
** overwrite <code>provision/modules/user/filefiles/id_rsa</code> with your private key (eg: <code>cp ~/.ssh/<i>username@myhost.com</i> provision/modules/user/filefiles/id_rsa</code>): target name should be kept to <code>id_rsa</code>
* create the VM with the following command:
For example the next screenshot display an authorization error while connecting to DAVE git server:
 [[File:Mvm-sync git error unauthorized.png|thumb|center|600px]] 
{{ImportantMessage|text=Please note that usually <code>mvm-sync</code> needs to be run '''twice''': the first time to update the MVM repository, the second time to run the updated provision}}
vagrant up --provision --color
</pre>
== FAQs ==
Please go to [[MVM_FAQs|this page]].
 
== Known issues ==
Please go to [[MVM_known_issues|this page]].
4,650
edits