To simplify the development and testing process, Ubuntu provides static ARM virtual functions starting from 9.10. You can build a chroot environment of the ARM machine on a PC, which can be compiled or tested. Compared with cross-compilation, this method is slow in compilation, but it is easy to configure and has the function of direct debugging. First install the ARM virtual program provided by Ubuntu: sudoapt-getinstallqemu-arm-staticdebootstrap and then use bu
To simplify the development and testing process, Ubuntu provides static ARM virtual functions starting from 9.10. You can build a chroot environment of the ARM machine on a PC, which can be compiled or tested. Compared with cross-compilation, this method is slow in compilation, but it is easy to configure and has the function of direct debugging.
First install the ARM virtual program provided by Ubuntu:
Sudo apt-get install qemu-arm-static debootstrap
Then, run the build-arm-chroot command to create the chroot system:
Build-arm-chroot karmic eabi-chroot
Domestic users can consider using srt.cn images to speed up:
Build-arm-chroot karmic eabi-chroot http://ubuntu.srt.cn/ubuntu-ports/
Script for creating the chroot environment:
#! /Bin/bash
DROOT = full path of eabi-chroot
Mount -- bind/dev $ DROOT/dev
Mount -- bind/proc $ DROOT/proc
Mount -- bind/sys $ DROOT/sys
Mount -- bind/dev/pts $ DROOT/dev/pts
Cp/etc/resolv. conf $ DROOT/etc/resolv. conf
Chroot $ DROOT
After chroot is successful, it enters the simulated arm development environment.
Use uname-
The architecture changes can be observed. After that, create or modify/etc/apt/sources. list,
Add the following content to/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
Then, after entering apt-get update on the terminal, you can install software and develop programs as needed.
The following error message is displayed during the update:
E: Internal Error, cocould not perform immediate configuration (2) on mountall.
Solution:
# Mountall
# Dpkg -- force-all-I/var/cache/apt/archives/mount_2.XX.X-0ubuntu1_i386.deb
# Apt-get-f install
# Apt-get-V dist-upgrade
Enter exit on the terminal to exit the simulated arm development environment. Then, unmount the mounted directory in order.
Create a script to exit the chroot environment:
#! /Bin/bash
# Exit the ubuntu arm
# Umount the directory of eabi-chroot
DROOT =/eabi-chroot
Umount-l $ DROOT/dev/pts
Umount-l $ DROOT/sys
Umount-l $ DROOT/proc
Umount-l $ DROOT/dev