summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Yun <justinyun@google.com>2018-10-05 14:54:17 +0900
committerJustin Yun <justinyun@google.com>2018-10-29 12:18:11 +0900
commit1722a951588b44bc14114807edd72100c9c90782 (patch)
tree840d5eb3c8a94d040dc54d64090df16eb4a5ef03
parent924c2fde2dc4e3709376d877197730666652bf63 (diff)
downloadandroid_development-1722a951588b44bc14114807edd72100c9c90782.tar.gz
android_development-1722a951588b44bc14114807edd72100c9c90782.tar.bz2
android_development-1722a951588b44bc14114807edd72100c9c90782.zip
Use prebuilt otatools for mixed build
Enable mixed_build script to use prebuilt otatools for packaging image files. If we have otatools.zip file, use '-t' option to use the prebuilt tools instead of building them in mixed branches. Bug: 112732863 Test: run mixed_build with otatools using the command below: $ development/vndk/tools/build_mixed -v 9 \ -m development/vndk/tools/modify_system_img.sh \ -p out/prebuilt_cached/artifacts/gsi/vbmeta.img \ -t out/prebuilt_cached/artifacts/gsi/otatools.zip \ out/prebuilt_cached/artifacts/gsi \ out/prebuilt_cached/artifacts/taimen \ dist \ out/prebuilt_cached/artifacts/gsi/checkvintf Change-Id: I7891a2bad2f4e471baffb987149a39bbbd57f26e (cherry picked from commit 40da678a9fd22dae2ac37c6945ca09afd31e494d)
-rwxr-xr-xvndk/tools/build_mixed15
1 files changed, 14 insertions, 1 deletions
diff --git a/vndk/tools/build_mixed b/vndk/tools/build_mixed
index 5ff36d40f..9d5b71137 100755
--- a/vndk/tools/build_mixed
+++ b/vndk/tools/build_mixed
@@ -41,7 +41,7 @@ cleanup_and_exit () {
trap cleanup_and_exit EXIT
-while getopts :v:m:p: opt; do
+while getopts :v:m:p:t: opt; do
case "$opt" in
v)
readonly VENDOR_VERSION="$OPTARG"
@@ -52,6 +52,9 @@ while getopts :v:m:p: opt; do
p)
readonly OVERRIDE_VBMETA_IMAGE_PATH="$OPTARG"
;;
+ t)
+ readonly OTATOOLS_ZIP="$OPTARG"
+ ;;
\?)
exit_badparam "Invalid options: -"$OPTARG""
;;
@@ -104,6 +107,7 @@ readonly DEVICE_ARTIFACTS_DIR="$TEMP_DIR"/device_archive_artifacts
readonly DEVICE_IMAGES_DIR="$DEVICE_ARTIFACTS_DIR"/IMAGES
readonly SYSTEM_ARTIFACTS_DIR="$TEMP_DIR"/system_artifacts
readonly SYSTEM_IMAGES_DIR="$SYSTEM_ARTIFACTS_DIR"/IMAGES
+readonly OTATOOLS_DIR="$TEMP_DIR"/otatools
readonly SPL_PROPERTY_NAME="ro.build.version.security_patch"
readonly SYSTEM_BUILD_PROP="SYSTEM/build.prop"
@@ -124,6 +128,15 @@ unzip "$DEVICE_TARGET_FILES_ARCHIVE" \
META/vendor_matrix.xml META/vendor_manifest.xml "$SYSTEM_BUILD_PROP" \
-d "$DEVICE_ARTIFACTS_DIR"
+if [[ -f "$OTATOOLS_ZIP" ]]; then
+ # Uncompress otatools
+ mkdir -p "$OTATOOLS_DIR"
+ unzip "$OTATOOLS_ZIP" -d "$OTATOOLS_DIR"
+ # Set paths for using prebuilt host binaries.
+ export PATH="$OTATOOLS_DIR"/bin:"$PATH"
+ export LD_LIBRARY_PATH="$OTATOOLS_DIR"/lib64:"$LD_LIBRARY_PATH"
+fi
+
###
# Check compatibility between the system and device.
if [[ -f "$CHECK_TOOL" ]]; then