Skip to content

Commit

Permalink
Merge "GKI: build_abi.sh: copy updated symbols to DIST_DIR" into mast…
Browse files Browse the repository at this point in the history
…er-kernel-build-2021
  • Loading branch information
metti authored and Gerrit Code Review committed Jul 1, 2021
2 parents 23129e7 + 0e43206 commit 7d8f18e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 deletions.
13 changes: 2 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -844,18 +844,9 @@ fi

# Copy the abi symbol list file from the sources into the dist dir
if [ -n "${KMI_SYMBOL_LIST}" ]; then
echo "========================================================"
echo " Generating abi symbol list definition to ${ABI_SL}"
${ROOT_DIR}/build/copy_symbols.sh "$ABI_SL" "$ROOT_DIR/$KERNEL_DIR" \
"${KMI_SYMBOL_LIST}" ${ADDITIONAL_KMI_SYMBOL_LISTS}
pushd $ROOT_DIR/$KERNEL_DIR
cp "${KMI_SYMBOL_LIST}" ${ABI_SL}

# If there are additional symbol lists specified, append them
if [ -n "${ADDITIONAL_KMI_SYMBOL_LISTS}" ]; then
for symbol_list in ${ADDITIONAL_KMI_SYMBOL_LISTS}; do
echo >> ${ABI_SL}
cat "${symbol_list}" >> ${ABI_SL}
done
fi
if [ "${TRIM_NONLISTED_KMI}" = "1" ]; then
# Create the raw symbol list
cat ${ABI_SL} | \
Expand Down
5 changes: 5 additions & 0 deletions build_abi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ if [ -n "$KMI_SYMBOL_LIST" ]; then
${FULL_ABI_FLAG} \
${DIST_DIR}

# Redo what build.sh has done, with possibly fresher symbol lists.
ABI_SL="${DIST_DIR}/abi_symbollist"
${ROOT_DIR}/build/copy_symbols.sh "$ABI_SL" "$ROOT_DIR/$KERNEL_DIR" \
"${KMI_SYMBOL_LIST}" ${ADDITIONAL_KMI_SYMBOL_LISTS}

# In case of a simple --update-symbol-list call we can bail out early
[ $UPDATE -eq 0 ] && exit 0

Expand Down
42 changes: 42 additions & 0 deletions copy_symbols.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash -eu

# Copyright (C) 2021 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This is an internal helper script used by build.sh and build_abi.sh

# arguments are:
# abi_sl - the dist directory ABI symbol list
# kernel_dir
# main_symbol_list_file_name
# (additional_symbol_list_file_name)*

abi_sl="$1"; shift
kernel_dir="$1"; shift
symbol_list="$1"; shift

# Copy the abi symbol list file from the sources into the dist dir.
verb=Generating
test -e "$abi_sl" && verb=Refreshing
echo "========================================================"
echo " $verb abi symbol list definition in $abi_sl"
cp -- "$kernel_dir/$symbol_list" "$abi_sl"

# If there are additional symbol lists specified, append them.
for symbol_list; do
echo >> "$abi_sl"
cat -- "$kernel_dir/$symbol_list" >> "$abi_sl"
done

exit 0

0 comments on commit 7d8f18e

Please sign in to comment.