@pnck
2017-05-23T09:54:51.000000Z
字数 8546
阅读 2666
work
1. Why not just call this project Poky? What has changed between Poky and the Yocto Project?
The Yocto Project is an umbrella project. Accordingly, it includes a
number of projects and resources specifically intended for
facilitating development with Linux on embedded devices, and it is an
appropriate place for larger organizations to collaborate on the
development of build infrastructure for embedded Linux. Poky is one of
the the largest components of the Yocto Project, and Poky continues as
an independent, open source project developing the build system used
by the Yocto Project, as well as by other open source projects.Poky is a reference system for the Yocto Project, showing how the
tools work together. It includes BitBake, openembedded-core, and
several other components that anyone can use to start developing with
embedded Linux. Poky as a build system is tested by the Yocto Project
teams before each release. When you download and use the Yocto Project
build system, you are actually downloading Poky and using it to create
a distribution that by default is also named Poky. (You can, of
course, name your distribution anything you like.)2. What is the difference between OpenEmbedded and the Yocto Project?
The Yocto Project and OpenEmbedded share a core collection of metadata
called openembedded-core. However, the two organizations remain
separate, each with its own focus. OpenEmbedded provides a
comprehensive set of metadata for a wide variety of architectures,
features, and applications. The Yocto Project focuses on providing
powerful, easy-to-use, interoperable, well-tested tools, metadata, and
board support packages (BSPs) for a core set of architectures and
specific boards.
公司使用的嵌入式linux基于poky,poky是基于Yocto Project 的一个具体实现方案,包括bibake系统
和OpenEmbeded Core
ubuntu@ubuntu:/home/samba/sda3$ tree -F -L 5 --filelimit 13 freescale/
freescale/
└── 3.14.52/
└── yocto-L3.14.52/ #yocto 根目录
├── bin_export.sh*
├── curl.sh*
├── downloads/ [2260 entries exceeds filelimit, not opening dir] #bitbake下载的源码包/依赖等等
├── fb/
│ ├── bitbake.lock
│ ├── cache/
│ │ ├── bb_codeparser.dat
│ │ ├── bb_persist_data.sqlite3
│ │ └── local_file_checksum_cache.dat
│ ├── conf/
│ │ ├── bblayers.conf
│ │ ├── bblayers.conf.org
│ │ ├── local.conf #默认平台在这里指定
│ │ ├── local.conf.org
│ │ ├── local.conf.sample
│ │ ├── sanity_info
│ │ └── templateconf.cfg
│ ├── imx_build_note.c*
│ ├── sstate-cache/ [252 entries exceeds filelimit, not opening dir]
│ ├── test/ [14 entries exceeds filelimit, not opening dir]
│ └── tmp/ #看起来叫tmp,其实build过程中所有生成的文件全部都在这个目录下
│ ├── abi_version
│ ├── buildstats/
│ ├── cache/
│ ├── deploy/ #可供部署的整合包,do_populate_sdk后会在 deploy/sdk下生成打包好的安装脚本
│ ├── log/
│ ├── qa.log
│ ├── saved_tmpdir
│ ├── sstate-control/
│ ├── stamps/
│ ├── sysroots/
│ ├── work/ #make过程中的work目录,成品到这里找
│ └── work-shared/
├── fsl-setup-release.sh* #另一个setup-environment,一般不用
├── git_config.sh*
├── README
├── README-IMXBSP
├── repo_init.sh*
├── setup-environment* #开始使用前source这个脚本设置环境,然后才能开始使用bitbake
└── sources/ #存放targets的源码,注意是bitbake目标的源码,bitbake解析这之中的源码进行build
├── base/
│ ├── conf/
│ ├── README
│ └── setup-environment*
├── meta-browser/
│ ├── classes/
│ ├── conf/
│ ├── COPYING.MIT
│ ├── README
│ ├── recipes-browser/
│ ├── recipes-devtools/
│ ├── recipes-gnome/
│ ├── recipes-mozilla/
│ └── scripts/
├── meta-fsl-arm/ [19 entries exceeds filelimit, not opening dir]
├── meta-fsl-arm-extra/
│ ├── conf/
│ ├── README
│ ├── recipes-bsp/
│ ├── recipes-core/
│ └── recipes-kernel/
├── meta-fsl-bsp-release/
│ └── imx/
├── meta-fsl-demos/
│ ├── conf/
│ ├── README
│ ├── recipes-fsl/
│ ├── recipes-graphics/
│ ├── recipes-multimedia/
│ └── recipes-qt/
├── meta-openembedded/ [18 entries exceeds filelimit, not opening dir]
├── meta-qt5/
│ ├── classes/
│ ├── conf/
│ ├── COPYING.MIT
│ ├── licenses/
│ ├── README
│ ├── recipes-devtools/
│ └── recipes-qt/
└── poky/ [14 entries exceeds filelimit, not opening dir]
52 directories, 31 files
bitbake
进行build管理 make
,可以自动解决编译过程中的依赖问题,并自动下载所需源码,每个target可分为不同功能模块(tasks),各task可分立单独执行.bb
文件,这些指导bitbake应该怎样 b(m)ake (挺有趣的) bitbake
时必须处于yocto的 build目录(fb) 下bitbake
targetbitbake
target -c listtasksbitbake
target -c task -c xxx
fsl-image-gui
和 fsl-image-qt5
fb
bitbake上游target仓库中有meta-toolchain-qt5
和fsl-image-qt5
两项 fsl-image-qt5`包含完整的,采用qt作为gui库的 全套系统 recipes
fsl-image-qt5
实际上包含了从头到脚需要的所有交叉编译器
,qt库
,开发sdk
,板上文件系统
等等一系列东西,其中也包括meta-toolchain-qt5
这个子目标
fsl-image-qt5
和 meta-toolchain-qt5
两者独立
前者专门build qt
开发工具链,后者则编译整个 后者 会 编译出cross-toolchain,但交叉编译工具链中不含有qmake等qt构建工具qt
库
也可以fsl-image-qt5
中有一项task叫 populate_sdk,通过它生成整个toolchain,所以其实不需要meta-toolchain-qt5
。从meta-
前缀可以猜测该target不会产生目标平台相关的image,纯粹是交叉编译所需的 meta tools
未经bitbake meta-toolchain-qt5
从 bitbake fsl-image-qt5 -c populate_sdk
生成的SDK 不含有 qmake等构建工具,build过meta-toolchain-qt5
后才会有
I have found the solution (perhaps its was clear for you :-) ) To add the QT toolchain in your global toolchain, in your image file (eg image_types_yourimage.bbclass), add this "inherit populate_sdk_qt5"
https://stackoverflow.com/questions/33808081/yocto-dora-qt5-on-imx6-where-is-qmake
meta-toolchain-qt5
:
meta-toolchain-qt5
fsl-image-qt5
: sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-qt5.bb
inherit distro_features_check
后的下一行加入 inherit populate_sdk_qt
fsl-image-qt5
build整个qt库 fsl-image-qt5
-c populate_sdk 生成sdk安装包由populate_sdk
生成的sdk包含完整cross-gcc toolchain,执行environment-setup-xxxx
后当前shell环境自动配好了path
export SDKTARGETSYSROOT=/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
export PATH=/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr/bin:/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH
export CCACHE_PATH=/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr/bin:/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$CCACHE_PATH
export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig
export CONFIG_SITE=/opt/fsl-imx-fb/3.14.52-1.1.1/site-config-cortexa9hf-vfp-neon-poky-linux-gnueabi
export OECORE_NATIVE_SYSROOT="/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux"
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
export OECORE_ACLOCAL_OPTS="-I /opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr/share/aclocal"
export PYTHONHOME=/opt/fsl-imx-fb/3.14.52-1.1.1/sysroots/i686-pokysdk-linux/usr
export CC="arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-poky-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CPP="arm-poky-linux-gnueabi-gcc -E -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export AS="arm-poky-linux-gnueabi-as "
export LD="arm-poky-linux-gnueabi-ld --sysroot=$SDKTARGETSYSROOT"
export GDB=arm-poky-linux-gnueabi-gdb
export STRIP=arm-poky-linux-gnueabi-strip
export RANLIB=arm-poky-linux-gnueabi-ranlib
export OBJCOPY=arm-poky-linux-gnueabi-objcopy
export OBJDUMP=arm-poky-linux-gnueabi-objdump
export AR=arm-poky-linux-gnueabi-ar
export NM=arm-poky-linux-gnueabi-nm
export M4=m4
export TARGET_PREFIX=arm-poky-linux-gnueabi-
export CONFIGURE_FLAGS="--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=i686-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="3.14.52-1.1.1"
export OECORE_SDK_VERSION="3.14.52-1.1.1"
export ARCH=arm
export CROSS_COMPILE=arm-poky-linux-gnueabi-
# Append environment subscripts
if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
source $envfile
done
fi
if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
source $envfile
done
fi
-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=xxxx
必须随gcc命令完整携带,否则会出现找不到包含文件以及链接失败的现象(不需要用-I
指定包含目录,如果是populate_sdk出来的gcc,指定的--sysroot
下会包含完整的包含文件/库目录树),-mfloat-abi=hard
指定平台所使用的abi,bitbake出来的gcc只使用这一种abi模式,如换成其它,需要链接不同的.o
文件,而这些文件不会随populate_sdk生成,于是产生链接错误。