-
-
Save pigscanflyyyy/a1ae1e342af218c3c056bed434b0d7ca 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