使用OpenEmbedded构建交叉编译环境

简单简单,麻烦麻烦,记录记录,做个记录。

1,选择 /opt做为存放openembedded的文件系统。
2,设置环境变量:
export OEDIR=/opt/openembedded
export PATH=$OEDIR/bitbake/bin:$PATH
export BBPATH=$OEDIR/build:$OEDIR/org.openembedded.dev

3,建立 “/opt/openembedded”目录,这是根
4,构建环境,先安装软件包,debian系统testing branch:

5,接下,获取bitbake
svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake

然后,安装monotone 0.32版本,获取OE的数据库:
wget
bunzip2 OE.mtn

然后更新
mtn –db=OE.mtn db migrate
mtn –db=OE.mtn pull monotone.openembedded.org org.openembedded.dev

然后获取 openembedded的源代码
mtn –db=OE.mtn checkout –branch=org.openembedded.dev

6,创建配置文件
cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
修改后的格式:
DL_DIR = “${OEDIR}/sources”

BBFILES := “${OEDIR}/org.openembedded.dev/packages/*/*.bb”
#BBMASK = “”

# Select between multiple alternative providers, if more than one is eligible.
PREFERRED_PROVIDERS = “virtual/qte:qte virtual/libqpe:libqpe-opie”
PREFERRED_PROVIDERS += ” virtual/libsdl:libsdl-x11″
PREFERRED_PROVIDERS += ” virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial”
PREFERRED_PROVIDERS += ” virtual/${TARGET_PREFIX}gcc:gcc-cross”
PREFERRED_PROVIDERS += ” virtual/${TARGET_PREFIX}g++:gcc-cross”

MACHINE = “qemuarm”
TARGET_ARCH = “arm”
TARGET_OS = “linux”

DISTRO = “generic”
MACHINE_KERNEL_VERSION = “2.6″

IMAGE_FSTYPES = “jffs2 tar”

BBDEBUG = “yes”

# PARALLEL_MAKE = “-j 4″

BBINCLUDELOGS = “yes”

7,获得交叉编译工具链
bitbake gcc

8,使用交叉编译工具
交叉编译工具在tmp/cross/bin/下,可以用它们编译一个 hello, world。

9,运行编译好的目标程序
这就需要用qemu这样的模拟程序了,或者用开发板。
from
http://blog.csdn.net/leo_cao/archive/2007/08/06/1728122.aspx

 

【转】http://blog.chinaunix.net/uid-20235103-id-1970766.html

 

posted on   lydstory  阅读(112)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2019-07-04 linux解压缩6层
2019-07-04 链接socket加异常
2019-07-04 zxing opencv

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示