Browse Source

Merge commit 'e341fbc7d' into bfgminer

Luke Dashjr 8 years ago
parent
commit
3900e388b1
2 changed files with 17 additions and 9 deletions
  1. 8 6
      README.OpenWrt
  2. 9 3
      openwrt/multibuild.sh

+ 8 - 6
README.OpenWrt

@@ -1,14 +1,16 @@
 First, look at /etc/openwrt_release (on your router). You will see a bunch of
 First, look at /etc/openwrt_release (on your router). You will see a bunch of
 attributes for the OpenWrt system. The DISTRIB_RELEASE attribute is your
 attributes for the OpenWrt system. The DISTRIB_RELEASE attribute is your
-OpenWrt version, and the first part of DISTRIB_TARGET (before the slash) is
-the router's platform.
+OpenWrt version, the first part of DISTRIB_TARGET (before the slash) is the
+router's platform, and (only on newer versions) DISTRIB_ARCH is the package
+architecture. Older versions of OpenWrt (up to 15.05) use the router's
+platform for packages instead of the package architecture.
 
 
 Now, open up /etc/opkg.conf (again, on your router) in your favourite editor.
 Now, open up /etc/opkg.conf (again, on your router) in your favourite editor.
 Add a new line at the bottom, similar to this:
 Add a new line at the bottom, similar to this:
-	src/gz bfgminer http://luke.dashjr.org/programs/bitcoin/files/bfgminer/latest/openwrt/15.05/ar71xx
-In this example, 15.05 is the version of OpenWrt, and ar71xx is the platform.
-Be sure to change those to match your router! You can also change "latest" to
-"stable" or "testing" to get better-tested versions.
+	src/gz bfgminer http://luke.dashjr.org/programs/bitcoin/files/bfgminer/latest/openwrt/17.01/mips_24kc
+In this example, 17.01 is the version of OpenWrt, and mips_24kc is the package
+architecture. Be sure to change those to match your router! You can also 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
 by running the command:
 by running the command:

+ 9 - 3
openwrt/multibuild.sh

@@ -46,15 +46,20 @@ fi
 
 
 plat1=''
 plat1=''
 for cfn in $vcfglist; do
 for cfn in $vcfglist; do
-	plat="$(perl -ple 's/^(\d+)\.config\.(\w+?)_\w+$/$2/ or $_=""' <<<"$cfn")"
+	plat="$(perl -ple 's/^\d+\.config\.(\w+)$/$1/ or $_=""' <<<"$cfn")"
 	test -n "$plat" ||
 	test -n "$plat" ||
 		continue
 		continue
+	if [[ $plat =~ _pkgs$ ]]; then
+		plat="${plat::-5}"
+	else
+		plat="$(perl -ple 's/_.*//' <<<"$plat")"
+	fi
 	platlist+=("$plat")
 	platlist+=("$plat")
 	cp -v "$vcfgdir/$cfn" .config
 	cp -v "$vcfgdir/$cfn" .config
 	yes '' | make oldconfig
 	yes '' | make oldconfig
-	make {tools,toolchain}/install package/bfgminer/{clean,compile}
+	make {tools,toolchain}/install package/bfgminer/{clean,compile} V=s
 	mkdir "$reporoot/$plat" -pv
 	mkdir "$reporoot/$plat" -pv
-	files=$(ls "bin/$plat/packages/"{*/,}bfgminer*_${plat}*.ipk || true)
+	files=$(ls bin/"$plat"/packages/{*/,}bfgminer*_${plat}*.ipk bin/packages/"$plat"/{*/,}bfgminer*_${plat}*.ipk || true)
 	if test -z "${files}"; then
 	if test -z "${files}"; then
 		echo "Cannot find built packages"
 		echo "Cannot find built packages"
 		exit 1
 		exit 1
@@ -71,6 +76,7 @@ for cfn in $vcfglist; do
 	fi
 	fi
 	(
 	(
 		cd "$reporoot/$plat/"
 		cd "$reporoot/$plat/"
+		PATH="${openwrt_root}/staging_dir/host/bin/:${PATH}" \
 		"${openwrt_root}/scripts/ipkg-make-index.sh" .
 		"${openwrt_root}/scripts/ipkg-make-index.sh" .
 	) > "$reporoot/$plat/Packages"
 	) > "$reporoot/$plat/Packages"
 	gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"
 	gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"