Skip to content

Instantly share code, notes, and snippets.

@highway900
Last active December 23, 2015 21:48
Show Gist options
  • Save highway900/6698416 to your computer and use it in GitHub Desktop.
Save highway900/6698416 to your computer and use it in GitHub Desktop.
Cross compile environment for raspbian

Setup Cross compiler

Create an installation on an SDCARD or copy the contents of the raspian image to a new directory. Both will be referred to as 'raspbian' as a mount point

#Mount img

mkdir -p tmp raspbian
sudo mount rasp.img tmp -o loop -o offset=$((122880*512))
sudo cp -rpv tmp/. raspbian/.
sudo umount tmp

#Install to SD Card

sudo dd if=rasp.img of=/dev/sdx bs=8M

#Copy qemu to the raspbian system

sudo cp /usr/bin/qemu-arm-static raspbian/usr/bin

#Chroot and enjoy

sudo LC_ALL=C chroot raspbian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment