Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d9f11f7 authored by Quentin Perret's avatar Quentin Perret
Browse files

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: default avatarQuentin Perret <qperret@google.com>
parent 390b1151
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -10,8 +10,7 @@
# published by the Free Software Foundation.
# published by the Free Software Foundation.


# Create/update the include/generated/autoksyms.h file from the list
# Create/update the include/generated/autoksyms.h file from the list
# of all module's needed symbols as recorded on the third line of
# of all module's needed symbols as recorded on the third line of *.mod files.
# .tmp_versions/*.mod files.
#
#
# For each symbol being added or removed, the corresponding dependency
# For each symbol being added or removed, the corresponding dependency
# file's timestamp is updated to force a rebuild of the affected source
# file's timestamp is updated to force a rebuild of the affected source
@@ -49,13 +48,10 @@ cat > "$new_ksyms_file" << EOT
 */
 */


EOT
EOT
[ "$(ls -A "$MODVERDIR")" ] &&
sed 's/ko$/mod/' modules.order |
for mod in "$MODVERDIR"/*.mod; do
xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- |
	sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod"
sort -u |
done | sort -u |
sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file"
while read sym; do
	echo "#define __KSYM_${sym} 1"
done >> "$new_ksyms_file"


# Special case for modversions (see modpost.c)
# Special case for modversions (see modpost.c)
if [ -n "$CONFIG_MODVERSIONS" ]; then
if [ -n "$CONFIG_MODVERSIONS" ]; then