i.MX6 Yocto工程简介与分析

i.MX6Yocto工程简介与分析

按照NXP官方网站的说法,i.MX6的源码都发布在Yocto Project Freescale i.MX6 release工程里了。The FSL Yocto Project Community BSP (freescale.github.io)是一个社区驱动的在Yocto Project里提供相关i.MX6单板支持和维BoardSupport Packagemetalayer社区。使用OpenEmbedded-CorePoky Yocto版本,提供如下主要3个主要meta layer

meta-freescale: 提供基本BSP支持。

meta-freescale-3rdparty: 第三方和合作伙伴板级支持。

meta-freescale-distro: 提供和版本发布、包管理相关的支持。

 

该社区最近发布的版本为2.0版本Jethro(对于imx-4.0)、2.1版本Krogoth (对于imx-4.1)和2.2版本Morty (对于imx-4.2)。我们选用imx-4.1.15-2.0.0这个稳定分支。

 

1、YoctoProject简介

术语 yocto 是最小的SI 单元。作为一个前缀,yocto表示10^-24。YoctoProject是一个开源的协作软件,提供模板、工具和方法帮你创建定制的 Linux 系统和嵌入式产品,而无需关心硬件体系,支持ARM, PPC, MIPS,x86 (32 & 64 bit)硬件体系架构。适合嵌入式Linux开发人员使用。查看Yocto Project Quick Start

在整个Yocto Project中,这些部分被称为项目,包括构建工具、称为核心配方的构建指令元数据、库、实用程序和图形用户界面 (GUI)。

PokyYoctoProject的参考发布版本。它包括OpenEmbedded构建系统(BitBake and OpenEmbedded Core)和一系列metadata,帮助开发者构建自己的distroPoky 这一名称也指使用参考构建系统得到的默认 Linux 发行版,它可能极其小 (core-image-minimal),也可能是带有 GUI 的整个Linux 系统 (core-image-sato),它是一个关于搭建编译你自己制定的Linux发布版本的一个源代码用例。

 

BitBake 是一个构建引擎,像所有的build工具一样(比如makeantjam)控制如何去构建系统并且解决构建依赖。BitBake不是基于固定依赖关系的makefile,而是收集和管理大量没有依赖关系的描述文件(称为包的配方recipes),然后自动按照正确的顺序进行构建。它读取recipes配方并通过获取程序包来密切关注它们、构建它们并将结果纳入可引导映像。BitBakeYocto ProjectOpenEmbedded 项目共同维护。

 

 OpenEmbedded,简称OE,它用来构建和管理嵌入式开发系统(交叉编译、安装、打包)2004年10月7日ChrisLarson把OE分成了两个项目。一个是BitBake(构建任务的执行者),一个是OpenEmbedded(实际上是为BitBake提供元数据)。YoctoProject使用的OE称为OpenEmbedded-Core,是一些脚本(shellPython脚本)和用来交叉编译、安装和打包的metadata(元数据)构成的自动构建系统。

 

metadata元数据集按层进行排列,每一层都可以为下面的层提供单独的功能。基层是 OpenEmbedded-Coreoe-core,提供了所有构建项目所必需的常见配方、类和相关功能。然后可以通过在 oe-core 之上添加新层来定制构建。OpenEmbedded-Core 由Yocto Project 和 OpenEmbedded 项目共同维护。将 Yocto ProjectOpenEmbedded 分开的层是meta-yocto 层,该层提供了 Poky 发行版配置和一组核心的参考 BSP

metadata元数据集包含如下部分:

recipes(配方):(.bb/.bbappend)组件的逻辑单元的构建规范,用来获取源代码、构建和打包组件;

class:(.bbclass)包括各个recipes之间共享的相同的功能;

configuration:(.conf)定义Poky如何的各种配置文件;

layers:一系列相同的recipes,就像meta-fsl-arm

 

板卡支持包BSP含为特定板卡或架构构建 Linux 必备的基本程序包和驱动程序。这通常由生产板卡的硬件制造商维护。

 

2、Freescalei.MX6 Yocto Project搭建

a)基本软硬件环境要求

虽然按照《i.MX Yocto Project User's Guide》中所说Ubuntu 12.04和14.04版本均可,但是为了以后升级和维护的便利,强烈建议使用14.04版本!内存要2G以上(注意不是包括2G,因为内存太小编译可能有问题),磁盘空间至少80G以上,推荐120GCPU至少双核。强烈不推荐虚拟机的方式,直接在硬盘上安装Ubuntu,除非你的磁盘性能很高。

 

b)建立Ubuntu 14.04所需要的包

建立Ubuntu 14.04开发包之前,最好把UbuntuSoftwareUpdater里更新到最新。

sudo apt-get update

sudo apt-get install gawk wget git-corediffstat unzip texinfo gcc-multilib \

build-essential chrpath socatlibsdl1.2-dev

 

sudo apt-get install libsdl1.2-devxterm sed cvs subversion coreutils texi2html \

docbook-utils python-pysqlite2 help2manmake gcc g++ desktop-file-utils \

libgl1-mesa-dev libglu1-mesa-devmercurial autoconf automake groff curl lzop asciidoc

 

sudo apt-get install u-boot-tools

 

c)下载repo

mkdir ~/bin (this step may not beneeded if the bin folder already exists)

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo> ~/bin/repo

参考文档1给出的地址需要翻墙才能下载,所以换个地址:

curlhttp://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > ~/bin/repo

chmod a+x ~/bin/repo

vi ~/.bashrc 在尾部加:

export PATH=~/bin:$PATH

 

d)配置git

git config --global user.name"Your Name"

git config --global user.email"Your Email"

git config --list

 

e) Yocto Project Setup

cd ~

mkdir imx6 && cd imx6

mkdir fsl-release-bsp && cdfsl-release-bsp

repo init -ugit://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth –m imx-4.1.15-2.0.0.xml --repo-url=https://gerrit-google.tuna.tsinghua.edu.cn/git-repo

//repo可能找不到,export PATH=~/bin:$PATH下,要是不行,可使用Ubuntu的提示:sudo apt-get installphablet-tools

repo sync  //时间可能比较长,依赖于你的网络。

 

3、ImageBuild

a)Build configurations

Freescale提供了一个脚本fsl-setup-release.sh,能大大简化构建配置。

DISTRO=<distro name> MACHINE=<machinename> source fsl-setup-release.sh -b <build dir>

<distroname>指定要生成的distribution,固定为以下内容的一个:

fsl-imx-x11      只支持X11 graphics

fsl-imx-wayland  只支持Waylandweston graphics

fsl-imx-xwayland 支持 WaylandgraphicsX11

fsl-imx-fb       只支持Frame Buffer graphics ,不支持X11Wayland

 

<machinename>指定板子型号,可在sources/meta-fsl-arm/conf/machine看到所有的支持型号,fsl-setup-release.sh脚本会根据MACHINE指定的内容从sources/meta-fsl-arm/conf/machine里面的文件选择对应的.conf进行编译,有下面的值:

imx23evk

imx28evk

imx51evk

imx53ard

imx53qsb

imx6dlsabreauto

imx6dlsabresd

imx6qdlsolo

imx6qpsabreauto

imx6qpsabresd

imx6qsabreauto

imx6qsabresd

imx6slevk

imx6sll_all

imx6sllevk

imx6slllpddr2arm2

imx6slllpddr3arm2

imx6solosabreauto

imx6solosabresd

imx6sx14x14arm2

imx6sx17x17arm2

imx6sx19x19ddr3arm2

imx6sx19x19lpddr2arm2

imx6sx_all

imx6sxsabreauto

imx6sxsabresd

imx6ul14x14ddr3arm2

imx6ul14x14lpddr2arm2

imx6ul7d

imx6ul9x9evk

imx6ulevk

imx6ull14x14ddr3arm2

imx6ull14x14evk

imx6ull9x9evk

imx7d12x12ddr3arm2

imx7d12x12lpddr3arm2

imx7d19x19ddr3arm2

imx7d19x19lpddr2arm2

imx7d19x19lpddr3arm2

imx7dsabresd

ls1021atwr

twr-vf65gs10

 

<build dir>是编译的目录,我们可以任意指定一个目录名,编译的时候将在当前目录下新建这个目录。

 

当执行该脚本之后,会在<build dir>目录下生成配置文件。在<builddir>/conf/local.conf会指定DL_DIR的内容,该路径用于下载并保存编译所需要的包。在bitbake在编译的时候会先去该路径查看有没有所需的包,如果没有,就从网上下载到该目录下。一般情况下这些包都是固定的,在团队开发中可由一人先下载,之后共享出来,然后每个人将DL_DIR指定到该共享文件夹就可以省去网上下载的麻烦。

<build dir>/conf/bblayers.conf会指定所需要的layersbitbake在启动时会执行bitbake.confbitbake.conf会装载用户提供的local.conf。然后根据用户在local.conf中定义的硬件平台MACHINE和发布目标DISTRO装载machine子目录和distro子目录的配置文件。machine子目录里是硬件平台相关的配置文件。distro子目录里是与发布目标相关的配置文件。配置文件负责设置bitbake内部使用的环境变量。这些变量会影响整个构建过程。

 

每次新打开一个窗口,都要进行一次source操作。

#sourcesetup-environment <build-dir>

 

我们使用的是

DISTRO=fsl-imx-x11 MACHINE= imx6qsabresd source fsl-setup-release.sh–b build-x11

 

b)选择一个镜像编译

可供选择的镜像名字如下表格:

Image name

Target

Provided by layer

core-image-minimal

A small image that only allows a device to boot.

poky

core-image-base

A console-only image that fully supports the target device hardware.

poky

core-image-sato

An image with Sato, a mobile environment and visual style for mobile devices. The image supports X11 with a Sato theme and uses Pimlico applications. It contains a terminal, an editor and a file manager.

poky

fsl-image-machine-test

An FSL Community i.MX core image with console environment - no GUI interface.

meta-fsl-demos

fsl-image-gui

Builds a Freescale image with a GUI without any Qt content.

meta-fsl-bsp-release/imx/meta-sdk

fsl-image-qt5

Builds an opensource Qt 5 image. These images are only supported for i.MX SoC with hardware graphics. They are not supported on the i.MX 6UltraLite, i.MX 6UltraLiteLite,and i.MX 7Dual.

meta-fsl-bsp-release/imx/meta-sdk

 

我们一般使用core-image-basefsl-image-gui吧。

c)编译镜像

bitbake  image-name

我们使用的是bitbake fsl-image-gui

然后漫长的等待,因为要下载7000+个源码包,并把它们编译完全。

 

4、编译完成后源码目录粗略分析

├── build-x11   //编译目录

│   ├── cache //编译缓存

│   ├── conf //配置

│   ├── sstate-cache  //保存状态,如果没有改变下次不再重新编译包

│   │   └── Ubuntu-14.04

│   └── tmp  //镜像,代码

│       ├── buildstats  //编译时状态记录,如果中断可以续编

│       │   ├── 20171116021902

│       │   └── 20171116063407

│       ├── cache   //编译过程中的缓存

│       │   └── default-glibc

│       ├── deploy  //生成的镜像、文件系统及安装插件

│       │   ├── images

│       │   ├── licenses

│       │   └── rpm

│       ├── log  //编译生成的日志文件

│       │   └── cooker

│       ├── sstate-control  //编译完成的包会在这里建立文件以标识

│       ├── stamps

│       │   ├── all-poky-linux

│       │   ├── cortexa9hf-neon-mx6qdl-poky-linux-gnueabi

│       │   ├── cortexa9hf-neon-poky-linux-gnueabi

│       │   ├── imx6qsabresd-poky-linux-gnueabi

│       │   ├── work-shared

│       │   └── x86_64-linux

│       ├── sysroots    //缓存的工具连,但是用不了

│       │   ├── imx6qsabresd

│       │   ├── imx6qsabresd-tcbootstrap

│       │   └── x86_64-linux

│       ├── work  //代码都在这里

│       │   ├── all-poky-linux

│       │   ├── cortexa9hf-neon-mx6qdl-poky-linux-gnueabi

│       │   ├── cortexa9hf-neon-poky-linux-gnueabi

│       │   ├── imx6qsabresd-poky-linux-gnueabi

│       │   └── x86_64-linux

│       └── work-shared

│           ├── gcc-5.3.0-r0

│           └── imx6qsabresd

└── sources  //repo下载的yocto

   ├── base //baseconfiguration for FSL Community BSP

   │   └── conf

   ├── meta-browser  //浏览器支持

   │   ├── classes

   │   ├── conf

   │   ├── recipes-browser

   │   │   └── chromium

   │   ├── recipes-gnome

   │   │   └── gnome-settings-daemon

   │   ├── recipes-mozilla

   │   │   ├── firefox

   │   │   ├── firefox-addon

   │   │   ├── firefox-l10n

   │   │   └── mozilla-devscripts

   │   └── scripts

   ├── meta-fsl-arm //Freescale ARM基础和Freescale ARM参考板支持

   │   ├── browser-layer

   │   │   └── recipes-browser

   │   ├── classes

   │   ├── conf

   │   │   └── machine

   │   ├── efl-layer

   │   │   └── recipes-efl

   │   ├── filesystem-layer

   │   │   └── recipes-fsl

   │   ├── openembedded-layer

   │   │   ├── recipes-benchmark

   │   │   ├── recipes-kernel

   │   │   └── recipes-support

   │   ├── qt4-layer

   │   │   └── recipes-qt4

   │   ├── qt5-layer

   │   │   └── recipes-qt

   │   ├── recipes-bsp

   │   │   ├── alsa-state

   │   │   ├── apptrk

   │   │   ├── barebox

   │   │   ├── change-file-endianess

   │   │   ├── elftosb

   │   │   ├── firmware-imx

   │   │   ├── formfactor

   │   │   ├── imx-bootlets

   │   │   ├── imx-kobs

   │   │   ├── imx-lib

   │   │   ├── imx-test

   │   │   ├── imx-uuc

   │   │   ├── imx-vpu

   │   │   ├── mxsldr

   │   │   ├── qe-ucode

   │   │   ├── rcw

   │   │   └── u-boot

   │   ├── recipes-core

   │   │   ├── packagegroup

   │   │   └── udev

   │   ├── recipes-devtools

   │   │   ├── cst

   │   │   ├── devregs

   │   │   ├── imx-usb-loader

   │   │   └── qemu

   │   ├── recipes-fsl

   │   │   ├── images

   │   │   └── packagegroups

   │   ├── recipes-graphics

   │   │   ├── cairo

   │   │   ├── clutter

   │   │   ├── cogl

   │   │   ├── drm

   │   │   ├── eglinfo

   │   │   ├── gtk+

   │   │   ├── images

   │   │   ├── imx-gpu-viv

   │   │   ├── mesa

   │   │   ├── piglit

   │   │   ├── wayland

   │   │   ├── xinput-calibrator

   │   │   ├── xorg-driver

   │   │   └── xorg-xserver

   │   ├── recipes-kernel

   │   │   ├── kernel-modules

   │   │   └── linux

   │   ├── recipes-multimedia

   │   │   ├── alsa

   │   │   ├── gstreamer

   │   │   ├── imx-codec

   │   │   ├── imx-parser

   │   │   ├── imx-vpuwrap

   │   │   ├── libimxvpuapi

   │   │   └── pulseaudio

   │   ├── SCR

   │   │   └── imx

   │   └── scripts

   │       └── lib

   ├── meta-fsl-arm-extra  //第三方和合作伙伴板级支持

   │   ├── conf

   │   │   └── machine

   │   ├── recipes-bsp

   │   │   ├── barebox

   │   │   ├── broadcom-nvram-config

   │   │   ├── formfactor

   │   │   ├── imx-bootlets

   │   │   ├── libmcc

   │   │   ├── libmcc2

   │   │   ├── mqxboot

   │   │   └── u-boot

   │   ├── recipes-core

   │   │   ├── init-ifupdown

   │   │   └── net-persistent-mac

   │   └── recipes-kernel

   │       ├── kernel-module-mcc-toradex

   │       ├── kernel-modules

   │       ├── linux

   │       └── linux-firmware

   ├── meta-fsl-bsp-release  // Freescale BSPrelease layer

   │   └── imx

   │       ├── classes

   │       ├── meta-bsp

   │       ├── meta-sdk

   │       └── tools

   ├── meta-fsl-demos  //额外的协助开发和测试板载能力

   │   ├── conf

   │   ├── recipes-fsl

   │   │   ├── fsl-rc-local

   │   │   ├── images

   │   │   └── packagegroups

   │   └── recipes-graphics

   │       ├── devil

   │       └── fsl-gpu-sdk

   ├── meta-openembedded  //OE核心层

   │   ├── contrib

   │   ├── meta-efl

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── recipes-core

   │   │   ├── recipes-devtools

   │   │   ├── recipes-efl

   │   │   ├── recipes-multimedia

   │   │   └── recipes-navigation

   │   ├── meta-filesystems

   │   │   ├── conf

   │   │   ├── recipes-filesystems

   │   │   ├── recipes-support

   │   │   └── recipes-utils

   │   ├── meta-gnome

   │   │   ├── conf

   │   │   ├── recipes-apps

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-devtools

   │   │   ├── recipes-extended

   │   │   ├── recipes-gnome

   │   │   ├── recipes-support

   │   │   └── site

   │   ├── meta-gpe

   │   │   ├── conf

   │   │   ├── recipes-graphics

   │   │   └── recipes-support

   │   ├── meta-initramfs

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── recipes-bsp

   │   │   ├── recipes-devtools

   │   │   └── recipes-kernel

   │   ├── meta-multimedia

   │   │   ├── conf

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-dvb

   │   │   ├── recipes-mediacentre

   │   │   ├── recipes-mkv

   │   │   ├── recipes-multimedia

   │   │   └── recipes-support

   │   ├── meta-networking

   │   │   ├── classes

    │   │   ├── conf

   │   │   ├── files

   │   │   ├── licenses

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-daemons

   │   │   ├── recipes-extended

   │   │   ├── recipes-filter

   │   │   ├── recipes-irc

   │   │   ├── recipes-kernel

   │   │   ├── recipes-netkit

   │   │   ├── recipes-protocols

   │   │   └── recipes-support

   │   ├── meta-oe

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-benchmark

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-core

   │   │   ├── recipes-devtools

   │   │   ├── recipes-extended

   │   │   ├── recipes-gnome

   │   │   ├── recipes-graphics

   │   │   ├── recipes-kernel

   │   │   ├── recipes-multimedia

   │   │   ├── recipes-navigation

   │   │   ├── recipes-sato

   │   │   ├── recipes-support

   │   │   ├── recipes-test

   │   │   └── site

   │   ├── meta-perl

   │   │   ├── conf

   │   │   ├── recipes-extended

   │   │   └── recipes-perl

   │   ├── meta-python

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-devtools

   │   │   └── recipes-extended

   │   ├── meta-ruby

   │   │   ├── classes

   │   │   ├── conf

   │   │   └── recipes-devtools

   │   ├── meta-systemd

   │   │   ├── conf

   │   │   ├── oe-core

   │   │   └── recipes-core

   │   ├── meta-webserver

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-httpd

   │   │   ├── recipes-php

   │   │   ├── recipes-support

   │   │   └── recipes-webadmin

   │   └── meta-xfce

   │       ├── classes

   │       ├── conf

   │       ├── recipes-apps

   │       ├── recipes-art

   │       ├── recipes-bindings

   │       ├── recipes-core

   │       ├── recipes-extended

   │       ├── recipes-multimedia

   │       ├── recipes-panel-plugins

   │       ├── recipes-support

   │       ├── recipes-thunar-plugins

   │       └── recipes-xfce

   ├── meta-qt5  //QT5支持

   │   ├── classes

   │   ├── conf

   │   ├── files

   │   ├── lib

   │   │   └── recipetool

   │   ├── licenses

   │   ├── recipes-devtools

   │   │   └── gdb

   │   └── recipes-qt

   │       ├── demo-extrafiles

   │       ├── examples

   │       ├── libconnman-qt

   │       ├── maliit

   │       ├── meta

   │       ├── packagegroups

   │       ├── qsiv

   │       ├── qt5

   │       ├── quazip

   │       └── tufao

   └── poky //基本Yocto ProjectPoky版本

       ├── bitbake

       │   ├── bin

       │   ├── contrib

       │   ├── doc

       │   └── lib

       ├── documentation

       │   ├── adt-manual

       │   ├── bsp-guide

       │   ├── dev-manual

       │   ├── kernel-dev

       │   ├── mega-manual

       │   ├── profile-manual

       │   ├── ref-manual

       │   ├── sdk-manual

       │   ├── template

       │   ├── toaster-manual

       │   ├── tools

       │   └── yocto-project-qs

       ├── meta

       │   ├── classes

       │   ├── conf

       │   ├── files

       │   ├── lib

       │   ├── recipes-bsp

       │   ├── recipes-connectivity

       │   ├── recipes-core

       │   ├── recipes-devtools

       │   ├── recipes-extended

       │   ├── recipes-gnome

       │   ├── recipes-graphics

       │   ├── recipes-kernel

       │   ├── recipes-lsb4

       │   ├── recipes-multimedia

       │   ├── recipes-rt

       │   ├── recipes-sato

       │   ├── recipes-support

       │   └── site

       ├── meta-poky

       │   ├── classes

       │   ├── conf

       │   └── recipes-core

       ├── meta-selftest

       │   ├── classes

       │   ├── conf

       │   ├── files

       │   ├── lib

       │   └── recipes-test

       ├── meta-skeleton

       │   ├── conf

       │   ├── recipes-core

       │   ├── recipes-kernel

       │   ├── recipes-multilib

       │   └── recipes-skeleton

       ├── meta-yocto

       │   └── conf

       ├── meta-yocto-bsp

       │   ├── conf

       │   ├── lib

       │   ├── recipes-bsp

       │   ├── recipes-core

       │   ├── recipes-graphics

       │   └── recipes-kernel

       └── scripts

            ├── contrib

            ├── lib

            ├── native-intercept

            ├── postinst-intercepts

            ├── pybootchartgui

            └── tiny

没有downloads目录是因为我把它设置到其他地方了。

 

5、可能存在的问题

(1) bitbake编译时提示在TMPDIRSSTATE_DIR创建一个长名文件失败

x@x:~/imx6/fsl-release-bsp/build-x11$ bitbake fsl-image-gui

NOTE: Your conf/bblayers.conf has been automatically updated.

ERROR: OE-core's config sanity checker detected a potential misconfiguration.

Either fix the cause of this error or at your own risk disable the checker(see sanity.conf).

Following is the list of potential problems / advisories:

 

Failed to create a file with a long name in TMPDIR. Please use afilesystem that does not unreasonably limit filename length.

Failed to create a file with a long name in SSTATE_DIR. Please use afilesystem that does not unreasonably limit filename length.

 

问题可能原因:# Check thatTMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)

 

解决方法:把用户目录去掉加密。

去掉加密步骤:

1)、备份主目录 sudo cp -rp /home/x /home/xx

2)、启动root登录,sudo passwd

3)root登录进去新建一个账号zuseradd z //注意不用创建目录

4)、重启系统,用z账号shell登录进去,然后su切换到root账号

5)root账号下删除x用户目录 rm -rf /home/x

root用户下删除主目录时失败,提示的资源文件忙,这时重启一下机器用root用户登录系统,在删除就没有问题了。

6)、重命名备份主目录xx为主目录xmv /home/xx /home/x

7)root账号下删除加密文件

rm -rf /home/.ecryptfs   

rm -rf /home/x/.ecryptfs

rm -rf /home/x/.Private

8)、账号x下取消root账号登录:sudo passwd -l root

9)、账号x下删除z账号:sudo userdel -rf z

(2) bitbake编译boost时提示virtual memory exhausted:

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: gcc.compile.c++ /home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/settings_parser.o

   "arm-poky-linux-gnueabi-g++" "-march=armv7-a""-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9""-Wl,-O1" "-Wl,--hash-style=gnu""-Wl,--as-needed""--sysroot=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd"  -ftemplate-depth-128  -O2 -pipe -g -feliminate-unused-debug-types-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0=/usr/src/debug/boost/1.60.0-r0-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/x86_64-linux=-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd=  -fvisibility-inlines-hidden -O3-finline-functions -Wno-inline -Wall -pthread -fPIC -fno-strict-aliasing-ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1-DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1-DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1-DBOOST_LOG_DYN_LINK=1 -DBOOST_LOG_SETUP_BUILDING_THE_LIB=1-DBOOST_LOG_SETUP_DLL -DBOOST_LOG_USE_NATIVE_SYSLOG-DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1-DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED-DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1-DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG-D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -I"." -c -o "/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/settings_parser.o""libs/log/src/settings_parser.cpp"

virtual memory exhausted:Cannot allocate memory

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: gcc.compile.c++ /home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/init_from_settings.o

   "arm-poky-linux-gnueabi-g++" "-march=armv7-a""-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9""-Wl,-O1" "-Wl,--hash-style=gnu""-Wl,--as-needed""--sysroot=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd"  -ftemplate-depth-128  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0=/usr/src/debug/boost/1.60.0-r0-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/x86_64-linux=-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd=  -fvisibility-inlines-hidden -O3-finline-functions -Wno-inline -Wall -pthread -fPIC -fno-strict-aliasing-ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1-DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1-DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1-DBOOST_LOG_DYN_LINK=1 -DBOOST_LOG_SETUP_BUILDING_THE_LIB=1-DBOOST_LOG_SETUP_DLL -DBOOST_LOG_USE_NATIVE_SYSLOG-DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1-DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED-DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1-DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG-D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -I"." -c -o "/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/init_from_settings.o""libs/log/src/init_from_settings.cpp"

In file included from ./boost/smart_ptr/detail/atomic_count.hpp:80:0,

                 from./boost/smart_ptr/intrusive_ref_counter.hpp:19,

                 from./boost/log/attributes/attribute.hpp:21,

                 from./boost/log/attributes/attribute_value_set.hpp:26,

                 from./boost/log/core/record.hpp:21,

                 from./boost/log/core/core.hpp:23,

                 from./boost/log/core.hpp:20,

                 fromlibs/log/src/init_from_settings.cpp:53:

./boost/smart_ptr/detail/atomic_count_sync.hpp: In member function 'longint boost::detail::atomic_count::operator++()':

./boost/smart_ptr/detail/atomic_count_sync.hpp:49:5: warning: no returnstatement in function returning non-void [-Wreturn-type]

     }

     ^

In file included from ./boost/asio/ip/impl/address_v4.ipp:21:0,

                 from./boost/asio/ip/address_v4.hpp:240,

                 from./boost/asio/ip/address.hpp:21,

                 fromlibs/log/src/init_from_settings.cpp:65:

./boost/asio/error.hpp: At global scope:

./boost/asio/error.hpp:258:45: warning:'boost::asio::error::system_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& system_category

                                             ^

./boost/asio/error.hpp:260:45: warning:'boost::asio::error::netdb_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& netdb_category

                                             ^

./boost/asio/error.hpp:262:45: warning: 'boost::asio::error::addrinfo_category'defined but not used [-Wunused-variable]

 static constboost::system::error_category& addrinfo_category

                                             ^

./boost/asio/error.hpp:264:45: warning:'boost::asio::error::misc_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& misc_category

                                             ^

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: ...failed updating 1 target...

 

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: + bb_exit_handler

+ ret=1

+ echo WARNING: exit code 1 from a shell command.

 

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

ERROR: boost-1.60.0-r0 do_compile: Function failed: do_compile (log fileis located at/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/temp/log.do_compile.8886)

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

ERROR: Logfile of failure stored in:/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/temp/log.do_compile.8886

Log data follows:

问题原因不清楚,可能是因为虚拟机内存(2GB)太小导致,也可能是虚拟机本身导致的。换成4GB内存和非虚拟机方式,问题不在重新。

 

6、参考文档:

1、《i.MX Yocto Project User's Guide

2、FSL Community BSPhttp://freescale.github.io

3、IBM Jeffrey Osier-Mixon使用Yocto Project构建自定义嵌入式Linux发行版

  • 6
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: i.MX6U是一款NXP(原Freescale)公司推出的嵌入式处理器,Yocto Project是一种用于构建根文件系统的开源项目。 要构建i.MX6U上的Yocto根文件系统,需要进行以下步骤: 1. 准备环境:首先需要在开发主机上安装Yocto Project开发环境。可以通过官方网站获取最新的Yocto Project版本,然后按照指南进行安装。 2. 获取代码:通过Git工具获取Yocto Project的源代码。可以使用以下命令进行克隆: git clone http://git.yoctoproject.org/git/poky 这将克隆Yocto Project的主要代码库。 3. 配置环境:进入代码目录,并执行以下命令: source oe-init-build-env 这将配置构建环境并创建一个"build"目录。 4. 配置构建:在"build"目录下,可以使用文本编辑器打开"conf/local.conf"文件和"conf/bblayers.conf"文件,进行环境变量和层配置。 a. 在"conf/local.conf"文件中,可以设置交叉编译工具链、目标硬件平台、软件包等配置项。 b. 在"conf/bblayers.conf"文件中,可以添加额外的层(比如meta-fsl-arm)来支持i.MX6U平台。 5. 构建根文件系统:在"build"目录下,执行以下命令进行构建: bitbake core-image-minimal 这将使用Yocto Project工具链和配置来构建一个精简的根文件系统镜像。 6. 导出根文件系统:构建完成后,可以在"build/tmp/deploy/images"目录下找到生成的根文件系统镜像文件。将它们拷贝到目标设备上即可使用。 这些步骤只是基本的流程,根据具体需求,还可以进行其他的配置和扩展。通过以上步骤,我们能够成功构建适用于i.MX6U的Yocto根文件系统,以满足特定的嵌入式应用需求。 ### 回答2: i.MX6U是一款基于ARM架构的处理器,而Yocto是一款针对嵌入式系统的开源构建工具。构建根文件系统时,我们可以使用Yocto项目来生成适用于i.MX6U平台的定制化文件系统。 首先,我们需要安装Yocto构建工具,并设置好相应的环境变量。然后,我们需要克隆i.MX6U的Yocto层,该层包含了i.MX6U特定的配置和软件包。在给定的i.MX6U Yocto层中,我们可以找到一个位于conf目录下的local.conf文件,该文件中包含了构建根文件系统所需的各种配置选项,如目标硬件平台、内核版本、文件系统类型等。 接着,我们需要在local.conf中配置构建参数。例如,我们可以指定使用哪个内核版本、选择文件系统类型(如ext4、ubifs等)、设置根文件系统的大小、选择需要安装的软件包等等。我们还需要指定i.MX6U的目标硬件平台和编译选项。 接下来,运行bitbake命令进行构建。bitbake命令会根据我们在local.conf中的配置选项来下载源代码、编译软件包、生成根文件系统映像等。整个构建过程可能需要一些时间,具体时间取决于我们选择的软件包和系统组件。 最后,构建完成后,我们可以在output目录中找到生成的根文件系统映像。这个映像可以烧录到i.MX6U平台上并运行。我们还可以在根文件系统中添加或修改软件包、配置文件等,以满足我们的特定需求。 总之,通过使用Yocto项目来构建根文件系统,我们可以灵活定制适用于i.MX6U平台的嵌入式系统,并满足特定的功能需求。 ### 回答3: i.MX6U是一款NXP公司推出的嵌入式处理器,它在嵌入式系统中应用广泛。Yocto Project是一个开源的构建系统,用于创建嵌入式Linux发行版。我们可以使用Yocto Project来构建i.MX6U的根文件系统。 首先,我们需要准备一台运行Linux操作系统的开发主机,并安装好Yocto Project的相关工具。接下来,我们需要下载i.MX6U的Yocto Project BSP(Board Support Package)提供的代码。 下载完成后,我们可以开始进行配置。根据Yocto Project的文档,我们需要使用bitbake工具进行配置。bitbake可以根据配置文件生成用于构建根文件系统的Makefile,并自动下载和编译所需的组件。 在配置过程中,我们需要指定构建目标(i.MX6U)以及需要的软件包。Yocto Project提供了一些预定义的配置模板,我们可以根据需要选择适合我们的配置模板,或者自定义配置。 配置完成后,我们可以运行bitbake进行构建。bitbake会根据配置文件,自动下载和编译所需的软件包,并生成根文件系统的镜像文件。 构建完成后,我们需要将生成的根文件系统的镜像文件烧录到i.MX6U的存储设备中,然后启动i.MX6U开发板。根文件系统启动后,我们可以登录到i.MX6U的Linux系统,并开始进行应用程序和驱动程序的开发。 总结来说,构建i.MX6U的根文件系统需要使用Yocto Project的工具和BSP提供的代码,通过配置和编译生成根文件系统的镜像文件。然后将镜像文件烧录到i.MX6U的存储设备中,从而实现开发板的启动和应用程序的开发。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值