summaryrefslogtreecommitdiff
path: root/tools/abi-checker/src/abi-module-checker
blob: 2666fbd9dc922fc2029d71dbd6dfcdcb902492ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

echo ""
echo "Module ABI/API checker"
echo ""
echo ""

if [ "${#}" != "1"  ]
then
	echo ""
	echo "ERROR: "
	echo "       Usage: ${0} _module_abi_fingerprint_"
	echo ""
	exit 1
fi

kerne_abi_file="/boot/abi/current"

if [ ! -f "${1}" -o ! -f "${kerne_abi_file}" ]
then
	echo ""
	echo "ERROR: Please check \"${1}\", \"${kerne_abi_file}\" files"
	echo ""
	exit 1
fi

ABI_TOOL_LOCATION="/usr/local/bin"
ABI_TOOL_NAME="abi-checker"
ABI_TOOL="${ABI_TOOL_LOCATION}/${ABI_TOOL_NAME}"

if [ -x "${ABI_TOOL}" ]
then
	CMD="${ABI_TOOL}"
elif [ -x "./${ABI_TOOL_NAME}" ]
then
	CMD="./${ABI_TOOL_NAME}"
else
	CMD="${ABI_TOOL_NAME}"
fi

"${CMD}" "test-module" "${kerne_abi_file}" "${1}"

exit ${?}