summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Berman <quic_eberman@quicinc.com>2021-04-30 17:48:54 -0700
committerElliot Berman <quic_eberman@quicinc.com>2021-04-30 17:53:03 -0700
commit7adfbf6e6d2ae1691ce13856437a419c4eac7091 (patch)
tree1f68519f8a011ee7179620b58a11d6ff2532aead
parentd15a0844a0d0947de4d2856270151fc403e4731d (diff)
downloadbuild-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-xbuild.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 2b4090bd..ab350c33 100755
--- a/build.sh
+++ b/build.sh
@@ -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