preinst.arm-ce 923 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. exec >&2
  3. printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
  4. if [ -n "${IPKG_INSTROOT}" ]; then
  5. printf "...[offline]... "
  6. eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")"
  7. ### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile
  8. echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && {
  9. echo "not supported"
  10. echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
  11. echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
  12. exit 1
  13. }
  14. else
  15. grep -q '^Features.*\baes\b' /proc/cpuinfo || {
  16. echo "not supported"
  17. echo "Error: Arm v8-A Cryptographic Extension not supported."
  18. echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
  19. echo "Contents of /proc/cpuinfo:"
  20. cat /proc/cpuinfo
  21. exit 1
  22. }
  23. fi
  24. echo OK
  25. exit 0