Date:2012-05-18 07:02:51 (11 years 10 months ago)
Author:Xiangfu
Commit:b3d4ed76cdd9a0ef62ae8f730e94b397418f746a
Message:cgminer: sleep 10s before cgminer start, this make Utility display correct

Files: cgminer/Makefile (3 diffs)
cgminer/files/20-cgminer-fpga.hotplug (1 diff)
cgminer/files/20-icarus.hotplug (1 diff)
cgminer/files/cgminer (1 diff)
cgminer/files/cgminer.init (1 diff)

Change Details

cgminer/Makefile
1212PKG_VERSION:=20120516
1313PKG_REV:=b69d735cfe468c489a24677ffef1d6d998818cac
1414# this is upstream version 2.4.1
15PKG_RELEASE:=1
15PKG_RELEASE:=2
1616PKG_INSTALL:=1
1717
1818PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
...... 
3939monitoring, (over)clocking and fanspeed support for bitcoin and derivative
4040coins. Do not use on multiple block chains at the same time!
4141endef
42# This package only enable the Icarus support. just connect your Icarus
43# FPGA miner board to OpenWrt router(with USB HOST support)
44# Run like:
45# cgminer -S /dev/ttyUSB0 -o http://MINING.POOL.URL -O USER:PASS
4642
47CONFIGURE_ARGS += --disable-opencl --disable-adl --enable-icarus
43CONFIGURE_ARGS += --disable-opencl --disable-adl --enable-icarus --enable-bitforce
4844TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
4945
5046define Build/Compile
...... 
5955    $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgminer-api $(1)/usr/bin
6056
6157    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin
62    $(INSTALL_BIN) $(FILES_DIR)/cgminer $(1)/etc/init.d
58    $(INSTALL_BIN) $(FILES_DIR)/cgminer.init $(1)/etc/init.d/cgminer
6359
64    $(CP) $(FILES_DIR)/20-icarus.hotplug $(1)/etc/hotplug.d/usb/20-icarus
60    $(CP) $(FILES_DIR)/20-cgminer-fpga.hotplug $(1)/etc/hotplug.d/usb/
6561endef
6662
6763$(eval $(call BuildPackage,cgminer))
cgminer/files/20-cgminer-fpga.hotplug
1#!/bin/sh
2
3# Copyright (C) 2009 OpenWrt.org
4
5if [ "${PRODUCT}" = "67b/2303/400" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
6    case "$ACTION" in
7        add)
8            killall -s 9 sleep
9            killall -s 9 cgminer
10            sleep 1 && /etc/init.d/cgminer start &
11            ;;
12        remove)
13            ;;
14    esac
15fi
cgminer/files/20-icarus.hotplug
1#!/bin/sh
2
3# Copyright (C) 2009 OpenWrt.org
4
5if [ "${PRODUCT}" = "67b/2303/400" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
6    case "$ACTION" in
7        add)
8            killall -s 9 sleep
9            killall -s 9 cgminer
10            sleep 1 && /etc/init.d/cgminer start &
11            ;;
12        remove)
13            ;;
14    esac
15fi
cgminer/files/cgminer
1#!/bin/sh /etc/rc.common
2START=99
3
4POOL1="-o http://us.ozco.in:8331 -O xiangfu.0:x"
5POOL2="-o http://pool.ABCPool.co:8332 -O xiangfu.0:x"
6POOL3="-o http://pit.deepbit.net:8332 -O xiangfu.z@gmail.com_0:x"
7
8POOLS="$POOL1 $POOL2 $POOL3"
9
10start() {
11    DEVS=`find /dev/ -type c -name "ttyUSB*" | sed 's/^/-S/' | sed ':a;N;$!ba;s/\n/ /g'`
12    cgminer -q -T --api-network --api-listen $POOLS $DEVS &
13}
14
15stop() {
16    killall -s 9 cgminer
17}
cgminer/files/cgminer.init
1#!/bin/sh /etc/rc.common
2START=99
3
4POOL1="-o http://us.ozco.in:8331 -O xiangfu.0:x"
5POOL2="-o http://pool.ABCPool.co:8332 -O xiangfu.0:x"
6POOL3="-o http://pit.deepbit.net:8332 -O xiangfu.z@gmail.com_0:x"
7
8POOLS="$POOL1 $POOL2 $POOL3"
9
10start() {
11    DEVS=`find /dev/ -type c -name "ttyUSB*" | sed 's/^/-S/' | sed ':a;N;$!ba;s/\n/ /g'`
12    sleep 10 && cgminer -q -T --api-network --api-listen $POOLS $DEVS &
13}
14
15stop() {
16    killall -s 9 cgminer
17}

Archive Download the corresponding diff file



interactive