Browse Source

openwrt: Update for LEDE 17.01

Luke Dashjr 8 years ago
parent
commit
e341fbc7df
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
 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.
 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
 by running the command:

+ 9 - 3
openwrt/multibuild.sh

@@ -46,15 +46,20 @@ fi
 
 plat1=''
 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" ||
 		continue
+	if [[ $plat =~ _pkgs$ ]]; then
+		plat="${plat::-5}"
+	else
+		plat="$(perl -ple 's/_.*//' <<<"$plat")"
+	fi
 	platlist+=("$plat")
 	cp -v "$vcfgdir/$cfn" .config
 	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
-	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
 		echo "Cannot find built packages"
 		exit 1
@@ -71,6 +76,7 @@ for cfn in $vcfglist; do
 	fi
 	(
 		cd "$reporoot/$plat/"
+		PATH="${openwrt_root}/staging_dir/host/bin/:${PATH}" \
 		"${openwrt_root}/scripts/ipkg-make-index.sh" .
 	) > "$reporoot/$plat/Packages"
 	gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"