Last active
December 22, 2020 15:36
-
-
Save oznu/b5efd7784e5a820ec3746820f2183dc0 to your computer and use it in GitHub Desktop.
Create a Raspbian Chroot Environment Emulating ARM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHROOT_DIR=/tmp/raspbian-chroot | |
MIRROR=http://archive.raspbian.org/raspbian | |
VERSION=jessie | |
CHROOT_ARCH=armhf | |
sudo apt-get install -y debootstrap qemu-user-static binfmt-support sbuild | |
sudo mkdir -p $CHROOT_DIR | |
sudo debootstrap --foreign --no-check-gpg --include=fakeroot,build-essential \ | |
--arch=${CHROOT_ARCH} ${VERSION} ${CHROOT_DIR} ${MIRROR} | |
sudo cp /usr/bin/qemu-arm-static ${CHROOT_DIR}/usr/bin/ | |
sudo chroot ${CHROOT_DIR} ./debootstrap/debootstrap --second-stage | |
sudo sbuild-createchroot --arch=${CHROOT_ARCH} --foreign --setup-only \ | |
${VERSION} ${CHROOT_DIR} ${MIRROR} | |
# Now you can chroot into Raspbian: | |
# sudo chroot /tmp/raspbian-chroot bash | |
# root@server:/# cat /etc/*release* | |
# PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)" | |
# NAME="Raspbian GNU/Linux" | |
# root@server:/# uname -m | |
# armv7l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stolen from https://www.tomaz.me/2013/12/02/running-travis-ci-tests-on-arm.html