Yocto Project Development Manual Is for the 1.4.3 Release of the Yocto Project
Total Page:16
File Type:pdf, Size:1020Kb
Scott Rifenbark, Intel Corporation <[email protected]> by Scott Rifenbark Copyright © 2010-2014 Linux Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales [http://creativecommons.org/licenses/by-sa/2.0/uk/] as published by Creative Commons. Manual Notes • This version of the Yocto Project Development Manual is for the 1.4.3 release of the Yocto Project. To be sure you have the latest version of the manual for this release, go to the Yocto Project documentation page [http://www.yoctoproject.org/documentation] and select the manual from that site. Manuals from the site are more up-to-date than manuals derived from the Yocto Project released TAR files. • If you located this manual through a web search, the version of the manual might not be the one you want (e.g. the search might have returned a manual much older than the Yocto Project version with which you are working). You can see all Yocto Project major releases by visiting the Releases [https://wiki.yoctoproject.org/wiki/Releases] page. If you need a version of this manual for a different Yocto Project release, visit the Yocto Project documentation page [http://www.yoctoproject.org/ documentation] and select the manual set by using the "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE" pull-down menus. • To report any inaccuracies or problems with this manual, send an email to the Yocto Project discussion group at [email protected] or log into the freenode #yocto channel. Table of Contents 1. The Yocto Project Development Manual .................................................................................. 1 1.1. Introduction ................................................................................................................. 1 1.2. What This Manual Provides .......................................................................................... 1 1.3. What this Manual Does Not Provide ............................................................................. 1 1.4. Other Information ........................................................................................................ 2 2. Getting Started with the Yocto Project .................................................................................... 4 2.1. Introducing the Yocto Project ....................................................................................... 4 2.2. Getting Set Up ............................................................................................................ 4 2.3. Building Images ........................................................................................................... 7 2.4. Using Pre-Built Binaries and QEMU .............................................................................. 7 3. The Yocto Project Open Source Development Environment ...................................................... 9 3.1. Open Source Philosophy .............................................................................................. 9 3.2. Using the Yocto Project in a Team Environment ............................................................ 9 3.2.1. System Configurations ...................................................................................... 9 3.2.2. Source Control Management (SCM) ................................................................. 10 3.2.3. Autobuilders ................................................................................................... 11 3.2.4. Policies and Change Flow ............................................................................... 11 3.2.5. Summary ........................................................................................................ 12 3.3. Yocto Project Source Repositories ............................................................................... 12 3.4. Yocto Project Terms ................................................................................................... 14 3.5. Licensing ................................................................................................................... 17 3.6. Git ............................................................................................................................. 17 3.6.1. Repositories, Tags, and Branches .................................................................... 18 3.6.2. Basic Commands ............................................................................................ 19 3.7. Workflows .................................................................................................................. 20 3.8. Tracking Bugs ............................................................................................................ 22 3.9. How to Submit a Change ........................................................................................... 22 3.9.1. Using Scripts to Push a Change Upstream and Request a Pull .......................... 24 3.9.2. Using Email to Submit a Patch ........................................................................ 25 4. Common Development Models ............................................................................................. 27 4.1. System Development Workflow .................................................................................. 27 4.1.1. Developing a Board Support Package (BSP) ..................................................... 27 4.1.2. Modifying the Kernel ....................................................................................... 30 4.2. Application Development Workflow ............................................................................ 34 4.2.1. Workflow Using the ADT and Eclipse™ ............................................................ 34 4.2.2. Working Within Eclipse ................................................................................... 37 4.2.3. Workflow Using Stand-Alone Cross-Development Toolchains ............................. 46 4.3. Modifying Temporary Source Code ............................................................................. 47 4.3.1. Finding the Temporary Source Code ................................................................ 47 4.3.2. Using a Quilt Workflow ................................................................................... 48 4.3.3. Using a Git Workflow ...................................................................................... 49 4.4. Image Development Using Hob ................................................................................. 51 4.5. Using a Development Shell ........................................................................................ 51 5. Common Tasks ..................................................................................................................... 53 5.1. Understanding and Creating Layers ........................................................................... 53 5.1.1. Layers ............................................................................................................ 53 5.1.2. Creating Your Own Layer ................................................................................ 53 5.1.3. Enabling Your Layer ........................................................................................ 55 5.1.4. Using .bbappend Files ..................................................................................... 56 5.1.5. Prioritizing Your Layer ..................................................................................... 57 5.1.6. Managing Layers ............................................................................................ 57 5.1.7. Creating a General Layer Using the yocto-layer Script ..................................... 58 5.2. Customizing Images .................................................................................................. 59 5.2.1. Customizing Images Using Custom .bb Files .................................................... 60 5.2.2. Customizing Images Using Custom Package Groups ........................................ 60 5.2.3. Customizing Images Using Custom IMAGE_FEATURES and EXTRA_IMAGE_FEATURES ............................................................................................ 61 5.2.4. Customizing Images Using local.conf ........................................................... 61 5.3. Writing a Recipe to Add a Package to Your Image ....................................................... 62 5.3.1. Single .c File Package (Hello World!) ................................................................ 63 5.3.2. Autotooled Package ........................................................................................ 63 iii Yocto Project Development Manual 5.3.3. Makefile-Based Package .................................................................................. 64 5.3.4. Splitting an Application into Multiple Packages ................................................ 65 5.3.5. Post-Installation Scripts ................................................................................... 65 5.4. Adding a New Machine .............................................................................................. 66 5.4.1. Adding the Machine Configuration File ............................................................ 66 5.4.2. Adding a Kernel for the Machine ..................................................................... 66 5.4.3. Adding a Formfactor Configuration File ...........................................................