multibuild.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -e
  3. set -x
  4. reporoot="$1" # .../files/bfgminer/BFGMINER_VERSION/openwrt/OPENWRT_VERSION
  5. test -n "$reporoot"
  6. reporoot="$(realpath "$reporoot")"
  7. test -n "$reporoot"
  8. cd "openwrt-src/"
  9. test -d "$reporoot"
  10. vcfgdir='vanilla_configs'
  11. vcfglist="$(
  12. ls -d "$vcfgdir"/*.config* |
  13. perl -ple 's[.*/][]' |
  14. sort -n
  15. )"
  16. plat1=''
  17. for cfn in $vcfglist; do
  18. plat="$(perl -ple 's/^(\d+)\.config\.(\w+)_\w+$/$2/ or $_=""' <<<"$cfn")"
  19. test -n "$plat" ||
  20. continue
  21. platlist+=("$plat")
  22. cp -v "$vcfgdir/$cfn" .config
  23. yes '' | make oldconfig
  24. make {tools,toolchain}/install package/bfgminer/{clean,compile}
  25. mkdir "$reporoot/$plat" -pv
  26. cp -v "bin/$plat/packages/"b{fgminer,itforce}*_${plat}.ipk "$reporoot/$plat/"
  27. if test -n "$plat1"; then
  28. (
  29. cd "$reporoot/$plat"
  30. ln -vfs "../$plat1/"bfgminer*_all.ipk .
  31. )
  32. else
  33. plat1="$plat"
  34. cp -v "bin/$plat/packages/"bfgminer*_all.ipk "$reporoot/$plat/"
  35. fi
  36. staging_dir/host/bin/ipkg-make-index "$reporoot/$plat/" > "$reporoot/$plat/Packages"
  37. gzip -9 < "$reporoot/$plat/Packages" > "$reporoot/$plat/Packages.gz"
  38. done