没有合适的资源?快使用搜索试试~ 我知道了~
首页yocto 超详细教程,看完必会搭建linux系统
Yocto:Yocto是这个开源项目的名称,该项目旨在帮助我们自定义Linux系统 Poky:Poky有两个含义。第一个含义是用来构建Linux的构建系统,值得注意的该Poky仅仅是一个概念,而非一个实体:它包含了 BitBake工具、编译工具链、BSP、诸多程序包或层,可以认为Poky即是Yocto的本质;此外Poky还有另外一层意思,使用Poky系统得到的默认参考 Linux 发行版也叫Poky(当然,我们可以对此发行版随意命名)。 很有用的yocto教程,看完包会
资源详情
资源推荐
Scott Rifenbark
Scotty's Documentation Services, INC
<srifenbark@gmail.com>
Copyright © 2010-2019 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 as published by Creative Commons.
Manual Notes
• This version of the Yocto Project Mega-Manual is for the 2.7 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 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 page. If you need a
version of this manual for a different Yocto Project release, visit the Yocto Project documentation page 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 yocto@yoctoproject.com or log into the freenode #yocto channel.
Revision History
Revision 1.8 April 2015
Released with the Yocto Project 1.8 Release.
Revision 2.0 October 2015
Released with the Yocto Project 2.0 Release.
Revision 2.1 April 2016
Released with the Yocto Project 2.1 Release.
Revision 2.2 October 2016
Released with the Yocto Project 2.2 Release.
Revision 2.3 May 2017
Released with the Yocto Project 2.3 Release.
Revision 2.4 October 2017
Released with the Yocto Project 2.4 Release.
Revision 2.5 May 2018
Released with the Yocto Project 2.5 Release.
Revision 2.6 November 2018
Released with the Yocto Project 2.6 Release.
Revision 2.7 May 2019
Released with the Yocto Project 2.7 Release.
Abstract¶
The Yocto Project Mega-Manual is a concatenation of the published Yocto Project HTML manuals along with the corresponding BitBake
User Manual for the given release. The Mega-Manual exists to help users efficiently search for strings across the entire Yocto Project
documentation set inclusive of the BitBake User Manual.
1/498Yocto Project Mega-Manual
2019/
5/
6
https://www.yoctoproject.org/docs/current/mega
-
manual/mega
-
manual.html
Yocto Project Quick Build¶
Copyright © 2010-2019 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 as published by Creative Commons.
Abstract¶
1. Welcome!¶
Welcome! This short document steps you through the process for a typical image build using the Yocto Project. The document also
introduces how to configure a build for specific hardware. You will use Yocto Project to build a reference embedded OS called Poky.
Notes
• The examples in this paper assume you are using a native Linux system running a recent Ubuntu Linux
distribution. If the machine you want to use Yocto Project on to build an image (build host) is not a native
Linux system, you can still perform these steps by using CROss PlatformS (CROPS) and setting up a Poky
container. See the Setting Up to Use CROss PlatformS (CROPS)" section in the Yocto Project Development
Tasks Manual for more information.
• You cannot use a build host that is using the Windows Subsystem for Linux (WSL). The Yocto Project is not
compatible with WSL.
If you want more conceptual or background information on the Yocto Project, see the Yocto project Overview and Concepts Manual.
2. Compatible Linux Distribution¶
Make sure your build host meets the following requirements:
• 50 Gbytes of free disk space
• Runs a supported Linux distribution (i.e. recent releases of Fedora, openSUSE, CentOS, Debian, or Ubuntu). For a list of Linux
distributions that support the Yocto Project, see the "Supported Linux Distributions" section in the Yocto Project Reference Manual. For
detailed information on preparing your build host, see the "Preparing the Build Host" section in the Yocto Project Development Tasks
Manual.
•
◦ Git 1.8.3.1 or greater
◦ tar 1.27 or greater
◦ Python 3.4.0 or greater.
If your build host does not meet any of these three listed version requirements, you can take steps to prepare the system so that you
can still use the Yocto Project. See the "Required Git, tar, and Python Versions" section in the Yocto Project Reference Manual for
information.
3. Build Host Packages¶
You must install essential host packages on your build host. The following command installs the host packages based on an Ubuntu
distribution:
Note
For host package requirements on all supported Linux distributions, see the "Required Packages for the Build
Host" section in the Yocto Project Reference Manual.
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
xterm
4. Use Git to Clone Poky¶
Once you complete the setup instructions for your machine, you need to get a copy of the Poky repository on your build host. Use the
following commands to clone the Poky repository.
$ git clone git://git.yoctoproject.org/poky
Cloning into 'poky'...
remote: Counting objects: 432160, done.
remote: Compressing objects: 100% (102056/102056), done.
remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
2/498Yocto Project Mega-Manual
2019/
5/
6
https://www.yoctoproject.org/docs/current/mega
-
manual/mega
-
manual.html
Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
Resolving deltas: 100% (323116/323116), done.
Checking connectivity... done.
Move to the poky directory and take a look at the tags:
$ cd poky
$ git fetch --tags
$ git tag
1.1_M1.final
1.1_M1.rc1
1.1_M1.rc2
1.1_M2.final
1.1_M2.rc1
.
.
.
yocto-2.5
yocto-2.5.1
yocto-2.5.2
yocto-2.6
yocto-2.6.1
yocto-2.6.2
yocto-2.7
yocto_1.5_M5.rc8
For this example, check out the branch based on the yocto-2.7 release:
$ git checkout tags/yocto-2.7 -b my-yocto-2.7
Switched to a new branch 'my-yocto-2.7'
The previous Git checkout command creates a local branch named my-yocto-2.7. The files available to you in that branch exactly match
the repository's files in the "warrior" development branch at the time of the Yocto Project yocto-2.7 release.
For more options and information about accessing Yocto Project related repositories, see the "Locating Yocto Project Source Files" section
in the Yocto Project Development Tasks Manual.
5. Building Your Image¶
Use the following steps to build your image. The build process creates an entire Linux distribution, including the toolchain, from source.
Note
• If you are working behind a firewall and your build host is not set up for proxies, you could encounter
problems with the build process when fetching source code (e.g. fetcher failures or Git failures).
• If you do not know your proxy settings, consult your local network infrastructure resources and get that
information. A good starting point could also be to check your web browser settings. Finally, you can find
more information on the "Working Behind a Network Proxy" page of the Yocto Project Wiki.
1. Initialize the Build Environment: From within the poky directory, run the oe-init-build-env environment setup
script to define Yocto Project's build environment on your build host.
$ cd ~/poky
$ source oe-init-build-env
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.
You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.
The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
Among other things, the script creates the Build Directory, which is build in this case and is located in the Source Directory.
After the script runs, your current working directory is set to the Build Directory. Later, when the build completes, the Build
Directory contains all the files created during the build.
2. Examine Your Local Configuration File: When you set up the build environment, a local configuration file named
local.conf becomes available in a conf subdirectory of the Build Directory. For this example, the defaults are set to
build for a qemux86 target, which is suitable for emulation. The package manager used is set to the RPM package manager.
3/498Yocto Project Mega-Manual
2019/
5/
6
https://www.yoctoproject.org/docs/current/mega
-
manual/mega
-
manual.html
Tip
You can significantly speed up your build and guard against fetcher failures by using mirrors. To use
mirrors, add these lines to your local.conf file in the Build directory:
SSTATE_MIRRORS = "\
file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \
file://.* http://sstate.yoctoproject.org/2.6/PATH;downloadfilename=PATH \n \
file://.* http://sstate.yoctoproject.org/2.7/PATH;downloadfilename=PATH \n \
"
The previous examples showed how to add sstate paths for Yocto Project 2.6, 2.7, and a development
area. For a complete index of sstate locations, see http://sstate.yoctoproject.org/.
3. Start the Build: Continue with the following command to build an OS image for the target, which is core-image-sato
in this example:
$ bitbake core-image-sato
For information on using the bitbake command, see the "BitBake" section in the Yocto Project Overview and Concepts
Manual, or see the "BitBake Command" section in the BitBake User Manual.
4. Simulate Your Image Using QEMU: Once this particular image is built, you can start QEMU, which is a Quick EMUlator that
ships with the Yocto Project:
$ runqemu qemux86
If you want to learn more about running QEMU, see the "Using the Quick EMUlator (QEMU)" chapter in the Yocto Project
Development Tasks Manual.
5. Exit QEMU: Exit QEMU by either clicking on the shutdown icon or by typing Ctrl-C in the QEMU transcript window from
which you evoked QEMU.
6. Customizing Your Build for Specific Hardware¶
So far, all you have done is quickly built an image suitable for emulation only. This section shows you how to customize your build for
specific hardware by adding a hardware layer into the Yocto Project development environment.
In general, layers are repositories that contain related sets of instructions and configurations that tell the Yocto Project what to do.
Isolating related metadata into functionally specific layers facilitates modular development and makes it easier to reuse the layer
metadata.
Note
By convention, layer names start with the string "meta-".
Follow these steps to add a hardware layer:
1. Find a Layer: Lots of hardware layers exist. The Yocto Project Source Repositories has many hardware layers. This example adds
the meta-altera hardware layer.
2. Clone the Layer Use Git to make a local copy of the layer on your machine. You can put the copy in the top level of the copy of
the Poky repository created earlier:
$ cd ~/poky
$ git clone https://github.com/kraj/meta-altera.git
Cloning into 'meta-altera'...
remote: Counting objects: 25170, done.
remote: Compressing objects: 100% (350/350), done.
remote: Total 25170 (delta 645), reused 719 (delta 538), pack-reused 24219
Receiving objects: 100% (25170/25170), 41.02 MiB | 1.64 MiB/s, done.
Resolving deltas: 100% (13385/13385), done.
Checking connectivity... done.
The hardware layer now exists with other layers inside the Poky reference repository on your build host as meta-altera
and contains all the metadata needed to support hardware from Altera, which is owned by Intel.
3. Change the Configuration to Build for a Specific Machine: The MACHINE variable in the local.conf file specifies
the machine for the build. For this example, set the MACHINE variable to "cyclone5". These configurations are used:
https://github.com/kraj/meta-altera/blob/master/conf/machine/cyclone5.conf.
Note
See the "Examine Your Local Configuration File" step earlier for more information on configuring the
build.
4. Add Your Layer to the Layer Configuration File: Before you can use a layer during a build, you must add it to your
bblayers.conf file, which is found in the Build Directory's conf directory.
Use the bitbake-layers add-layer command to add the layer to the configuration file:
$ cd ~/poky/build
$ bitbake-layers add-layer ../meta-altera
NOTE: Starting bitbake server...
Parsing recipes: 100% |##################################################################| Time: 0:00:32
Parsing of 918 .bb files complete (0 cached, 918 parsed). 1401 targets, 123 skipped, 0 masked, 0 errors.
You can find more information on adding layers in the "Adding a Layer Using the bitbake-layers Script" section.
4/498Yocto Project Mega-Manual
2019/
5/
6
https://www.yoctoproject.org/docs/current/mega
-
manual/mega
-
manual.html
Completing these steps has added the
meta-altera
layer to your Yocto Project development environment and configured it to
build for the "cyclone5" machine.
Note
The previous steps are for demonstration purposes only. If you were to attempt to build an image for the
"cyclone5" build, you should read the Altera README.
7. Creating Your Own General Layer¶
Maybe you have an application or specific set of behaviors you need to isolate. You can create your own general layer using the
bitbake-layers create-layer command. The tool automates layer creation by setting up a subdirectory with a
layer.conf configuration file, a recipes-example subdirectory that contains an example.bb recipe, a licensing file,
and a README.
The following commands run the tool to create a layer named meta-mylayer in the poky directory:
$ cd ~/poky
$ bitbake-layers create-layer meta-mylayer
NOTE: Starting bitbake server...
Add your new layer with 'bitbake-layers add-layer meta-mylayer'
For more information on layers and how to create them, see the "Creating a General Layer Using the bitbake-layers Script"
section in the Yocto Project Development Tasks Manual.
8. Where To Go Next¶
Now that you have experienced using the Yocto Project, you might be asking yourself "What now?" The Yocto Project has many sources
of information including the website, wiki pages, and user manuals:
• Website: The Yocto Project Website provides background information, the latest builds, breaking news, full development
documentation, and access to a rich Yocto Project Development Community into which you can tap.
• Developer Screencast: The Getting Started with the Yocto Project - New Developer Screencast Tutorial provides a 30-minute video
created for users unfamiliar with the Yocto Project but familiar with Linux build hosts. While this screencast is somewhat dated, the
introductory and fundamental concepts are useful for the beginner.
• Yocto Project Overview and Concepts Manual: The Yocto project Overview and Concepts Manual is a great place to start to learn
about the Yocto Project. This manual introduces you to the Yocto Project and its development environment. The manual also provides
conceptual information for various aspects of the Yocto Project.
• Yocto Project Wiki: The Yocto Project Wiki provides additional information on where to go next when ramping up with the Yocto
Project, release information, project planning, and QA information.
• Yocto Project Mailing Lists: Related mailing lists provide a forum for discussion, patch submission and announcements. Several
mailing lists exist and are grouped according to areas of concern. See the "Mailing lists" section in the Yocto Project Reference Manual
for a complete list of Yocto Project mailing lists.
• Comprehensive List of Links and Other Documentation: The "Links and Related Documentation" section in the Yocto Project
Reference Manual provides a comprehensive list of all related links and other user documentation.
Chapter 1. The Yocto Project Overview and Concepts Manual¶
1.1. Welcome
1.2. Other Information
1.1. Welcome¶
Welcome to the Yocto Project Overview and Concepts Manual! This manual introduces the Yocto Project by providing concepts, software
overviews, best-known-methods (BKMs), and any other high-level introductory information suitable for a new Yocto Project user.
The following list describes what you can get from this manual:
• Introducing the Yocto Project: This chapter provides an introduction to the Yocto Project. You will learn about features and
challenges of the Yocto Project, the layer model, components and tools, development methods, the Poky reference distribution, the
OpenEmbedded build system workflow, and some basic Yocto terms.
• The Yocto Project Development Environment: This chapter helps you get started understanding the Yocto Project development
environment. You will learn about open source, development hosts, Yocto Project source repositories, workflows using Git and the
Yocto Project, a Git primer, and information about licensing.
5/498Yocto Project Mega-Manual
2019/
5/
6
https://www.yoctoproject.org/docs/current/mega
-
manual/mega
-
manual.html
剩余497页未读,继续阅读
好好学习!
- 粉丝: 28
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功