android_kernel_xiaomi_sm8350/scripts/adjust_autoksyms.sh
Srinivasarao P f9b55c89b7 Merge android11-5.4.86+ (7d99cf8) into msm-5.4
* refs/heads/tmp-7d99cf8:
  ANDROID: GKI: Update abi_gki_aarch64_exynos
  UPSTREAM: HID: make arrays usage and value to be the same
  ANDROID: FUSE OWNERS pointing to android-mainline OWNERS
  ANDROID: abi_gki_aarch64_db845c: Regenerate symbols list after enabling QCOM_TSENSE
  ANDROID: db845c_gki.fragment: Add QCOM_TSENSE config to avoid thermal crashes
  UPSTREAM: mm/cma.c: remove redundant cma_mutex lock
  ANDROID: ABI: update allowed list for galaxy
  BACKPORT: remoteproc: core: Remove casting to rproc_handle_resource_t
  UPSTREAM: scsi: ufs: ufs-mediatek: Correct operator & -> &&
  UPSTREAM: kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh
  UPSTREAM: udp: ipv4: manipulate network header of NATed UDP GRO fraglist
  UPSTREAM: net: fix use-after-free when UDP GRO with shared fraglist
  UPSTREAM: scsi: ufs: Fix possible power drain during system suspend
  UPSTREAM: scsi: ufs: Re-enable WriteBooster after device reset
  UPSTREAM: driver: core: Fix list corruption after device_del()
  UPSTREAM: f2fs: fix double free of unicode map
  UPSTREAM: sched/fair: Prefer prev cpu in asymmetric wakeup path
  UPSTREAM: scsi: ufshcd: Fix missing destroy_workqueue()
  UPSTREAM: xfrm/compat: Translate by copying XFRMA_UNSPEC attribute
  UPSTREAM: xfrm/compat: memset(0) 64-bit padding at right place
  UPSTREAM: xfrm/compat: Don't allocate memory with __GFP_ZERO
  BACKPORT: scsi: ufs: Fix missing brace warning for old compilers
  UPSTREAM: net: xfrm: fix memory leak in xfrm_user_policy()
  BACKPORT: net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
  UPSTREAM: mac80211_hwsim: use GFP_ATOMIC under spin lock

 Conflicts:
	drivers/scsi/ufs/ufshcd-crypto.c
	fs/f2fs/super.c
	kernel/sched/fair.c

Change-Id: If96dda87de2c464c9473560c0cf249d4ced061b1
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2021-06-07 15:17:29 +05:30

79 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# Script to update include/generated/autoksyms.h and dependency files
#
# Copyright: (C) 2016 Linaro Limited
# Created by: Nicolas Pitre, January 2016
#
# Update the include/generated/autoksyms.h file.
#
# For each symbol being added or removed, the corresponding dependency
# file's timestamp is updated to force a rebuild of the affected source
# file. All arguments passed to this script are assumed to be a command
# to be exec'd to trigger a rebuild of those files.
set -e
cur_ksyms_file="include/generated/autoksyms.h"
new_ksyms_file="include/generated/autoksyms.h.tmpnew"
info() {
if [ "$quiet" != "silent_" ]; then
printf " %-7s %s\n" "$1" "$2"
fi
}
info "CHK" "$cur_ksyms_file"
# Use "make V=1" to debug this script.
case "$KBUILD_VERBOSE" in
*1*)
set -x
;;
esac
# Generate a new symbol list file
$CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file"
if [ -n "$CONFIG_UNUSED_KSYMS_WHITELIST_ONLY" ] && [ -f "vmlinux" ] ; then
info "WARNING" "CONFIG_UNUSED_KSYMS_WHITELIST_ONLY is enabled. "\
"Non-whitelisted symbols will be undefined!"
fi
# Extract changes between old and new list and touch corresponding
# dependency files.
changed=$(
count=0
sort "$cur_ksyms_file" "$new_ksyms_file" | uniq -u |
sed -n 's/^#define __KSYM_\(.*\) 1/\1/p' | tr "A-Z_" "a-z/" |
while read sympath; do
if [ -z "$sympath" ]; then continue; fi
depfile="include/ksym/${sympath}.h"
mkdir -p "$(dirname "$depfile")"
touch "$depfile"
# Filesystems with coarse time precision may create timestamps
# equal to the one from a file that was very recently built and that
# needs to be rebuild. Let's guard against that by making sure our
# dep files are always newer than the first file we created here.
while [ ! "$depfile" -nt "$new_ksyms_file" ]; do
touch "$depfile"
done
echo $((count += 1))
done | tail -1 )
changed=${changed:-0}
if [ $changed -gt 0 ]; then
# Replace the old list with tne new one
old=$(grep -c "^#define __KSYM_" "$cur_ksyms_file" || true)
new=$(grep -c "^#define __KSYM_" "$new_ksyms_file" || true)
info "KSYMS" "symbols: before=$old, after=$new, changed=$changed"
info "UPD" "$cur_ksyms_file"
mv -f "$new_ksyms_file" "$cur_ksyms_file"
# Then trigger a rebuild of affected source files
exec $@
else
rm -f "$new_ksyms_file"
fi