diff options
Diffstat (limited to 'scripts/image_signing/sign_official_build.sh')
-rwxr-xr-x | scripts/image_signing/sign_official_build.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh index 4e83a31a..59033c27 100755 --- a/scripts/image_signing/sign_official_build.sh +++ b/scripts/image_signing/sign_official_build.sh @@ -913,7 +913,13 @@ update_recovery_kernel_hash() { # Update the Kernel B hash in Kernel A command line local old_kerna_config="$(sudo dump_kernel_config "${loop_kerna}")" - local new_kernb_hash=$(sudo sha1sum "${loop_kernb}" | cut -f1 -d' ') + local old_kernb_hash="$(echo "$old_kerna_config" | + sed -nEe "s#.*kern_b_hash=([a-z0-9]*).*#\1#p")" + if [[ "${#old_kernb_hash}" -lt 64 ]]; then + local new_kernb_hash=$(sudo sha1sum "${loop_kernb}" | cut -f1 -d' ') + else + local new_kernb_hash=$(sudo sha256sum "${loop_kernb}" | cut -f1 -d' ') + fi new_kerna_config=$(make_temp_file) echo "$old_kerna_config" | |