久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

Yocto 環(huán)境搭建

 waston 2017-11-03

板,、工具和方法幫你創(chuàng)建定制的 Linux 系統(tǒng)和嵌入+式產(chǎn)品,,而無需關(guān)心硬件體系。適合嵌入式Linux開發(fā)人員使用。查看Yocto Project Quick Start

Yocto Project


相關(guān)術(shù)語

Poky

Poky是Yocto Project的參考發(fā)布版本,。它包括OpenEmbedded構(gòu)建系統(tǒng)(BitBake and OpenEmbedded Core)和一系列metadata,幫助開發(fā)者構(gòu)建自己的distro,。你可以下載Poky和使用它去逐步搭建自己的發(fā)布版本,。需要注意的是Poky不包括二進制文件,它是一個關(guān)于搭建編譯你自己制定的Linux發(fā)布版本的一個源代碼用例。


Bitbake

一種軟件組建自動化工具程式,,像所有的build工具一樣(比如make,,ant,jam)控制如何去構(gòu)建系統(tǒng)并且解決構(gòu)建依賴,。但是又區(qū)別于功能單一的工程管理工具(比如make),,bitbake不是基于把依賴寫死了的makefile,而是收集和管理大量之間沒有依賴關(guān)系的描述文件(這里我們稱為包的配方),,然后自動按照正確的順序進行構(gòu)建,。oe代表OpenEmbedded,而openembedded是一些用來交叉編譯,,安裝和打包的metadata(元數(shù)據(jù)),。會獲取*.bb文件中包的依賴關(guān)系的命令格式。


OpenEmbedded-Core

是一些腳本(shell和Python腳本)和數(shù)據(jù)構(gòu)成的自動構(gòu)建系統(tǒng),。


Metadata

Recipes(配方):(.bb/.bbappend)組件的邏輯單元的構(gòu)建規(guī)范,,用來獲取源代碼、構(gòu)建和打包組件,;
Class:(.bbclass)包括各個recipes之間共享的相同的功能,;
Configuration:(.conf)定義Poky如何的各種配置文件;
Layers:一系列相同的recipes,,就像meta-fsl-arm,。


i.MX 基于Yocto Project 環(huán)境搭建

下記內(nèi)容主要基于 i.MX_Yocto_Project_User’s_Guide.pdf進行整理。

簡介

Freescale provides an additional layer called the Freescale BSP Release, named meta-fsl-bsp-release, to integrate a new Freescale release with the FSL Yocto Project Community BSP.

Freescale i.MX boards are configured in the meta-fsl-bsp-release and meta-fsl-arm layers. This includes U-Boot, the Linux kernel, and reference board-specific details.

L4.1.15_2.0.0_ga is a Linux kernel that Freescale has released only for the Yocto Project.

Freescale L4.1.15_2.0.0_ga uses device trees. Device tree settings are found in the i.MX machine configuration files.

Graphics recipes integrate the Freescale graphics package release. For the i.MX boards that have a GPU, the imxgpu-viv recipes package the graphic components for each DISTRO – X11, frame buffer (FB), Xwayland,Wayland backend, and Weston compositor (Weston).

Freescales provideds a script, fsl-setup-release.sh, that simplifies the setup for i.MX machines. To use the script, the name of the specific machine to be built for needs to be specified as well as the graphical backend desired. The script sets up a directory and the configuration files for the specified machine and backend.

The Yocto Project build uses the bitbake command. For example, bitbake builds the named component. Each component build has multiple tasks, such as fetching, configuration, compilation, packaging, and deploying to the target rootfs. The bitbake image build gathers all the components required by the image and build in order of the dependency per task. The first build is the toolchain along with the tools required for the components to build.

If a new terminal window is opened or the machine is rebooted after a build directory is set up, the setup environment script should be used to set up the environment variables and run a build again. The full fsl-setup-release.sh is not needed.

$ source setup-environment

Aftera build is complete, the created image resides in /tmp/deploy/images. An image is, for the most part, specific to the machine set in the environment setup. Each image build creates a U-Boot, a kernel, and an image type based on the IMAGE_FSTYPES defined in the machine configuration file. Most machine configurations provide an SD card image (.sdcard), an ext3 and tar.bz2. The ext3 is the root file system only. The .sdcard image contains U-Boot, the kernel and the rootfs completely set up for use on an SD card.


Ubuntu下載編譯Yocto所需要的工具包

Essential Yocto Project host packages are:

#sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev
  • 1
  • 2

i.MX layers host packages for a Ubuntu 12.04 or 14.04 host setup are:

#sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
  • 1
  • 2
  • 3

i.MX layers host packages for a Ubuntu 12.04 host setup only are:

#sudo apt-get install uboot-mkimage
  • 1

i.MX layers host packages for a Ubuntu 14.04 host setup only are:

#sudo apt-get install u-boot-tools
  • 1

設(shè)置repo工具

設(shè)置repo工具


下載recipe layers

4,、下載recipe layers

下載之后,,在fsl-release-bsp/sources目錄下會有meta文件如下:
base meta-browser meta-fsl-arm meta-fsl-arm-extra meta-fsl-bsp-release meta-fsl-demos meta-openembedded meta-qt5 poky

每個文件夾里面存放著各個layers所需的文件來源信息。bitbake命令就是通過解析里面的文件來獲取并下載編譯所需的源代碼,。

layer


配置環(huán)境

DISTRO=fsl-imx-x11 MACHINE=imx6dlsabresd source fsl-setup-release.sh -b build-x11
  • 1

DISTRO指定的內(nèi)容標(biāo)記要生成的distribution,,固定為以下內(nèi)容的一個:
DISTRO

fsl-setup-release.sh腳本會根據(jù)MACHINE指定的內(nèi)容從sources/meta-fsl-arm/conf/machine里面的文件選擇對應(yīng)的.conf進行編譯。

-b選項指定配置和編譯的內(nèi)容存放的路徑放在build-x11,。
當(dāng)執(zhí)行該腳本之后,,會在build-x11/ 目錄下生成配置文件。

build-x11

build-x11/conf/local.conf會指定DL_DIR的內(nèi)容,,該路徑用于下載并保存編譯所需要的包,。在bitbake在編譯的時候會先去該路徑查看有沒有所需的包,如果沒有,,就從網(wǎng)上下載到該目錄下,。一般情況下這些包都是固定的,在團隊開發(fā)中可由一人先下載,,之后共享出來,,然后每個人將DL_DIR指定到該共享文件夾就可以省去網(wǎng)上下載的麻煩,。

local.conf

Build-x11/conf/bblayers.conf會指定所需要的layers。
layers

bitbake在啟動時會執(zhí)行bitbake.conf,,bitbake.conf會裝載用戶提供的local.conf,。然后根據(jù)用戶在local.conf中定義的硬件平臺MACHINE和發(fā)布目標(biāo)DISTRO裝載machine子目錄和distro子目錄的配置文件。machine子目錄里是硬件平臺相關(guān)的配置文件,。distro子目錄里是與發(fā)布目標(biāo)相關(guān)的配置文件,。配置文件負(fù)責(zé)設(shè)置bitbake內(nèi)部使用的環(huán)境變量。這些變量會影響整個構(gòu)建過程,。

每次新打開一個窗口,,都要進行一次source操作。

#source setup-environment <build-dir>
  • 1

編譯

執(zhí)行編譯之前,,先要在/home/VictorHuang/work/downloads執(zhí)行腳本./mk-empty-dir創(chuàng)建git關(guān)聯(lián)空的目錄,。正常使用 DL_DIR 下載到的包都是包括 .git 的目錄的,編譯的時候會去檢查 .git的內(nèi)容,。但是我們使用git管理并共享downloads/的內(nèi)容,,這里將 .git 相關(guān)的內(nèi)容給忽略掉。所以編譯之前要創(chuàng)建 .git 相關(guān)的空目錄,。
執(zhí)行

#bitbake image-name
  • 1

其中image-name的內(nèi)容為以下的一個:
image-name

執(zhí)行完畢之后會在build-x11/tmp/work-shared/imx6dlsabresd/kernel-source看到kernel的源代碼和
tmp/work/imx6dlsabresd-poky-linux-gnueabi/linux-imx/4.1.15-r0/git

build-x11/tmp/deploy/images目錄下會有編譯生成的所有images文件,。
在build-x11/tmp目錄下常見的目錄為:

http://blog.csdn.net/rocky_zhm/article/details/48266657
tmp目錄


U-Boot所在路徑

通用路徑為:
<builddirectory>/tmp/work/<machine>-poky-linuxgnueabi/u-boot-imx/<version>/git
比如為:
build-x11/tmp/work/imx6dlsabresd-poky-linux-gnueabi/u-boot-imx/2016.03-r0/git


單獨編譯某一模塊

#bitbake -c compile -f module-name
  • 1

-f是為了強制編譯
module-name 是模塊的名稱,這個名稱可以在 tmp/work/imx6dlsabresd-poky-linux-gnueabi/目錄下看,。

例如:想單獨編譯一下kernel,,可以用以下命令。

#bitbake -c compile -f linux-imx
  • 1

編譯后重新發(fā)布:

#bitbake -c deploy module-name
  • 1

例如:

#bitbake -c deploy linux-imx
  • 1

查看列表

#bitbake -c listtasks linux-imx
  • 1

mk-empty-dir腳本

#!/bin/sh
# version 0.1
REVERSION=0.1
# copy right bingge
# --- History ---
# v0.1 init version

if [ "$1" = "--version" -o "$1" = "-V" ]; then
  echo -e "\033[32mVersion: $REVERSION\033[0m"
  exit 1
fi

cd git2
ls | grep \.done -v > .tmp # ignore .done file and cat to .tmp file

for line in $(cat .tmp)
do
    #echo "File: ${line}"
  if [ -d ${line}/objects ]; then
    mkdir -p ${line}/branches
    mkdir -p ${line}/objects/info
    mkdir -p ${line}/refs/heads
    mkdir -p ${line}/refs/tags
  elif [ -d ${line}/common.git/objects ]; then
    mkdir -p ${line}/common.git/branches

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點擊一鍵舉報,。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多