aboutsummaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
authorSimon Glass2018-09-14 04:57:28 -0600
committerSimon Glass2018-09-29 11:49:35 -0600
commit0a98b28b06800da48f006069fe14e47dd399d2ff (patch)
tree1646d2600d0b6e8ba7459695db082bc7f345d9b6 /tools/patman
parentb4e1a38c294f56708d1a82717c850da359401d7e (diff)
binman: Support adding files
In some cases it is useful to add a group of files to the image and be able to access them at run-time. Of course it is possible to generate the binman config file with a set of blobs each with a filename. But for convenience, add an entry type which can do this. Add required support (for adding nodes and string properties) into the state module. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rw-r--r--tools/patman/tools.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 0870bccca0e..1c9bf4e8100 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -4,6 +4,7 @@
#
import command
+import glob
import os
import shutil
import tempfile
@@ -123,6 +124,23 @@ def GetInputFilename(fname):
raise ValueError("Filename '%s' not found in input path (%s) (cwd='%s')" %
(fname, ','.join(indir), os.getcwd()))
+def GetInputFilenameGlob(pattern):
+ """Return a list of filenames for use as input.
+
+ Args:
+ pattern: Filename pattern to search for
+
+ Returns:
+ A list of matching files in all input directories
+ """
+ if not indir:
+ return glob.glob(fname)
+ files = []
+ for dirname in indir:
+ pathname = os.path.join(dirname, pattern)
+ files += glob.glob(pathname)
+ return sorted(files)
+
def Align(pos, align):
if align:
mask = align - 1