cros_bundle_firmware: Add an option to disable defaults

These tools have a lot of default settings. They are useful in normal
operation but can also obscure problems or missing files.

Add a -D option to disable all defaults. Every file needed by the
tool will then need to be provided explicitly using command line
parameters.

Add tests for this functionality also.

BUG=chromium-os:38684
TEST=FEATURES=test sudo -E emerge cros-devutils

Change-Id: I26121f4fe3095d86bb10bbc266df69dc0f8f1dc6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43004
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index eab7369..1eceafd 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -1111,19 +1111,26 @@
     self._tools.OutputSize('Final image', image)
     return image, pack
 
-  def SelectFdt(self, fdt_fname):
+  def SelectFdt(self, fdt_fname, use_defaults):
     """Select an FDT to control the firmware bundling
 
+    We make a copy of this which will include any on-the-fly changes we want
+    to make.
+
     Args:
       fdt_fname: The filename of the fdt to use.
+      use_defaults: True to use a default FDT name if available, and to add
+          a full path to the provided filename if necessary.
 
     Returns:
       The Fdt object of the original fdt file, which we will not modify.
 
-    We make a copy of this which will include any on-the-fly changes we want
-    to make.
+    Raises:
+      ValueError if no FDT is provided (fdt_fname is None and use_defaults is
+          False).
     """
-    fdt_fname = self._CheckFdtFilename(fdt_fname)
+    if use_defaults:
+      fdt_fname = self._CheckFdtFilename(fdt_fname)
     if not fdt_fname:
       raise ValueError('Please provide an FDT filename')
     fdt = Fdt(self._tools, fdt_fname)