Ubuntu simulated ARM Development Environment

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.