From 8013679744e5873c3a17f526eafca01119f08157 Mon Sep 17 00:00:00 2001 From: Howard Chen Date: Tue, 2 Aug 2022 14:06:21 +0800 Subject: [PATCH] Fix the incorrect prebuilts-info in aosp-master-boot Bug: 241050793 Test: \ development/gsi/build_with_kernel/repack_kernels.sh aarch64 \ development/gsi/build_with_kernel/update_kernel_prebuilts_510_arm64.sh \ development/gsi/build_with_kernel/update_kernel_prebuilts_515_arm64.sh \ build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=gki_arm64 TARGET_BUILD_VARIANT=user DIST_DIR=%dist_dir% droid dist \ development/gsi/build_with_kernel/kernel_info_to_dist.sh aarch64 Change-Id: I6ee2e6a5dfbc4e3105bfcdf7191dd306edb59b4c --- gsi/build_with_kernel/repack_kernels_common.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gsi/build_with_kernel/repack_kernels_common.sh b/gsi/build_with_kernel/repack_kernels_common.sh index 401553854..5e47c42d6 100755 --- a/gsi/build_with_kernel/repack_kernels_common.sh +++ b/gsi/build_with_kernel/repack_kernels_common.sh @@ -86,7 +86,12 @@ function prepare_kernel_image() #EOF printf "generate ${dist_root}/prebuilt-info.txt with kernel\n" cksum "${out_root}/kernel-${kernel_version}${postfix}" - strings "${out_root}/kernel-${kernel_version}${postfix}" |grep -E "Linux version [0-9]\." | sed -e 's/Linux version.*-ab//'| cut -f1 -d ' ' > "${dist_root}/prebuilt-info.txt" + local t="${out_root}/prebuilt-info.txt" + echo "{" > $t + echo -n " \"kernel-build-id\": " >> $t + strings "${out_root}/kernel-${kernel_version}${postfix}" |grep -E "Linux version [0-9]\." | sed -e 's/Linux version.*-ab//'| cut -f1 -d ' ' >> $t + echo "}" >> $t + cp $t ${dist_root}/prebuilt-info.txt } @@ -131,7 +136,8 @@ function update_kernel_prebuilts_with_artifact kernel-${kernel_version}-lz4-allsyms \ kernel-${kernel_version} \ kernel-${kernel_version}-gz \ - kernel-${kernel_version}-lz4" + kernel-${kernel_version}-lz4 \ + prebuilt-info.txt" printf "%20s\n --> %20s\n" "${out_root}" "${prebuilts_dir}" for f in ${list}; do echo \