diff options
author | Simon Glass <sjg@chromium.org> | 2018-07-17 13:25:32 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-08-01 16:30:47 -0600 |
commit | 53af22a9958ca93c89056ad2750ad0d46a51b6c8 (patch) | |
tree | 232abf4eb746495b01b96f3540a370ae71ac1da0 /tools/binman/etype/_testing.py | |
parent | dc08ecc90cc57d7ca73f837a847a81c8b1e8af79 (diff) | |
download | u-boot-53af22a9958ca93c89056ad2750ad0d46a51b6c8.zip u-boot-53af22a9958ca93c89056ad2750ad0d46a51b6c8.tar.gz u-boot-53af22a9958ca93c89056ad2750ad0d46a51b6c8.tar.bz2 |
binman: Add support for passing arguments to entries
Sometimes it is useful to pass binman the value of an entry property from
the command line. For example some entries need access to files and it is
not always convenient to put these filenames in the image definition
(device tree).
Add a -a option which can be used like this:
-a<prop>=<value>
where
<prop> is the property to set
<value> is the value to set it to
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/_testing.py')
-rw-r--r-- | tools/binman/etype/_testing.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/binman/etype/_testing.py b/tools/binman/etype/_testing.py index 31f625c..3eeec72 100644 --- a/tools/binman/etype/_testing.py +++ b/tools/binman/etype/_testing.py @@ -5,7 +5,9 @@ # Entry-type module for testing purposes. Not used in real images. # -from entry import Entry +from collections import OrderedDict + +from entry import Entry, EntryArg import fdt_util import tools @@ -27,6 +29,21 @@ class Entry__testing(Entry): self.process_fdt_ready = False self.never_complete_process_fdt = fdt_util.GetBool(self._node, 'never-complete-process-fdt') + self.require_args = fdt_util.GetBool(self._node, 'require-args') + + # This should be picked up by GetEntryArgsOrProps() + self.test_existing_prop = 'existing' + self.force_bad_datatype = fdt_util.GetBool(self._node, + 'force-bad-datatype') + (self.test_str_fdt, self.test_str_arg, self.test_int_fdt, + self.test_int_arg, existing) = self.GetEntryArgsOrProps([ + EntryArg('test-str-fdt', str), + EntryArg('test-str-arg', str), + EntryArg('test-int-fdt', int), + EntryArg('test-int-arg', int), + EntryArg('test-existing-prop', str)], self.require_args) + if self.force_bad_datatype: + self.GetEntryArgsOrProps([EntryArg('test-bad-datatype-arg', bool)]) def ObtainContents(self): if self.return_unknown_contents: |