From f5c5a97a5ce083bce8dd8a9d002c6b19e76f2f73 Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Mon, 19 Mar 2012 15:59:39 +0800 Subject: [PATCH] cgminer: add /etc/init.d/cgminer for autostart you may needs modify the cgminer user --- cgminer/Makefile | 11 ++++++----- cgminer/files/cgminer | 13 +++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 cgminer/files/cgminer diff --git a/cgminer/Makefile b/cgminer/Makefile index 9aac6db..7a29885 100644 --- a/cgminer/Makefile +++ b/cgminer/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cgminer PKG_VERSION:=20120315 PKG_REV:=22ff7a406951f97af57cbca75d282c4bbf41a3e7 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_INSTALL:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz @@ -47,10 +47,11 @@ 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/ - $(INSTALL_DIR) $(1)/usr/share/cgminer - $(CP) $(PKG_BUILD_DIR)/miner.php $(1)/usr/share/cgminer/ + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/cgminer $(1)/etc/init.d + + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin + $(INSTALL_BIN) $(FILES_DIR)/cgminer $(1)/etc/init.d + $(CP) $(PKG_BUILD_DIR)/miner.php $(1)/usr/share/cgminer endef $(eval $(call BuildPackage,cgminer)) diff --git a/cgminer/files/cgminer b/cgminer/files/cgminer new file mode 100755 index 0000000..d780f87 --- /dev/null +++ b/cgminer/files/cgminer @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +START=99 + +POOL="-o http://pool.ABCPool.co -O xiangfu.0:x" +DEV="-S /dev/ttyUSB0" +PARAMETER="$DEV $POOL" +start() { + cgminer -q -T --api-network --api-listen $PARAMETER> /dev/null 2>&1 & +} + +stop() { + killall -s 9 cgminer +}