gooftool: Support optional arguments for verify commands.
The verify_* scripts used to rely on arguments to find out system
information, and is very useful for debugging purpose.
Add the arguments back to gooftool version so we are backward
compatible.
BUG=chromium:573933
TEST=make test
Change-Id: I678d84ac161592ff9c1525aa3b4759baf66265d6
Reviewed-on: https://chromium-review.googlesource.com/336551
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 4743126..cedeffc 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -508,11 +508,13 @@
print 'Verification SUCCESS!'
-@Command('verify_keys')
+@Command('verify_keys',
+ CmdArg('kernel_device', nargs='?', help='Kernel device to verify.'),
+ CmdArg('main_firmware', nargs='?', help='Main firmware image file.'))
def VerifyKeys(options): # pylint: disable=W0613
"""Verify keys in firmware and SSD match."""
-
- return GetGooftool(options).VerifyKeys()
+ return GetGooftool(options).VerifyKeys(
+ options.kernel_device, options.main_firmware)
@Command('set_fw_bitmap_locale')
@@ -524,18 +526,20 @@
index, locale)
-@Command('verify_system_time')
+@Command('verify_system_time',
+ CmdArg('root_dev', nargs='?', help='Root device to check.'))
def VerifySystemTime(options): # pylint: disable=W0613
"""Verify system time is later than release filesystem creation time."""
- return GetGooftool(options).VerifySystemTime()
+ return GetGooftool(options).VerifySystemTime(options.root_dev)
-@Command('verify_rootfs')
+@Command('verify_rootfs',
+ CmdArg('release_rootfs', nargs='?', help='Release root file system.'))
def VerifyRootFs(options): # pylint: disable=W0613
"""Verify rootfs on SSD is valid by checking hash."""
- return GetGooftool(options).VerifyRootFs()
+ return GetGooftool(options).VerifyRootFs(options.release_rootfs)
@Command('verify_tpm')