Bitcoin Forum
July 09, 2024, 03:06:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 [2]
21  Bitcoin / Mining support / [GUIDE] Running cgminer/bfgminer on Synology NAS on: July 10, 2013, 10:02:45 AM
Newbie here, but as all other newbies are thinking, better mine now or never  Roll Eyes

I plan to use my Synology NAS to mine with ASIC erupters since it's running 24/7.  This guide is using Synology DSM 4.2 (3202) as a base, with a DS410j (Marvell MV6281) NAS (I cannot guarantee that this guide will work for DSM versions lower than 4.2!)
Even if it is slow and will void warranty, I will be doing native compiling which is mostly documented here.  You can also do cross-compiling but it gives me more headache since there are a lot of library dependencies, it's much easier to do it natively (albeit there are things to be fixed in the NAS though to get cgminer/bfgminer to be compiled properly).  Since I'm waiting for my USB erupters, might as well write a guide here while waiting.

DISCLAIMER : Since this will void your warranty, I am not responsible for any result leading to corruption of your NAS.

Step 1. Setting up the bootstrap/toolchain

Login as user "root", password is the same as for admin via SSH.
Change to a directory such as "/volume1/@tmp"
Download the script for installing bootstrap for your CPU. To find out which kind of CPU your NAS have check it here.

Code:
wget <bootstrap script link>

For Intel XScale FW IXP420 BB ARM Processor http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/unstable/ds101-bootstrap_1.0-4_armeb.xsh
For Intel Atom CPU's: D410, D425, D510, D525 and D2700 Processors http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
For 8241 PPC models http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/ds101-bootstrap_1.0-4_powerpc.xsh
For Freescale PowerPC QorIQ P1022, 8533/8543 PPC models http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/syno-e500-bootstrap_1.2-7_powerpc.xsh
For mv5281 ARM models http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/syno-x07-bootstrap_1.2-7_arm.xsh
For Marvel Kirkwood mv6281 ARM models http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
For Marvel Kirkwood mv6282 ARM models http://wizjos.endofinternet.net/synology/archief/syno-mvkw-bootstrap_1.2-7_arm-ds111.xsh

In my case, it's
Code:
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh

Set the .xsh script to be executable and run the script:
Code:
chmod +x syno-mvkw-bootstrap_1.2-7_arm.xsh
sh syno-mvkw-bootstrap_1.2-7_arm.xsh

After the script has finished, do not reboot yet.  Do the following:

make symlink of opt:
Code:
cd /
ln -s /volume1/@optware /opt

check that /etc/profile contains:
Code:
PATH=/opt/bin:/opt/sbin:$PATH
if not, add it.

In /root/.profile comment the following lines by adding #:
Code:
#PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
#export PATH

Now you can reboot.  Reboot the NAS and login again as user "root", then

Code:
ipkg update

Now you can get the toolchain!  Run these series of commands:

Code:
ipkg install gcc
ipkg install make automake autoconf libtool binutils
ipkg install crosstool-native optware-devel

Toolchain done!  You can now start compiling natively!  (Still a long way to compile cgminer/bfgminer though... Tongue)

Step 2. Setting up the environment and dependencies

Run the following commands:

Code:
ipkg install libcurl libcurl-dev
ipkg install ncurses-dev
ipkg install sysfsutils

check libcurl if properly installed by typing:
Code:
pkg-config --libs libcurl

Fix ldconfig path

Code:
export PATH=$PATH:/volume1/@optware/share/ipkg/intercept

Fixing libpthread

the libpthread installed in optware is corrupted, so we copy the original libpthread installed.  Make a backup of libpthread:
Code:
mkdir /opt/arm-none-linux-gnueabi/lib_disabled
mv /opt/arm-none-linux-gnueabi/lib/libpthread* /opt/arm-none-linux-gnueabi/lib_disabled

Copy and link libpthread to /opt
Code:
cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
cd /opt/arm-none-linux-gnueabi/lib/
ln -s libpthread.so.0 libpthread.so
ln -s libpthread.so.0 libpthread-2.5.so


Step 3. Compiling dependencies

download and install jansson:

Code:
wget http://www.digip.org/jansson/releases/jansson-2.1.tar.gz
tar xvf jansson-2.1.tar.gz
cd jansson-2.1
./configure --prefix=/opt
make install

download uthash header files (located in https://github.com/troydhanson/uthash/tree/master/src) and put it in /opt/include

download and install libusb:

Code:
wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar xvf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
./configure --prefix=/opt
make install

Step 4. Compiling cgminer/bfgminer[TODO]

To be continued in a moment...
22  Local / Biete / Re: Groupbuy - 50 Asic-USB-Erupter - Batch2: 40/50 on: June 30, 2013, 05:06:21 PM
I'll take 3 Smiley
23  Other / Beginners & Help / Re: USB ASICs on: June 30, 2013, 11:49:22 AM
Does it scale or returns remain the same (e.g., 1 usb ROI is 6 months, how about 2? 3?)

I'm very new to this, not doing for profit, but for the geeky aspect of it.  I'm planning to run my NAS with this usbs, but not quite sure the 'optimal' number of usbs you can run (without breaking the bank)
Pages: « 1 [2]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!