Create the chroot.
# sbuild-createchroot --arch=i386 \
> --make-sbuild-tarball=/srv/chroots/sid-i386-cross-buildd.tgz sid \
> /srv/chroots/sid-i386 \
> http://ftp.us.debian.org/debian
Add the normal user to the sbuild
group.
# sbuild-adduser <youruser>
Edit the new chroot's schroot configuration to allow users in groups root
and
sbuild
to access the schroot service.
# echo 'source-root-groups=root,sbuild' >> \
> /etc/schroot/chroot.d/sid-i386-sbuild-*
Start a new login shell with the normal user to load its new group membership.
# login
Enter the chroot as the superuser.
$ fakeroot sbuild-shell sid-i386
Add the armhf
architecture to dpkg's configuration.
# dpkg --add-architecture armhf
Add the necessary archives to APT's sources list.
# cat >> /etc/apt/sources.list <<EOF
> deb http://emdebian.org/~thibg/repo sid main
> deb-src http://emdebian.org/~thibg/repo sid main
> deb http://bootstrap.pehjota.net/archive sid main
> deb-src http://bootstrap.pehjota.net/archive sid main
> EOF
Configure APT to not install recommended packages.
# echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf
Update the chroot.
# apt-get update
# apt-get dist-upgrade
Install gcc-4.7-arm-linux-gnueabihf
.
# apt-get install gcc-4.7-arm-linux-gnueabihf
Make and install a fake g++-4.7-arm-linux-gnueabihf
(until #678623
is resolved).
# apt-get install wget equivs
# wget http://bootstrap.pehjota.net/cross/g++-4.7-arm-linux-gnueabihf.ctl
# equivs-build -a i386 g++-4.7-arm-linux-gnueabihf.ctl
# dpkg -i g++-4.7-arm-linux-gnueabihf_4.7.1-2_i386.deb
Install crossbuild-essential-armhf
.
# apt-get install crossbuild-essential-armhf
Add symbolic links (until they are provided by a package built from
src:gcc-defaults
or similar – see this thread for more
information):
# ln -s arm-linux-gnueabihf-gcc-ranlib-4.7 /usr/bin/arm-linux-gnueabihf-gcc-ranlib
# ln -s arm-linux-gnueabihf-gcc-nm-4.7 /usr/bin/arm-linux-gnueabihf-gcc-nm
# ln -s arm-linux-gnueabihf-gcc-ar-4.7 /usr/bin/arm-linux-gnueabihf-gcc-ar
# ln -s arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
# ln -s arm-linux-gnueabihf-gcov-4.7 /usr/bin/arm-linux-gnueabihf-gcov
# ln -s arm-linux-gnueabihf-g++-4.7 /usr/bin/arm-linux-gnueabihf-g++
Exit the chroot.
# exit