diff options
author | Elliot Berman <quic_eberman@quicinc.com> | 2021-04-30 17:48:54 -0700 |
---|---|---|
committer | Elliot Berman <quic_eberman@quicinc.com> | 2021-04-30 17:53:03 -0700 |
commit | 7adfbf6e6d2ae1691ce13856437a419c4eac7091 (patch) | |
tree | 1f68519f8a011ee7179620b58a11d6ff2532aead | |
parent | d15a0844a0d0947de4d2856270151fc403e4731d (diff) | |
download | build-7adfbf6e6d2ae1691ce13856437a419c4eac7091.tar.gz |
build.sh: Fix prefix detection for GKI_ variables in mixed build
If the device kernel of a mixed build wants to set
GKI_DEFCONFIG_FRAGMENT for the GKI kernel, then it would specify:
GKI_GKI_DEFCONFIG_FRAGMENT=common/build.config.gki_kprobes.aarch64
The sed expresion would currently translate this variable to
DEFCONFIG_FRAGMENT, but it should've converted it to
GKI_DEFCONFIG_FRAGMENT since kleene star will match as many characters
as possible.
export -p would print this variable like this:
export GKI_GKI_DEFCONFIG_FRAGMENT=common/build.config.gki_kprobes.aarch64
^
Use the space in front to ensure that only the GKI_ prefix is trimmed off.
Bug: 186872007
Change-Id: I0bb3da10751fef986b654e2fbc76aa4fff370306
-rwxr-xr-x | build.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -537,7 +537,7 @@ if [ -n "${GKI_BUILD_CONFIG}" ]; then GKI_ENVIRON+=("GKI_BUILD_CONFIG=") # Any variables prefixed with GKI_ get set without that prefix in the GKI build environment # e.g. GKI_BUILD_CONFIG=common/build.config.gki.aarch64 -> BUILD_CONFIG=common/build.config.gki.aarch64 - GKI_ENVIRON+=($(export -p | sed -n -E -e 's/.*GKI_([^=]+=.*)$/\1/p' | tr '\n' ' ')) + GKI_ENVIRON+=($(export -p | sed -n -E -e 's/.* GKI_([^=]+=.*)$/\1/p' | tr '\n' ' ')) GKI_ENVIRON+=("OUT_DIR=${GKI_OUT_DIR}") GKI_ENVIRON+=("DIST_DIR=${GKI_DIST_DIR}") ( env -i bash -c "source ${OLD_ENVIRONMENT}; rm -f ${OLD_ENVIRONMENT}; export ${GKI_ENVIRON[*]} ; ./build/build.sh" ) || exit 1 |