summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Shah <gauravsh@chromium.org>2011-08-24 10:15:35 -0700
committerGaurav Shah <gauravsh@chromium.org>2011-08-25 15:16:00 -0700
commitc0911e27b93eae772088ed09d7a41561b7a5b0b6 (patch)
tree2e96bd56fe3cdc21404f86de8e64b850107759a7
parenta36ee8740ec26d333ec9480f8124b67ad7aaa6d4 (diff)
downloadvboot-c0911e27b93eae772088ed09d7a41561b7a5b0b6.tar.gz
Fix image verify with new key-value verity params
BUG=chromium-os:18492 TEST=manually on new and old image. Change-Id: Ifa7ab70cd2cd3629656d167cd6f4bfaae8f7f03a Reviewed-on: http://gerrit.chromium.org/gerrit/6589 Reviewed-by: Elly Jones <ellyjones@chromium.org> Tested-by: Gaurav Shah <gauravsh@chromium.org>
-rwxr-xr-xscripts/image_signing/sign_official_build.sh20
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
#