Revert "build_kernel_image: use a salt for verity."

Seems to break internal PFQ.

This reverts commit e13e4d94753a585234189f0f34c1723cdbdb36a4

Change-Id: Ia232dc7a50feb87b2af8e945c6940eaa71390525
Reviewed-on: http://gerrit.chromium.org/gerrit/7195
Tested-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
This commit is contained in:
Darin Petkov 2011-09-02 13:38:18 -07:00
parent 6f568e6a94
commit 4b964ca646

View File

@ -76,14 +76,6 @@ eval set -- "${FLAGS_ARGV}"
# Die on error # Die on error
set -e set -e
make_salt() {
# It is not important that the salt be cryptographically strong; it just needs
# to be different for each release. The purpose of the salt is just to ensure
# that if someone collides a block in one release, they can't reuse it in
# future releases.
xxd -l 32 -p -c 32 /dev/urandom
}
verity_args= verity_args=
# Even with a rootfs_image, root= is not changed unless specified. # Even with a rootfs_image, root= is not changed unless specified.
if [[ -n "${FLAGS_rootfs_image}" && -n "${FLAGS_rootfs_hash}" ]]; then if [[ -n "${FLAGS_rootfs_image}" && -n "${FLAGS_rootfs_hash}" ]]; then
@ -108,16 +100,14 @@ if [[ -n "${FLAGS_rootfs_image}" && -n "${FLAGS_rootfs_hash}" ]]; then
error "Root file system blocks are not 4k!" error "Root file system blocks are not 4k!"
fi fi
salt=$(make_salt) info "Generating root fs hash tree."
info "Generating root fs hash tree (salt $salt)."
# Runs as sudo in case the image is a block device. # Runs as sudo in case the image is a block device.
# First argument to verity is reserved/unused and MUST be 0 # First argument to verity is reserved/unused and MUST be 0
table=$(sudo verity mode=create \ table=$(sudo verity mode=create \
alg=${FLAGS_verity_hash_alg} \ alg=${FLAGS_verity_hash_alg} \
payload=${FLAGS_rootfs_image} \ payload=${FLAGS_rootfs_image} \
payload_blocks=${root_fs_blocks} \ payload_blocks=${root_fs_blocks} \
hashtree=${FLAGS_rootfs_hash} \ hashtree=${FLAGS_rootfs_hash})
salt=$salt)
if [[ -f "${FLAGS_rootfs_hash}" ]]; then if [[ -f "${FLAGS_rootfs_hash}" ]]; then
sudo chmod a+r "${FLAGS_rootfs_hash}" sudo chmod a+r "${FLAGS_rootfs_hash}"
fi fi