From 40da678a9fd22dae2ac37c6945ca09afd31e494d Mon Sep 17 00:00:00 2001 From: Justin Yun Date: Fri, 5 Oct 2018 14:54:17 +0900 Subject: [PATCH] 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/system/vbmeta.img \ -t out/prebuilt_cached/artifacts/system/otatools.zip \ out/prebuilt_cached/artifacts/system \ out/prebuilt_cached/artifacts/taimen \ dist \ out/prebuilt_cached/artifacts/system/checkvintf Change-Id: I7891a2bad2f4e471baffb987149a39bbbd57f26e --- vndk/tools/build_mixed | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vndk/tools/build_mixed b/vndk/tools/build_mixed index da705df64..f4441437e 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"" ;; @@ -119,6 +122,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" @@ -139,6 +143,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