Ubuntu 模拟ARM开发环境
来源:互联网 发布:淘宝窗轮背景图 编辑:程序博客网 时间:2024/06/06 09:31
为了简化开发和测试过程,Ubuntu从9.10开始提供静态的ARM虚拟功能,可以直接在PC机上建立ARM机器的chroot环境,既可以编译,也可以测试程序。相比于交叉编译而言,这种方法虽然编译速度较慢,但配置方便,还具备直接调试的功能。
先安装Ubuntu提供的ARM虚拟程序:
1
sudo
apt-get
install
qemu-arm-static debootstrap
接着,使用build-arm-chroot命令建立chroot系统:
1
build-arm-chroot karmic eabi-chroot
国内用户可以考虑使用srt.cn的镜像以加快速度:
build-arm-chroot karmic eabi-chroot http://Ubuntu.srt.cn/ubuntu-ports/
建立chroot环境的脚本:
1
#!/bin/bash
2
DROOT=eabi-chroot的完整路径
3
mount
--bind /dev $DROOT/dev
4
mount
--bind /proc $DROOT/proc
5
mount
--bind /sys $DROOT/sys
6
mount
--bind /dev/pts $DROOT/dev/pts
7
cp
/etc/resolv.conf $DROOT/etc/resolv.conf
8
chroot $DROOT
chroot成功后,就进入了模拟arm开发环境。
使用 uname -a
可以观察到架构的变化。此后,新建或修改/etc/apt/sources.list,
在/etc/apt/sources.list中添加如下内容:
deb http://ports.Ubuntu.com/ lucid main restricted universe multiverse
deb-src http://ports.Ubuntu.com/ lucid main restricted universe multiverse
然后在终端输入 apt-get update更新之后,就可以按需装软件、开发程序了。
在更新时出现如下错误信息:
E: Internal Error, Could not perform immediate configuration (2) on mountall。
解决办法:
1
#mountall
2
# dpkg --force-all -i /var/cache/apt/archives/mount_2.XX.X-0Ubuntu1_i386.deb
3
# apt-get -f install
4
# apt-get -V dist-upgrade
在终端输入:exit 退出模拟arm开发环境。然后按顺序卸载刚才挂载的目录。
建立退出chroot环境脚本:
1
#!/bin/bash
2
#exit the Ubuntu arm
3
#umount the directory of eabi-chroot
4
5
DROOT=/eabi-chroot
6
umount
-l $DROOT/dev/pts
7
umount
-l $DROOT/sys
8
umount
-l $DROOT/proc
9
umount
-l $DROOT/dev
- ubuntu 模拟arm开发环境
- Ubuntu 模拟ARM开发环境
- Ubuntu 模拟ARM开发环境
- Ubuntu上模拟ARM开发环境
- Ubuntu 部署 arm 开发环境
- ubuntu下使用qemu-system-arm模拟arm环境
- ubuntu下使用qemu-system-arm模拟arm环境
- ubuntu下使用qemu-system-arm模拟arm环境
- ubuntu下使用qemu-system-arm模拟arm环境
- Ubuntu上建立Arm Linux 开发环境
- Ubuntu下Eclipse搭建ARM开发环境
- Ubuntu下Eclipse搭建ARM开发环境
- ubuntu下安装ARM开发环境
- ubuntu 11.04 进行arm开发-环境配置
- Ubuntu下Eclipse搭建ARM开发环境
- ubuntu arm软件开发环境配置
- Ubuntu下Eclipse搭建ARM开发环境
- 基于ubuntu的ARM开发环境搭建
- RETURN TRUE
- Lua基础教程
- Java字符串——大小写转换
- 将date命令结果转换为yyyymmdd日期格式
- linux安装jdk
- Ubuntu 模拟ARM开发环境
- SQL如何获得本季度第一天、一年的第一天、本月的最后一天
- C#常用集合类
- 创建一个简单的视图(模板)插件
- [django-celery]监控管理指南
- javascript 高级——prototyp对象(上)
- Cocos2d-X 摇杆的使用(Joystick)
- 搭建基于OpenStack的Ubuntu Cloud (Ubuntu Server 12.04.3 LTS )
- 操作系统之初出茅庐