449e324f160fc8cd95f185fd111716d6e759d8c4
[openwrt/openwrt.git] / package / libs / wolfssl / preinst.arm-ce
1 #!/bin/sh
2 exec >&2
3 printf "[libwolfssl-cpu-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 libwolfssl-cpu-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 libwolfssl-cpu-crypto."
19 echo "Contents of /proc/cpuinfo:"
20 cat /proc/cpuinfo
21 exit 1
22 }
23 fi
24 echo OK
25 exit 0