diff options
Diffstat (limited to 'scripts/image_signing/sign_official_build.sh')
-rwxr-xr-x | scripts/image_signing/sign_official_build.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh index bbba4e25..8a1b4eb5 100755 --- a/scripts/image_signing/sign_official_build.sh +++ b/scripts/image_signing/sign_official_build.sh @@ -80,13 +80,6 @@ grab_kernel_config() { dump_kernel_config ${temp_kimage} } -# Get the hash from a kernel config command line -get_hash_from_config() { - local kernel_config=$1 - echo ${kernel_config} | sed -e 's/.*dm="\([^"]*\)".*/\1/g' | \ - cut -f2- -d, | cut -f9 -d ' ' -} - # TODO(gauravsh): These are duplicated from chromeos-setimage. We need # to move all signing and rootfs code to one single place where it can be # reused. crosbug.com/19543 @@ -104,6 +97,19 @@ is_old_verity_argv() { return 1 } +# Get the verity root digest hash from a kernel config command line. +get_hash_from_config() { + local kernel_config=$1 + local dm_config=$(echo ${kernel_config} | + sed -e 's/.*dm="\([^"]*\)".*/\1/g' | + cut -f2- -d, ) + if is_old_verity_argv "${dm_config}"; then + echo ${dm_config} | cut -f9 -d ' ' + else + echo $(get_verity_arg "${dm_config}" root_hexdigest) + fi +} + # Calculate rootfs hash of an image # Args: ROOTFS_IMAGE KERNEL_CONFIG HASH_IMAGE # |