diff --git a/CI/azure/check_kernel.sh b/CI/azure/check_kernel.sh index e8bb5931d..b9fece03d 100755 --- a/CI/azure/check_kernel.sh +++ b/CI/azure/check_kernel.sh @@ -2,6 +2,7 @@ set -e KERNEL_TYPES="/tmp/mainline_types.h" +KERNEL_MODIFIER="/tmp/modifier.c" IIOH="./include/iio/iio.h" CHANNELC="./channel.c" @@ -15,8 +16,9 @@ if [ ! -f ${CHANNELC} ] ; then exit 1 fi -rm -f ${KERNEL_TYPES} +rm -f ${KERNEL_TYPES} ${KERNEL_MODIFIER} wget -O ${KERNEL_TYPES} https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/iio/types.h +wget -O ${KERNEL_MODIFIER} https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/drivers/iio/industrialio-core.c ret=0 @@ -67,4 +69,16 @@ while IFS="" read -r p ; do fi done < /tmp/libiio_iio_modifier +sed '/\[IIO_MOD_.*\] =/!d' ${KERNEL_MODIFIER} | sed 's/,$//' > /tmp/kernel_modifier +while IFS="" read -r p ; do + key=$(echo $"${p}" | sed -e 's/^[ \t]*//' -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' ) + count=$(grep "${key}" ./channel.c | wc -l) + if [ "$count" -eq "0" ] ; then + echo "${p} set to wrong string in channel.c" + ret=1 + fi +done < /tmp/kernel_modifier + + +rm -f /tmp/kernel_modifier /tmp/libiio_iio_modifier /tmp/libiio_iio_chan_type ${KERNEL_TYPES} ${KERNEL_MODIFIER} exit $ret