Browse Source

first commit

Your Name 4 years ago
commit
55209c5097
95 changed files with 3757 additions and 0 deletions
  1. 1 0
      README
  2. 24 0
      UNLICENSE
  3. 18 0
      cgminer/Config.in
  4. 153 0
      cgminer/Makefile
  5. 39 0
      cgminer/data/config.avalon1.703n
  6. 46 0
      cgminer/data/config.avalon2.1043nd-v2
  7. 46 0
      cgminer/data/config.avalon2.703n
  8. 59 0
      cgminer/data/config.avalon2.raspberry-pi
  9. 46 0
      cgminer/data/config.avalon4.703n
  10. 65 0
      cgminer/data/config.avalon4.raspberry-pi
  11. 45 0
      cgminer/data/config.avalon6.mr3020
  12. 62 0
      cgminer/data/config.avalon6.raspberry-pi
  13. 63 0
      cgminer/data/config.avalon6.rpi2
  14. 45 0
      cgminer/data/config.bitmain.703n
  15. 45 0
      cgminer/data/config.bitmain.mr3020
  16. 45 0
      cgminer/data/config.dragon.703n
  17. 45 0
      cgminer/data/config.dragon.mr3020
  18. 54 0
      cgminer/data/config.dragon.raspberry-pi
  19. 55 0
      cgminer/data/config.dragon.rpi2
  20. 45 0
      cgminer/data/config.gekko.703n
  21. 47 0
      cgminer/data/config.gekko.mr3020
  22. 54 0
      cgminer/data/config.gekko.raspberry-pi
  23. 55 0
      cgminer/data/config.gekko.rpi2
  24. 45 0
      cgminer/data/config.rockminer.703n
  25. 45 0
      cgminer/data/config.rockminer.mr3020
  26. 54 0
      cgminer/data/config.rockminer.raspberry-pi
  27. 55 0
      cgminer/data/config.rockminer.rpi2
  28. 45 0
      cgminer/data/config.x11.703n
  29. 45 0
      cgminer/data/config.x11.mr3020
  30. 31 0
      cgminer/data/feeds-patches/packages-libs-curl-disable-libopenssl.patch
  31. 15 0
      cgminer/data/feeds.avalon4.conf
  32. 3 0
      cgminer/data/feeds.avalon6.conf
  33. 3 0
      cgminer/data/feeds.bitmain.conf
  34. 14 0
      cgminer/data/feeds.conf
  35. 3 0
      cgminer/data/feeds.dragon.conf
  36. 3 0
      cgminer/data/feeds.gekko.conf
  37. 3 0
      cgminer/data/feeds.rockminer.conf
  38. 4 0
      cgminer/data/feeds.x11.conf
  39. 41 0
      cgminer/files/cgminer-avalon1-monitor
  40. 41 0
      cgminer/files/cgminer-avalon2-monitor
  41. 29 0
      cgminer/files/cgminer-avalon4-monitor
  42. 29 0
      cgminer/files/cgminer-avalon6-monitor
  43. 29 0
      cgminer/files/cgminer-bitmain-monitor
  44. 29 0
      cgminer/files/cgminer-dmaxl-monitor
  45. 29 0
      cgminer/files/cgminer-dragon-monitor
  46. 30 0
      cgminer/files/cgminer-gekko-monitor
  47. 29 0
      cgminer/files/cgminer-rockminer-monitor
  48. 29 0
      cgminer/files/cgminer-x11-monitor
  49. 20 0
      cgminer/files/cgminer.avalon1.config
  50. 91 0
      cgminer/files/cgminer.avalon1.init
  51. 19 0
      cgminer/files/cgminer.avalon2.config
  52. 95 0
      cgminer/files/cgminer.avalon2.init
  53. 21 0
      cgminer/files/cgminer.avalon4.config
  54. 99 0
      cgminer/files/cgminer.avalon4.init
  55. 18 0
      cgminer/files/cgminer.avalon6.config
  56. 94 0
      cgminer/files/cgminer.avalon6.init
  57. 18 0
      cgminer/files/cgminer.bitmain.config
  58. 93 0
      cgminer/files/cgminer.bitmain.init
  59. 18 0
      cgminer/files/cgminer.dmaxl.config
  60. 94 0
      cgminer/files/cgminer.dmaxl.init
  61. 18 0
      cgminer/files/cgminer.dragon.config
  62. 94 0
      cgminer/files/cgminer.dragon.init
  63. 18 0
      cgminer/files/cgminer.gekko.config
  64. 96 0
      cgminer/files/cgminer.gekko.init
  65. 17 0
      cgminer/files/cgminer.rockminer.config
  66. 95 0
      cgminer/files/cgminer.rockminer.init
  67. 18 0
      cgminer/files/cgminer.x11.config
  68. 94 0
      cgminer/files/cgminer.x11.init
  69. 16 0
      cgminer/files/mm-avalon4-upgrade
  70. 16 0
      cgminer/files/mm-avalon6-upgrade
  71. 16 0
      cgminer/files/mm-bitmain-upgrade
  72. 16 0
      cgminer/files/mm-dmaxl-upgrade
  73. 16 0
      cgminer/files/mm-gekko-upgrade
  74. 14 0
      cgminer/root-files/etc/banner
  75. 25 0
      cgminer/root-files/etc/config/dhcp
  76. 119 0
      cgminer/root-files/etc/config/firewall
  77. 13 0
      cgminer/root-files/etc/config/network
  78. 13 0
      cgminer/root-files/etc/config/system
  79. 7 0
      cgminer/root-files/etc/openwrt_release
  80. 1 0
      cgminer/root-files/etc/openwrt_version
  81. 27 0
      cgminer/root-files/etc/sysctl.conf
  82. 18 0
      cgminer/root-files/etc/uci-defaults/01-cgminer
  83. 15 0
      cgminer/root-files/usr/lib/lua/luci/version.lua
  84. 75 0
      fpgatools/Makefile
  85. 42 0
      fpgatools/patches/exclude-static-libs.patch
  86. 44 0
      jansson/Makefile
  87. 49 0
      libftdi/Makefile
  88. 56 0
      mm-tools/Makefile
  89. 39 0
      xc3sprog/Makefile
  90. 7 0
      xc3sprog/files/program-avalon
  91. BIN
      xc3sprog/files/xc6slx16-2-ftg256.bscan_s6_spi_isf_ext.bit
  92. 25 0
      xc3sprog/patches/0001-add-qi-jtag-serial-cable.patch
  93. 87 0
      xc3sprog/patches/0002-add-xc6slx16-ucf-and-a-Makefile-for-xilinx-tools.patch
  94. 13 0
      xc3sprog/patches/0003-disable-libftd2xx.patch
  95. 18 0
      xc3sprog/patches/0004-version-detect.patch

+ 1 - 0
README

@@ -0,0 +1 @@
+OpenWrt packages for Avalon firmware

+ 24 - 0
UNLICENSE

@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>

+ 18 - 0
cgminer/Config.in

@@ -0,0 +1,18 @@
+config CGMINER_AVALON1
+	bool "Enable Avalon1(A3256) support"
+	default n
+config CGMINER_AVALON2
+	bool "Enable Avalon2(A3255)/Avalon3(A3233) support"
+	default n
+config CGMINER_AVALON4
+	bool "Enable Avalon4(A3222) support"
+	default n
+config CGMINER_AVALON6
+	bool "Enable Avalon6(A3218) support"
+	default n
+config CGMINER_GEKKO
+	bool "Enable Gekko support"
+	default n
+config CGMINER_BITMAIN
+	bool "enable BitmainS3 support"
+	default n

+ 153 - 0
cgminer/Makefile

@@ -0,0 +1,153 @@
+#
+# Author: Xiangfu Liu <xiangfu@openmobilefree.net>
+# Address: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q
+#
+# This is free and unencumbered software released into the public domain.
+# For details see the UNLICENSE file at the root of the source tree.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cgminer
+
+ifeq ($(CONFIG_CGMINER_AVALON4),y)
+	PKG_VERSION:=git-$(shell git ls-remote https://github.com/csa402/cgminer-gekko avalon4 | cut -f1 | cut -c1-7)
+	PKG_REV:=avalon4
+endif
+ifeq ($(CONFIG_CGMINER_GEKKO),y)
+       PKG_VERSION:=git-$(shell git ls-remote https://github.com/csa402/cgminer-gekko.git master | cut -f1 | cut -c1-7)
+       PKG_REV:=master
+endif
+ifeq ($(CONFIG_CGMINER_ROCKMINER),y)
+       PKG_VERSION:=git-$(shell git ls-remote https://github.com/wareck/cgminer-gekko.git master | cut -f1 | cut -c1-7)
+       PKG_REV:=f8b12c8f424ef11d65be425db243416e9d0ef1d3
+endif
+
+#ifeq ($(CONFIG_CGMINER_BITMAIN),y)
+#       PKG_VERSION:=git-$(shell git ls-remote https://github.com/csa402/cgminer-ants3.git master | cut -f1 | cut -c1-7)
+#       PKG_REV:=master
+#endif
+
+ifeq ($(CONFIG_CGMINER_BITMAIN),y)
+       PKG_VERSION:=git-$(shell git ls-remote https://github.com/csa402/cgminer-ants3.git master | cut -f1 | cut -c1-7)
+       PKG_REV:=master
+endif
+
+#PKG_VERSION:=4.10.0
+#PKG_REV:=764b03ada628acd2ae917daa13e8afd6af088913
+
+PKG_RELEASE:=1
+PKG_INSTALL:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.bz2
+ifeq ($(CONFIG_CGMINER_AVALON4),y)
+	PKG_SOURCE_URL:=git://github.com/wareck/cgminer-gekko.git
+endif
+ifeq ($(CONFIG_CGMINER_GEKKO),y)
+	PKG_SOURCE_URL:=git://github.com/csa402/cgminer-gekko.git
+endif
+ifeq ($(CONFIG_CGMINER_BITMAIN),y)
+	PKG_SOURCE_URL:=git://github.com/csa402/cgminer-ants3.git
+endif
+
+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
+	SECTION:=utils
+	CATEGORY:=Utilities
+	TITLE:=cgminer
+	URL:=https://github.com/ckolivas/cgminer
+ifeq ($(CONFIG_TARGET_brcm2708_RaspberryPi),)
+	DEPENDS:=+libcurl +libpthread +jansson +udev
+else
+	DEPENDS:=+libcurl +libpthread +jansson +udev +libncurses
+endif
+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
+
+define Package/cgminer/config
+	menu "Configuration"
+	depends on PACKAGE_cgminer
+	source "$(SOURCE)/Config.in"
+	endmenu
+endef
+
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+ifeq ($(CONFIG_CGMINER_AVALON1),y)
+	CONFIGURE_ARGS += --enable-avalon
+endif
+ifeq ($(CONFIG_CGMINER_AVALON2),y)
+	CONFIGURE_ARGS += --enable-avalon2
+endif
+ifeq ($(CONFIG_CGMINER_AVALON4),y)
+	CONFIGURE_ARGS += --enable-avalon4
+endif
+ifeq ($(CONFIG_CGMINER_GEKKO),y)
+	CONFIGURE_ARGS += --enable-gekko
+endif
+ifeq ($(CONFIG_CGMINER_BITMAIN),y)
+	CONFIGURE_ARGS += --without-curses --enable-ants3
+endif
+ifeq ($(CONFIG_TARGET_brcm2708_RaspberryPi),)
+	CONFIGURE_ARGS += --without-curses
+endif
+
+define Build/Compile
+	$(call Build/Compile/Default)
+	(cd $(PKG_BUILD_DIR) && \
+	 $(TARGET_CC) -Icompat/jansson -Icompat/libusb-1.0/libusb \
+	api-example.c -o cgminer-api;)
+
+endef
+
+define Package/cgminer/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_DIR) $(1)/etc/config
+
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/cgminer-api	   $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer  $(1)/usr/bin
+
+ifeq ($(CONFIG_CGMINER_AVALON1),y)
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer-avalon1-monitor        $(1)/usr/bin/cgminer-monitor
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer.avalon1.init           $(1)/etc/init.d/cgminer
+	$(CP)          $(FILES_DIR)/cgminer.avalon1.config         $(1)/etc/config/cgminer
+endif
+ifeq ($(CONFIG_CGMINER_AVALON2),y)
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer-avalon2-monitor        $(1)/usr/bin/cgminer-monitor
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer.avalon2.init           $(1)/etc/init.d/cgminer
+	$(CP)          $(FILES_DIR)/cgminer.avalon2.config         $(1)/etc/config/cgminer
+endif
+ifeq ($(CONFIG_CGMINER_AVALON4),y)
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer-avalon4-monitor        $(1)/usr/bin/cgminer-monitor
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer.avalon4.init           $(1)/etc/init.d/cgminer
+	$(CP)          $(FILES_DIR)/cgminer.avalon4.config         $(1)/etc/config/cgminer
+	$(INSTALL_BIN) $(FILES_DIR)/mm-avalon4-upgrade             $(1)/usr/bin/mmupgrade
+endif
+ifeq ($(CONFIG_CGMINER_GEKKO),y)
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer-gekko-monitor        $(1)/usr/bin/cgminer-monitor
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer.gekko.init           $(1)/etc/init.d/cgminer
+	$(CP)          $(FILES_DIR)/cgminer.gekko.config         $(1)/etc/config/cgminer
+	$(INSTALL_BIN) $(FILES_DIR)/mm-gekko-upgrade             $(1)/usr/bin/mmupgrade
+endif
+ifeq ($(CONFIG_CGMINER_BITMAIN),y)
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer-bitmain-monitor	   $(1)/usr/bin/cgminer-monitor
+	$(INSTALL_BIN) $(FILES_DIR)/cgminer.bitmain.init           $(1)/etc/init.d/cgminer
+	$(CP)          $(FILES_DIR)/cgminer.bitmain.config         $(1)/etc/config/cgminer
+	$(INSTALL_BIN) $(FILES_DIR)/mm-bitmain-upgrade             $(1)/usr/bin/mmupgrade
+endif
+endef
+
+$(eval $(call BuildPackage,cgminer))

+ 39 - 0
cgminer/data/config.avalon1.703n

@@ -0,0 +1,39 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 46 - 0
cgminer/data/config.avalon2.1043nd-v2

@@ -0,0 +1,46 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR1043=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb-serial=y
+CONFIG_PACKAGE_kmod-usb-serial-ftdi=y
+CONFIG_PACKAGE_kmod-usb-serial-pl2303=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON2=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 46 - 0
cgminer/data/config.avalon2.703n

@@ -0,0 +1,46 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb-serial=y
+CONFIG_PACKAGE_kmod-usb-serial-ftdi=y
+CONFIG_PACKAGE_kmod-usb-serial-pl2303=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON2=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 59 - 0
cgminer/data/config.avalon2.raspberry-pi

@@ -0,0 +1,59 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+CONFIG_PACKAGE_kmod-usb-serial=y
+CONFIG_PACKAGE_kmod-usb-serial-ftdi=y
+CONFIG_PACKAGE_kmod-usb-serial-pl2303=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON2=y
+
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_cal=y
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_screen=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_pyserial=y
+CONFIG_PACKAGE_python=y
+CONFIG_PACKAGE_python-mini=y
+
+CONFIG_PACKAGE_fpgatools=y
+CONFIG_PACKAGE_xc3sprog=y
+CONFIG_PACKAGE_mini-jtag=y

+ 46 - 0
cgminer/data/config.avalon4.703n

@@ -0,0 +1,46 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON4=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 65 - 0
cgminer/data/config.avalon4.raspberry-pi

@@ -0,0 +1,65 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_JFFS2=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON4=y
+
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_cal=y
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_screen=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_python=y
+CONFIG_PACKAGE_python-mini=y
+
+CONFIG_PACKAGE_fpgatools=m
+CONFIG_PACKAGE_xc3sprog=m
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# I2C
+#
+CONFIG_PACKAGE_kmod-i2c-bcm2708=y
+CONFIG_PACKAGE_kmod-i2c-core=y

+ 45 - 0
cgminer/data/config.avalon6.mr3020

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON6=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 62 - 0
cgminer/data/config.avalon6.raspberry-pi

@@ -0,0 +1,62 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON4=n
+CONFIG_CGMINER_AVALON6=y
+
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y
+
+#
+# I2C
+#
+CONFIG_PACKAGE_kmod-i2c-bcm2708=y
+CONFIG_PACKAGE_kmod-i2c-core=y

+ 63 - 0
cgminer/data/config.avalon6.rpi2

@@ -0,0 +1,63 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_bcm2709=y
+CONFIG_TARGET_brcm2708_bcm2709_RaspberryPi2=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_AVALON4=n
+CONFIG_CGMINER_AVALON6=y
+
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y
+
+#
+# I2C
+#
+CONFIG_PACKAGE_kmod-i2c-bcm2708=y
+CONFIG_PACKAGE_kmod-i2c-core=y

+ 45 - 0
cgminer/data/config.bitmain.703n

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_BITMAIN=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 45 - 0
cgminer/data/config.bitmain.mr3020

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_BITMAIN=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 45 - 0
cgminer/data/config.dragon.703n

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_DRAGON=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 45 - 0
cgminer/data/config.dragon.mr3020

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_DRAGON=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 54 - 0
cgminer/data/config.dragon.raspberry-pi

@@ -0,0 +1,54 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_DRAGON=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 55 - 0
cgminer/data/config.dragon.rpi2

@@ -0,0 +1,55 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_bcm2709=y
+CONFIG_TARGET_brcm2708_bcm2709_RaspberryPi2=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_DRAGON=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 45 - 0
cgminer/data/config.gekko.703n

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 47 - 0
cgminer/data/config.gekko.mr3020

@@ -0,0 +1,47 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y
+
+CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_NANO=y

+ 54 - 0
cgminer/data/config.gekko.raspberry-pi

@@ -0,0 +1,54 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 55 - 0
cgminer/data/config.gekko.rpi2

@@ -0,0 +1,55 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_bcm2709=y
+CONFIG_TARGET_brcm2708_bcm2709_RaspberryPi2=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 45 - 0
cgminer/data/config.rockminer.703n

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_rockminer=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 45 - 0
cgminer/data/config.rockminer.mr3020

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_ROCKMINER=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 54 - 0
cgminer/data/config.rockminer.raspberry-pi

@@ -0,0 +1,54 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_RaspberryPi=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_ROCKMINER=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 55 - 0
cgminer/data/config.rockminer.rpi2

@@ -0,0 +1,55 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_brcm2708=y
+CONFIG_TARGET_brcm2708_bcm2709=y
+CONFIG_TARGET_brcm2708_bcm2709_RaspberryPi2=y
+
+#
+# Kernel
+#
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+#
+# Rootfs
+#
+CONFIG_TARGET_ROOTFS_TARGZ=y
+
+#
+# OpenWrt etc
+#
+# CONFIG_BUILD_PATENTED is not set
+
+#
+# Busybox
+#
+CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH=y
+
+#
+# Luci
+#
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-theme-avalon=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+CONFIG_PACKAGE_luci-app-avalon=y
+
+#
+# Apps
+#
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_ROCKMINER=y
+CONFIG_PACKAGE_libncurses=y
+
+CONFIG_PACKAGE_coreutils=y
+CONFIG_PACKAGE_sed=y
+
+CONFIG_PACKAGE_mm-tools=y
+
+#
+# Filesystem
+#
+CONFIG_PACKAGE_e2fsprogs=y

+ 45 - 0
cgminer/data/config.x11.703n

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLWR703=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 45 - 0
cgminer/data/config.x11.mr3020

@@ -0,0 +1,45 @@
+#
+# This file must be copied to .config in the OpenWrt root folder,
+# then run: yes "" | make oldconfig > /dev/null
+#
+CONFIG_TARGET_ar71xx=y
+CONFIG_TARGET_ar71xx_generic=y
+CONFIG_TARGET_ar71xx_generic_TLMR3020=y
+
+# CONFIG_PACKAGE_kmod-ip6tables is not set
+# CONFIG_PACKAGE_kmod-ipv6 is not set
+# CONFIG_PACKAGE_kmod-ppp is not set
+# CONFIG_PACKAGE_kmod-pppoe is not set
+# CONFIG_PACKAGE_kmod-pppox is not set
+CONFIG_PACKAGE_kmod-lib-crc-ccitt=y
+
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_kmod-usb2=y
+
+CONFIG_TARGET_ROOTFS_TARGZ=y
+CONFIG_TARGET_ROOTFS_SQUASHFS=y
+
+# CONFIG_BUILD_PATENTED is not set
+CONFIG_SDK=y
+
+# CONFIG_PACKAGE_ppp is not set
+# CONFIG_PACKAGE_ppp-mod-pppoe is not set
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-mod-rpc=y
+CONFIG_PACKAGE_luci-theme-openwrt=y
+CONFIG_PACKAGE_luci-app-cgminer=y
+
+# CONFIG_PACKAGE_ip6tables is not set
+# CONFIG_PACKAGE_6relayd is not set
+# CONFIG_PACKAGE_odhcp6c is not set
+# CONFIG_DEFAULT_uboot-envtools is not set
+CONFIG_PACKAGE_cgminer=y
+CONFIG_CGMINER_GEKKO=y
+CONFIG_PACKAGE_mm-tools=y
+
+# CONFIG_LIBCURL_POLARSSL is not set
+# CONFIG_LIBCURL_CYASSL is not set
+# CONFIG_LIBCURL_AXTLS is not set
+# CONFIG_LIBCURL_OPENSSL is not set
+# CONFIG_LIBCURL_GNUTLS is not set
+CONFIG_LIBCURL_NOSSL=y

+ 31 - 0
cgminer/data/feeds-patches/packages-libs-curl-disable-libopenssl.patch

@@ -0,0 +1,31 @@
+Index: libs/curl/Makefile
+===================================================================
+--- libs/curl/Makefile	(revision 38031)
++++ libs/curl/Makefile	(working copy)
+@@ -46,7 +46,7 @@
+   $(call Package/curl/Default)
+   SECTION:=libs
+   CATEGORY:=Libraries
+-  DEPENDS:=+libopenssl +zlib
++  DEPENDS:=+zlib
+   TITLE:=A client-side URL transfer library
+ endef
+ 
+@@ -73,7 +73,7 @@
+ 	--enable-tftp \
+ 	--disable-verbose \
+ 	--with-random="/dev/urandom" \
+-	--with-ssl="$(STAGING_DIR)/usr" \
++	--without-ssl \
+ 	--without-ca-bundle \
+ 	--without-gnutls \
+ 	--without-krb4 \
+@@ -84,7 +84,7 @@
+ 	$(call autoconf_bool,CONFIG_IPV6,ipv6) \
+ 
+ CONFIGURE_VARS += \
+-	LIBS="-lcrypto -lssl -lz" \
++	LIBS="-lz" \
+ 	CC="$(filter-out ccache,$(TARGET_CC))"
+ 
+ define Build/Compile

+ 15 - 0
cgminer/data/feeds.avalon4.conf

@@ -0,0 +1,15 @@
+src-git packages http://git.openwrt.org/packages.git
+src-git luci https://github.com/Canaan-Creative/luci.git;cgminer-webui-avalon4
+src-git routing https://github.com/openwrt-routing/packages.git
+src-git telephony http://git.openwrt.org/feed/telephony.git
+#src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
+#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
+#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
+#src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg
+#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
+#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
+#src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
+#src-link custom /usr/src/openwrt/custom-feed
+
+src-git cgminer git://github.com/Canaan-Creative/cgminer-openwrt-packages.git
+#src-git qipackages git://projects.qi-hardware.com/openwrt-packages.git

+ 3 - 0
cgminer/data/feeds.avalon6.conf

@@ -0,0 +1,3 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/Canaan-Creative/luci.git;cgminer-webui-avalon6
+src-git cgminer git://github.com/Canaan-Creative/cgminer-openwrt-packages.git

+ 3 - 0
cgminer/data/feeds.bitmain.conf

@@ -0,0 +1,3 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/csa402/luci.git;master
+src-git cgminer git://github.com/csa402/cgminer-openwrt-packages.git

+ 14 - 0
cgminer/data/feeds.conf

@@ -0,0 +1,14 @@
+src-git packages http://git.openwrt.org/packages.git
+src-git luci http://git.openwrt.org/project/luci.git
+src-git routing https://github.com/openwrt-routing/packages.git
+src-git telephony http://git.openwrt.org/feed/telephony.git
+#src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
+#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
+#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
+#src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg
+#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
+#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
+#src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
+#src-link custom /usr/src/openwrt/custom-feed
+src-git cgminer git://github.com/Canaan-Creative/cgminer-openwrt-packages.git
+#src-git qipackages git://projects.qi-hardware.com/openwrt-packages.git

+ 3 - 0
cgminer/data/feeds.dragon.conf

@@ -0,0 +1,3 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/csa402/luci.git;master
+src-git cgminer git://github.com/csa402/cgminer-openwrt-packages.git

+ 3 - 0
cgminer/data/feeds.gekko.conf

@@ -0,0 +1,3 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/csa402/luci.git;master
+src-git cgminer git://github.com/csa402/cgminer-openwrt-packages.git

+ 3 - 0
cgminer/data/feeds.rockminer.conf

@@ -0,0 +1,3 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/csa402/luci.git;master
+src-git cgminer git://github.com/csa402/cgminer-openwrt-packages.git

+ 4 - 0
cgminer/data/feeds.x11.conf

@@ -0,0 +1,4 @@
+src-git packages git://github.com/openwrt/packages.git;for-15.05
+src-git luci https://github.com/csa402/luci.git;master
+src-git cgminer git://github.com/csa402/cgminer-openwrt-packages.git
+

+ 41 - 0
cgminer/files/cgminer-avalon1-monitor

@@ -0,0 +1,41 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# If there new device added, restart cgminer
+B=`find /dev/ -name "ttyUSB*" | wc -l`
+A=`cat /tmp/usbnr.log`
+echo -n "$B" > /tmp/usbnr.log
+if [ "$A" != "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+

+ 41 - 0
cgminer/files/cgminer-avalon2-monitor

@@ -0,0 +1,41 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# If there new device added, restart cgminer
+B=`find /dev/ -name "ttyUSB*" | wc -l`
+A=`cat /tmp/usbnr.log`
+echo -n "$B" > /tmp/usbnr.log
+if [ "$A" != "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+

+ 29 - 0
cgminer/files/cgminer-avalon4-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 29 - 0
cgminer/files/cgminer-avalon6-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 29 - 0
cgminer/files/cgminer-bitmain-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 29 - 0
cgminer/files/cgminer-dmaxl-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 29 - 0
cgminer/files/cgminer-dragon-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 30 - 0
cgminer/files/cgminer-gekko-monitor

@@ -0,0 +1,30 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+

+ 29 - 0
cgminer/files/cgminer-rockminer-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 29 - 0
cgminer/files/cgminer-x11-monitor

@@ -0,0 +1,29 @@
+#!/bin/sh
+# This file is for cron job
+
+# Make sure there is only one cgminer running
+C=`pidof cgminer | wc -w`
+if [ "$C" != "1" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+# Make sure the devices staill active
+B=`cgminer-api devs | grep "^   \[Last Valid Work\]"`
+if [ "$?" != "0" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi
+
+A=`cat /tmp/cm.log`
+echo -n "$B" > /tmp/cm.log
+if [ "$A" == "$B" ]; then
+    killall -s 9 cgminer
+    sleep 1
+    /etc/init.d/cgminer restart
+    exit 0;
+fi

+ 20 - 0
cgminer/files/cgminer.avalon1.config

@@ -0,0 +1,20 @@
+package 'cgminer'
+
+config 'cgminer' 'default'
+	option	'pool1url'	'stratum+tcp://stratum.kano.is:3333'
+	option	'pool1user'	'canaan.default'
+	option	'pool1pw'	'1234'
+	option	'pool2url'	'stratum+tcp://stratum.kano.is:3333'
+	option	'pool2user'	'canaan.default'
+	option	'pool2pw'	'1234'
+	option	'pool3url'	'stratum+tcp://stratum.kano.is:3333'
+	option	'pool3user'	'canaan.default'
+	option	'pool3pw'	'1234'
+	option	'asic'		'110'
+	option	'chip_frequency'	'282'
+	option	'miner_count'	'32'
+	option	'api_allow'	'W:127.0.0.1'
+	option	'pool_balance'	'--balance'
+	option	'more_options'	'--quiet'
+	option	'target'	'60'
+	option	'overheat'	'70'

+ 91 - 0
cgminer/files/cgminer.avalon1.init

@@ -0,0 +1,91 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _mc
+	local _aa
+
+	local _pb
+	local _mo
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _asic default asic
+	config_get _cf default chip_frequency
+	config_get _mc default miner_count
+
+	config_get _aa default api_allow
+
+	config_get _pb default pool_balance
+	config_get _target default target
+	config_get _overheat default overheat
+	config_get _mo default more_options
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	# (1.67/50) == (2^32/1000/1000/$_cf/$CHIP_NUM/TO)
+	# 1.67 Second in FPGA is 50, a 256Mhs chip needs 16.7s finish 2^32 hashs
+	CHIP_NUM=10
+	TO=$(( 128591 / $CHIP_NUM / $_cf ))
+
+	AOPTIONS=" --avalon-options 115200:$_mc:$CHIP_NUM:$TO:$_cf:$_asic "
+	PARAMS=" --lowmem $AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-listen $_mo --avalon-cutoff $_overheat --avalon-temp $_target"
+
+	$APP --lowmem $AOPTIONS -q >/dev/null 2>&1
+	sleep 1
+
+	if [ ! -f /tmp/cgminer-ntpd-done ]; then
+		while [ "$NTPD_RET" != "0" ]; do
+			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
+
+			NTPD_RET=$?
+		done
+
+		touch /tmp/cgminer-ntpd-done
+	fi
+
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+}

+ 19 - 0
cgminer/files/cgminer.avalon2.config

@@ -0,0 +1,19 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://stratum.kano.is:3333'
+	option pool1user	'canaan.default'
+	option pool1pw		'1234'
+	option pool2url		'stratum+tcp://stratum.kano.is:3333'
+	option pool2user	'canaan.default'
+	option pool2pw		'1234'
+	option pool3url		'stratum+tcp://stratum.kano.is:3333'
+	option pool3user	'canaan.default'
+	option pool3pw		'1234'
+	option pool_balance	'  '
+	option chip_frequency	'500'
+	option chip_voltage	'7250'
+	option fan		'60-100'
+	option api_allow	'W:127.0.0.1'
+	option more_options	'--real-quiet'
+	option ntp_enable	'default'
+

+ 95 - 0
cgminer/files/cgminer.avalon2.init

@@ -0,0 +1,95 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _cv
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _cv default chip_voltage
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	DEVS=`find /dev/ -type c -name "ttyUSB*"  | sed 's/^/-S/' |  sed ':a;N;$!ba;s/\n/ /g'`
+	AVA2_OPTIONS=" --avalon2-fan $_fan --avalon2-freq $_cf --avalon2-voltage $_cv "
+	PARAMS=" ${DEVS} $AVA2_OPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-listen $_mo "
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+}

+ 21 - 0
cgminer/files/cgminer.avalon4.config

@@ -0,0 +1,21 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://stratum.kano.is:3333'
+	option pool1user	'canaan.3333'
+	option pool1pw		'1234'
+	option pool2url		'stratum+tcp://stratum80.kano.is:80'
+	option pool2user	'canaan.80'
+	option pool2pw		'1234'
+	option pool3url		'stratum+tcp://stratum81.kano.is:81'
+	option pool3user	'canaan.81'
+	option pool3pw		'1234'
+	option pool_balance	'  '
+	option chip_frequency	'450:390:370'
+	option chip_voltage	'8000'
+	option voltage_adjust	'--avalon4-automatic-voltage'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	'--real-quiet'
+	option ntp_enable	'default'
+	option mining_mode 	' '
+

+ 99 - 0
cgminer/files/cgminer.avalon4.init

@@ -0,0 +1,99 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _cv
+	local _va
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _mmode default mining_mode
+	config_get _cf default chip_frequency
+	config_get _cv default chip_voltage
+	config_get _va default voltage_adjust
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS=" --avalon4-fan $_fan-100 --avalon4-freq $_cf "
+	PARAMS=" --lowmem $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo "
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 18 - 0
cgminer/files/cgminer.avalon6.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://stratum.kano.is:3333'
+	option pool1user	'canaan.3333'
+	option pool1pw		'1234'
+	option pool2url		'stratum+tcp://stratum80.kano.is:80'
+	option pool2user	'canaan.80'
+	option pool2pw		'1234'
+	option pool3url		'stratum+tcp://stratum81.kano.is:81'
+	option pool3user	'canaan.81'
+	option pool3pw		'1234'
+	option pool_balance	'  '
+	option chip_frequency	'500'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'
+

+ 94 - 0
cgminer/files/cgminer.avalon6.init

@@ -0,0 +1,94 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS=" --avalon4-fan $_fan-100 --avalon4-freq $_cf "
+	PARAMS=" --lowmem $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 18 - 0
cgminer/files/cgminer.bitmain.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://ispace.co.uk:4443/#skipcbcheck#xnsub'
+	option pool1user	'wareck.OpenWRT'
+	option pool1pw		'x'
+	option pool2url		'stratum+tcp://kryptos.podzone.net:3348/#skipcbcheck#xnsub'
+	option pool2user	'SVdNZJntkhDQjrbY9PxPXsmr3NTq56vhGQ'
+	option pool2pw		'x'
+	option pool3url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool3user	'wareck.OpenWRT'
+	option pool3pw		'x'
+	option pool_balance	'  '
+	option chip_frequency	'150'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'
+

+ 93 - 0
cgminer/files/cgminer.bitmain.init

@@ -0,0 +1,93 @@
+#!/bin/sh /etc/rc.common
+#set -x
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _pb
+	local _ow
+	local _bec
+
+	local _aa
+	local _mo
+	
+	local _freq
+	local _volt
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _pb default pool_balance
+	config_get _ow default bitmain_tempoverctrl
+	config_get _bec default bitmain_beeper
+
+	config_get _aa default api_allow
+	config_get _mo default more_options
+	config_get _xn default xnsub_options
+
+	config_get _freq default freq
+	config_get _volt default voltage
+
+	if [ "$_volt" != "" ]; then
+		VOPT="--bitmain-voltage $_volt"
+	fi
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	BITOPT="--bitmain-options 115200:32:8 --bitmain-freq $_freq"
+	POOLOPT="$POOL1 $POOL2 $POOL3 $_pb"
+	APIOPT="--api-listen --api-allow $_aa"
+	OTHEROPT="--bitmain-checkn2diff --bitmain-hwerror $_ow $_bec"
+
+	PARAMS="$BITOPT $VOPT $POOLOPT $APIOPT $OTHEROPT $_mo $_xn"
+
+	sleep 1
+	cnt=0
+	while [ "$cnt" != "3" -a "$NTPD_RET" != "0" ] ; do
+		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 &> /dev/null
+		NTPD_RET="$?"
+		cnt=$(($cnt+1))
+		sleep 1
+	done
+	echo $cnt
+	echo $PARAMS
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+}

+ 18 - 0
cgminer/files/cgminer.dmaxl.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://192.168.1.20:3340'
+	option pool1user	'GWzCfieMTLHvkufcq8F36HAFwnibY14Uwr'
+	option pool1pw		'xxx'
+	option pool2url		'stratum+tcp://stratum80.kano.is:80'
+	option pool2user	'canaan.80'
+	option pool2pw		'1234'
+	option pool3url		'stratum+tcp://stratum81.kano.is:81'
+	option pool3user	'canaan.81'
+	option pool3pw		'1234'
+	option pool_balance	'  '
+	option chip_frequency	'780'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'
+

+ 94 - 0
cgminer/files/cgminer.dmaxl.init

@@ -0,0 +1,94 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS="  --gridseed-options=baud=115200,freq=$_cf0,chips=40,modules=1,usefifo=0,btc=0 --hotplug=0 "
+        PARAMS=" --scrypt $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 18 - 0
cgminer/files/cgminer.dragon.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://ispace.co.uk:4443/#skipcbcheck#xnsub'
+	option pool1user	'wareck.OpenWRT'
+	option pool1pw		'x'
+	option pool2url		'stratum+tcp://kryptos.podzone.net:3348/#skipcbcheck#xnsub'
+	option pool2user	'SVdNZJntkhDQjrbY9PxPXsmr3NTq56vhGQ'
+	option pool2pw		'x'
+	option pool3url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool3user	'wareck.OpenWRT'
+	option pool3pw		'x'
+	option pool_balance	'  '
+	option chip_frequency	'150'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'
+

+ 94 - 0
cgminer/files/cgminer.dragon.init

@@ -0,0 +1,94 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS="  --compac-freq $_cf --compac-options 115200:1:1 "
+        PARAMS=" $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 18 - 0
cgminer/files/cgminer.gekko.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://ispace.co.uk:4443/#skipcbcheck#xnsub'
+	option pool1user	'wareck.OpenWRT'
+	option pool1pw		'x'
+	option pool2url		'stratum+tcp://kryptos.podzone.net:3348/#skipcbcheck#xnsub'
+	option pool2user	'SVdNZJntkhDQjrbY9PxPXsmr3NTq56vhGQ'
+	option pool2pw		'x'
+	option pool3url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool3user	'wareck.OpenWRT'
+	option pool3pw		'x'
+	option pool_balance	'  '
+	option 2pac_frequency	'100'
+	option gek1_frequency   '150'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'

+ 96 - 0
cgminer/files/cgminer.gekko.init

@@ -0,0 +1,96 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _2pacf default 2pac_frequency
+	config_set _gek1f default gek1_frequency
+
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS="  --gekko-2pac-freq $_2pacf --gekko-compac-freq $_gek1f "
+        PARAMS=" $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 17 - 0
cgminer/files/cgminer.rockminer.config

@@ -0,0 +1,17 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool1user	'wareck.OpenWRT'
+	option pool1pw		'x'
+	option pool2url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool2user	'wareck.OpenWRT'
+	option pool2pw		'x'
+	option pool3url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool3user	'wareck.OpenWRT'
+	option pool3pw		'x'
+	option pool_balance	' '
+	option chip_frequency	'290'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'

+ 95 - 0
cgminer/files/cgminer.rockminer.init

@@ -0,0 +1,95 @@
+#!/bin/sh /etc/rc.common
+#rockminer
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS="  --rock-freq $_cf "
+        PARAMS=" $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 18 - 0
cgminer/files/cgminer.x11.config

@@ -0,0 +1,18 @@
+
+config cgminer 'default'
+	option pool1url		'stratum+tcp://ispace.co.uk:4443/#skipcbcheck#xnsub'
+	option pool1user	'wareck.OpenWRT'
+	option pool1pw		'x'
+	option pool2url		'stratum+tcp://kryptos.podzone.net:3348/#skipcbcheck#xnsub'
+	option pool2user	'SVdNZJntkhDQjrbY9PxPXsmr3NTq56vhGQ'
+	option pool2pw		'x'
+	option pool3url		'stratum+tcp://stratum.bitcoin.cz:3333'
+	option pool3user	'wareck.OpenWRT'
+	option pool3pw		'x'
+	option pool_balance	'  '
+	option chip_frequency	'150'
+	option fan		'20'
+	option api_allow	'W:127.0.0.1'
+	option more_options	''
+	option ntp_enable	'disable'
+

+ 94 - 0
cgminer/files/cgminer.x11.init

@@ -0,0 +1,94 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+APP=cgminer
+PID_FILE=/var/run/$APP.pid
+
+
+start() {
+	local _pool1url
+	local _pool1user
+	local _pool1pw
+
+	local _pool2url
+	local _pool2user
+	local _pool2pw
+
+	local _pool3url
+	local _pool3user
+	local _pool3pw
+
+	local _cf
+	local _fan
+
+	local _aa
+	local _pb
+	local _mo
+
+	local _ntp_enable
+
+	config_load cgminer
+
+	config_get _pool1url default pool1url
+	config_get _pool1user default pool1user
+	config_get _pool1pw default pool1pw
+	config_get _pool2url default pool2url
+	config_get _pool2user default pool2user
+	config_get _pool2pw default pool2pw
+	config_get _pool3url default pool3url
+	config_get _pool3user default pool3user
+	config_get _pool3pw default pool3pw
+
+	config_get _cf default chip_frequency
+	config_get _fan default fan
+
+	config_get _aa default api_allow
+	config_get _pb default pool_balance
+	config_get _mo default more_options
+
+	config_get _ntp_enable default ntp_enable
+
+	if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; then
+	    POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
+	fi
+	if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; then
+	    POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
+	fi
+	if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; then
+	    POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
+	fi
+
+	AVA4_OPTIONS="  --x11 --du1 "
+        PARAMS=" $AVA4_OPTIONS $POOL1 $POOL2 $POOL3 --api-allow $_aa --api-listen $_mo --real-quiet"
+
+	NTP_POOL="-p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org  -p 3.openwrt.pool.ntp.org -p 4.openwrt.pool.ntp.org"
+	ASIA="-p 1.cn.pool.ntp.org -p 3.asia.pool.ntp.org -p 2.asia.pool.ntp.org"
+
+	# _ntp_enable: openwrt, asia, globle
+	if [ "$_ntp_enable" == "asia" ]; then
+	    NTP_POOL="${ASIA}"
+	fi
+
+	if [ ! -f /tmp/cgminer-ntpd-done -a "$_ntp_enable" != "disable" ]; then
+	    while [ "$NTPD_RET" != "0" ]; do
+		ntpd -d -n -q -N ${NTP_POOL}
+		NTPD_RET=$?
+	    done
+
+	    touch /tmp/cgminer-ntpd-done
+	fi
+
+        # Make sure udevd run before cgminer start
+        UDEVDCNT=`pidof udevd | wc -w`
+        if [ "$UDEVDCNT" == "0" ]; then
+                udevd --daemon
+        fi
+
+	sleep 2
+	start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- $PARAMS
+}
+
+stop() {
+	start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
+	sleep 2
+}

+ 16 - 0
cgminer/files/mm-avalon4-upgrade

@@ -0,0 +1,16 @@
+#!/bin/sh
+# MM firmware upgrade scripts
+FIRMWARE=mm.mcs
+cd /tmp
+if [ ! -f "$FIRMWARE" ]; then
+        wget http://downloads.canaan-creative.com/software/avalon4/mm41/latest/mm.mcs -O ./$FIRMWARE
+fi
+/etc/init.d/cron stop
+/etc/init.d/cgminer stop
+# wait cgminer stop finish
+sleep 2
+mm-tools
+# wait mm reboot
+sleep 25
+/etc/init.d/cgminer start
+/etc/init.d/cron start

+ 16 - 0
cgminer/files/mm-avalon6-upgrade

@@ -0,0 +1,16 @@
+#!/bin/sh
+# MM firmware upgrade scripts
+FIRMWARE=mm.mcs
+cd /tmp
+if [ ! -f "$FIRMWARE" ]; then
+        wget http://downloads.canaan-creative.com/software/avalon6/mm60/latest/mm.mcs -O ./$FIRMWARE
+fi
+/etc/init.d/cron stop
+/etc/init.d/cgminer stop
+# wait cgminer stop finish
+sleep 2
+mm-tools
+# wait mm reboot
+sleep 25
+/etc/init.d/cgminer start
+/etc/init.d/cron start

+ 16 - 0
cgminer/files/mm-bitmain-upgrade

@@ -0,0 +1,16 @@
+#!/bin/sh
+# MM firmware upgrade scripts
+FIRMWARE=mm.mcs
+cd /tmp
+if [ ! -f "$FIRMWARE" ]; then
+        wget http://downloads.canaan-creative.com/software/avalon6/mm60/latest/mm.mcs -O ./$FIRMWARE
+fi
+/etc/init.d/cron stop
+/etc/init.d/cgminer stop
+# wait cgminer stop finish
+sleep 2
+mm-tools
+# wait mm reboot
+sleep 25
+/etc/init.d/cgminer start
+/etc/init.d/cron start

+ 16 - 0
cgminer/files/mm-dmaxl-upgrade

@@ -0,0 +1,16 @@
+#!/bin/sh
+# MM firmware upgrade scripts
+FIRMWARE=mm.mcs
+cd /tmp
+if [ ! -f "$FIRMWARE" ]; then
+        wget http://downloads.canaan-creative.com/software/avalon6/mm60/latest/mm.mcs -O ./$FIRMWARE
+fi
+/etc/init.d/cron stop
+/etc/init.d/cgminer stop
+# wait cgminer stop finish
+sleep 2
+mm-tools
+# wait mm reboot
+sleep 25
+/etc/init.d/cgminer start
+/etc/init.d/cron start

+ 16 - 0
cgminer/files/mm-gekko-upgrade

@@ -0,0 +1,16 @@
+#!/bin/sh
+# MM firmware upgrade scripts
+FIRMWARE=mm.mcs
+cd /tmp
+if [ ! -f "$FIRMWARE" ]; then
+        wget http://downloads.canaan-creative.com/software/avalon6/mm60/latest/mm.mcs -O ./$FIRMWARE
+fi
+/etc/init.d/cron stop
+/etc/init.d/cgminer stop
+# wait cgminer stop finish
+sleep 2
+mm-tools
+# wait mm reboot
+sleep 25
+/etc/init.d/cgminer start
+/etc/init.d/cron start

+ 14 - 0
cgminer/root-files/etc/banner

@@ -0,0 +1,14 @@
+  _______                     ________        __
+ |       |.-----.-----.-----.|  |  |  |.----.|  |_
+ |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
+ |_______||   __|_____|__|__||________||__|  |____|
+          |__| W I R E L E S S   F R E E D O M
+ -----------------------------------------------------
+ CHAOS CALMER (Chaos Calmer 15.05.1[wareck_mod], r49118)
+ -----------------------------------------------------
+  * 1 1/2 oz Gin            Shake with a glassful
+  * 1/4 oz Triple Sec       of broken ice and pour
+  * 3/4 oz Lime Juice       unstrained into a goblet.
+  * 1 1/2 oz Orange Juice
+  * 1 tsp. Grenadine Syrup
+ -----------------------------------------------------

+ 25 - 0
cgminer/root-files/etc/config/dhcp

@@ -0,0 +1,25 @@
+
+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 'ignore' '1'
+
+config 'dhcp' 'wan'
+	option 'interface' 'wan'
+	option 'ignore' '1'
+

+ 119 - 0
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'
+

+ 13 - 0
cgminer/root-files/etc/config/network

@@ -0,0 +1,13 @@
+config interface 'loopback'
+        option ifname 'lo'
+        option proto 'static'
+        option ipaddr '127.0.0.1'
+        option netmask '255.255.255.0'
+
+config interface 'lan'
+        option ifname 'eth0'
+        option type 'bridge'
+        option _orig_ifname 'eth0 radio0.network1'
+        option _orig_bridge 'true'
+        option proto 'dhcp'
+        option hostname 'OpenWRT_Wareck_Mod'

+ 13 - 0
cgminer/root-files/etc/config/system

@@ -0,0 +1,13 @@
+config system
+        option hostname 'wareck'
+        option zonename 'Europe/Paris'
+        option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
+        option conloglevel '8'
+        option cronloglevel '8'
+
+config timeserver 'ntp'
+        list server '0.openwrt.pool.ntp.org'
+        list server '1.openwrt.pool.ntp.org'
+        list server '2.openwrt.pool.ntp.org'
+        list server '3.openwrt.pool.ntp.org'
+        option enabled '1'

+ 7 - 0
cgminer/root-files/etc/openwrt_release

@@ -0,0 +1,7 @@
+DISTRIB_ID="OpenWrt"
+DISTRIB_RELEASE="15.05.1[Wareck_Mod]"
+DISTRIB_REVISION="r42625"
+DISTRIB_CODENAME="chaos_calmer"
+DISTRIB_TARGET="ar71xx/generic"
+DISTRIB_DESCRIPTION="OpenWrt Chaos Calmer 15.05.1[Wareck_Mod]"
+DISTRIB_TAINTS=""

+ 1 - 0
cgminer/root-files/etc/openwrt_version

@@ -0,0 +1 @@
+15.05.1[Wareck_Mod]

+ 27 - 0
cgminer/root-files/etc/sysctl.conf

@@ -0,0 +1,27 @@
+kernel.panic=3
+net.ipv4.conf.default.arp_ignore=1
+net.ipv4.conf.all.arp_ignore=1
+net.ipv4.ip_forward=1
+net.ipv4.icmp_echo_ignore_broadcasts=1
+net.ipv4.icmp_ignore_bogus_error_responses=1
+net.ipv4.tcp_ecn=0
+net.ipv4.tcp_fin_timeout=30
+net.ipv4.tcp_keepalive_time=120
+net.ipv4.tcp_syncookies=1
+net.ipv4.tcp_timestamps=1
+net.ipv4.tcp_sack=1
+net.ipv4.tcp_dsack=1
+
+net.netfilter.nf_conntrack_acct=1
+net.netfilter.nf_conntrack_checksum=0
+net.netfilter.nf_conntrack_max=16384
+net.netfilter.nf_conntrack_tcp_timeout_established=3600
+net.netfilter.nf_conntrack_udp_timeout=60
+net.netfilter.nf_conntrack_udp_timeout_stream=180
+
+# disable bridge firewalling by default
+net.bridge.bridge-nf-call-arptables=0
+net.bridge.bridge-nf-call-ip6tables=0
+net.bridge.bridge-nf-call-iptables=0
+
+vm.overcommit_memory=1

+ 18 - 0
cgminer/root-files/etc/uci-defaults/01-cgminer

@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Hook the Cgminer Configuration + /etc/init.d/cgminer restart
+echo '' >> /etc/config/ucitrack
+echo 'config cgminer' >> /etc/config/ucitrack
+echo -e '\toption init cgminer' >> /etc/config/ucitrack
+
+# Enable the cgminer service
+/etc/init.d/cgminer enable
+
+# Disable ntp service (Run once when start cgminer)
+/etc/init.d/sysntpd disable
+
+# 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

+ 15 - 0
cgminer/root-files/usr/lib/lua/luci/version.lua

@@ -0,0 +1,15 @@
+local pcall, dofile, _G = pcall, dofile, _G
+
+module "luci.version"
+
+if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
+        distname    = ""
+        distversion = _G.DISTRIB_DESCRIPTION
+else
+        distname    = "OpenWrt"
+        distversion = "Development Snapshot"
+end
+
+luciname    = "LuCI 15.05-283"
+luciversion = "4b80adb"
+

+ 75 - 0
fpgatools/Makefile

@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2012 Xiangfu Liu <xiangfu@openmobilefree.net>
+#                            bitcoin: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fpgatools
+PKG_VERSION:=$(shell date +%Y%m%d)
+PKG_REV:=HEAD
+PKG_RELEASE:=1
+PKG_INSTALL:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_URL:=git://github.com/Wolfgang-Spraul/fpgatools.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fpgatools/Default
+	MAINTAINER:="Xiangfu Liu" <xiangfu@sharism.cc>
+	SECTION:=utils
+	CATEGORY:=Utilities
+	TITLE:=fpgatools
+	URL:=https://github.com/ckolivas/fpgatools
+	DEPENDS:=+libusb-compat +libftdi
+endef
+
+define Package/fpgatools/description
+fpgatools is a toolchain to program field-programmable gate arrays (FPGAs)
+endef
+
+TARGET_LDFLAGS += -lusb -lftdi
+define Build/Compile
+	$(call Build/Compile/Default, fp2bit, bit2fp)
+	$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/mini-jtag \
+		$(MAKE_FLAGS) \
+		DESTDIR="$(PKG_INSTALL_DIR)" \
+		all install
+endef
+
+define Package/fpgatools
+	$(call Package/fpgatools/Default)
+	TITLE+=(fpgatools)
+endef
+
+define Package/fpgatools/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_DIR) $(1)/usr/lib
+
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/fp2bit $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/bit2fp $(1)/usr/bin
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/local/lib/libfpga-* \
+		$(1)/usr/lib/
+endef
+
+define Package/mini-jtag
+	$(call Package/fpgatools/Default)
+	DEPENDS:=+libusb-compat +libftdi
+	TITLE+=(mini-jtag)
+endef
+
+define Package/mini-jtag/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/mini-jtag $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,fpgatools))
+$(eval $(call BuildPackage,mini-jtag))

+ 42 - 0
fpgatools/patches/exclude-static-libs.patch

@@ -0,0 +1,42 @@
+diff --git a/Makefile b/Makefile
+index 1aed6d1..a44dbe0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -245,8 +245,6 @@ install: fp2bit bit2fp
+ 	mkdir -p $(DESTDIR)/$(PREFIX)/bin/
+ 	install -m 755 fp2bit $(DESTDIR)/$(PREFIX)/bin/
+ 	install -m 755 bit2fp $(DESTDIR)/$(PREFIX)/bin/
+-	chrpath -d $(DESTDIR)/$(PREFIX)/bin/fp2bit
+-	chrpath -d $(DESTDIR)/$(PREFIX)/bin/bit2fp
+ 
+ uninstall:
+ 	@make -C libs uninstall
+diff --git a/libs/Makefile b/libs/Makefile
+index 159125a..1628cae 100644
+--- a/libs/Makefile
++++ b/libs/Makefile
+@@ -27,7 +27,7 @@ DYNAMIC_HEADS = bit.h control.h floorplan.h helper.h model.h parts.h
+ SHARED_FLAGS = -shared -Wl,-soname,$@.$(LIBS_VERSION_MAJOR)
+ .PHONY:	all clean install uninstall FAKE
+ 
+-all: $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.a)
++all: $(DYNAMIC_LIBS)
+ 
+ include ../Makefile.common
+ 
+@@ -75,15 +75,11 @@ install: all
+ 	mkdir -p $(DESTDIR)/$(PREFIX)/lib/
+ 	install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/
+ 	for f in $(DYNAMIC_LIBS); do \
+-	  chrpath -d $$f.$(LIBS_VERSION_MAJOR) && \
+ 	  install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \
+ 	  (cd $(DESTDIR)/$(PREFIX)/lib/ && \
+ 	   ln -sf $$f.$(LIBS_VERSION) $$f.$(LIBS_VERSION_MAJOR) && \
+ 	   ln -sf $$f.$(LIBS_VERSION_MAJOR) $$f) \
+ 	  || exit 1; done
+-	for f in $(DYNAMIC_LIBS:.so=.a); do \
+-	  install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f \
+-	  || exit 1; done
+ 
+ uninstall:
+ 	for f in $(DYNAMIC_HEADS); do rm -f $(DESTDIR)/$(PREFIX)/include/$$f || exit 1; done

+ 44 - 0
jansson/Makefile

@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=jansson
+PKG_VERSION:=2.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.digip.org/jansson/releases/
+PKG_MD5SUM:=00dd7b55c01c74cac59df398208b92ed
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/jansson
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=JSON library
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/{lib,include}
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson* $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+endef
+
+define Package/jansson/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,jansson))
+

+ 49 - 0
libftdi/Makefile

@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libftdi
+PKG_VERSION:=0.19
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
+PKG_MD5SUM:=e6e25f33b4327b1b7aa1156947da45f3
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libftdi
+	SECTION:=libs
+	CATEGORY:=Libraries
+	DEPENDS:=+libusb +libusb-compat
+	TITLE:=library to talk to FTDI chips
+	URL:=http://www.intra2net.com/en/developer/libftdi/
+endef
+
+define Package/libftdi/description
+	libFTDI - FTDI USB driver with bitbang mode
+	libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode.
+	The library is linked with your program in userspace, no kernel driver required.
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/ftdi.h $(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.{a,so} $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so* $(1)/usr/lib/
+endef
+
+define Package/libftdi/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libftdi))

+ 56 - 0
mm-tools/Makefile

@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2014 Mikeqin <Fengling.Qin@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mm-tools
+PKG_VERSION:=git-$(shell git ls-remote https://github.com/Canaan-Creative/Avalon-extras master | cut -f1 | cut -c1-7)
+PKG_REV:=master
+PKG_RELEASE:=1
+PKG_INSTALL:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_URL:=https://github.com/Canaan-Creative/Avalon-extras.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
+PKG_UNPACK_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+PKG_UNPACK := $(SH_FUNC) $(call UNPACK_CMD,$(PKG_UNPACK_DIR)) $(call CRLF_CMD,         $(PKG_UNPACK_DIR))
+
+define Package/mm-tools/Default
+	MAINTAINER:="Mikeqin" <Fengling.Qin@gmail.com>
+	SECTION:=utils
+	CATEGORY:=Utilities
+	TITLE:=mm-tools
+	URL:=https://github.com/Creative-Canaan/Avalon-extras.git
+	DEPENDS:=+libpthread +udev
+endef
+
+define Package/mm-tools/description
+mm-tools is a tool to reflash MM firmware for Avalon4, Support Raspberry Pi B only.
+endef
+
+define Package/mm-tools
+	$(call Package/mm-tools/Default)
+	TITLE+=(for Avalon4)
+endef
+
+define Build/Install
+	@echo "Install nothing, Ignore install error"
+endef
+
+define Package/mm-tools/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	cp $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,mm-tools))

+ 39 - 0
xc3sprog/Makefile

@@ -0,0 +1,39 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=xc3sprog
+PKG_REV:=742
+PKG_VERSION:=r$(PKG_REV)
+PKG_RELEASE:=1
+
+PKG_SOURCE=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://svn.code.sf.net/p/xc3sprog/code/trunk
+PKG_SOURCE_PROTO:=svn
+PKG_SOURCE_VERSION=$(PKG_REV)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/xc3sprog
+	SECTION:=utils
+	CATEGORY:=Utilities
+	TITLE:=xc3sporg
+	URL:=http://xc3sprog.sourceforge.net/
+	DEPENDS:=+libusb-compat +libftdi +libstdcpp
+endef
+
+define Package/xc3sprog/description
+xc3sprog is a suite of utilities for programming Xilinx FPGAs, CPLDs, and EEPROMs with the Xilinx Parallel Cable and other JTAG adapters under Linux. 
+endef
+
+define Package/xc3sprog/install
+	$(INSTALL_DIR) $(1)/usr/bin
+
+	$(INSTALL_BIN) \
+		$(PKG_INSTALL_DIR)/usr/bin/* \
+		$(1)/usr/bin/
+
+	$(CP) $(FILES_DIR)/* $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,xc3sprog))

+ 7 - 0
xc3sprog/files/program-avalon

@@ -0,0 +1,7 @@
+#!/bin/sh
+#mini-jtag load xc6slx16-2-ftg256.bscan_s6_spi_isf_ext.bit && sleep 1 && xc3sprog -c qi -v -I fpga_controller_2013-05-02-D.bit
+xc3sprog -c qi xc6slx16-2-ftg256.bscan_s6_spi_isf_ext.bit && sleep 1 && xc3sprog -c qi -v -I fpga_controller_2013-05-02-D.bit
+xc3sprog -c qi -v -I file.bin:R:0:bin
+dd if=file.bin bs=68 skip=1 of=file2.bin
+xc3sprog -c qi -v -I file2.bin:w:0:bin
+rm -f file.bin file2.bin

BIN
xc3sprog/files/xc6slx16-2-ftg256.bscan_s6_spi_isf_ext.bit


+ 25 - 0
xc3sprog/patches/0001-add-qi-jtag-serial-cable.patch

@@ -0,0 +1,25 @@
+From bbd42d8369343a782317c25c2be933e77956fc26 Mon Sep 17 00:00:00 2001
+From: Xiangfu <xiangfu@openmobilefree.net>
+Date: Mon, 1 Jul 2013 20:19:01 +0800
+Subject: [PATCH 1/2] add qi-jtag-serial cable
+
+---
+ cablelist.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cablelist.txt b/cablelist.txt
+index 2d59dda..db37967 100644
+--- a/cablelist.txt
++++ b/cablelist.txt
+@@ -6,6 +6,8 @@
+ # Max_Freq == 0 mean use maximum speed of device
+ # Use 1500000 for all cable connected cables and max for all on board cables
+ 
++qi            ftdi    1500000 0x20b7:0x0713:
++qijtag        ftdi    1500000 0x20b7:0x0713:FTDIJTAG:1:0x00:0x10:0x00:0x00
+ ftdi          ftdi    1500000 0x0403:0x6010:                                       
+ minila        ftdi     800000 0x0403:0x6010:
+ ft232h        ftdi    1500000 0x0403:0x6014:                                      
+-- 
+1.8.1.2
+

+ 87 - 0
xc3sprog/patches/0002-add-xc6slx16-ucf-and-a-Makefile-for-xilinx-tools.patch

@@ -0,0 +1,87 @@
+From 1bdad90649f380ba652b6ff522646345c0b575c6 Mon Sep 17 00:00:00 2001
+From: Xiangfu <xiangfu@openmobilefree.net>
+Date: Mon, 1 Jul 2013 20:19:29 +0800
+Subject: [PATCH 2/2] add xc6slx16 ucf and a Makefile for xilinx tools
+
+---
+ bscan_spi/Makefile                 | 56 ++++++++++++++++++++++++++++++++++++++
+ bscan_spi/bscan_s6_spi_isf_ext.ucf |  4 +++
+ 2 files changed, 60 insertions(+)
+ create mode 100644 bscan_spi/Makefile
+ create mode 100644 bscan_spi/bscan_s6_spi_isf_ext.ucf
+
+diff --git a/bscan_spi/Makefile b/bscan_spi/Makefile
+new file mode 100644
+index 0000000..59dad6b
+--- /dev/null
++++ b/bscan_spi/Makefile
+@@ -0,0 +1,56 @@
++#
++# Author: Xiangfu Liu
++#
++# This is free and unencumbered software released into the public domain.
++# For details see the UNLICENSE file at the root of the source tree.
++#
++
++all: bscan_s6_spi_isf_ext.bit
++
++# Build for m1
++#FPGA_TARGET ?= xc6slx45-fgg484-2
++
++# Build for mini-slx9 board tqg144/ftg256/csg324
++#FPGA_TARGET ?= xc6slx9-2-csg324
++#FPGA_TARGET ?= xc6slx9-2-ftg256
++FPGA_TARGET ?= xc6slx16-2-ftg256
++
++%.bit: %-routed.ncd
++# -d disables DRC
++# -b creates rawbits file .rbt
++# -l creates logic allocation file .ll
++# -w overwrite existing output file
++# "-g compress" enables compression
++	if test -f $<; then bitgen -b -l -w $< $@; fi
++	mkdir -p bits
++	cp $@ bits/$(FPGA_TARGET).$@
++
++%.ncd: %.xdl
++	-xdl -xdl2ncd $<
++
++%-routed.ncd: %.ncd
++	par -w $< $@
++
++%.ncd: %.ngd
++	map -w $<
++
++%.ngd: %.ucf %.ngc
++	ngdbuild -uc $< $(@:.ngd=.ngc)
++
++%.ngc: %.xst
++	xst -ifn $<
++
++%.xst: %.prj
++	echo run > $@
++	echo -ifn $< >> $@
++	echo -top top >> $@
++	echo -ifmt MIXED >> $@
++	echo -opt_mode SPEED >> $@
++	echo -opt_level 1 >> $@
++	echo -ofn $(<:.prj=.ngc) >> $@
++	echo -p $(FPGA_TARGET) >> $@
++
++%.prj: %.v
++	for i in `echo $^`; do \
++	    echo "verilog $(basename $<) $$i" >> $@; \
++	done
+diff --git a/bscan_spi/bscan_s6_spi_isf_ext.ucf b/bscan_spi/bscan_s6_spi_isf_ext.ucf
+new file mode 100644
+index 0000000..48098cd
+--- /dev/null
++++ b/bscan_spi/bscan_s6_spi_isf_ext.ucf
+@@ -0,0 +1,4 @@
++net "MISO" LOC = "P10";
++net "MOSI" LOC = "T10";
++net "DRCK1" LOC= "R11";
++net "CSB"  LOC = "T3";
+-- 
+1.8.1.2
+

+ 13 - 0
xc3sprog/patches/0003-disable-libftd2xx.patch

@@ -0,0 +1,13 @@
+Index: xc3sprog-r742/CMakeLists.txt
+===================================================================
+--- xc3sprog-r742.orig/CMakeLists.txt	2012-09-20 21:36:46.000000000 +0800
++++ xc3sprog-r742/CMakeLists.txt	2014-09-23 17:17:42.507053279 +0800
+@@ -11,7 +11,7 @@
+ set(USE_STATIC_FTDI ON)
+ endif(${WIN32})
+ 
+-option(USE_FTD2XX "Use FTDI libFTD2XX instead of free libftdi" ON)
++option(USE_FTD2XX "Use FTDI libFTD2XX instead of free libftdi" OFF)
+ 
+ find_package(libftdi)
+ include_directories(${LIBFTDI_INCLUDE_DIR})

+ 18 - 0
xc3sprog/patches/0004-version-detect.patch

@@ -0,0 +1,18 @@
+Index: xc3sprog-r742/CMakeLists.txt
+===================================================================
+--- xc3sprog-r742.orig/CMakeLists.txt	2014-09-23 17:17:42.507053279 +0800
++++ xc3sprog-r742/CMakeLists.txt	2014-09-23 17:22:59.147040108 +0800
+@@ -30,13 +30,7 @@
+ if(EXISTS ${PROJECT_SOURCE_DIR}/.git) 
+   set(VERSION_STRING "${xc3sprog_VERSION_MAJOR}.${xc3sprog_VERSION_MINOR}-git")
+ else(EXISTS ${PROJECT_SOURCE_DIR}/.git)
+-  FIND_PACKAGE(Subversion)
+-  IF(Subversion_FOUND)
+-    Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+-    set(VERSION_STRING "${xc3sprog_VERSION_MAJOR}.${xc3sprog_VERSION_MINOR}-svn${Project_WC_REVISION}")
+-  ELSE(Subversion_FOUND)
+     set(VERSION_STRING "unknown")
+-  ENDIF(Subversion_FOUND)
+ endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
+ 
+ # Create suffix to eventually install inlib64