Allow /etc/defaults/vboot_reference to customise some utilities

The dev_debug_vboot program can sometimes interfere with
automated firmware testing because it takes too long to read the
BIOS flash. Limiting the sections of flash that are read may
help, but in some cases skipping this program entirely may be
better.

This CL does three things:

1. dev_debug_vboot will read only some sections of the BIOS
   flash, falling back to reading the whole thing only if it
   fails at that.

2. dev_debug_vboot will source /etc/default/vboot_reference if it
   exists. Putting DEV_DEBUG_FORCE=1 in that file will prevent
   dev_debug_vboot from reading the flash at all unless it's
   invoked with --force option.

3. The Makefile will create the /etc/default/vboot_reference file
   in the install directory, setting DEV_DEBUG_FORCE to the value
   in effect at build time. This will let a future CL change the
   default behavior for each target.

BUG=chromium:438854
BRANCH=none
TEST=manual

Built and tested on Samus. /etc/default/vboot_reference was
present, containing "DEV_DEBUG_FORCE=". The dev_debug_vboot
script ran normally.

Manually changing /etc/default/vboot_reference to contain
"DEV_DEBUG_FORCE=1" and rebooting caused dev_debug_vboot to stop
before reading the BIOS flash.

I also manually forced various flashrom invocations to fail to
test each part of the new flow.

Change-Id: Ib319dd16b9026162d01f435f15570ec8ba99c512
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/233228
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2 files changed