2022-08-08 00:56:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
exec >&2
|
2022-09-23 11:43:59 +00:00
|
|
|
printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
|
2022-08-08 00:56:50 +00:00
|
|
|
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."
|
2022-09-23 11:43:59 +00:00
|
|
|
echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
|
2022-08-08 00:56:50 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
grep -q '^Features.*\baes\b' /proc/cpuinfo || {
|
|
|
|
echo "not supported"
|
|
|
|
echo "Error: Arm v8-A Cryptographic Extension not supported."
|
2022-09-23 11:43:59 +00:00
|
|
|
echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
|
2022-08-08 00:56:50 +00:00
|
|
|
echo "Contents of /proc/cpuinfo:"
|
|
|
|
cat /proc/cpuinfo
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
echo OK
|
|
|
|
exit 0
|