From 25b0a63d4dbda61c994166c906ccb692c3a1cf5f Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Thu, 17 Jan 2013 23:05:58 +0800 Subject: [PATCH] cgminer: update to 2.10.4, include root-files --- cgminer/Makefile | 10 +- cgminer/files/20-cgminer.hotplug | 8 +- cgminer/files/cgminer.init | 2 + cgminer/root-files/etc/config/dhcp | 27 ++++ cgminer/root-files/etc/config/firewall | 119 ++++++++++++++++++ cgminer/root-files/etc/config/network | 14 +++ .../root-files/etc/uci-defaults/01-cgminer | 10 ++ 7 files changed, 177 insertions(+), 13 deletions(-) create mode 100644 cgminer/root-files/etc/config/dhcp create mode 100644 cgminer/root-files/etc/config/firewall create mode 100644 cgminer/root-files/etc/config/network create mode 100644 cgminer/root-files/etc/uci-defaults/01-cgminer diff --git a/cgminer/Makefile b/cgminer/Makefile index afa45a1..5d5145c 100644 --- a/cgminer/Makefile +++ b/cgminer/Makefile @@ -9,17 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cgminer -PKG_VERSION:=20121225 -PKG_REV:=b9c7f3d169942417e04f13fab6e86d944aff37cb -# this is upstream version 2.10.2 +PKG_VERSION:=2.10.4 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:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://ck.kolivas.org/apps/cgminer/ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=$(PKG_REV) PKG_FIXUP:=autoreconf diff --git a/cgminer/files/20-cgminer.hotplug b/cgminer/files/20-cgminer.hotplug index b84c321..57eee2a 100644 --- a/cgminer/files/20-cgminer.hotplug +++ b/cgminer/files/20-cgminer.hotplug @@ -6,9 +6,7 @@ if [ "${PRODUCT}" = "403/6001/600" ] && [ "${INTERFACE}" = "255/255/255" ] && [ "$TYPE" = "0/0/0" ]; then case "$ACTION" in add) - killall -s 9 cgminer - ntpd -d -n -q -N -p 0.openwrt.pool.ntp.org \ - -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org && \ + /etc/init.d/cgminer stop /etc/init.d/cgminer start & ;; remove) @@ -20,9 +18,7 @@ fi if [ "${PRODUCT}" = "67b/2303/400" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then case "$ACTION" in add) - killall -s 9 cgminer - ntpd -d -n -q -N -p 0.openwrt.pool.ntp.org \ - -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org && \ + /etc/init.d/cgminer stop /etc/init.d/cgminer start & ;; remove) diff --git a/cgminer/files/cgminer.init b/cgminer/files/cgminer.init index ce0b744..c53fdac 100755 --- a/cgminer/files/cgminer.init +++ b/cgminer/files/cgminer.init @@ -9,6 +9,8 @@ POOLS="$POOL1 $POOL2 $POOL3" start() { DEVS=`find /dev/ -type c -name "ttyUSB*" | sed 's/^/-S/' | sed ':a;N;$!ba;s/\n/ /g'` + ntpd -d -n -q -N -p 0.openwrt.pool.ntp.org \ + -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org && \ cgminer -q --api-allow "W:0/0" --api-listen $POOLS $DEVS & } diff --git a/cgminer/root-files/etc/config/dhcp b/cgminer/root-files/etc/config/dhcp new file mode 100644 index 0000000..f245115 --- /dev/null +++ b/cgminer/root-files/etc/config/dhcp @@ -0,0 +1,27 @@ + +config 'dnsmasq' + option 'domainneeded' '1' + option 'boguspriv' '1' + option 'filterwin2k' '0' + option 'localise_queries' '1' + option 'rebind_protection' '1' + option 'rebind_localhost' '1' + option 'local' '/lan/' + option 'domain' 'lan' + option 'expandhosts' '1' + option 'nonegcache' '0' + option 'authoritative' '1' + option 'readethers' '1' + option 'leasefile' '/tmp/dhcp.leases' + option 'resolvfile' '/tmp/resolv.conf.auto' + +config 'dhcp' 'lan' + option 'interface' 'lan' + option 'start' '100' + option 'leasetime' '12h' + option 'limit' '100' + +config 'dhcp' 'wan' + option 'interface' 'wan' + option 'ignore' '1' + diff --git a/cgminer/root-files/etc/config/firewall b/cgminer/root-files/etc/config/firewall new file mode 100644 index 0000000..b044336 --- /dev/null +++ b/cgminer/root-files/etc/config/firewall @@ -0,0 +1,119 @@ + +config 'defaults' + option 'syn_flood' '1' + option 'input' 'ACCEPT' + option 'output' 'ACCEPT' + option 'forward' 'REJECT' + +config 'zone' + option 'name' 'lan' + option 'network' 'lan' + option 'input' 'ACCEPT' + option 'output' 'ACCEPT' + option 'forward' 'REJECT' + +config 'zone' + option 'name' 'wan' + option 'input' 'REJECT' + option 'output' 'ACCEPT' + option 'forward' 'REJECT' + option 'masq' '1' + option 'mtu_fix' '1' + option 'network' 'wan wwan' + +config 'forwarding' + option 'src' 'lan' + option 'dest' 'wan' + +config 'rule' + option 'name' 'Allow-DHCP-Renew' + option 'src' 'wan' + option 'proto' 'udp' + option 'dest_port' '68' + option 'target' 'ACCEPT' + option 'family' 'ipv4' + +config 'rule' + option 'name' 'Allow-Ping' + option 'src' 'wan' + option 'proto' 'icmp' + option 'icmp_type' 'echo-request' + option 'family' 'ipv4' + option 'target' 'ACCEPT' + +config 'rule' + option 'name' 'Allow-DHCPv6' + option 'src' 'wan' + option 'proto' 'udp' + option 'src_ip' 'fe80::/10' + option 'src_port' '547' + option 'dest_ip' 'fe80::/10' + option 'dest_port' '546' + option 'family' 'ipv6' + option 'target' 'ACCEPT' + +config 'rule' + option 'name' 'Allow-ICMPv6-Input' + option 'src' 'wan' + option 'proto' 'icmp' + list 'icmp_type' 'echo-request' + list 'icmp_type' 'destination-unreachable' + list 'icmp_type' 'packet-too-big' + list 'icmp_type' 'time-exceeded' + list 'icmp_type' 'bad-header' + list 'icmp_type' 'unknown-header-type' + list 'icmp_type' 'router-solicitation' + list 'icmp_type' 'neighbour-solicitation' + option 'limit' '1000/sec' + option 'family' 'ipv6' + option 'target' 'ACCEPT' + +config 'rule' + option 'name' 'Allow-ICMPv6-Forward' + option 'src' 'wan' + option 'dest' '*' + option 'proto' 'icmp' + list 'icmp_type' 'echo-request' + list 'icmp_type' 'destination-unreachable' + list 'icmp_type' 'packet-too-big' + list 'icmp_type' 'time-exceeded' + list 'icmp_type' 'bad-header' + list 'icmp_type' 'unknown-header-type' + option 'limit' '1000/sec' + option 'family' 'ipv6' + option 'target' 'ACCEPT' + +config 'include' + option 'path' '/etc/firewall.user' + +config 'zone' + option 'name' 'newzone' + option 'input' 'ACCEPT' + option 'forward' 'REJECT' + option 'network' ' ' + option 'output' 'ACCEPT' + +config 'rule' + option 'target' 'ACCEPT' + option 'src' 'wan' + option 'dest_port' '22' + option 'name' 'ssh' + option 'family' 'ipv4' + option 'proto' 'tcp udp' + +config 'rule' + option 'target' 'ACCEPT' + option 'src' 'wan' + option 'dest_port' '80' + option 'name' 'web' + option 'family' 'ipv4' + option 'proto' 'tcp udp' + +config 'rule' + option 'target' 'ACCEPT' + option 'src' 'wan' + option 'dest_port' '4028' + option 'name' 'cgminer' + option 'family' 'ipv4' + option 'proto' 'tcp udp' + diff --git a/cgminer/root-files/etc/config/network b/cgminer/root-files/etc/config/network new file mode 100644 index 0000000..c2bd615 --- /dev/null +++ b/cgminer/root-files/etc/config/network @@ -0,0 +1,14 @@ + +config 'interface' 'loopback' + option 'ifname' 'lo' + option 'proto' 'static' + option 'ipaddr' '127.0.0.1' + option 'netmask' '255.0.0.0' + +config 'interface' 'lan' + option 'ifname' 'eth0' + option 'type' 'bridge' + option 'proto' 'static' + option 'netmask' '255.255.255.0' + option 'ipaddr' '192.168.42.1' + diff --git a/cgminer/root-files/etc/uci-defaults/01-cgminer b/cgminer/root-files/etc/uci-defaults/01-cgminer new file mode 100644 index 0000000..7765a44 --- /dev/null +++ b/cgminer/root-files/etc/uci-defaults/01-cgminer @@ -0,0 +1,10 @@ +#!/bin/sh + +# Disable cgminer. because there is hotplug.d already +/etc/init.d/cgminer enable + +# Setup the cron job +echo "*/5 * * * * /usr/bin/cgminer-monitor" | crontab - +/etc/init.d/cron enable +/etc/init.d/cron stop +/etc/init.d/cron start