multibuild.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # Copyright 2013 Luke Dashjr
  3. #
  4. # This program is free software; you can redistribute it and/or modify it
  5. # under the terms of the GNU General Public License as published by the Free
  6. # Software Foundation; either version 3 of the License, or (at your option)
  7. # any later version. See COPYING for more details.
  8. set -e
  9. set -x
  10. reporoot="$1" # .../files/bfgminer/BFGMINER_VERSION/openwrt/OPENWRT_VERSION
  11. test -n "$reporoot"
  12. reporoot="$(realpath "$reporoot")"
  13. test -n "$reporoot"
  14. cd "openwrt-src/"
  15. test -d "$reporoot"
  16. vcfgdir='vanilla_configs'
  17. vcfglist="$(
  18. ls -d "$vcfgdir"/*.config* |
  19. perl -ple 's[.*/][]' |
  20. sort -n
  21. )"
  22. plat1=''
  23. for cfn in $vcfglist; do
  24. plat="$(perl -ple 's/^(\d+)\.config\.(\w+?)_\w+$/$2/ or $_=""' <<<"$cfn")"
  25. test -n "$plat" ||
  26. continue
  27. platlist+=("$plat")
  28. cp -v "$vcfgdir/$cfn" .config
  29. yes '' | make oldconfig
  30. make {tools,toolchain}/install package/bfgminer/{clean,compile}
  31. mkdir "$reporoot/$plat" -pv
  32. cp -v "bin/$plat/packages/"b{fgminer,itforce}*_${plat}.ipk "$reporoot/$plat/"
  33. if test -n "$plat1"; then
  34. (
  35. cd "$reporoot/$plat"
  36. ln -vfs "../$plat1/"bfgminer*_all.ipk .
  37. )
  38. else
  39. plat1="$plat"
  40. cp -v "bin/$plat/packages/"bfgminer*_all.ipk "$reporoot/$plat/"
  41. fi
  42. staging_dir/host/bin/ipkg-make-index "$reporoot/$plat/" > "$reporoot/$plat/Packages"
  43. gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"
  44. done