Pour créer un dépôt OpenWRT pour l'application quid
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

make_ipk.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. set -ex
  3. VERSION="0.0.0-0"
  4. ARCH="arm_cortex-a9_vfpv3"
  5. SRC="server-linux-arm.tar.gz"
  6. BUILD_KEY_DIR=/srv/keys
  7. BUILD_KEY=$BUILD_KEY_DIR/cadoles
  8. # create Cadoles repository key sign
  9. # file PUB_KEY_NAME must be copied to /etc/opkg/keys/ on openwrt
  10. if [ ! -f /srv/keys/cadoles ]; then
  11. /srv/usign/build/usign -G -s $BUILD_KEY -p $BUILD_KEY.pub -c "Key for Cadoles repositories"
  12. PUB_KEY_NAME=$(/srv/usign/build/usign -F -p $BUILD_KEY.pub)
  13. cp $BUILD_KEY.pub $BUILD_KEY_DIR/$PUB_KEY_NAME
  14. fi
  15. # build package
  16. cd /srv/cadoles
  17. rm -rf depot/* tmp
  18. mkdir -p tmp/src/opt/quid tmp/src/opt/cadoles tmp/src/etc/hotplug.d/iface/
  19. tar zxf $SRC --strip-components 1 --one-top-level=tmp/src/opt/quid
  20. cp -a configure_captive.sh tmp/src/etc/hotplug.d/iface/30-captive
  21. cp -a management/* tmp/src/opt/cadoles
  22. cd tmp/src/
  23. tar zcf ../data.tar.gz ./
  24. cd ..
  25. PKG="""Package: quid
  26. Version: ${VERSION}
  27. License: GPL-2.0
  28. LicenseFiles: LICENSE
  29. Section: admin
  30. Maintainer: Cadoles <contact@cadoles.com>
  31. Architecture: ${ARCH}
  32. Installed-Size: 203390
  33. Description: QUID package
  34. """
  35. echo $PKG > control
  36. tar zcf control.tar.gz control
  37. echo "2.0" > debian-binary
  38. PKG_NAME=quid_${VERSION}_${ARCH}.ipk
  39. tar zcf ../depot/$PKG_NAME debian-binary control.tar.gz data.tar.gz
  40. cd ..
  41. rm -rf tmp
  42. # create Packages
  43. SUM=$(sha256sum depot/$PKG_NAME | awk '{ print $1 }')
  44. echo """${PKG}SHA256sum: $SUM
  45. Filename: $PKG_NAME
  46. """ > depot/Packages
  47. # sign Packages with Cadole's key
  48. /srv/usign/build/usign -S -m depot/Packages -s $BUILD_KEY;
  49. # compress Packages
  50. gzip depot/Packages