Skip to content

Setting up a working developer sdcard

Eric Westphal edited this page Jul 9, 2017 · 4 revisions

Here are some tips for setting up a sdcard with a nicer working environment for developers:

If your main working environment is Linux or OS X, image the sdcard as follows:

  1. Download the latest -dev.img.zip file from https://github.com/cyoung/stratux/releases
  2. Unzip the file: unzip XXX-dev.img.zip.
  3. Plug your sdcard into your computer.
  4. lsblk to see which device your sdcard mounted as; assume it's /dev/sdX.
  5. Image the card with sudo dd if=XXX-dev.img of=/dev/sdX bs=4M status=progress
  6. Mount the root partition of the sdcard with sudo mount /dev/sdX2 /mnt (use whatever mount point you like if /mnt is taken).
  7. Add your ssh key: cat ~/.ssh/id_rsa.pub >> /mnt/etc/ssh/authorized_keys/root (assuming your public ssh key is ~/.ssh/id_rsa.pub).
  8. If you like to have a wired ethernet connection: vi /mnt/etc/network/interfaces and insert allow-hotplug eth0 right under allow-hotplug-wlan0.
  9. Unmount the sdcard: sudo umount /mnt. Remove it from the computer, insert it in the Pi, and boot it up.
  10. Now you should easily be able to ssh into the Pi over your wired lan.
  11. Sync up the Pi's time: systemctl start ntp (enable if always wired).
  12. Expand the filesystem: raspi-config and choose the option to expand the filesystem.
  13. Reboot; you can do a df -h to check that the filesystem is expanded.
  14. For faster builds: go get github.com/mattn/go-sqlite3
  15. Install WiringPi static libs:

Now you can easily git pull, modify, build. To build: cd ~/stratux && make && make install. If you only want to build the main stratux binary, gen_gdl90, just make xgen_gdl90 && make install.

Happy coding!