diff options
Diffstat (limited to 'package/libs/wolfssl/preinst.arm-ce')
-rw-r--r-- | package/libs/wolfssl/preinst.arm-ce | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/package/libs/wolfssl/preinst.arm-ce b/package/libs/wolfssl/preinst.arm-ce new file mode 100644 index 0000000000..449e324f16 --- /dev/null +++ b/package/libs/wolfssl/preinst.arm-ce @@ -0,0 +1,25 @@ +#!/bin/sh +exec >&2 +printf "[libwolfssl-cpu-crypto] Checking for Arm v8-A Cryptographic Extension support: " +if [ -n "${IPKG_INSTROOT}" ]; then + printf "...[offline]... " + eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")" + ### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile + echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && { + echo "not supported" + echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension." + echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto." + exit 1 + } +else + grep -q '^Features.*\baes\b' /proc/cpuinfo || { + echo "not supported" + echo "Error: Arm v8-A Cryptographic Extension not supported." + echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto." + echo "Contents of /proc/cpuinfo:" + cat /proc/cpuinfo + exit 1 + } +fi +echo OK +exit 0 |