Skip to content

Crosscompiling ARMv7 in Ubuntu for Rasbian

Pablo Tesone edited this page Mar 1, 2023 · 5 revisions

From: http://logan.tw/posts/2017/01/21/introduction-to-qemu-debootstrap/

To Setup:

$ sudo apt-get install debootstrap qemu-user-static schroot

$ sudo debootstrap --arch=armhf --foreign buster arm32-raspbian http://archive.raspbian.org/raspbian

$ echo "[arm32-raspbian]
description=Raspbian 10 (armhf/arm32)
directory=$(pwd)/arm32-raspbian
root-users=$(whoami)
users=$(whoami)
type=directory" | sudo tee /etc/schroot/chroot.d/arm32-raspbian

To install sudo

$ sudo schroot -c arm32-raspbian
$ apt install sudo ssh-askpass

Then we can use the local user, it is not needed to enter as root.

In the file arm32-raspbian/etc/sudoers check that the line of the group sudo is like: %sudo ALL=(ALL) NOPASSWD: ALL

To Enter:

$ schroot -c arm32-raspbian

Packages to Install

  • build-essential
  • gcc
  • g++
  • binutils
  • cmake
  • git
  • wget
  • unzip
  • uuid-dev
  • libssl-dev
  • libtool
  • automake
sudo apt-get install \
	build-essential \
	gcc \
	g++ \
	binutils \
	cmake \
	git \
	wget \
	unzip \
	uuid-dev \
	libssl-dev \
	libtool \
	automake 
Clone this wiki locally