Browse Source

Updates for OpenWrt 15.05

Luke Dashjr 10 years ago
parent
commit
13f6a2d99d
3 changed files with 23 additions and 8 deletions
  1. 3 3
      README.OpenWrt
  2. 4 0
      openwrt/bfgminer/Makefile
  3. 16 5
      openwrt/multibuild.sh

+ 3 - 3
README.OpenWrt

@@ -1,11 +1,11 @@
 Open up /etc/opkg.conf (on your router) in your favourite editor. You will see
 Open up /etc/opkg.conf (on your router) in your favourite editor. You will see
 a line that looks similar to this at the top (depending on your device):
 a line that looks similar to this at the top (depending on your device):
-	src/gz attitude_adjustment http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages
+	src/gz attitude_adjustment http://downloads.openwrt.org/attitude_adjustment/15.05/ar71xx/generic/packages
 Note the platform following the OpenWrt version. In this example, it is ar71xx.
 Note the platform following the OpenWrt version. In this example, it is ar71xx.
 
 
 Now add a new line immediately below it, similar to this:
 Now add a new line immediately below it, similar to this:
-	src/gz bfgminer http://luke.dashjr.org/programs/bitcoin/files/bfgminer/latest/openwrt/12.09/ar71xx
-Be sure you put the same platform at the end as your OpenWrt repository!
+	src/gz bfgminer http://luke.dashjr.org/programs/bitcoin/files/bfgminer/latest/openwrt/15.05/ar71xx
+Be sure you put the same OpenWrt version and platform at the end as your OpenWrt repository!
 Also note that you can change "latest" to "stable" or "testing" to get better-tested versions.
 Also note that you can change "latest" to "stable" or "testing" to get better-tested versions.
 
 
 Next, save the file and exit your editor. Tell opkg to reload its package lists
 Next, save the file and exit your editor. Tell opkg to reload its package lists

+ 4 - 0
openwrt/bfgminer/Makefile

@@ -17,6 +17,10 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).txz
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).txz
 PKG_SOURCE_URL:=http://luke.dashjr.org/programs/bitcoin/files/$(PKG_NAME)/$(PKG_VERSION)/
 PKG_SOURCE_URL:=http://luke.dashjr.org/programs/bitcoin/files/$(PKG_NAME)/$(PKG_VERSION)/
 
 
+PKG_MAINTAINER:=Luke Dashjr <luke-jr+bfgminer@utopios.org>
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+
 PKG_INSTALL:=1
 PKG_INSTALL:=1
 
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/package.mk

+ 16 - 5
openwrt/multibuild.sh

@@ -9,10 +9,13 @@
 set -e
 set -e
 set -x
 set -x
 reporoot="$1"  # .../files/bfgminer/BFGMINER_VERSION/openwrt/OPENWRT_VERSION
 reporoot="$1"  # .../files/bfgminer/BFGMINER_VERSION/openwrt/OPENWRT_VERSION
+openwrt_root="${2:-openwrt-src}"
+BITSTREAM_PKG_PATH="${3}"  # Relative to reporoot
 test -n "$reporoot"
 test -n "$reporoot"
 reporoot="$(realpath "$reporoot")"
 reporoot="$(realpath "$reporoot")"
 test -n "$reporoot"
 test -n "$reporoot"
-cd "openwrt-src/"
+cd "${openwrt_root}/"
+openwrt_root="$PWD"
 test -d "$reporoot"
 test -d "$reporoot"
 vcfgdir='vanilla_configs'
 vcfgdir='vanilla_configs'
 vcfglist="$(
 vcfglist="$(
@@ -20,7 +23,6 @@ vcfglist="$(
 	 perl -ple 's[.*/][]' |
 	 perl -ple 's[.*/][]' |
 	 sort -n
 	 sort -n
 )"
 )"
-BITSTREAM_PKG_PATH='../../../../bitstreams/openwrt/'  # Relative to reporoot
 BITSTREAMS=(
 BITSTREAMS=(
 	fpgaminer_402-1
 	fpgaminer_402-1
 	ztex-ufm1_15b1_121126-1
 	ztex-ufm1_15b1_121126-1
@@ -52,15 +54,24 @@ for cfn in $vcfglist; do
 	yes '' | make oldconfig
 	yes '' | make oldconfig
 	make {tools,toolchain}/install package/bfgminer/{clean,compile}
 	make {tools,toolchain}/install package/bfgminer/{clean,compile}
 	mkdir "$reporoot/$plat" -pv
 	mkdir "$reporoot/$plat" -pv
-	cp -v "bin/$plat/packages/"bfgminer*_${plat}.ipk "$reporoot/$plat/"
-	if [ -d "$reporoot/${BITSTREAM_PKG_PATH}" ]; then
+	files=$(ls "bin/$plat/packages/"{*/,}bfgminer*_${plat}*.ipk || true)
+	if test -z "${files}"; then
+		echo "Cannot find built packages"
+		exit 1
+	fi
+	cp -v ${files} "$reporoot/$plat/"
+	if [ -n "${BITSTREAM_PKG_PATH}" ]; then
 	(
 	(
+		test -d "$reporoot/${BITSTREAM_PKG_PATH}"
 		cd "$reporoot/$plat"
 		cd "$reporoot/$plat"
 		for bs in ${BITSTREAMS[@]}; do
 		for bs in ${BITSTREAMS[@]}; do
 			ln -vfs "../${BITSTREAM_PKG_PATH}/bitstream-${bs}_all.ipk" .
 			ln -vfs "../${BITSTREAM_PKG_PATH}/bitstream-${bs}_all.ipk" .
 		done
 		done
 	)
 	)
 	fi
 	fi
-	staging_dir/host/bin/ipkg-make-index "$reporoot/$plat/" > "$reporoot/$plat/Packages"
+	(
+		cd "$reporoot/$plat/"
+		"${openwrt_root}/scripts/ipkg-make-index.sh" .
+	) > "$reporoot/$plat/Packages"
 	gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"
 	gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"
 done
 done