diff options
author | Will McVicker <willmcvicker@google.com> | 2023-11-27 14:28:19 -0800 |
---|---|---|
committer | Will McVicker <willmcvicker@google.com> | 2023-11-30 10:09:14 -0800 |
commit | 4464f9f77c4f918d0c3d26735a3f016fc021a685 (patch) | |
tree | 4c599a2a927edd7df1e22de44757b13a60f06a28 | |
parent | 32d2db6179111b26cf1f523de91e1fe67fec4c29 (diff) | |
download | build-4464f9f77c4f918d0c3d26735a3f016fc021a685.tar.gz |
build_utils.sh: update the SPL for developmentandroid-wear-13.0.0_r0.14android-wear-13.0.0_r0.12android-u-qpr3-beta-1_r0.7android-u-qpr3-beta-1_r0.5android-u-qpr3-beta-1_r0.4android-u-qpr3-beta-1_r0.3android-u-qpr3-beta-1_r0.2android-u-qpr3-beta-1_r0.1android-u-qpr2-beta-3_r0.7android-u-qpr2-beta-3_r0.6android-u-qpr2-beta-3_r0.5android-u-qpr2-beta-3_r0.4android-u-qpr2-beta-3_r0.3android-u-qpr2-beta-3_r0.2android-u-qpr2-beta-3.1_r0.7android-u-qpr2-beta-3.1_r0.5android-u-qpr2-beta-3.1_r0.4android-u-qpr2-beta-3.1_r0.3android-u-qpr2-beta-3.1_r0.2android-u-qpr2-beta-3.1_r0.1android-15-dp-1_r0.7android-15-dp-1_r0.5android-15-dp-1_r0.4android-15-dp-1_r0.3android-15-dp-1_r0.2android-15-dp-1_r0.1android-14.0.0_r0.56android-14.0.0_r0.55android-14.0.0_r0.54android-14.0.0_r0.53android-14.0.0_r0.52android-14.0.0_r0.51android-msm-eos-android13-wear-kr3-pixel-watchandroid-gs-tangorpro-5.10-android14-qpr2-betaandroid-gs-raviole-5.10-android14-qpr2-betaandroid-gs-pantah-5.10-android14-qpr2-betaandroid-gs-lynx-5.10-android14-qpr2-betaandroid-gs-felix-5.10-android14-qpr2-betaandroid-gs-bluejay-5.10-android14-qpr2-beta
The SPL in the platform build is being updated more frequently than
originally anticipated (previously it was updated quarterly in the
trunk_staging builds). Now the trunk staging SPL follows the monthly
SPL. To accomidate this, this patch updates the development build's SPL
to pick the QPR date after the next QPR, e.g. Nov 2023 builds would pick
March 2024.
Note, as a reminder, this is only applied for development GKI boot
images (not certified GKI boot images).
Bug: 274825778
Change-Id: I4b746e417d8b0403ad7a2cb21a83001cd1ecbd40
Signed-off-by: Will McVicker <willmcvicker@google.com>
-rw-r--r-- | build_utils.sh | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/build_utils.sh b/build_utils.sh index 2307615..3b48cbe 100644 --- a/build_utils.sh +++ b/build_utils.sh @@ -647,12 +647,12 @@ function gki_get_boot_img_size() { echo "${!boot_size_var}" } -# gki_add_avb_footer <image> <partition_size> <security_patch_month> +# gki_add_avb_footer <image> <partition_size> <security_patch_level> function gki_add_avb_footer() { - local spl_month="$3" + local spl_date="$3" local additional_props="" - if [ -n "${spl_month}" ]; then - additional_props="--prop com.android.build.boot.security_patch:$(date +'%Y')-${spl_month}-05" + if [ -n "${spl_date}" ]; then + additional_props="--prop com.android.build.boot.security_patch:${spl_date}" fi avbtool add_hash_footer --image "$1" \ @@ -660,18 +660,18 @@ function gki_add_avb_footer() { ${additional_props} } -# gki_dry_run_certify_bootimg <boot_image> <gki_artifacts_info_file> <security_patch_month> +# gki_dry_run_certify_bootimg <boot_image> <gki_artifacts_info_file> <security_patch_level> # The certify_bootimg script will be executed on a server over a GKI # boot.img during the official certification process, which embeds # a GKI certificate into the boot.img. The certificate is for Android # VTS to verify that a GKI boot.img is authentic. # Dry running the process here so we can catch related issues early. function gki_dry_run_certify_bootimg() { - local spl_month="$3" + local spl_date="$3" local additional_props=() - if [ -n "${spl_month}" ]; then + if [ -n "${spl_date}" ]; then additional_props+=("--extra_footer_args" \ - "--prop com.android.build.boot.security_patch:$(date +'%Y')-${spl_month}-05") + "--prop com.android.build.boot.security_patch:${spl_date}") fi certify_bootimg --boot_img "$1" \ @@ -705,11 +705,23 @@ function build_gki_artifacts_info() { # kernel images are optional, e.g., ${DIST_DIR}/Image.gz. function build_gki_boot_images() { local uncompressed_kernel_path=$1 - local spl_month=$(date +'%m') + # Pick a SPL date far enough in the future so that you can flash + # development GKI kernels on an unlocked device without wiping the + # userdata. This is for development purposes only and should be + # overwritten by the Android platform build to include an accurate SPL. + # Note, the certified GKI release builds will not include the SPL + # property. + local spl_month=$((($(date +'%m') + 3) % 12)) + local spl_year="$(date +'%Y')" if [ $((${spl_month} % 3)) -gt 0 ]; then - # Round up to the closest quarterly month + # Round up to the next quarterly platform release (QPR) month spl_month=$((${spl_month} + 3 - (${spl_month} % 3))) fi + if [ "${spl_month}" -lt "$(date +'%m')" ]; then + # rollover to the next year + spl_year="$((${spl_year} + 1))" + fi + local spl_date=$(printf "%d-%02d-05\n" ${spl_year} ${spl_month}) if ! [ -f "${uncompressed_kernel_path}" ]; then echo "ERROR: '${uncompressed_kernel_path}' doesn't exist" >&2 @@ -746,9 +758,9 @@ function build_gki_boot_images() { "${MKBOOTIMG_PATH}" "${GKI_MKBOOTIMG_ARGS[@]}" gki_add_avb_footer "${boot_image_path}" \ - "$(gki_get_boot_img_size "${compression}")" "${spl_month}" + "$(gki_get_boot_img_size "${compression}")" "${spl_date}" gki_dry_run_certify_bootimg "${boot_image_path}" \ - "${GKI_ARTIFACTS_INFO_FILE}" "${spl_month}" + "${GKI_ARTIFACTS_INFO_FILE}" "${spl_date}" images_to_pack+=("${boot_image}") done |