From 9d9f11f7d8e59ac5a01df2c476a3dbe0e207aaee Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Mon, 17 Feb 2020 10:55:48 +0000 Subject: [PATCH] ANDROID: kbuild: use modules.order in adjust_autoksyms.sh This is essentially a partial backport of b7dca6dd1e59 ("kbuild: create *.mod with full directory path and remove MODVERDIR") as a full backport would pull in too many dependencies. It is necessary to simplify the backport of the TRIM_NONLISTED_KMI feature. Bug: 148277666 Change-Id: Ibf85bf864b3961d5bec4965742f08a80e9f234af Signed-off-by: Quentin Perret --- scripts/adjust_autoksyms.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 84bf6b500815..76edccbe732d 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -10,8 +10,7 @@ # published by the Free Software Foundation. # Create/update the include/generated/autoksyms.h file from the list -# of all module's needed symbols as recorded on the third line of -# .tmp_versions/*.mod files. +# of all module's needed symbols as recorded on the third line of *.mod files. # # For each symbol being added or removed, the corresponding dependency # file's timestamp is updated to force a rebuild of the affected source @@ -49,13 +48,10 @@ cat > "$new_ksyms_file" << EOT */ EOT -[ "$(ls -A "$MODVERDIR")" ] && -for mod in "$MODVERDIR"/*.mod; do - sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod" -done | sort -u | -while read sym; do - echo "#define __KSYM_${sym} 1" -done >> "$new_ksyms_file" +sed 's/ko$/mod/' modules.order | +xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- | +sort -u | +sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" # Special case for modversions (see modpost.c) if [ -n "$CONFIG_MODVERSIONS" ]; then