天天看點

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-Core 和 Poky 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)。

Poky是YoctoProject的參考釋出版本。它包括OpenEmbedded建構系統(BitBake and OpenEmbedded Core)和一系列metadata,幫助開發者建構自己的distro。Poky 這一名稱也指使用參考建構系統得到的預設 Linux 發行版,它可能極其小 (core-image-minimal),也可能是帶有 GUI 的整個Linux 系統 (core-image-sato),它是一個關于搭建編譯你自己制定的Linux釋出版本的一個源代碼用例。

BitBake 是一個建構引擎,像所有的build工具一樣(比如make,ant,jam)控制如何去建構系統并且解決建構依賴。BitBake不是基于固定依賴關系的makefile,而是收集和管理大量沒有依賴關系的描述檔案(稱為包的配方recipes),然後自動按照正确的順序進行建構。它讀取recipes配方并通過擷取程式包來密切關注它們、建構它們并将結果納入可引導映像。BitBake 由 Yocto Project 和OpenEmbedded 項目共同維護。

 OpenEmbedded,簡稱OE,它用來建構和管理嵌入式開發系統(交叉編譯、安裝、打包)。2004年10月7日ChrisLarson把OE分成了兩個項目。一個是BitBake(建構任務的執行者),一個是OpenEmbedded(實際上是為BitBake提供中繼資料)。YoctoProject使用的OE稱為OpenEmbedded-Core,是一些腳本(shell和Python腳本)和用來交叉編譯、安裝和打包的metadata(中繼資料)構成的自動建構系統。

metadata中繼資料集按層進行排列,每一層都可以為下面的層提供單獨的功能。基層是 OpenEmbedded-Core 或oe-core,提供了所有建構項目所必需的常見配方、類和相關功能。然後可以通過在 oe-core 之上添加新層來定制建構。OpenEmbedded-Core 由Yocto Project 和 OpenEmbedded 項目共同維護。将 Yocto Project 與 OpenEmbedded 分開的層是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以上,推薦120G,CPU至少雙核。強烈不推薦虛拟機的方式,直接在硬碟上安裝Ubuntu,除非你的磁盤性能很高。

b)建立Ubuntu 14.04所需要的包

建立Ubuntu 14.04開發包之前,最好把Ubuntu在SoftwareUpdater裡更新到最新。

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 支援 Waylandgraphics 和X11

fsl-imx-fb       隻支援Frame Buffer graphics ,不支援X11和Wayland

<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會指定所需要的layers。bitbake在啟動時會執行bitbake.conf,bitbake.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-base和fsl-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 Project的Poky版本

       ├── 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編譯時提示在TMPDIR或SSTATE_DIR建立一個長名檔案失敗

[email protected]:~/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登入進去建立一個賬号z,useradd z //注意不用建立目錄

4)、重新開機系統,用z賬号shell登入進去,然後su切換到root賬号

5)、root賬号下删除x使用者目錄 rm -rf /home/x

在root使用者下删除主目錄時失敗,提示的資源檔案忙,這時重新開機一下機器用root使用者登入系統,在删除就沒有問題了。

6)、重命名備份主目錄xx為主目錄x:mv /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 BSP:http://freescale.github.io

3、IBM Jeffrey Osier-Mixon:使用Yocto Project建構自定義嵌入式Linux發行版。

繼續閱讀