Chinaunix首页 | 论坛 | 博客
  • 博客访问: 317283
  • 博文数量: 62
  • 博客积分: 2087
  • 博客等级: 大尉
  • 技术积分: 780
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-20 21:08
文章分类

全部博文(62)

文章存档

2009年(7)

2008年(55)

我的朋友

分类: LINUX

2008-07-23 22:58:21


开发Host Ubuntu8.0.4

这里记录建立openmoko模拟器环境的过程
1.准备OpenMoko编译环境
sudo apt-get install subversion build-essential help2man \
diffstat texi2html texinfo cvs gawk zip \
unzip git-core

2.建立MoKo工作路径,下载MokoMakefile
cd ~
mkdir moko
cd moko
wget  

3.执行make
通过查看Makefile脚本,了解到这个编译脚本做了如下工作:

下载bitbake openembeded openmoko三部分软件包
bitbake--- build system used for embedded Linux distributions

BitBake is a simple tool for the execution of tasks. It is derived from Portage, which is the package management system used by the Gentoo Linux distribution. It is most commonly used to build packages, as it can easily use its rudimentary inheritence to abstract common operations, such as fetching sources, unpacking them, patching them, compiling them, and so on. It is the basis of the OpenEmbedded project, which is being used for OpenZaurus, Familiar and a number of other Linux distributions.

openembeded---编译工具链


openmoko---文档代码库,包括host端工具,target系统各模块,应用程序等代码
.
|-- doc
| `-- hardware
| |-- GTA01Bv2
| |-- GTA01Bv3
| |-- GTA01Bv4
| |-- GTA01v3
| |-- GTA01v4
| |-- GTA02v1
| |-- GTA02v2
| |-- GTA02v3
| |-- GTA02v4
| |-- HXD8v011
| `-- SMDK2440
|-- feeds
| `-- community-repository
| `-- file-index.txt
`-- src
|-- host
| |-- devirginator
| |-- dfu-util
| |-- envedit
| |-- norwp
| |-- openembedded
| |-- opkg-utils
| |-- qemu-neo1973
| |-- s3c2410_boot_usb
| |-- sjf2410-linux
| |-- splash
| |-- toolchain-scripts
| |-- usbpath
| |-- usbreset
| `-- xoo
`-- target
|-- AR6kSDK.build_sw.18
|-- OM-2007.2
|-- audio
|-- debug
|-- dynenv
|-- gpio
|-- gsm
|-- kernel
|-- opkg
|-- thumbnails
|-- u-boot
`-- xserver

4.当系统下载完成真正开始编译系统的时候,会提示配置脚本错误,这时
需要修改moko/build/conf/local.conf为如下内容:
MACHINE = "x86"
DISTRO = "openmoko"
BUILD_ARCH = "i686"
//如果安装的主机操作系统为64位,则设置BUILD_ARCH = "x86_64"

INHERIT += "devshell"

5.修改完成后,继续编译大概2小时

中间可能会遇到部分packet存在下载、校验或编译问题,根据实际情况进行修改。
我编译过程遇到libnss-mdns下载校验存在问题,予以跳过!

6.Setup the image filesystem
su -

Copy the rootf into a directory called MokoBox. From now on, we will call the chrooted environment a MokoBox.

cp -r /home/moko/build/tmp/rootfs /home/moko/mokobox

make sure /dev and /proc of the host machine are visible from within mokobox

mount --bind /dev /home/moko/mokobox/dev
mount -t proc none /home/moko/mokobox/proc

Start/Move into the protected mokobox environment

chroot /home/moko/mokobox /bin/sh

7.使用如下脚本建立目标系统的运行环境
#!/bin/bash

# Setup required environment variables

# Xephyr must listen to this DISPLAY
DISPLAY=:1

# If we don't have locale, applications refuse to launch
LANG=C

# We are running as root in our chrooted environment

HOME=/home/root
export DISPLAY LANG HOME

# Update pango modules
pango-querymodules > /etc/pango/pango.modules

# Update icon images
gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders


# Remove touch screen calibration start up app
# It doesn't launch on x86 and prevents X booting
if [ -e /etc/X11/Xsession.d/30xTs_Calibrate ] ; then
rm /etc/X11/Xsession.d/30xTs_Calibrate
fi

# Use host name server information so that
# web browsing works
cp /etc/resolv.conf etc/resolv.conf


8.从Host端 Launching Xephyr ,可能会遇到字体问题,需要从X11/font目录拷贝到mokobox
(
In another terminal (not related to mokobox), start Xephyr)
Xephyr :1 -ac -2button -host-cursor -screen 480x640

9.回到chrooted的mokobox终端,启动 X Client
eval $(dbus-launch) /etc/X11/Xsession


10.Improving Display Realism - Extending Xephyr with Xoo


阅读(1621) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~