Heres something for Linux users I worked out a while back but haven't had a chance to share yet.
As most people running Linux know, writing to system folders manually (outside of your distro's package management system), is a seriously bad idea.
That is (from
http://fpgamining.com/software at time of writing), this:
Install the FTDI D2XX drivers
and this:
sudo python setup.py install
bad, bad, bad!
Heres how to run fizzisist's pyusb and the FTDID2XX driver stack
without polluting your system folders with files your package manager doesn't know about.
I have directories and some scripts set up as follows, under my fpgaminer user's home directory:
./bin
./bin/list_x6500s.sh
./bin/program_x6500_0.sh
./bin/program_x6500_1.sh
./bin/mine_x6500_0.sh
./bin/mine_x6500_1.sh
./x6500/fizzisist-x6500-miner-007fcc8 (contains unzipped zipball of latest git code)
./x6500/bitstreams (all the *.bit files)
./x6500/libftd2xx1.0.4 (contains untarred ftdi d2xx driver)
./x6500/PyUSB-1.6-fizzisist-linux (contains fizzisist's modified pyusb, untarred)
My fpgamining user is a member of my distro's "usb" group which gives it permissions to write directly to the correct usb devices in /dev, without needing to use sudo at all.
Heres a cat of one of my program_x6500 scripts:
#!/bin/bash
FPGAROOT="/home/fpgamining/x6500"
cd "$FPGAROOT/fizzisist-x6500-miner-007fcc8"
LD_PRELOAD="$FPGAROOT/libftd2xx1.0.4/build/i386/libftd2xx.so.1.0.4:$FPGAROOT/PyUSB-1.6-fizzisist-linux/build/lib.linux-i686-2.6/d2xx/_d2xx.so" PYTHONPATH="$FPGAROOT/PyUSB-1.6-fizzisist-linux/build/lib.linux-i686-2.6/" python program.py -d 0 ../bitstreams/ztexmerge_180mhz.bit
Note the trick of setting "LD_PRELOAD" environment variable, which lets you manually specify to preload libraries which are not in the system library search path, and the PYTHONPATH, which does the same thing for non-system python files.
voila: I only needed sudo to useradd the fpgamining user. Everything runs non-root,
and without breaking my distro-installed pyusb etc, because it's all nicely self contained in one directory under /home.
for completeness sake: heres one of my mining scripts:
#!/bin/bash
#for permissions to the usb device, this user needs to be part of the usb group
FPGAROOT="/home/fpgamining/x6500"
cd "$FPGAROOT/fizzisist-x6500-miner-007fcc8"
LD_PRELOAD="$FPGAROOT/libftd2xx1.0.4/build/i386/libftd2xx.so.1.0.4:$FPGAROOT/PyUSB-1.6-fizzisist-linux/build/lib.linux-i686-2.6/d2xx/_d2xx.so" PYTHONPATH="$FPGAROOT/PyUSB-1.6-fizzisist-linux/build/lib.linux-i686-2.6/" python mine.py -d 0 -u api.bitcoin.cz:8332 -w myworker:sensored_secret
I'm running gentoo linux, if anyone was interested, but the above should apply for almost any linux distro.