aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create
diff options
context:
space:
mode:
authorGeorgy Redkozubov <georgy.redkozubov@linaro.org>2013-10-14 11:53:14 +0400
committerGeorgy Redkozubov <georgy.redkozubov@linaro.org>2013-10-14 11:53:14 +0400
commit0ebe866633d2c64540b3a8f420b8acc513bb04f7 (patch)
tree87a713fab82ba9e9fc29f6af496a00893f3df0ed /linaro_image_tools/media_create
parentbbd9b863885ad3728074177aeee0347eee18f044 (diff)
downloadlinaro-image-tools-0ebe866633d2c64540b3a8f420b8acc513bb04f7.tar.gz
Added checks for dtb_files and if found set first entry as default dtb file.
Diffstat (limited to 'linaro_image_tools/media_create')
-rw-r--r--linaro_image_tools/media_create/boards.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index 57ffab7..4e6e3f5 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -873,6 +873,25 @@ class BoardConfig(object):
if self.dtb_file:
dtb = _get_file_matching(os.path.join(path, self.dtb_file))
if not self.dtb_file or not dtb:
+ logger.warn("Could not find a valid dtb file from dtb_file, "
+ "trying dtb_files...")
+
+ if self.dtb_files:
+ # Use first file from list as a default dtb file.
+ dtb_file = self.dtb_files[0]
+ if dtb_file:
+ if isinstance(dtb_file, dict):
+ for key, value in dtb_file.iteritems():
+ # The name of the dtb file.
+ to_file = os.path.basename(key)
+ from_file = value
+
+ # User specified only the directory, without renaming
+ # the file.
+ if not to_file:
+ to_file = os.path.basename(from_file)
+ dtb = _get_file_matching(os.path.join(path, to_file))
+ if not self.dtb_files or not dtb:
logger.warn("Could not find a valid dtb file, skipping it.")
logger.info("Will use kernel=%s, initrd=%s, dtb=%s." %