Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | function finalize_vintf_resources() { |
| 6 | local top="$(dirname "$0")"/../../../.. |
| 7 | source $top/build/make/tools/finalization/environment.sh |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 8 | # environment needed to build dependencies and run scripts |
| 9 | # These should remain the same for all steps here to speed up build time |
| 10 | export ANDROID_BUILD_TOP="$top" |
| 11 | export ANDROID_HOST_OUT="$ANDROID_BUILD_TOP/out/host/linux-x86" |
| 12 | export ANDROID_PRODUCT_OUT="$ANDROID_BUILD_TOP/out/target/product/generic_arm64" |
| 13 | export PATH="$PATH:$ANDROID_HOST_OUT/bin/" |
| 14 | export TARGET_BUILD_VARIANT=userdebug |
| 15 | export DIST_DIR=out/dist |
| 16 | export TARGET_RELEASE=fina_0 |
| 17 | export TARGET_PRODUCT=aosp_arm64 |
Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 18 | |
Justin Yun | b9c461d | 2024-11-21 16:20:12 +0900 | [diff] [blame] | 19 | # build/soong |
| 20 | local vendor_api_level_map="case ${FINAL_NEXT_BOARD_API_LEVEL}:" |
| 21 | if ! grep -q "$vendor_api_level_map" "$top/build/soong/android/vendor_api_levels.go" ; then |
| 22 | sed -i -e "/case ${FINAL_BOARD_API_LEVEL}:/{N;a \\\t$vendor_api_level_map\n\t\tsdkVersion = ${FINAL_NEXT_CORRESPONDING_SDK_VERSION} |
| 23 | }" "$top/build/soong/android/vendor_api_levels.go" |
| 24 | fi |
| 25 | |
Inseob Kim | 9d5066b | 2024-01-19 21:28:09 +0900 | [diff] [blame] | 26 | # system/sepolicy |
Devin Moore | df129fb | 2024-02-02 22:08:32 +0000 | [diff] [blame] | 27 | "$top/system/sepolicy/tools/finalize-vintf-resources.sh" "$top" "$FINAL_BOARD_API_LEVEL" |
Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 28 | |
Devin Moore | 56f8a77 | 2024-02-02 01:06:45 +0000 | [diff] [blame] | 29 | create_new_compat_matrix_and_kernel_configs |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 30 | |
Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 31 | # pre-finalization build target (trunk) |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 32 | local aidl_m="$top/build/soong/soong_ui.bash --make-mode" |
Hsin-Yi Chen | a7d2200 | 2024-02-07 17:12:53 +0800 | [diff] [blame] | 33 | AIDL_TRANSITIVE_FREEZE=true $aidl_m aidl-freeze-api create_reference_dumps |
| 34 | |
| 35 | # Generate LLNDK ABI dumps |
| 36 | # This command depends on ANDROID_BUILD_TOP |
| 37 | "$ANDROID_HOST_OUT/bin/create_reference_dumps" -release "$TARGET_RELEASE" --build-variant "$TARGET_BUILD_VARIANT" --lib-variant LLNDK |
Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Devin Moore | 56f8a77 | 2024-02-02 01:06:45 +0000 | [diff] [blame] | 40 | function create_new_compat_matrix_and_kernel_configs() { |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 41 | # The compatibility matrix versions are bumped during vFRC |
| 42 | # These will change every time we have a new vFRC |
Justin Yun | 7fc3802 | 2024-07-19 08:43:20 +0900 | [diff] [blame] | 43 | local CURRENT_COMPATIBILITY_MATRIX_LEVEL="$FINAL_BOARD_API_LEVEL" |
| 44 | local NEXT_COMPATIBILITY_MATRIX_LEVEL="$FINAL_NEXT_BOARD_API_LEVEL" |
Devin Moore | 56f8a77 | 2024-02-02 01:06:45 +0000 | [diff] [blame] | 45 | # The kernel configs need the letter of the Android release |
Justin Yun | 7fc3802 | 2024-07-19 08:43:20 +0900 | [diff] [blame] | 46 | local CURRENT_RELEASE_LETTER="$FINAL_CORRESPONDING_VERSION_LETTER" |
| 47 | local NEXT_RELEASE_LETTER="$FINAL_NEXT_CORRESPONDING_VERSION_LETTER" |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 48 | |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 49 | |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 50 | # build the targets required before touching the Android.bp/Android.mk files |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 51 | local build_cmd="$top/build/soong/soong_ui.bash --make-mode" |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 52 | $build_cmd bpmodify |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 53 | |
Justin Yun | 7fc3802 | 2024-07-19 08:43:20 +0900 | [diff] [blame] | 54 | "$top/prebuilts/build-tools/path/linux-x86/python3" "$top/hardware/interfaces/compatibility_matrices/bump.py" "$CURRENT_COMPATIBILITY_MATRIX_LEVEL" "$NEXT_COMPATIBILITY_MATRIX_LEVEL" "$CURRENT_RELEASE_LETTER" "$NEXT_RELEASE_LETTER" "$FINAL_CORRESPONDING_PLATFORM_VERSION" |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 55 | |
| 56 | # Freeze the current framework manifest file. This relies on the |
| 57 | # aosp_cf_x86_64-trunk_staging build target to get the right manifest |
| 58 | # fragments installed. |
| 59 | "$top/system/libhidl/vintfdata/freeze.sh" "$CURRENT_COMPATIBILITY_MATRIX_LEVEL" |
Devin Moore | a1339af | 2024-01-11 23:51:22 +0000 | [diff] [blame] | 60 | } |
| 61 | |
Devin Moore | bdc54ad | 2024-02-09 23:18:55 +0000 | [diff] [blame] | 62 | function freeze_framework_manifest() { |
| 63 | ANDROID_PRODUCT_OUT=~/workspace/internal/main/out/target/product/vsoc_x86 ANDROID_BUILD_TOP=~/workspace/internal/main ANDROID_HOST_OUT=~/workspace/internal/main/out/host/linux-x86 ./freeze.sh 202404 |
| 64 | |
| 65 | } |
| 66 | |
| 67 | |
Steven Moreland | 0f84e4b | 2023-12-16 02:51:26 +0000 | [diff] [blame] | 68 | finalize_vintf_resources |
| 69 | |