英码科技的文件系统是定制的The Angstrom Distribution Linux(以下简称Angstrom)。Angstrom是一个界面友好的嵌入式发行版本,用于手持设备,机顶盒和网络存储设备等嵌入式设备。关于Angstrom的相关资料可以登录http://www.angstrom-distribution.org查询。Angstrom Linux是基于OpenEmbedded(以下简称OE)工具创建的嵌入式系统专用Linux发行版。关于OE的相关资料可以登录http://www.openembedded.org查询。
EMA-Tech修改的OE开发包要求开发环境有50G~60G的可用空间,编译运行时确保网络与外网连接OE对于不同系统的支持请参考http://www.openembedded.org/index.php/OEandYourDistro。运行环境为Ubuntu 10.04(OE推荐)32bit(可使用python-psyco大幅提高OE速度)server版。
安装基本的依赖库和工具(不同发行版请查找对应的包名):
在ubuntu下运行命令:
sudo apt-get install sed wget cvs subversion git-core coreutils unzip bzip2 gzip texi2html \
texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ \
desktop-file-utils chrpath libxml2-utils xmlto python-psyco libapr1 docbook
2)因为OE要求使用bash用作系统shell。请确保/bin/sh为bash。
在ubunutu下运行以下命令:
sudo dpkg-reconfigure dash
里假设$HOME的绝对路径为/home/ema/,即$HOME=/home/ema
如果用户的当前用户的路径不是为/home/ema,则请把/home/ema改为当前用户绝对路径
1) 将我司提供的oe.tar.bz2压缩包拷贝并解压到当前用户$HOME目录下(这里的$HOME是/home/ema目录)(以下的资源均存于我公司提供的“OE开发工具”目录中)
$cp /mnt/hgfs/share/ OE开发工具/ openembedded/oe.tar.bz2 /home/ema
$ tar jxvf oe.tar.bz2 -C /home/ema
在/home/ema下得到名为oe的目录
2) 打入EMA-Tech的支持补丁
$ cp /mnt/hgfs/share/ OE开发工具/ openembedded/patch_sbc3530 /home/ema/oe/sources/openembedded
$ cd /home/ema/oe/sources/openembedded
$ patch -p1 < patch_sbc3530
3) 将提供的资源psp3.00.01.06.tar.bz2、ti_cgt_c6000_6.1.17_setup_linux_x86.bin、Graphics_SDK_setuplinux_4_03_00_02.bin、Graphics_SDK_setuplinux_4_03_00_02.bin.md5放到指定目录下
在ubuntu下运行以下命令:
$ cp /mnt/hgfs/share/ OE开发工具/ openembedded/psp3.00.01.06.tar.bz2 /home/ema/oe/sources/openembedded/recipes/linux/linux-omap-sbc3530-2.6.32
$ cp /mnt/hgfs/share/ OE开发工具/ openembedded/ti_cgt_c6000_6.1.17_setup_linux_x86.bin /home/ema/oe/sources/openembedded/recipes/ti/files
$ cp /mnt/hgfs/share/ OE开发工具/ openembedded/Graphics_SDK_setuplinux_4_03_00_02.bin /home/ema/oe/sources/downloads
$ cp /mnt/hgfs/share/ OE开发工具/ openembedded/Graphics_SDK_setuplinux_4_03_00_02.bin.md5 /home/ema/oe/sources/downloads
修改文件
这里假设$HOME的绝对路径为/home/ema,即$HOME=/home/ema
如果用户的当前用户的路径不是为/home/ema,则请把/home/ema改为当前用户绝对路径
1) 修改/home/ema/oe/build/conf/bblayers.conf文件中的路径
修改文件内容如下:
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "1"
BBFILES ?= ""
# Add your overlay location to BBLAYERS
# Make sure to have a conf/layers.conf in there
BBLAYERS = "/home/ema/oe/sources/openembedded "
如果用户的当前用户的路径不是为/home/ema,请把/home/ema改为当前用户的绝对路径
2) 还需要修改文件$HOME/oe/build/conf/local.conf
修改如下:
# Where to store sources
DL_DIR = "/home/ema/oe/sources/downloads"
INHERIT += "rm_work"
# Which files do we want to parse:
BBFILES ?= "/home/ema/oe/sources/openembedded/recipes/*/*.bb"
BBMASK = ""
# Qemu 0.12.x is giving too much problems recently (2010.05), so disable it for users
ENABLE_BINARY_LOCALE_GENERATION = "0"
# What kind of images do we want?
IMAGE_FSTYPES += "tar.bz2"
# Make use of SMP:
# PARALLEL_MAKE specifies how many concurrent compiler threads are spawned per bitbake process
# BB_NUMBER_THREADS specifies how many concurrent bitbake tasks will be run
PARALLEL_MAKE = "-j4"
BB_NUMBER_THREADS = "4"
DISTRO = "angstrom-2008.1"
MACHINE ?= "sbc3530"
# Set TMPDIR instead of defaulting it to /tmp
TMPDIR = "/home/ema/oe/build/tmp-angstrom_2008_1"
# Don't generate the mirror tarball for SCM repos, the snapshot is enough
BB_GENERATE_MIRROR_TARBALLS = "0"
# Go through the Firewall
#HTTP_PROXY = http://:/
如果用户的当前用户的路径不是为/home/ema,请把/home/ema改为当前用户的绝对路径
OE编译示例
1) 设置编译环境变量(一个终端窗口只需设置一次,重新打开终端窗口需重新设置)
$ export OE_BUILD_DIR="$HOME/oe/build"
$ export OE_BUILD_TMPDIR="$HOME/oe/build/tmp-angstrom_2008_1"
$ export OE_SOURCE_DIR="$HOME/oe/sources"
$ export OE_BASE="$HOME/oe"
$ export PATH="$HOME/oe/sources/bitbake/bin:$PATH"
$ export BBPATH="$HOME/oe/build:$HOME/oe/sources/openembedded"
2) 编译有console的微型文件系统
$ bitbake console-base-image(编译需要的时间比较长)
编译完成后生成的console文件系统和Linux Kernel文件所在的目录:
$HOME/oe/build/tmp-angstrom_2008_1/deploy/glibc/images/sbc3530/
其中文件系统为
Angstrom-console-base-image-glibc-ipk-2011.03-sbc3530.rootfs.tar.bz2
(用于解压到SD卡上EXT分区的文件系统)
Angstrom-console-base-image-glibc-ipk-2011.03-sbc3530.rootfs.ubi
(用于烧写到Flash的文件系统)
Linux Kernel为
uImage-2.6.32-r90+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869-sbc3530.bin
(需要修改名才能在SD卡上用,如:uImage,烧写就不需要)
bz2文件可以用在SD卡中作为根文件系统。ubi文件是Flash镜像,在之后制作SD卡时会用到。但建议将发开。制作的文件系统可以放在SD卡中使用了。
在镜像生成时,同时还生成一个内核的配置文件.config ,可以使用这个配置文件单独的去编译调试内核
更多OE知识,请查阅网站:http://docs.openembedded.org/usermanual/usermanual.html
更多英码科技的产品,请登陆英码信息科技有限公司网站http://www.ema-tech.com。