sign_official_build: add a dump_config helper and clean up argument processing

For debugging purposes, we like to see the kernel command line that a
particular kernel is using.  We have all the tools to do this already,
but not easy to leverage (you have to manually extract/etc...).  So
add a "dump_config" helper to help people out.

Further, the existing argc processing is incomplete and not terribly
friendly.  Add some useful error messages explaining why we quit.

BUG=None
TEST=`./sign_official_build.sh dump_config <bin>` works
TEST=`./sign_official_build.sh verify <bin>` works
TEST=`./sign_official_build.sh` shows usage
TEST=`./sign_official_build.sh recovery <bin>` shows usage
TEST=`./sign_official_build.sh recovery <bin> / /tmp/foo` tries to sign
BRANCH=None

Change-Id: I9f94250b8c299783bdcba704733974c6a5491101
Reviewed-on: https://gerrit.chromium.org/gerrit/39603
Reviewed-by: Paul Taysom <taysom@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
1 file changed