New issue
Advanced search Search tips

Issue 801865 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jan 2018
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

verify_rootfs_chksum.sh doesn't work, uses old positional arguments to verity

Reported by nbis...@neverware.com, Jan 13 2018

Issue description

Steps to reproduce:

0. enter the CrOS chroot
1. ./build_image base
2. ./verify_rootfs_chksum.sh --image ../build/images/amd64-generic/latest/chromiumos_base_image.bin

The command immediately fails with this output:

missing value: create
Usage:
  /bin/verity <arg>=<value>...
Options:
  mode              One of 'create' or 'verify'
  alg               Hash algorithm to use. One of:
                      sha512 sha384 sha256 sha224 sha1 sha
                      mdc2 ripemd160 md5 md4 md2
  payload           Path to the image to hash
  payload_blocks    Size of the image, in blocks (4096 bytes)
  hashtree          Path to a hash tree to create or read from
  root_hexdigest    Digest of the root node (in hex) for verification
  salt              Salt (in hex)

ERROR   : Sat Jan 13 18:33:56 EST 2018
ERROR   :  PGID  PPID   PID     ELAPSED     TIME %CPU COMMAND
ERROR   : 29025     4 29025    01:42:12 00:00:00  0.0 -bash
ERROR   : 31137 29025 31137       00:12 00:00:00  0.3  \_ /bin/bash ./verify_rootfs_chksum.sh --image ../build/images/amd64-generic/latest/chromiumos_base_image.bin
ERROR   : 31137 31137 31284       00:05 00:00:00  0.0      \_ /bin/bash ./verify_rootfs_chksum.sh --image ../build/images/amd64-generic/latest/chromiumos_base_image.bin
ERROR   : 31137 31284 31285       00:05 00:00:00  0.0          \_ ps f -o pgid,ppid,pid,etime,cputime,%cpu,command
ERROR   : Arguments of 31137: ./verify_rootfs_chksum.sh '--image' '../build/images/amd64-generic/latest/chromiumos_base_image.bin'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :  verify_rootfs_chksum.sh:94:main(), called: die_err_trap  
ERROR   : 
ERROR   : Command failed:
ERROR   :   Command 'table="vroot none ro,"$(sudo "${VERITY}" create 0         "${verity_algorithm}"         "${ROOTFS_IMG}"         $((rootfs_sectors / 8))         /dev/null)' exited with nonzero code: 255
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosutils/+/7be80ae217367b17daa5060f39ada069ad27e2cd

commit 7be80ae217367b17daa5060f39ada069ad27e2cd
Author: Nicholas Bishop <nbishop@neverware.com>
Date: Tue Jan 16 04:31:58 2018

verify_rootfs_chksum.sh: use key=val arguments for verity

The script was failing because it used positional arguments to verity,
but verity now expects key=val style arguments.

To make the script easier to debug the arguments to verity are now
printed before invoking it.

BUG= chromium:801865 
TEST=Inside the chroot run "./verify_rootfs_chksum.sh --image path/to/image.bin". Should print out "Root filesystem checksum match!".

Change-Id: I5bb1b0b741d42e156d1babc28a426dd2046be566
Reviewed-on: https://chromium-review.googlesource.com/866059
Commit-Ready: Nicholas Bishop <nbishop@neverware.com>
Tested-by: Nicholas Bishop <nbishop@neverware.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/7be80ae217367b17daa5060f39ada069ad27e2cd/verify_rootfs_chksum.sh

Status: Fixed (was: Unconfirmed)

Sign in to add a comment