Patchwork [OpenWrt-Devel] cgminer: multi-threaded multi-pool GPU, FPGA, CPU bitcoin miner

login
register
Submitter Xiangfu Liu
Date 2012-03-05 03:06:24
Message ID <1330916784-5947-1-git-send-email-xiangfu.z@gmail.com>
Download mbox | patch
Permalink /patch/1947/
State New
Headers show

Comments

Xiangfu Liu - 2012-03-05 03:06:24
From: Xiangfu <xiangfu.z@gmail.com>

---
Hi 
  For use openwrt as bitcoin mining host connect Icarus as mining board.

 utils/cgminer/Makefile                             |   54 ++++++++++++++++++++
 ...add-MIPSED-to-icarus-for-BIG_ENDIAN.patch.patch |   25 +++++++++
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 utils/cgminer/Makefile
 create mode 100644 utils/cgminer/patches/0001-add-MIPSED-to-icarus-for-BIG_ENDIAN.patch.patch

Patch

diff --git a/utils/cgminer/Makefile b/utils/cgminer/Makefile
new file mode 100644
index 0000000..5bc4dd1
--- /dev/null
+++ b/utils/cgminer/Makefile
@@ -0,0 +1,54 @@ 
+#
+# Copyright (C) 2012 Xiangfu Liu <xiangfu.z@gmail.com>
+#                            bitcoin: 1BQvUsuQBYUyVuX4jjFk4dVBpWJVQEUHTZ
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cgminer
+PKG_VERSION:=20120305
+PKG_REV:=97ab111ec924e8812eaeff2f4f71940811a3cf1b
+PKG_RELEASE:=1
+PKG_INSTALL:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_URL:=git://github.com/ckolivas/cgminer.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/cgminer
+	MAINTAINER:="Xiangfu Liu" <xiangfu@sharism.cc>
+	SECTION:=utils
+	CATEGORY:=Utilities
+	TITLE:=cgminer (FPGA Miner)
+	URL:=https://github.com/ckolivas/cgminer
+	DEPENDS:=+libcurl +libpthread +libncurses +jansson
+endef
+
+define Package/cgminer/description
+Cgminer is a multi-threaded multi-pool GPU, FPGA and CPU miner with ATI GPU
+monitoring, (over)clocking and fanspeed support for bitcoin and derivative
+coins. Do not use on multiple block chains at the same time!
+endef
+# This package only enable the Icarus support. just connect your Icarus
+# FPGA miner board to OpenWrt router(with USB HOST support)
+# Run like: 
+#    cgminer -S /dev/ttyUSB0 -o http://MINING.POOL.URL -O USER:PASS
+
+CONFIGURE_ARGS += --disable-opencl --disable-adl --enable-icarus
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/cgminer/install
+	$(INSTALL_DIR) $(1)/usr/bin/
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,cgminer))
diff --git a/utils/cgminer/patches/0001-add-MIPSED-to-icarus-for-BIG_ENDIAN.patch.patch b/utils/cgminer/patches/0001-add-MIPSED-to-icarus-for-BIG_ENDIAN.patch.patch
new file mode 100644
index 0000000..0c9f7c8
--- /dev/null
+++ b/utils/cgminer/patches/0001-add-MIPSED-to-icarus-for-BIG_ENDIAN.patch.patch
@@ -0,0 +1,25 @@ 
+From 5d3d883703d8098537c248c797009247f51b116b Mon Sep 17 00:00:00 2001
+From: Xiangfu <xiangfu@openmobilefree.net>
+Date: Sun, 19 Feb 2012 22:20:22 +0800
+Subject: [PATCH] add-MIPSED-to-icarus-for-BIG_ENDIAN.patch
+
+---
+ icarus.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/icarus.c b/icarus.c
+index 1d59657..26f4927 100644
+--- a/icarus.c
++++ b/icarus.c
+@@ -287,7 +287,7 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
+         if (nonce == 0 && ret)
+                 return 0xffffffff;
+ 
+-#ifndef __BIG_ENDIAN__
++#if !defined (__BIG_ENDIAN__) && !defined(MIPSEB)
+ 	nonce = swab32(nonce);
+ #endif
+ 	work->blk.nonce = 0xffffffff;
+-- 
+1.7.5.4
+