CHROOTED GDB Development Environment

This page provides step by step information on how to setup a chroot environment for arm and aarch64 gdb development on x86 based Ubuntu/Debain host.

Setup Host System

Install schroot and debootstrap

schroot allows users to execute commands in chrooted environment.

debootstrap is used to install a Debian base system.

sudo apt-get install schroot debootstrap

Create schroot configuration file

Append your chroot configuration to schroot configuration file: /etc/schroot/schroot.conf

If you prefer separate configuration files, place them in /etc/schroot/chroot.d/.

Example schroot configuration:

[trusty]
description=Ubuntu Trusty
type=directory
groups=users
root-users=omair
directory=/srv/chroot/trusty

Setup Chroot Base System

You need to be connected to the internet and this process will take several minutes to complete.

Create a resident directory for your chroot by:

sudo mkdir -p /srv/chroot/trusty

Install Ubuntu base system by:

sudo debootstrap trusty /srv/chroot/trusty http://archive.ubuntu.com/ubuntu/

Configure the package sources repositories:

schroot -c trusty
sudo -s
echo "deb http://archive.ubuntu.com/ubuntu trusty restricted" >> /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu trusty universe" >> /etc/apt/sources.list
apt-get update

Setup ARMHF Development Environment

Configure the armhf package sources repositories:

schroot -c trusty
sudo -s
echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty main universe" >> /etc/apt/sources.list
dpkg --add-architecture armhf
apt-get update
apt-get install crossbuild-essential-armhf

Setup GDB Build Pre-Requsites

Install following packages if they are not already present:

sudo apt-get install git gcc make texinfo libncurses5-dev:armhf libexpat1-dev:armhf flex bison dejagnu

Setup ARM64 Development Environment

Configure the arm64 package sources repositories:

schroot -c trusty
sudo -s
echo "deb [arch=arm64] http://ports.ubuntu.com/ trusty main universe" >> /etc/apt/sources.list
dpkg --add-architecture arm64
apt-get update
apt-get install crossbuild-essential-arm64

Setup GDB Build Pre-Requsites

Install following packages if they are not already present:

sudo apt-get install git gcc make texinfo libncurses5-dev:arm64 libexpat1-dev:arm64 flex bison dejagnu

WorkingGroups/ToolChain/GDB/gdbchroots (last modified 2014-12-16 00:13:17)