All the following procedures are done on the host system, not the raspberry pi!, you will just need the PI's SDCard, not the device itself!
I will assume that your sdcard is unmounted and is located on /dev/sdc. Your sdcard might be located somewhere else, and might be mounted. If you don't know how to umount it, or find out what the name is of your sdcard device, check out the beginners` guide on the wiki : http://elinux.org/RPi_Easy_SD_Card_Setu ... nd_line.29
Lets first mount the correct partition of the sdcard, (the one with the linux file hierarchy). to do this we will issue this command:
Code: Select all
$ sudo fdisk -l
Code: Select all
Disk /dev/sdc: 2013 MB, 2013265920 bytes
4 heads, 32 sectors/track, 30720 cylinders, total 3932160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ee283
Device Boot Start End Blocks Id System
/dev/sdc1 2048 155647 76800 c W95 FAT32 (LBA)
/dev/sdc2 157696 3414015 1628160 83 Linux
/dev/sdc3 3416064 3807231 195584 82 Linux swap / Solaris
Code: Select all
$ sudo mount /dev/sdc2 /mnt
Code: Select all
$ sudo apt-get install qemu qemu-user qemu-user-static
Code: Select all
$ sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin
Code: Select all
$ sudo chroot /mnt
Code: Select all
root:/# gcc -v
Using built-in specs.
Target: arm-linux-gnueabi
and then just run your Makefile or gcc or any ARM Build tool you need, and it will start building.
Once you're done compiling, type in this to exit the chroot
Code: Select all
# exit
Code: Select all
$ sudo unmount /dev/sdc2
You won't have to copy over the qemu-arm-static file every time, just once, so next time you just do:
Code: Select all
$ sudo mount /dev/sdc2 /mnt
$ sudo chroot /mnt
NOTE: make sure you're using qemu 1.0 at least, older versions might glitch, no good timez. Check it with "qemu-arm-static -version"
Happy developing!
~~ Arian & AAA801