Checking GKI KMI compatibility for GKI modules
Not all exported symbols from GKI modules are part of KMI. Only those
found in the symbol list (abi_symbollist.report) are. So Module.symvers
alone is not enough to check GKI KMI compatibility.
This change references abi_symbollist.report (from the old GKI) to
decide what symbols really need to be checked.
Released Android 14 GKI 6.1
- 2023-07: 10521792
- 2023-08: 10672300
- 2023-09: 10816536
Bug: 300218636
Test: $ cd development/gki/kmi_abi_chk
$ ./kmi_compatibility_test.sh sym-6.1/Module.symvers-10672300 sym-6.1/Module.symvers-10521792
Current kernel symbol file, sym-6.1/Module.symvers-10672300, is checking against:
sym-6.1/Module.symvers-10521792
0x39780159 wwan_create_port drivers/net/wwan/wwan EXPORT_SYMBOL_GPL
0x35acf01e wwan_register_ops drivers/net/wwan/wwan EXPORT_SYMBOL_GPL
sym-6.1/Module.symvers-10521792 contains symbol(s) not found in, or incompatible with, sym-6.1/Module.symvers-10672300.
$ ./kmi_compatibility_test.sh sym-6.1/Module.symvers-10672300 sym-6.1/Module.symvers-10521792 abi_symbollist.report
ABI list: abi_symbollist.report
Current kernel symbol file, sym-6.1/Module.symvers-10672300, is checking against:
sym-6.1/Module.symvers-10521792
Change-Id: Icb2e7949a6e576eded0c88311abca2e835826039
This commit is contained in:
@@ -16,15 +16,18 @@
|
||||
|
||||
# Usage:
|
||||
# development/gki/kmi_abi_chk/kmi_static_chk.sh \
|
||||
# <current_symbol_info> <previous_symbol_info> ...
|
||||
# <current_symbol_info> <previous_symbol_info> (abi_symbollist.report)
|
||||
#
|
||||
# abi_symbollist.report is from the previous/old GKI and optional.
|
||||
# If it's not on the command line, all symbols from the previous/old GKI
|
||||
# are considered KMI and will be checked.
|
||||
if [[ "$#" -lt 2 ]]; then
|
||||
echo "Usage: $0 <current_symbol_info> <previous_symbol_info> ..."
|
||||
echo "Usage: $0 <current_symbol_info> <previous_symbol_info> (abi_symbollist.report)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ret=0
|
||||
for f in "$@"; do
|
||||
for f in $1 $2; do
|
||||
if [[ ! -e "$f" ]]; then
|
||||
echo "Kernel symbol file $f does not exist!" >&2
|
||||
ret=1
|
||||
@@ -34,12 +37,25 @@ for f in "$@"; do
|
||||
fi
|
||||
done
|
||||
|
||||
unset abi_list
|
||||
if [[ "$#" -gt 2 ]]; then
|
||||
if [[ ! -e "$3" ]]; then
|
||||
echo "ABI symbol list $3 does not exist!" >&2
|
||||
ret=1
|
||||
else
|
||||
abi_list=$3
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! ret -eq 0 ]]; then
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
tmp=$(mktemp /tmp/linux-symvers.XXXXXX)
|
||||
trap "rm -f $tmp" EXIT
|
||||
tmp_symvers_new=$(mktemp /tmp/linux-symvers.XXXXXX)
|
||||
tmp_symvers_old=$(mktemp /tmp/linux-symvers.XXXXXX)
|
||||
tmp_abi_lst_old=$(mktemp /tmp/linux-symvers.XXXXXX)
|
||||
|
||||
trap "rm -f $tmp_symvers_new tmp_symvers_old tmp_abi_lst_old" EXIT
|
||||
|
||||
curr=$1
|
||||
shift
|
||||
@@ -58,18 +74,29 @@ shift
|
||||
# break KMI ABI, because the requirement is "relaxed". We want this case to
|
||||
# pass so a keyword like "...EXPORT_SYMBOL" in the current symbol file can
|
||||
# still match "...EXPORT_SYMBOL_GPL" in the previous symbol file.
|
||||
grep "EXPORT_SYMBOL" $curr | sed 's/[ \t]*$//' > $tmp
|
||||
grep "EXPORT_SYMBOL" $curr | sed 's/[ \t]*$//' > $tmp_symvers_new
|
||||
|
||||
if [[ -v abi_list ]]; then
|
||||
awk '{print $1}' $abi_list > $tmp_abi_lst_old
|
||||
echo "ABI list: $abi_list"
|
||||
fi
|
||||
|
||||
echo "Current kernel symbol file, $curr, is checking against:"
|
||||
|
||||
for f in "$@"; do
|
||||
for f in $1; do
|
||||
if [[ -v abi_list ]]; then
|
||||
grep -wf $tmp_abi_lst_old $f > $tmp_symvers_old
|
||||
else
|
||||
cp $f $tmp_symvers_old
|
||||
fi
|
||||
|
||||
echo " $f"
|
||||
# if nothing is found, grep returns 1, which means every symbol in the
|
||||
# previous release (usually in *.symvers-$BID) can be found in the current
|
||||
# release, so is considered successful here.
|
||||
# if grep returns 0, which means some symbols are found in the previous
|
||||
# symbol file but not in the current symbol file, then something wrong!
|
||||
if grep -vf $tmp $f; then
|
||||
if grep -vf $tmp_symvers_new $tmp_symvers_old; then
|
||||
ret=1
|
||||
echo "$f contains symbol(s) not found in, or incompatible with, $curr." >&2
|
||||
fi
|
||||
|
||||
@@ -1 +1 @@
|
||||
Module.symvers-10342778
|
||||
Module.symvers-10816536
|
||||
6781
gki/kmi_abi_chk/sym-6.1/Module.symvers-10521792
Normal file
6781
gki/kmi_abi_chk/sym-6.1/Module.symvers-10521792
Normal file
File diff suppressed because it is too large
Load Diff
6875
gki/kmi_abi_chk/sym-6.1/Module.symvers-10672300
Normal file
6875
gki/kmi_abi_chk/sym-6.1/Module.symvers-10672300
Normal file
File diff suppressed because it is too large
Load Diff
7068
gki/kmi_abi_chk/sym-6.1/Module.symvers-10816536
Normal file
7068
gki/kmi_abi_chk/sym-6.1/Module.symvers-10816536
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user