Snap for 6439596 from 14be2d1fcb097b45f50d14085a032f1d34d62a7b to qt-aml-tzdata-release
Change-Id: Ied06710a3baaff856d5883048a175fd3a66c6861
diff --git a/_setup_env.sh b/_setup_env.sh
deleted file mode 100644
index f49eea9..0000000
--- a/_setup_env.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (C) 2019 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 implementation detail of build.sh and friends. Do not source
-# directly as it will spoil your shell and make build.sh unusable. You have
-# been warned! If you have a good reason to source the result of this file into
-# a shell, please let kernel-team@android.com know and we are happy to help
-# with your use case.
-
-[ -n "$_SETUP_ENV_SH_INCLUDED" ] && return || _SETUP_ENV_SH_INCLUDED=1
-
-# TODO: Use a $(gettop) style method.
-export ROOT_DIR=$PWD
-
-export BUILD_CONFIG=${BUILD_CONFIG:-build.config}
-set -a
-. ${ROOT_DIR}/${BUILD_CONFIG}
-set +a
-
-export COMMON_OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
-export OUT_DIR=$(readlink -m ${COMMON_OUT_DIR}/${KERNEL_DIR})
-export DIST_DIR=$(readlink -m ${DIST_DIR:-${COMMON_OUT_DIR}/dist})
-
-if sh -c 'which repo && repo info' >/dev/null 2>&1; then
- # extract the repo branch name (e.g. common-android-mainline)
- repo_branch=$(repo --color=never info -o | grep -E "Manifest merge branch" |
- sed "s|.*refs/heads/\(.*\)|\1|")
- export KBUILD_BUILD_VERSION="1 repo:$repo_branch"
-fi
-
-echo "========================================================"
-echo "= build config: ${ROOT_DIR}/${BUILD_CONFIG}"
-cat ${ROOT_DIR}/${BUILD_CONFIG}
-
-# List of prebuilt directories shell variables to incorporate into PATH
-PREBUILTS_PATHS=(
-LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN
-LINUX_GCC_CROSS_COMPILE_ARM32_PREBUILTS_BIN
-CLANG_PREBUILT_BIN
-LZ4_PREBUILTS_BIN
-DTC_PREBUILTS_BIN
-LIBUFDT_PREBUILTS_BIN
-BUILDTOOLS_PREBUILT_BIN
-)
-
-for PREBUILT_BIN in "${PREBUILTS_PATHS[@]}"; do
- PREBUILT_BIN=\${${PREBUILT_BIN}}
- eval PREBUILT_BIN="${PREBUILT_BIN}"
- if [ -n "${PREBUILT_BIN}" ]; then
- # Mitigate dup paths
- PATH=${PATH//"${ROOT_DIR}\/${PREBUILT_BIN}:"}
- PATH=${ROOT_DIR}/${PREBUILT_BIN}:${PATH}
- fi
-done
-export PATH
-
-echo
-echo "PATH=${PATH}"
-echo
-
-# verifies that defconfig matches the DEFCONFIG
-function check_defconfig() {
- (cd ${OUT_DIR} && \
- make "${TOOL_ARGS[@]}" O=${OUT_DIR} savedefconfig)
- [ "$ARCH" = "x86_64" -o "$ARCH" = "i386" ] && local ARCH=x86
- echo Verifying that savedefconfig matches ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG}
- RES=0
- diff ${OUT_DIR}/defconfig ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG} ||
- RES=$?
- if [ ${RES} -ne 0 ]; then
- echo ERROR: savedefconfig does not match ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG}
- fi
- return ${RES}
-}
diff --git a/abi/.gitignore b/abi/.gitignore
index cbfa6e6..6ddc8a7 100644
--- a/abi/.gitignore
+++ b/abi/.gitignore
@@ -1,4 +1,3 @@
abigail-*
-elfutils-*
*.pyc
__pycache__
diff --git a/abi/README.md b/abi/README.md
index 15bfdf9..55cefcb 100644
--- a/abi/README.md
+++ b/abi/README.md
@@ -1,325 +1,48 @@
-ABI Monitoring for Android Kernels
-==================================
+ABI Monitoring Utilities
+========================
-Overview
---------
-In order to stabilize the in-kernel ABI of Android kernels, the ABI Monitoring
-tooling has been created to collect and compare ABI representations from
-existing kernel binaries (vmlinux + modules). The tools can be used to track
-and mitigate changes to said ABI. This document describes the tooling, the
-process of collecting and analyzing ABI representations and how such
-representations can be used to ensure stability of the in-kernel ABI. Lastly,
-this document gives some details about the process of contributing changes to
-the Android kernels.
+This directory contains scripts and utilities to compare, track and mitigate
+changes to the kernel ABI. The comparison framework used is
+[libabigail](https://sourceware.org/libabigail/), but this might change in the
+future. Follow the instructions below to set up the current prerequisites.
-This directory contains the specific tools for the ABI analysis. It should be
-used as part of the build scripts that are provided by this repository (see
-`../build_abi.sh`).
-
-Process Description
--------------------
-
-Analyzing the kernel's ABI is done in multiple steps. Most of the steps can be
-automated:
-
- 1. Acquire the toolchain, build scripts and kernel sources through `repo`
- 2. Provide any prerequisites (e.g. libabigail)
- 3. Build the kernel and its ABI representation
- 4. Analyze ABI differences between the build and a reference
- 5. Update the ABI representation (if required)
- 6. Working with symbol whitelists
-
-
-The following instructions work for any kernel that can be built using a
-supported toolchain (i.e. a prebuilt Clang toolchain). There exist [`repo`
-manifests](https://android.googlesource.com/kernel/manifest/+refs) for all
-Android common kernel branches, for some upstream branches (e.g.
-upstream-linux-4.19.y) and several device specific kernels that ensure the
-correct toolchain is used when building a kernel distribution.
-
-
-Using the ABI Monitoring tooling
---------------------------------
-
-### 1. Acquire the toolchain, build scripts and kernel sources through repo
-
-Toolchain, build scripts (i.e. these scripts) and kernel sources can be
-acquired with `repo`. For detailed documentation, refer to the corresponding
-documentation on
-[source.android.com](https://source.android.com/setup/build/building-kernels).
-
-To illustrate the process, the following steps use `common-android-mainline`,
-an Android kernel branch that is kept up-to-date with the upstream Linux
-releases. In order to obtain this branch via `repo`, execute
-
-```
- $ repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
- $ repo sync
-```
-
-### 2. Provide any prerequisites
-
-**NOTE**: Googlers might want to follow the steps in
-[go/kernel-abi-monitoring](http://go/kernel-abi-monitoring) to use a prebuilt
-libabigail distribution.
-
-The ABI tooling makes use of [libabigail](https://sourceware.org/libabigail/),
-a library and collection of tools to analyze binaries. In order to use the
-tooling, users are required to provide a functional libabigail installation.
-The released version of your Linux distribution might not be a supported one;
-hence, it is recommended way to use the `bootstrap` script which can be found in
-this directory. The `bootstrap` script automates the process of acquiring and
-building a valid libabigail distribution and needs to be executed without any
-arguments like so:
-
-```
- $ build/abi/bootstrap
-```
-
-The script will ensure the following system prerequisites are installed along
-with their dependencies:
-
- - autoconf
- - libtool
+Set up the prerequisites
+------------------------
+The script `bootstrap` will install the system prerequisites
- libxml2-dev
- - pkg-config
- - python3
+ - elfutils
-**NOTE**: At the moment, only apt based package managers are supported, but
-`bootstrap` provides some hints to help users that have other package
-managers.
+It will then acquire the libabigail sources and build the required binaries.
+At the very end the script will print instructions how to add the binaries to
+the local `${PATH}` to be used by the remaining utilities.
-The script continues with acquiring the sources for the correct versions of
-*elfutils* and *libabigail* and will build the required binaries. At the very
-end the script will print instructions to add the binaries to the local
-`${PATH}`. The output will look similar to:
-
-```
- NOTE: Export the following environment before running the executables:
-
- export PATH="/src/kernel/build/abi/abigail-inst/d7ae619f/bin:${PATH}"
- export LD_LIBRARY_PATH="/src/kernel/build/abi/abigail-inst/d7ae619f/lib:/src/kernel/build/abi/abigail-inst/d7ae619f/lib/elfutils:${LD_LIBRARY_PATH}"
-```
-
-**NOTE**: It is probably a good idea to save these instructions to reuse the
-prebuilt binaries in a later session.
-
-Follow the instructions to enable the prerequisites in your environment.
-
-### 3. Build the kernel and its ABI representation
-
-At this point you are ready to build a kernel with the correct toolchain and to
-extract an ABI representation from its binaries (vmlinux + modules).
-
-Similar to the usual Android kernel build process (using `build.sh`), this step
-requires running `build_abi.sh`.
-
-```
- $ BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh
-```
-
-**NOTE**: `build_abi.sh` makes use of `build.sh` and therefore accepts the
-same environment variables to customize the build. It also *requires* the same
-variables that would need to be passed to `build.sh`, such as `BUILD_CONFIG`.
-
-That builds the kernel and extracts the ABI representation into the `out`
-directory. In this case `out/android-mainline/dist/abi.xml` would be a symbolic
-link to `out/android-mainline/dist/abi-<id>.xml`. `id` is computed from
-executing `git describe` against the kernel source tree.
-
-### 4. Analyze ABI differences between the build and a reference representation
-
-`build_abi.sh` is capable of analyzing and reporting any ABI differences when
-a reference is provided via the environment variable `ABI_DEFINITION`.
-`ABI_DEFINITION` should point to a reference file relative to the kernel source
-tree and can be specified on the command line or (more commonly) as a value in
-*build.config*. E.g.
-
-```
- $ BUILD_CONFIG=common/build.config.gki.aarch64 \
- ABI_DEFINITION=abi_gki_aarch64.xml \
- build/build_abi.sh
-```
-
-Above, the `build.config.gki.aarch64` defines the reference file (as
-*abi_gki_aarch64.xml*) and therefore the analysis has been completed. If an
-abidiff was executed, then `build_abi.sh` will print the location of the report
-and identify any ABI breakage. If breakages are detected, then `build_abi.sh`
-will terminate and return a non-zero exit code.
-
-### 5. Update the ABI representation (if required)
-
-To update the ABI dump, `build_abi.sh` can be invoked with the `--update` flag.
-It will update the corresponding abi.xml file that is defined via the
-build.config. It might also be useful to invoke the script with `--print-report`
-to print the differences the update fixes. The report is useful to include in
-the commit message when updating the abi.xml.
-
-### 6. Working with symbol whitelists
-
-`build_abi.sh` can be parameterized to filter symbols during extraction and
-comparison with KMI (Kernel Module Interface) whitelists. These are simple
-plain text files that list relevant ABI kernel symbols. E.g. a whitelist file
-with the following content would limit ABI analysis to the ELF symbols with the
-names `symbol1` and `symbol2`:
-
-```
- [abi_whitelist]
- symbol1
- symbol2
-```
-
-**NOTE**: Please refer to the [libabigail
-documentation](https://sourceware.org/libabigail/manual/kmidiff.html#environment)
-for details about the KMI whitelist file format.
-
-Changes to other ELF symbols would not be considered any longer unless they are
-indirectly affecting symbols that are whitelisted. A whitelist file can be
-specified -- similar to the abi baseline file via `ABI_DEFINITION=` -- in the
-corresponding `build.config` configuration file with `KMI_WHITELIST=` as a file
-relative to the kernel source directory (`$KERNEL_DIR`).
+You can skip this step if your host system provides a suitable version of the
+libabigail tooling including the binaries `abidw` and `abidiff`.
-Working with the lower level ABI tooling
-----------------------------------------
-
-Most users will need to use `build_abi.sh`. In some cases, it might be
-necessary to work with the lower level ABI tooling directly. There are
-currently two commands -- `dump_abi` and `diff_abi` -- that are available to
-collect and compare ABI files. These commands are used by `build_abi.sh`. See
-the following sections for their usages.
-
-### Creating ABI dumps from kernel trees
-
+Creating ABI dumps from kernel trees
+------------------------------------
Provided a linux kernel tree with built vmlinux and kernel modules, the tool
-`dump_abi` creates an ABI representation using the selected ABI tool. As of now
+`dump_abi` creates an ABI representation using the selected abi tool. As of now
there is only one option: 'libabigail' (default). A sample invocation looks as
follows:
+ $ dump_abi --linux-tree path/to/out --out-file /path/to/abidump.out
-```
- $ dump_abi --linux-tree path/to/out --out-file /path/to/abi.xml
-```
+To ensure a consistent environment and stable toolchain, a wrapper script is
+provided at the topmost directory of this project: `build_abi.sh`. It builds
+the kernel using `build.sh` and therefore accepts the same environment
+variables to customize the build, such as BUILD_CONFIG, CC and the various
+SKIP_* variables to speed up incremental builds. Following a successful build,
+`build_abi.sh` will create an ABI dump in the DIST_DIR of the build. A sample
+invocation from the top of the repo tree looks as follows:
+ $ BUILD_CONFIG=path/to/build.config build/build_abi.sh
-The file `abi.xml` will contain a combined textual ABI representation that can
-be observed from vmlinux and the kernel modules in the given directory. This
-file might be used for manual inspection, further analysis or as a reference
-file to enforce ABI stability.
-
-### Comparing ABI dumps
-
+Comparing ABI dumps
+-------------------
ABI dumps created by `dump_abi` can be compared with `diff_abi`. Ensure to use
-the same abi-tool for `dump_abi` and `diff_abi`. A sample invocation looks like:
-
-```
- $ diff_abi --baseline abi1.xml --new abi2.xml --report report.out
-```
+the same abi-tool for `dump_abi` and `diff_abi`. A sample invocation looks as
+follows:
+ $ diff_abi --baseline dump1.out --new dump2.out --report report.out
The report created is tool specific, but generally lists ABI changes detected
-that affect the kernel's module interface. The files specified as `baseline`
-and `new` are ABI representations collected with `dump_abi`. `diff_abi`
-propagates the exit code of the underlying tool and therefore returns a
-non-zero value in case the ABIs compared are incompatible.
-
-### Using KMI whitelists
-
-To filter dumps created with `dump_abi` or filter symbols compared with
-`diff_abi`, each of those tools provides a parameter `--kmi-whitelist` that
-takes a path to a KMI whitelist file:
-
-```
- $ dump_abi --linux-tree path/to/out --out-file /path/to/abi.xml --kmi-whitelist /path/to/whitelist
-```
-
-Dealing with ABI breakages
---------------------------
-
-As an example, the following patch introduces a very obvious ABI breakage:
-
-```
- diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
- index 5ed8f6292a53..f2ecb34c7645 100644
- --- a/include/linux/mm_types.h
- +++ b/include/linux/mm_types.h
- @@ -339,6 +339,7 @@ struct core_state {
- struct kioctx_table;
- struct mm_struct {
- struct {
- + int dummy;
- struct vm_area_struct *mmap; /* list of VMAs */
- struct rb_root mm_rb;
- u64 vmacache_seqnum; /* per-thread vmacache */
-```
-
-Running `build_abi.sh` again with this patch applied, the tooling will exit with
-a non-zero error code and will report an ABI difference similar to this:
-
-```
- Leaf changes summary: 1 artifact changed
- Changed leaf types summary: 1 leaf type changed
- Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
- Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable
-
- 'struct mm_struct at mm_types.h:372:1' changed:
- type size changed from 6848 to 6912 (in bits)
- there are data member changes:
- [...]
-```
-
-### How to fix a broken ABI on Android Gerrit
-
-If you didn't intentionally break the kernel ABI, then you need to investigate
-via the Android Gerrit test log to identify the issue(s) reported by the tool. Most
-common causes of breakages are added or deleted functions, changed data
-structures or changes to the ABI by adding config options that lead to any of
-the aforementioned. Most likely you want to start with addressing the issues
-found by the tool.
-
-You can reproduce the KernelABI test locally by running the following command
-with the same arguments that you would have run `build/build.sh` with.
-
-Example command for the GKI kernels:
-<pre>
- $ BUILD_CONFIG=common/build.config.gki.aarch64 build/<b>build_abi.sh</b>
-</pre>
-
-### Updating the Kernel ABI
-
-If you need to update the kernel ABI, then you must update the corresponding
-`abi.xml` file in the kernel source tree. This is most conveniently done by
-using `build/build_abi.sh` like so:
-
-<pre>
- $ build/<b>build_abi.sh</b> --update --print-report
-</pre>
-
-with the same arguments that you would have run `build/build.sh` with. This
-updates the correct `abi.xml` in the source tree and prints the detected
-differences. It is recommended to include the printed report in the commit
-message (at least partially).
-
-
-Android Kernel Branches with predefined ABI
--------------------------------------------
-
-Some kernel branches might come with golden ABI representations for Android as
-part of their source distribution. These ABI representations are supposed to be
-accurate and should reflect the result of `build_abi.sh` as if you would execute
-it on your own. As the ABI is heavily influenced by various kernel configuration
-options, these .xml files usually belong to a certain configuration. E.g. the
-`common-android-mainline` branch contains an `abi_gki_aarch64.xml` that
-corresponds to the build result when using the `build.config.gki.aarch64`. In
-particular, `build.config.gki.aarch64` also refers to this file as its
-`ABI_DEFINITION`.
-
-Such predefined ABI representations are used as a baseline definition when
-comparing with `diff_abi` (s.a.). E.g. to validate a kernel patch in regards to
-any changes to the ABI, create the ABI representation with the patch applied and
-use `diff_abi` to compare it to the expected ABI for that particular source tree
-/ configuration.
-
-Caveats and known issues
-------------------------
-- Version 1.7 of libabigail, that contains all currently required patches to
- properly work on clang-built aarch64 Android kernels, has not been released
- yet. Using a recent master is a sufficient workaround for that. The
- `bootstrap` script refers to a sufficient commit from upstream.
+that affect the Kernel's module interface.
diff --git a/abi/abitool.py b/abi/abitool.py
index a54d5e5..9491c3f 100644
--- a/abi/abitool.py
+++ b/abi/abitool.py
@@ -22,10 +22,10 @@
class AbiTool(object):
""" Base class for different kinds of abi analysis tools"""
- def dump_kernel_abi(self, linux_tree, dump_path, whitelist):
+ def dump_kernel_abi(self, linux_tree, dump_path):
raise NotImplementedError()
- def diff_abi(self, old_dump, new_dump, diff_report, whitelist):
+ def diff_abi(self, old_dump, new_dump, diff_report):
raise NotImplementedError()
def name(self):
@@ -33,23 +33,15 @@
class Libabigail(AbiTool):
"""" Concrete AbiTool implementation for libabigail """
- def dump_kernel_abi(self, linux_tree, dump_path, whitelist):
+ def dump_kernel_abi(self, linux_tree, dump_path):
dump_abi_cmd = ['abidw',
- # omit various sources of indeterministic abidw output
- '--no-corpus-path',
- '--no-comp-dir-path',
- # the path containing vmlinux and *.ko
'--linux-tree',
linux_tree,
'--out-file',
dump_path]
-
- if whitelist is not None:
- dump_abi_cmd.extend(['--kmi-whitelist', whitelist])
-
subprocess.check_call(dump_abi_cmd)
- def diff_abi(self, old_dump, new_dump, diff_report, whitelist):
+ def diff_abi(self, old_dump, new_dump, diff_report):
log.info('libabigail diffing: {} and {} at {}'.format(old_dump,
new_dump,
diff_report))
@@ -60,9 +52,6 @@
old_dump,
new_dump]
- if whitelist is not None:
- diff_abi_cmd.extend(['--kmi-whitelist', whitelist])
-
with open(diff_report, 'w') as out:
try:
subprocess.check_call(diff_abi_cmd, stdout=out, stderr=out)
diff --git a/abi/bootstrap b/abi/bootstrap
index d241d7f..c2f0120 100755
--- a/abi/bootstrap
+++ b/abi/bootstrap
@@ -14,14 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-ELFUTILS_VERSION=elfutils-0.176
-ABIGAIL_VERSION=75637035
+ABIGAIL_VERSION=1.6
NUM_CORES=$(cat /proc/cpuinfo | grep -c proc)
BASE_DIR=$(readlink -f $(dirname $0))
OUT_DIR="${BASE_DIR}/abigail-inst/${ABIGAIL_VERSION}"
-
-ELFUTILS_SRC="${BASE_DIR}/elfutils-src"
LIBABIGAIL_SRC="${BASE_DIR}/abigail-src"
# Check output dir.
@@ -30,55 +27,21 @@
read
fi
-PACKAGES="autoconf libtool libxml2-dev pkg-config python3"
-# Install the dependencies.
-if ! ( hash dpkg 2>/dev/null ); then
- echo "WARN: not running on a Debian compatible system!"
- echo " Please be sure you have the required packages installed on"
- echo " your system before continuing."
- echo ""
- echo " The list of required packages is, at the minimum:"
- echo " ${PACKAGES}"
- echo " but some distributions may require more."
- echo " You are on your own here, be careful."
- echo ""
- echo "Press enter to continue or Ctrl-C to abort."
- read
-elif ! dpkg -s ${PACKAGES} > /dev/null 2>&1 ; then
- set -x
- sudo apt-get install --yes ${PACKAGES}
-fi
set -x
-# Acquire elfutils sources
-if [ ! -d "${ELFUTILS_SRC}" ]; then
- git clone git://sourceware.org/git/elfutils.git "${ELFUTILS_SRC}"
-else
- git -C ${ELFUTILS_SRC} fetch
+PACKAGES="libxml2-dev elfutils libdw-dev"
+# Install the dependencies.
+if ! dpkg -s ${PACKAGES} > /dev/null 2>&1 ; then
+ sudo apt-get install ${PACKAGES}
fi
-git -C ${ELFUTILS_SRC} checkout ${ELFUTILS_VERSION}
-
-# Build elfutils
-pushd "${ELFUTILS_SRC}"
- #git clean -dfx
- autoreconf -i --force
- mkdir -p build/
- pushd build/
- ../configure --prefix="${OUT_DIR}" --enable-maintainer-mode
- make -j${NUM_CORES}
- make -j${NUM_CORES} install
- popd
-popd
-
-# Acquire libabigail sources
if [ ! -d "${LIBABIGAIL_SRC}" ]; then
git clone git://sourceware.org/git/libabigail.git "${LIBABIGAIL_SRC}"
else
git -C ${LIBABIGAIL_SRC} fetch
fi
-git -C ${LIBABIGAIL_SRC} checkout ${ABIGAIL_VERSION}
+git -C ${LIBABIGAIL_SRC} checkout libabigail-${ABIGAIL_VERSION}
# Build libabigail
pushd "${LIBABIGAIL_SRC}"
@@ -86,13 +49,9 @@
autoreconf -i --force
mkdir -p build/
pushd build/
- ../configure --prefix="${OUT_DIR}" \
- --enable-cxx11=yes \
- --disable-shared \
- "CPPFLAGS=-I${OUT_DIR}/include" \
- "LDFLAGS=-L${OUT_DIR}/lib"
- make -j${NUM_CORES}
- make -j${NUM_CORES} install
+ ../configure --prefix="${OUT_DIR}" --enable-cxx11=yes --disable-shared
+# make -j${NUM_CORES}
+ make -j${NUM_CORES} install-exec
popd
popd
@@ -102,6 +61,5 @@
echo "Note: Export following environment before running the executables:"
echo
echo "export PATH=\"${OUT_DIR}/bin:\${PATH}\""
-echo "export LD_LIBRARY_PATH=\"${OUT_DIR}/lib:${OUT_DIR}/lib/elfutils:\${LD_LIBRARY_PATH}\""
echo
echo
diff --git a/abi/diff_abi b/abi/diff_abi
index 738466b..7ea4448 100755
--- a/abi/diff_abi
+++ b/abi/diff_abi
@@ -21,9 +21,9 @@
from abitool import get_abi_tool
-def diff_abi(abitool, baseline, new, out_file, whitelist):
+def diff_abi(abitool, baseline, new, out_file):
tool = get_abi_tool(abitool)
- return tool.diff_abi(baseline, new, out_file, whitelist)
+ return tool.diff_abi(baseline, new, out_file)
def main():
""" Build the linux kernel, freshly cloning if needed"""
@@ -36,16 +36,13 @@
help='abi tool to be used to monitor abi')
parser.add_argument('--report', help='where to write the report to',
required=True)
- parser.add_argument('--kmi-whitelist', default=None,
- help='KMI whitelist to filter for')
args = parser.parse_args()
abi_changed = diff_abi(args.abi_tool,
args.baseline,
args.new,
- args.report,
- args.kmi_whitelist)
+ args.report)
if abi_changed:
return 8
diff --git a/abi/dump_abi b/abi/dump_abi
index dc4544d..3791504 100755
--- a/abi/dump_abi
+++ b/abi/dump_abi
@@ -21,9 +21,9 @@
from abitool import get_abi_tool
-def dump_abi(abitool, linux_tree, out_file, whitelist):
+def dump_abi(abitool, linux_tree, out_file):
tool = get_abi_tool(abitool)
- tool.dump_kernel_abi(linux_tree, out_file, whitelist)
+ tool.dump_kernel_abi(linux_tree, out_file)
def main():
""" Build the linux kernel, freshly cloning if needed"""
@@ -36,15 +36,12 @@
help='abi tool to be used to monitor abi')
parser.add_argument('--out-file', default=None,
help='where to write the abi dump to')
- parser.add_argument('--kmi-whitelist', default=None,
- help='KMI whitelist to filter for')
args = parser.parse_args()
dump_abi(args.abi_tool,
args.linux_tree,
- args.out_file or os.path.join(args.linux_tree, "abi.xml"),
- args.kmi_whitelist)
+ args.out_file or os.path.join(args.linux_tree, "abi.out"))
if __name__ == "__main__":
sys.exit(main())
diff --git a/build-tools/path/linux-x86/awk b/build-tools/path/linux-x86/awk
deleted file mode 120000
index b3ad24f..0000000
--- a/build-tools/path/linux-x86/awk
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/awk
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/basename b/build-tools/path/linux-x86/basename
deleted file mode 120000
index 451ccc9..0000000
--- a/build-tools/path/linux-x86/basename
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/basename
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/bc b/build-tools/path/linux-x86/bc
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/bc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/bison b/build-tools/path/linux-x86/bison
deleted file mode 100755
index 2edbffe..0000000
--- a/build-tools/path/linux-x86/bison
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-base=$(readlink -f $(dirname $0))
-export BISON_PKGDATADIR=$(readlink -f ${base}/../../../../prebuilts/build-tools/common/bison)
-export M4=${base}/m4
-
-${base}/../../../../prebuilts/build-tools/linux-x86/bin/bison $*
diff --git a/build-tools/path/linux-x86/bzcat b/build-tools/path/linux-x86/bzcat
deleted file mode 120000
index 63dbd42..0000000
--- a/build-tools/path/linux-x86/bzcat
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/bzcat
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/cat b/build-tools/path/linux-x86/cat
deleted file mode 120000
index 451e54fe..0000000
--- a/build-tools/path/linux-x86/cat
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/cat
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/chmod b/build-tools/path/linux-x86/chmod
deleted file mode 120000
index 7a46fb3..0000000
--- a/build-tools/path/linux-x86/chmod
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/chmod
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/cmp b/build-tools/path/linux-x86/cmp
deleted file mode 120000
index 70a8836..0000000
--- a/build-tools/path/linux-x86/cmp
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/cmp
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/comm b/build-tools/path/linux-x86/comm
deleted file mode 120000
index 23cf94e..0000000
--- a/build-tools/path/linux-x86/comm
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/comm
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/cp b/build-tools/path/linux-x86/cp
deleted file mode 120000
index 067aac8..0000000
--- a/build-tools/path/linux-x86/cp
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/cp
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/cut b/build-tools/path/linux-x86/cut
deleted file mode 120000
index e7de104..0000000
--- a/build-tools/path/linux-x86/cut
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/cut
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/date b/build-tools/path/linux-x86/date
deleted file mode 120000
index b45dc5c..0000000
--- a/build-tools/path/linux-x86/date
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/date
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/diff b/build-tools/path/linux-x86/diff
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/diff
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/dirname b/build-tools/path/linux-x86/dirname
deleted file mode 120000
index a021dfc..0000000
--- a/build-tools/path/linux-x86/dirname
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/dirname
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/du b/build-tools/path/linux-x86/du
deleted file mode 120000
index 7950478..0000000
--- a/build-tools/path/linux-x86/du
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/du
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/echo b/build-tools/path/linux-x86/echo
deleted file mode 120000
index 06a21e8..0000000
--- a/build-tools/path/linux-x86/echo
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/echo
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/env b/build-tools/path/linux-x86/env
deleted file mode 120000
index 6c6cc0b..0000000
--- a/build-tools/path/linux-x86/env
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/env
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/expr b/build-tools/path/linux-x86/expr
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/expr
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/find b/build-tools/path/linux-x86/find
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/find
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/flex b/build-tools/path/linux-x86/flex
deleted file mode 120000
index 7c4992c..0000000
--- a/build-tools/path/linux-x86/flex
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/flex
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/getconf b/build-tools/path/linux-x86/getconf
deleted file mode 120000
index 4b78d9b..0000000
--- a/build-tools/path/linux-x86/getconf
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/getconf
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/grep b/build-tools/path/linux-x86/grep
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/grep
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/head b/build-tools/path/linux-x86/head
deleted file mode 120000
index 3d0375c..0000000
--- a/build-tools/path/linux-x86/head
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/head
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/hostname b/build-tools/path/linux-x86/hostname
deleted file mode 120000
index 86c2c44..0000000
--- a/build-tools/path/linux-x86/hostname
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/hostname
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/id b/build-tools/path/linux-x86/id
deleted file mode 120000
index 66a0d67..0000000
--- a/build-tools/path/linux-x86/id
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/id
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/ln b/build-tools/path/linux-x86/ln
deleted file mode 120000
index 0d88290..0000000
--- a/build-tools/path/linux-x86/ln
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/ln
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/ls b/build-tools/path/linux-x86/ls
deleted file mode 120000
index b5f162e..0000000
--- a/build-tools/path/linux-x86/ls
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/ls
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/m4 b/build-tools/path/linux-x86/m4
deleted file mode 120000
index 5944dbf..0000000
--- a/build-tools/path/linux-x86/m4
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/m4
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/make b/build-tools/path/linux-x86/make
deleted file mode 120000
index 0c587ac..0000000
--- a/build-tools/path/linux-x86/make
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/make
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/md5sum b/build-tools/path/linux-x86/md5sum
deleted file mode 120000
index bc1bd4a..0000000
--- a/build-tools/path/linux-x86/md5sum
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/md5sum
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/mkdir b/build-tools/path/linux-x86/mkdir
deleted file mode 120000
index acc1367..0000000
--- a/build-tools/path/linux-x86/mkdir
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/mkdir
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/mktemp b/build-tools/path/linux-x86/mktemp
deleted file mode 120000
index 81f6174..0000000
--- a/build-tools/path/linux-x86/mktemp
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/mktemp
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/mv b/build-tools/path/linux-x86/mv
deleted file mode 120000
index 975f1a1..0000000
--- a/build-tools/path/linux-x86/mv
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/mv
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/nproc b/build-tools/path/linux-x86/nproc
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/nproc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/od b/build-tools/path/linux-x86/od
deleted file mode 120000
index ac09903..0000000
--- a/build-tools/path/linux-x86/od
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/od
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/paste b/build-tools/path/linux-x86/paste
deleted file mode 120000
index 74d0f2b..0000000
--- a/build-tools/path/linux-x86/paste
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/paste
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/pgrep b/build-tools/path/linux-x86/pgrep
deleted file mode 120000
index 684fadf..0000000
--- a/build-tools/path/linux-x86/pgrep
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/pgrep
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/pkill b/build-tools/path/linux-x86/pkill
deleted file mode 120000
index 5ff766a..0000000
--- a/build-tools/path/linux-x86/pkill
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/pkill
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/ps b/build-tools/path/linux-x86/ps
deleted file mode 120000
index fb750e9..0000000
--- a/build-tools/path/linux-x86/ps
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/ps
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/pwd b/build-tools/path/linux-x86/pwd
deleted file mode 120000
index 94938be..0000000
--- a/build-tools/path/linux-x86/pwd
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/pwd
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/python b/build-tools/path/linux-x86/python
deleted file mode 120000
index 8ee52bf..0000000
--- a/build-tools/path/linux-x86/python
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/python
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/python2 b/build-tools/path/linux-x86/python2
deleted file mode 120000
index 6dc382c..0000000
--- a/build-tools/path/linux-x86/python2
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/python2
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/python2.7 b/build-tools/path/linux-x86/python2.7
deleted file mode 120000
index a107778..0000000
--- a/build-tools/path/linux-x86/python2.7
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/python2.7
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/readlink b/build-tools/path/linux-x86/readlink
deleted file mode 120000
index bb56a21..0000000
--- a/build-tools/path/linux-x86/readlink
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/readlink
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/realpath b/build-tools/path/linux-x86/realpath
deleted file mode 120000
index 4bf115b..0000000
--- a/build-tools/path/linux-x86/realpath
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/toybox
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/rm b/build-tools/path/linux-x86/rm
deleted file mode 120000
index ed8748a..0000000
--- a/build-tools/path/linux-x86/rm
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/rm
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/rmdir b/build-tools/path/linux-x86/rmdir
deleted file mode 120000
index ebcf983..0000000
--- a/build-tools/path/linux-x86/rmdir
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/rmdir
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sed b/build-tools/path/linux-x86/sed
deleted file mode 120000
index ada77e3..0000000
--- a/build-tools/path/linux-x86/sed
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sed
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/seq b/build-tools/path/linux-x86/seq
deleted file mode 120000
index 38cc8850a..0000000
--- a/build-tools/path/linux-x86/seq
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/seq
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/setsid b/build-tools/path/linux-x86/setsid
deleted file mode 120000
index c2a339d..0000000
--- a/build-tools/path/linux-x86/setsid
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/setsid
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sha1sum b/build-tools/path/linux-x86/sha1sum
deleted file mode 120000
index be9f137..0000000
--- a/build-tools/path/linux-x86/sha1sum
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sha1sum
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sha256sum b/build-tools/path/linux-x86/sha256sum
deleted file mode 120000
index 98bfbad..0000000
--- a/build-tools/path/linux-x86/sha256sum
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sha256sum
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sha512sum b/build-tools/path/linux-x86/sha512sum
deleted file mode 120000
index d7f0383..0000000
--- a/build-tools/path/linux-x86/sha512sum
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sha512sum
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sleep b/build-tools/path/linux-x86/sleep
deleted file mode 120000
index 85ec0c8..0000000
--- a/build-tools/path/linux-x86/sleep
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sleep
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/sort b/build-tools/path/linux-x86/sort
deleted file mode 120000
index bc9e639..0000000
--- a/build-tools/path/linux-x86/sort
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/sort
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/stat b/build-tools/path/linux-x86/stat
deleted file mode 120000
index f535efc..0000000
--- a/build-tools/path/linux-x86/stat
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/stat
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/tail b/build-tools/path/linux-x86/tail
deleted file mode 120000
index 12c0d08..0000000
--- a/build-tools/path/linux-x86/tail
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/tail
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/tee b/build-tools/path/linux-x86/tee
deleted file mode 120000
index feda8f5..0000000
--- a/build-tools/path/linux-x86/tee
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/tee
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/timeout b/build-tools/path/linux-x86/timeout
deleted file mode 120000
index 1fa683d..0000000
--- a/build-tools/path/linux-x86/timeout
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/timeout
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/touch b/build-tools/path/linux-x86/touch
deleted file mode 120000
index 73a656c..0000000
--- a/build-tools/path/linux-x86/touch
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/touch
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/true b/build-tools/path/linux-x86/true
deleted file mode 120000
index 1322b7f..0000000
--- a/build-tools/path/linux-x86/true
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/true
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/uname b/build-tools/path/linux-x86/uname
deleted file mode 120000
index 15a0523..0000000
--- a/build-tools/path/linux-x86/uname
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/uname
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/uniq b/build-tools/path/linux-x86/uniq
deleted file mode 120000
index f1a3fe9..0000000
--- a/build-tools/path/linux-x86/uniq
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/uniq
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/unix2dos b/build-tools/path/linux-x86/unix2dos
deleted file mode 120000
index 09ca536..0000000
--- a/build-tools/path/linux-x86/unix2dos
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/unix2dos
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/wc b/build-tools/path/linux-x86/wc
deleted file mode 120000
index d6de485..0000000
--- a/build-tools/path/linux-x86/wc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/wc
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/which b/build-tools/path/linux-x86/which
deleted file mode 120000
index c560b07..0000000
--- a/build-tools/path/linux-x86/which
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/which
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/whoami b/build-tools/path/linux-x86/whoami
deleted file mode 120000
index d087e09..0000000
--- a/build-tools/path/linux-x86/whoami
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/whoami
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/xxd b/build-tools/path/linux-x86/xxd
deleted file mode 120000
index 9bd64f2..0000000
--- a/build-tools/path/linux-x86/xxd
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/xxd
\ No newline at end of file
diff --git a/build-tools/path/linux-x86/xzcat b/build-tools/path/linux-x86/xzcat
deleted file mode 120000
index 6ef3164..0000000
--- a/build-tools/path/linux-x86/xzcat
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/path/linux-x86/xzcat
\ No newline at end of file
diff --git a/build.config.net_test b/build.config.net_test
index 19ca052..721dac0 100644
--- a/build.config.net_test
+++ b/build.config.net_test
@@ -1,11 +1,9 @@
ARCH=um
SUBARCH=x86_64
-CLANG_TRIPLE=x86_64-linux-gnu-
-CROSS_COMPILE=x86_64-linux-androidkernel-
+CROSS_COMPILE=
EXTRA_CMDS=''
KERNEL_DIR=$(. $(dirname $0)/build.config && echo $KERNEL_DIR || echo common)
-CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r353983c/bin
-LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin
+LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=
FILES="
linux
"
diff --git a/build.sh b/build.sh
index a627514..94eb2b5 100755
--- a/build.sh
+++ b/build.sh
@@ -20,7 +20,7 @@
# OUT_DIR=<out dir> DIST_DIR=<dist dir> build/build.sh <make options>*
#
# Example:
-# OUT_DIR=output DIST_DIR=dist build/build.sh -j24 V=1
+# OUT_DIR=output DIST_DIR=dist build/build.sh -j24
#
#
# The following environment variables are considered during execution:
@@ -54,11 +54,6 @@
# LD
# Override linker (flags) to be used.
#
-# ABI_DEFINITION
-# Location of the abi definition file relative to <REPO_ROOT>/KERNEL_DIR
-# If defined (usually in build.config), also copy that abi definition to
-# <OUT_DIR>/dist/abi.xml when creating the distribution.
-#
# Environment variables to influence the stages of the kernel build.
#
# SKIP_MRPROPER
@@ -76,10 +71,6 @@
# POST_KERNEL_BUILD_CMDS
# Command evaluated after `make`.
#
-# TAGS_CONFIG
-# if defined, calls ./scripts/tags.sh utility with TAGS_CONFIG as argument
-# and exit once tags have been generated
-#
# IN_KERNEL_MODULES
# if defined, install kernel modules
#
@@ -92,37 +83,6 @@
# SKIP_CP_KERNEL_HDR
# if defined, skip installing kernel headers.
#
-# BUILD_BOOT_IMG
-# if defined, build a boot.img binary that can be flashed into the 'boot'
-# partition of an Android device. The boot image contains a header as per the
-# format defined by https://source.android.com/devices/bootloader/boot-image-header
-# followed by several components like kernel, ramdisk, DTB etc. The ramdisk
-# component comprises of a GKI ramdisk cpio archive concatenated with a
-# vendor ramdisk cpio archive which is then gzipped. It is expected that
-# all components are present in ${DIST_DIR}.
-#
-# When the BUILD_BOOT_IMG flag is defined, the following flags that point to the
-# various components needed to build a boot.img also need to be defined.
-# - MKBOOTIMG_PATH=<path to the mkbootimg.py script which builds boot.img>
-# - GKI_RAMDISK_PREBUILT_BINARY=<Name of the GKI ramdisk prebuilt which includes
-# the generic ramdisk components like init and the non-device-specific rc files>
-# - VENDOR_RAMDISK_BINARY=<Name of the vendor ramdisk binary which includes the
-# device-specific components of ramdisk like the fstab file and the
-# device-specific rc files.>
-# - KERNEL_BINARY=<name of kernel binary, eg. Image.lz4, Image.gz etc>
-# - BOOT_IMAGE_HEADER_VERSION=<version of the boot image header>
-# - BASE_ADDRESS=<base address to load the kernel from>
-# - PAGE_SIZE=<kernel's page size>
-# - KERNEL_CMDLINE=<string of kernel parameters for boot>
-#
-# BUILD_INITRAMFS
-# if defined, build a ramdisk containing all .ko files and resulting depmod artifacts
-#
-# MODULES_OPTIONS
-# A /lib/modules/modules.options file is created on the ramdisk containing
-# the contents of this variable, lines should be of the form: options
-# <modulename> <param1>=<val> <param2>=<val> ...
-#
# Note: For historic reasons, internally, OUT_DIR will be copied into
# COMMON_OUT_DIR, and OUT_DIR will be then set to
# ${COMMON_OUT_DIR}/${KERNEL_DIR}. This has been done to accommodate existing
@@ -167,65 +127,43 @@
SIGN_CERT=certs/signing_key.x509
SIGN_ALGO=sha512
-# Save environment parameters before being overwritten by sourcing
-# BUILD_CONFIG.
-CC_ARG="${CC}"
+source "${ROOT_DIR}/build/envsetup.sh"
-source "${ROOT_DIR}/build/_setup_env.sh"
-
-export MAKE_ARGS=$*
-export MAKEFLAGS="-j$(nproc) ${MAKEFLAGS}"
+export MAKE_ARGS=$@
export MODULES_STAGING_DIR=$(readlink -m ${COMMON_OUT_DIR}/staging)
export MODULES_PRIVATE_DIR=$(readlink -m ${COMMON_OUT_DIR}/private)
export UNSTRIPPED_DIR=${DIST_DIR}/unstripped
export KERNEL_UAPI_HEADERS_DIR=$(readlink -m ${COMMON_OUT_DIR}/kernel_uapi_headers)
-export INITRAMFS_STAGING_DIR=${MODULES_STAGING_DIR}/initramfs_staging
cd ${ROOT_DIR}
export CLANG_TRIPLE CROSS_COMPILE CROSS_COMPILE_ARM32 ARCH SUBARCH
-# Restore the previously saved CC argument that might have been overridden by
-# the BUILD_CONFIG.
-[ -n "${CC_ARG}" ] && CC="${CC_ARG}"
-
# CC=gcc is effectively a fallback to the default gcc including any target
-# triplets. An absolute path (e.g., CC=/usr/bin/gcc) must be specified to use a
-# custom compiler.
-[ "${CC}" == "gcc" ] && unset CC && unset CC_ARG
-
-TOOL_ARGS=()
+# triplets. If the user wants to use a custom compiler, they are still able to
+# pass an absolute path, e.g. CC=/usr/bin/gcc.
+[ "${CC}" == "gcc" ] && unset CC
if [ -n "${CC}" ]; then
- TOOL_ARGS+=("CC=${CC}" "HOSTCC=${CC}")
+ CC_ARG="CC=${CC}"
fi
if [ -n "${LD}" ]; then
- TOOL_ARGS+=("LD=${LD}")
+ LD_ARG="LD=${LD}"
fi
-if [ -n "${NM}" ]; then
- TOOL_ARGS+=("NM=${NM}")
-fi
-
-if [ -n "${OBJCOPY}" ]; then
- TOOL_ARGS+=("OBJCOPY=${OBJCOPY}")
-fi
-
-# Allow hooks that refer to $CC_LD_ARG to keep working until they can be
-# updated.
-CC_LD_ARG="${TOOL_ARGS[@]}"
+CC_LD_ARG="${CC_ARG} ${LD_ARG}"
mkdir -p ${OUT_DIR}
echo "========================================================"
echo " Setting up for build"
if [ -z "${SKIP_MRPROPER}" ] ; then
set -x
- (cd ${KERNEL_DIR} && make "${TOOL_ARGS[@]}" O=${OUT_DIR} ${MAKE_ARGS} mrproper)
+ (cd ${KERNEL_DIR} && make ${CC_LD_ARG} O=${OUT_DIR} mrproper)
set +x
fi
-if [ -n "${PRE_DEFCONFIG_CMDS}" ]; then
+if [ "${PRE_DEFCONFIG_CMDS}" != "" ]; then
echo "========================================================"
echo " Running pre-defconfig command(s):"
set -x
@@ -235,10 +173,10 @@
if [ -z "${SKIP_DEFCONFIG}" ] ; then
set -x
-(cd ${KERNEL_DIR} && make "${TOOL_ARGS[@]}" O=${OUT_DIR} ${MAKE_ARGS} ${DEFCONFIG})
+(cd ${KERNEL_DIR} && make ${CC_LD_ARG} O=${OUT_DIR} ${DEFCONFIG})
set +x
-if [ -n "${POST_DEFCONFIG_CMDS}" ]; then
+if [ "${POST_DEFCONFIG_CMDS}" != "" ]; then
echo "========================================================"
echo " Running pre-make command(s):"
set -x
@@ -247,23 +185,15 @@
fi
fi
-if [ -n "${TAGS_CONFIG}" ]; then
- echo "========================================================"
- echo " Running tags command:"
- set -x
- (cd ${KERNEL_DIR} && SRCARCH=${ARCH} ./scripts/tags.sh ${TAGS_CONFIG})
- set +x
- exit 0
-fi
-
echo "========================================================"
echo " Building kernel"
set -x
-(cd ${OUT_DIR} && make O=${OUT_DIR} "${TOOL_ARGS[@]}" ${MAKE_ARGS})
+(cd ${OUT_DIR} && \
+ make O=${OUT_DIR} ${CC_LD_ARG} -j$(nproc) $@)
set +x
-if [ -n "${POST_KERNEL_BUILD_CMDS}" ]; then
+if [ "${POST_KERNEL_BUILD_CMDS}" != "" ]; then
echo "========================================================"
echo " Running post-kernel-build command(s):"
set -x
@@ -274,16 +204,16 @@
rm -rf ${MODULES_STAGING_DIR}
mkdir -p ${MODULES_STAGING_DIR}
-if [ -n "${BUILD_INITRAMFS}" -o -n "${IN_KERNEL_MODULES}" ]; then
+if [ -n "${IN_KERNEL_MODULES}" ]; then
echo "========================================================"
echo " Installing kernel modules into staging directory"
- (cd ${OUT_DIR} && \
- make O=${OUT_DIR} "${TOOL_ARGS[@]}" INSTALL_MOD_STRIP=1 \
- INSTALL_MOD_PATH=${MODULES_STAGING_DIR} ${MAKE_ARGS} modules_install)
+ (cd ${OUT_DIR} && \
+ make O=${OUT_DIR} ${CC_LD_ARG} INSTALL_MOD_STRIP=1 \
+ INSTALL_MOD_PATH=${MODULES_STAGING_DIR} modules_install)
fi
-if [[ -z "${SKIP_EXT_MODULES}" ]] && [[ -n "${EXT_MODULES}" ]]; then
+if [[ -z "${SKIP_EXT_MODULES}" ]] && [[ "${EXT_MODULES}" != "" ]]; then
echo "========================================================"
echo " Building external modules and installing them into staging directory"
@@ -300,17 +230,16 @@
mkdir -p ${OUT_DIR}/${EXT_MOD_REL}
set -x
make -C ${EXT_MOD} M=${EXT_MOD_REL} KERNEL_SRC=${ROOT_DIR}/${KERNEL_DIR} \
- O=${OUT_DIR} "${TOOL_ARGS[@]}" ${MAKE_ARGS}
+ O=${OUT_DIR} ${CC_LD_ARG} -j$(nproc) "$@"
make -C ${EXT_MOD} M=${EXT_MOD_REL} KERNEL_SRC=${ROOT_DIR}/${KERNEL_DIR} \
- O=${OUT_DIR} "${TOOL_ARGS[@]}" INSTALL_MOD_STRIP=1 \
- INSTALL_MOD_PATH=${MODULES_STAGING_DIR} \
- ${MAKE_ARGS} modules_install
+ O=${OUT_DIR} ${CC_LD_ARG} INSTALL_MOD_STRIP=1 \
+ INSTALL_MOD_PATH=${MODULES_STAGING_DIR} modules_install
set +x
done
fi
-if [ -n "${EXTRA_CMDS}" ]; then
+if [ "${EXTRA_CMDS}" != "" ]; then
echo "========================================================"
echo " Running extra build command(s):"
set -x
@@ -325,8 +254,7 @@
if [ -d ${OVERLAY_DIR} ]; then
OVERLAY_OUT_DIR=${OUT_DIR}/overlays/${ODM_DIR}
mkdir -p ${OVERLAY_OUT_DIR}
- make -C ${OVERLAY_DIR} DTC=${OUT_DIR}/scripts/dtc/dtc \
- OUT_DIR=${OVERLAY_OUT_DIR} ${MAKE_ARGS}
+ make -C ${OVERLAY_DIR} DTC=${OUT_DIR}/scripts/dtc/dtc OUT_DIR=${OVERLAY_OUT_DIR}
OVERLAYS=$(find ${OVERLAY_OUT_DIR} -name "*.dtbo")
OVERLAYS_OUT="$OVERLAYS_OUT $OVERLAYS"
fi
@@ -335,12 +263,12 @@
mkdir -p ${DIST_DIR}
echo "========================================================"
echo " Copying files"
-for FILE in $(cd ${OUT_DIR} && ls -1 ${FILES}); do
+for FILE in ${FILES}; do
if [ -f ${OUT_DIR}/${FILE} ]; then
echo " $FILE"
cp -p ${OUT_DIR}/${FILE} ${DIST_DIR}/
else
- echo " $FILE is not a file, skipping"
+ echo " $FILE does not exist, skipping"
fi
done
@@ -353,38 +281,17 @@
MODULES=$(find ${MODULES_STAGING_DIR} -type f -name "*.ko")
if [ -n "${MODULES}" ]; then
- if [ -n "${IN_KERNEL_MODULES}" -o -n "${EXT_MODULES}" ]; then
- echo "========================================================"
- echo " Copying modules files"
+ echo "========================================================"
+ echo " Copying modules files"
+ if [ -n "${IN_KERNEL_MODULES}" -o "${EXT_MODULES}" != "" ]; then
for FILE in ${MODULES}; do
echo " ${FILE#${MODULES_STAGING_DIR}/}"
cp -p ${FILE} ${DIST_DIR}
done
fi
- if [ -n "${BUILD_INITRAMFS}" ]; then
- echo "========================================================"
- echo " Creating initramfs"
- set -x
- rm -rf ${INITRAMFS_STAGING_DIR}
- mkdir -p ${INITRAMFS_STAGING_DIR}/lib/modules/kernel/
- cp -r ${MODULES_STAGING_DIR}/lib/modules/*/kernel/* ${INITRAMFS_STAGING_DIR}/lib/modules/kernel/
- cp ${MODULES_STAGING_DIR}/lib/modules/*/modules.* ${INITRAMFS_STAGING_DIR}/lib/modules/
- cp ${MODULES_STAGING_DIR}/lib/modules/*/modules.order ${INITRAMFS_STAGING_DIR}/lib/modules/modules.load
- echo "${MODULES_OPTIONS}" > ${INITRAMFS_STAGING_DIR}/lib/modules/modules.options
-
- if [ -n "${EXT_MODULES}" ]; then
- mkdir -p ${INITRAMFS_STAGING_DIR}/lib/modules/extra/
- cp -r ${MODULES_STAGING_DIR}/lib/modules/*/extra/* ${INITRAMFS_STAGING_DIR}/lib/modules/extra/
- fi
-
- (cd ${INITRAMFS_STAGING_DIR} && find . | cpio -H newc -o > ${MODULES_STAGING_DIR}/initramfs.cpio)
- gzip -fc ${MODULES_STAGING_DIR}/initramfs.cpio > ${MODULES_STAGING_DIR}/initramfs.cpio.gz
- mv ${MODULES_STAGING_DIR}/initramfs.cpio.gz ${DIST_DIR}/initramfs.img
- set +x
- fi
fi
-if [ -n "${UNSTRIPPED_MODULES}" ]; then
+if [ "${UNSTRIPPED_MODULES}" != "" ]; then
echo "========================================================"
echo " Copying unstripped module files for debugging purposes (not loaded on device)"
mkdir -p ${UNSTRIPPED_DIR}
@@ -397,9 +304,7 @@
echo "========================================================"
echo " Installing UAPI kernel headers:"
mkdir -p "${KERNEL_UAPI_HEADERS_DIR}/usr"
- make -C ${OUT_DIR} O=${OUT_DIR} "${TOOL_ARGS[@]}" \
- INSTALL_HDR_PATH="${KERNEL_UAPI_HEADERS_DIR}/usr" ${MAKE_ARGS} \
- headers_install
+ make -C ${OUT_DIR} O=${OUT_DIR} ${CC_LD_ARG} INSTALL_HDR_PATH="${KERNEL_UAPI_HEADERS_DIR}/usr" -j$(nproc) headers_install
# The kernel makefiles create files named ..install.cmd and .install which
# are only side products. We don't want those. Let's delete them.
find ${KERNEL_UAPI_HEADERS_DIR} \( -name ..install.cmd -o -name .install \) -exec rm '{}' +
@@ -409,111 +314,25 @@
fi
if [ -z "${SKIP_CP_KERNEL_HDR}" ] ; then
- echo "========================================================"
- KERNEL_HEADERS_TAR=${DIST_DIR}/kernel-headers.tar.gz
- echo " Copying kernel headers to ${KERNEL_HEADERS_TAR}"
- pushd $ROOT_DIR/$KERNEL_DIR
- find arch include $OUT_DIR -name *.h -print0 \
- | tar -czf $KERNEL_HEADERS_TAR \
- --absolute-names \
- --dereference \
- --transform "s,.*$OUT_DIR,," \
- --transform "s,^,kernel-headers/," \
- --null -T -
- popd
-fi
-
-# Copy the abi_${arch}.xml file from the sources into the dist dir
-if [ -n "${ABI_DEFINITION}" ]; then
- echo "========================================================"
- echo " Copying abi definition to ${DIST_DIR}/abi.xml"
- pushd $ROOT_DIR/$KERNEL_DIR
- cp "${ABI_DEFINITION}" ${DIST_DIR}/abi.xml
- popd
+ echo "========================================================"
+ KERNEL_HEADERS_TAR=${DIST_DIR}/kernel-headers.tar.gz
+ echo " Copying kernel headers to ${KERNEL_HEADERS_TAR}"
+ TMP_DIR="${OUT_DIR}/tmp"
+ TMP_KERNEL_HEADERS_CHILD="kernel-headers"
+ TMP_KERNEL_HEADERS_DIR=$TMP_DIR/$TMP_KERNEL_HEADERS_CHILD
+ CURDIR=$(pwd)
+ mkdir -p $TMP_KERNEL_HEADERS_DIR
+ cd $ROOT_DIR/$KERNEL_DIR; find arch -name *.h -exec cp --parents {} $TMP_KERNEL_HEADERS_DIR \;
+ cd $ROOT_DIR/$KERNEL_DIR; find include -name *.h -exec cp --parents {} $TMP_KERNEL_HEADERS_DIR \;
+ cd $OUT_DIR; find -name *.h -exec cp --parents {} $TMP_KERNEL_HEADERS_DIR \;
+ tar -czvf $KERNEL_HEADERS_TAR --directory=$TMP_DIR $TMP_KERNEL_HEADERS_CHILD > /dev/null 2>&1
+ rm -rf $TMP_KERNEL_HEADERS_DIR
+ cd $CURDIR
fi
echo "========================================================"
echo " Files copied to ${DIST_DIR}"
-if [ ! -z "${BUILD_BOOT_IMG}" ] ; then
- MKBOOTIMG_BASE_ADDR=
- MKBOOTIMG_PAGE_SIZE=
- MKBOOTIMG_CMDLINE=
- if [ -n "${BASE_ADDRESS}" ]; then
- MKBOOTIMG_BASE_ADDR="--base ${BASE_ADDRESS}"
- fi
- if [ -n "${PAGE_SIZE}" ]; then
- MKBOOTIMG_PAGE_SIZE="--pagesize ${PAGE_SIZE}"
- fi
- if [ -n "${KERNEL_CMDLINE}" ]; then
- MKBOOTIMG_CMDLINE="--cmdline \"${KERNEL_CMDLINE}\""
- fi
-
- DTB_FILE_LIST=$(find ${DIST_DIR} -name "*.dtb")
- if [ -z "${DTB_FILE_LIST}" ]; then
- echo "No *.dtb files found in ${DIST_DIR}"
- exit 1
- fi
- cat $DTB_FILE_LIST > ${DIST_DIR}/dtb.img
-
- set -x
- MKBOOTIMG_RAMDISKS=()
- for ramdisk in ${VENDOR_RAMDISK_BINARY} ${GKI_RAMDISK_PREBUILT_BINARY} \
- "${MODULES_STAGING_DIR}/initramfs.cpio"; do
- if [ -f "${DIST_DIR}/${ramdisk}" ]; then
- MKBOOTIMG_RAMDISKS+=("${DIST_DIR}/${ramdisk}")
- else
- if [ -f "${ramdisk}" ]; then
- MKBOOTIMG_RAMDISKS+=("${ramdisk}")
- fi
- fi
- done
- set +e # disable exiting of error so gzip -t can be handled properly
- for ((i=0; i<"${#MKBOOTIMG_RAMDISKS[@]}"; i++)); do
- TEST_GZIP=$(gzip -t "${MKBOOTIMG_RAMDISKS[$i]}" 2>&1 > /dev/null)
- if [ "$?" -eq 0 ]; then
- CPIO_NAME=$(echo "${MKBOOTIMG_RAMDISKS[$i]}" | sed -e 's/\(.\+\)\.[a-z]\+$/\1.cpio/')
- gzip -cd "${MKBOOTIMG_RAMDISKS[$i]}" > ${CPIO_NAME}
- MKBOOTIMG_RAMDISKS[$i]=${CPIO_NAME}
- fi
- done
- set -e # re-enable exiting on errors
- if [ "${#MKBOOTIMG_RAMDISKS[@]}" -gt 0 ]; then
- cat ${MKBOOTIMG_RAMDISKS[*]} | gzip - > ${DIST_DIR}/ramdisk.gz
- else
- echo "No ramdisk found. Please provide a GKI and/or a vendor ramdisk."
- exit 1
- fi
- set -x
-
- if [ ! -f "$MKBOOTIMG_PATH" ]; then
- echo "mkbootimg.py script not found. MKBOOTIMG_PATH = $MKBOOTIMG_PATH"
- exit 1
- fi
-
- if [ ! -f "${DIST_DIR}/$KERNEL_BINARY" ]; then
- echo "kernel binary(KERNEL_BINARY = $KERNEL_BINARY) not present in ${DIST_DIR}"
- exit 1
- fi
-
- if [ -z "${BOOT_IMAGE_HEADER_VERSION}" ]; then
- echo "BOOT_IMAGE_HEADER_VERSION must specify the boot image header version"
- exit 1
- fi
-
- # (b/141990457) Investigate parenthesis issue with MKBOOTIMG_CMDLINE when
- # executed outside of this "bash -c".
- (set -x; bash -c "python $MKBOOTIMG_PATH --kernel ${DIST_DIR}/$KERNEL_BINARY \
- --ramdisk ${DIST_DIR}/ramdisk.gz \
- --dtb ${DIST_DIR}/dtb.img --header_version $BOOT_IMAGE_HEADER_VERSION \
- ${MKBOOTIMG_BASE_ADDR} ${MKBOOTIMG_PAGE_SIZE} ${MKBOOTIMG_CMDLINE} \
- -o ${DIST_DIR}/boot.img"
- )
- set +x
- echo "boot image created at ${DIST_DIR}/boot.img"
-fi
-
-
# No trace_printk use on build server build
if readelf -a ${DIST_DIR}/vmlinux 2>&1 | grep -q trace_printk_fmt; then
echo "========================================================"
diff --git a/build_abi.sh b/build_abi.sh
index 6566fa9..12d125e 100755
--- a/build_abi.sh
+++ b/build_abi.sh
@@ -22,69 +22,13 @@
# ABI_OUT_TAG
# Customize the output file name for the abi dump. If undefined, the tag is
# derived from `git describe`.
-#
-# ABI_DEFINITION
-# Specify an expected Kernel ABI representation. If defined, this script
-# will, in addition to extracting the ABI representation from the currently
-# built kernel, compare the extracted ABI to the expected one. In case of
-# any significant differences, it will exit with the return code of
-# diff_abi and optionally (-r) print a report.
-# ABI_DEFINITION is supposed to be defined relative to $KERNEL_DIR/
-#
-# KMI_WHITELIST
-# Define a Kernel Module Interface white list description. If defined, it
-# will be taken into account when extracting Kernel ABI information from
-# vmlinux and kernel modules.
-# KMI_WHITELIST is supposed to be defined relative to $KERNEL_DIR/
-#
export ROOT_DIR=$(readlink -f $(dirname $0)/..)
-function show_help {
- echo "USAGE: $0 [-u|--update] [-n|--nodiff]"
- echo
- echo " -u | --update Update the abi.xml in the source directory"
- echo " -n | --nodiff Do not generate a ABI report with abidiff"
- echo " -r | --print-report Print ABI report in case of differences"
-}
-
-UPDATE=0
-DIFF=1
-PRINT_REPORT=0
-
-ARGS=()
-for i in "$@"
-do
-case $i in
- -u|--update)
- UPDATE=1
- shift # past argument=value
- ;;
- -n|--nodiff)
- DIFF=0
- shift # past argument=value
- ;;
- -r|--print-report)
- PRINT_REPORT=1
- shift # past argument=value
- ;;
- -h|--help)
- show_help
- exit 0
- ;;
- *)
- ARGS+=("$1")
- shift
- ;;
-esac
-done
-
-set -- "${ARGS[@]}"
-
set -e
set -a
-source "${ROOT_DIR}/build/_setup_env.sh"
+source "${ROOT_DIR}/build/envsetup.sh"
# inject CONFIG_DEBUG_INFO=y
export POST_DEFCONFIG_CMDS="${POST_DEFCONFIG_CMDS} : && update_config_for_abi_dump"
@@ -92,40 +36,11 @@
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_DEBUG_INFO
(cd ${OUT_DIR} && \
- make O=${OUT_DIR} "${TOOL_ARGS[@]}" $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
-}
-export -f check_defconfig
-export -f update_config_for_abi_dump
-
-function version_greater_than() {
- test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
+ make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
-# ensure that abigail is present in path
-if ! ( hash abidiff 2>/dev/null); then
- echo "ERROR: libabigail is not found in \$PATH at all!"
- echo "Have you run build/abi/bootstrap and followed the instructions?"
- exit 1
-fi
-
-# ensure we have a "new enough" version of abigail present before continuing
-if ! ( version_greater_than "$(abidiff --version | awk '{print $2}')" \
- "1.6.0" ); then
- echo "ERROR: no suitable libabigail (>= 1.6.0) in \$PATH."
- echo "Have you run build/abi/bootstrap and followed the instructions?"
- exit 1
-fi
-
-# delegate the actual build to build.sh.
-# suppress possible values of ABI_DEFINITION when invoking build.sh to avoid
-# the generated abi.xml to be copied to <DIST_DIR>/abi.out.
-ABI_DEFINITION= ${ROOT_DIR}/build/build.sh $*
-
-# define a common KMI whitelist flag for the abi tools
-KMI_WHITELIST_FLAG=
-if [ -n "$KMI_WHITELIST" ]; then
- KMI_WHITELIST_FLAG="--kmi-whitelist $KERNEL_DIR/$KMI_WHITELIST"
-fi
+# delegate the actual build to build.sh
+${ROOT_DIR}/build/build.sh $*
echo "========================================================"
echo " Creating ABI dump"
@@ -133,54 +48,13 @@
# create abi dump
COMMON_OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
id=${ABI_OUT_TAG:-$(git -C $KERNEL_DIR describe --dirty --always)}
-abi_out_file=abi-${id}.xml
+abi_out_file=abi-${id}.out
${ROOT_DIR}/build/abi/dump_abi \
--linux-tree $OUT_DIR \
- --out-file ${DIST_DIR}/${abi_out_file} \
- $KMI_WHITELIST_FLAG
+ --out-file ${DIST_DIR}/${abi_out_file}
-# sanitize the abi.xml by removing any occurences of the kernel path
-sed -i "s#${ROOT_DIR}/${KERNEL_DIR}/##g" ${DIST_DIR}/${abi_out_file}
-# now also do that with any left over paths sneaking in
-# (e.g. from the prebuilts)
-sed -i "s#${ROOT_DIR}/##g" ${DIST_DIR}/${abi_out_file}
-
-ln -sf ${abi_out_file} ${DIST_DIR}/abi.xml
+ln -sf ${abi_out_file} ${DIST_DIR}/abi.out
echo "========================================================"
echo " ABI dump has been created at ${DIST_DIR}/${abi_out_file}"
-rc=0
-if [ -n "$ABI_DEFINITION" ]; then
- if [ $DIFF -eq 1 ]; then
- echo "========================================================"
- echo " Comparing ABI against expected definition ($ABI_DEFINITION)"
- abi_report=${DIST_DIR}/abi.report
- set +e
- ${ROOT_DIR}/build/abi/diff_abi --baseline $KERNEL_DIR/$ABI_DEFINITION \
- --new ${DIST_DIR}/${abi_out_file} \
- --report ${abi_report} \
- $KMI_WHITELIST_FLAG
- rc=$?
- set -e
- echo "========================================================"
- echo " ABI report has been created at ${abi_report}"
-
- if [ $rc -ne 0 ]; then
- echo " ABI DIFFERENCES HAVE BEEN DETECTED! (RC=$rc)"
- fi
-
- if [ $PRINT_REPORT -eq 1 ] && [ $rc -ne 0 ] ; then
- echo "========================================================"
- cat ${abi_report}
- fi
- fi
- if [ $UPDATE -eq 1 ] ; then
- echo "========================================================"
- echo " Updating expected ABI definition ($ABI_DEFINITION)"
- cp -v ${DIST_DIR}/${abi_out_file} $KERNEL_DIR/$ABI_DEFINITION
- fi
-fi
-
-exit $rc
-
diff --git a/build_test.sh b/build_test.sh
index 17adaf5..268af0b 100755
--- a/build_test.sh
+++ b/build_test.sh
@@ -36,7 +36,7 @@
test=all_tests.sh
set -e
-source ${ROOT_DIR}/_setup_env.sh
+source ${ROOT_DIR}/envsetup.sh
export OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
mkdir -p ${OUT_DIR}
diff --git a/envsetup.sh b/envsetup.sh
index 09ab724..db02d2c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1,3 +1,5 @@
+# source this file. Don't run it.
+
# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,32 +14,66 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This is an implementation detail of build.sh and friends. Do not source
-# directly as it will spoil your shell and make build.sh unusable. You have
-# been warned! If you have a good reason to source the result of this file into
-# a shell, please let kernel-team@android.com know and we are happy to help
-# with your use case.
+# Usage:
+# source build/envsetup.sh
+# to setup your path and cross compiler so that a kernel build command is
+# just:
+# make -j24
+[ -n "$ENVSETUP_SH_INCLUDED" ] && return || export ENVSETUP_SH_INCLUDED=1
-# This is a dummy to not break people that have a workflow that includes
-# sourcing build/envsetup.sh into a shell when working with Android repo.
-# The actual functionality of this script has been moved to _setup_env.sh.
-#
-# It turns out that build/envsetup.sh was sourced into the shell by a lot of
-# people. Mostly due to the fact that old documentation asked people to do so
-# (including this script itself). Unfortunately, this causes more harm than it
-# does any good. Mostly it spoils the shell with environment variables that are
-# only valid in the context of a very specific build configuration. To overcome
-# this, the content of this file has been moved to _setup_env.sh and callers
-# within this project have been adjusted. This script serves as a dummy to not
-# break people sourcing it, but it will from now on emit a deprecation warning.
-# That script might be removed at a later time.
-#
-# For further information on the Android Kernel build process with the tooling
-# of this project, please refer to
-# https://source.android.com/setup/build/building-kernels.
-#
-# For any questions or concerns, please contact kernel-team@android.com.
+# TODO: Use a $(gettop) style method.
+export ROOT_DIR=$PWD
-echo "Sourcing 'build/envsetup.sh' for Android Kernels is deprecated and no longer valid!"
-echo "Please refer to the documentation in said script for details."
+export BUILD_CONFIG=${BUILD_CONFIG:-build.config}
+. ${ROOT_DIR}/${BUILD_CONFIG}
+
+export COMMON_OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
+export OUT_DIR=$(readlink -m ${COMMON_OUT_DIR}/${KERNEL_DIR})
+export DIST_DIR=$(readlink -m ${DIST_DIR:-${COMMON_OUT_DIR}/dist})
+
+echo "========================================================"
+echo "= build config: ${ROOT_DIR}/${BUILD_CONFIG}"
+cat ${ROOT_DIR}/${BUILD_CONFIG}
+
+# List of prebuilt directories shell variables to incorporate into PATH
+PREBUILTS_PATHS="
+LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN
+LINUX_GCC_CROSS_COMPILE_ARM32_PREBUILTS_BIN
+CLANG_PREBUILT_BIN
+LZ4_PREBUILTS_BIN
+DTC_PREBUILTS_BIN
+LIBUFDT_PREBUILTS_BIN
+"
+
+for PREBUILT_BIN in ${PREBUILTS_PATHS}; do
+ PREBUILT_BIN=\${${PREBUILT_BIN}}
+ eval PREBUILT_BIN="${PREBUILT_BIN}"
+ if [ -n "${PREBUILT_BIN}" ]; then
+ # Mitigate dup paths
+ PATH=${PATH//"${ROOT_DIR}/${PREBUILT_BIN}:"}
+ PATH=${ROOT_DIR}/${PREBUILT_BIN}:${PATH}
+ fi
+done
+export PATH
+
+echo
+echo "PATH=${PATH}"
+echo
+
+export $(sed -n -e 's/\([^=]\)=.*/\1/p' ${ROOT_DIR}/${BUILD_CONFIG})
+
+# verifies that defconfig matches the DEFCONFIG
+function check_defconfig() {
+ (cd ${OUT_DIR} && \
+ make O=${OUT_DIR} savedefconfig)
+ [ "$ARCH" = "x86_64" -o "$ARCH" = "i386" ] && local ARCH=x86
+ echo Verifying that savedefconfig matches ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG}
+ RES=0
+ diff ${OUT_DIR}/defconfig ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG} ||
+ RES=$?
+ if [ ${RES} -ne 0 ]; then
+ echo ERROR: savedefconfig does not match ${KERNEL_DIR}/arch/${ARCH}/configs/${DEFCONFIG}
+ fi
+ return ${RES}
+}
diff --git a/static_analysis/checkpatch.sh b/static_analysis/checkpatch.sh
index 8545c8f..4857d26 100755
--- a/static_analysis/checkpatch.sh
+++ b/static_analysis/checkpatch.sh
@@ -22,7 +22,7 @@
ROOT_DIR="${STATIC_ANALYSIS_SRC_DIR}/../../"
pushd ${ROOT_DIR}
-source ${STATIC_ANALYSIS_SRC_DIR}/../_setup_env.sh
+source ${STATIC_ANALYSIS_SRC_DIR}/../envsetup.sh
export OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
export DIST_DIR=$(readlink -m ${DIST_DIR:-${OUT_DIR}/dist})
mkdir -p ${DIST_DIR}
diff --git a/static_analysis/checkpatch_blacklist b/static_analysis/checkpatch_blacklist
index 9343067..b28c845 100644
--- a/static_analysis/checkpatch_blacklist
+++ b/static_analysis/checkpatch_blacklist
@@ -108,7 +108,6 @@
STRING_FRAGMENTS
SUSPECT_CODE_INDENT
TRAILING_SEMICOLON
-TYPO_SPELLING
UNDOCUMENTED_DT_STRING
UNNECESSARY_BREAK
UNNECESSARY_CASTS
diff --git a/static_analysis/checkpatch_presubmit.sh b/static_analysis/checkpatch_presubmit.sh
index 854dab4..d854e16 100755
--- a/static_analysis/checkpatch_presubmit.sh
+++ b/static_analysis/checkpatch_presubmit.sh
@@ -22,7 +22,7 @@
export STATIC_ANALYSIS_SRC_DIR=$(dirname $(readlink -f $0))
-source ${STATIC_ANALYSIS_SRC_DIR}/../_setup_env.sh
+source ${STATIC_ANALYSIS_SRC_DIR}/../envsetup.sh
export OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
export DIST_DIR=$(readlink -m ${DIST_DIR:-${OUT_DIR}/dist})
@@ -78,7 +78,7 @@
# Pick the correct patch to test.
verify_file_exists ${APPLIED_PROP_PATH}
-GIT_SHA1=$(sed -nE "s#${KERNEL_DIR} .*([0-9a-f]{40}).*#\\1#p" "${APPLIED_PROP_PATH}")
+GIT_SHA1=$(grep -E "${KERNEL_DIR} [0-9a-f]+" "${APPLIED_PROP_PATH}" | awk '{print $2}')
if [[ -z ${GIT_SHA1} ]]; then
# Since applied.prop only tracks user changes, ignore projects that are
# included in presubmit without any changed files.
@@ -86,15 +86,5 @@
exit 0
fi
-# Skip checkpatch for merge commits on common kernels
-# These are upstream merges that likely hit issues in checkpatch.pl or merges
-# from other common kernel repositories where _this_ check has been run as part
-# of the developement process.
-if [ "${KERNEL_DIR}" == "common" ]; then
- if [ $(git -C ${KERNEL_DIR} show --no-patch --format="%p" ${GIT_SHA1} | wc -w) -gt 1 ] ; then
- echo "Merge commit detected for a ${KERNEL_DIR} kernel. Skipping this check."
- exit 0
- fi
-fi
-
${STATIC_ANALYSIS_SRC_DIR}/checkpatch.sh --git_sha1 ${GIT_SHA1} ${FORWARDED_ARGS[*]}
+