aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/_testing.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-09-14 04:57:29 -0600
committerSimon Glass <sjg@chromium.org>2018-09-29 11:49:35 -0600
commitba64a0bbb7b7128479a97fdf58baa9ddfbfe4db6 (patch)
treebda0f81481e31aa9563906e2049124b610652b96 /tools/binman/etype/_testing.py
parent0a98b28b06800da48f006069fe14e47dd399d2ff (diff)
downloadu-boot-ba64a0bbb7b7128479a97fdf58baa9ddfbfe4db6.zip
u-boot-ba64a0bbb7b7128479a97fdf58baa9ddfbfe4db6.tar.gz
u-boot-ba64a0bbb7b7128479a97fdf58baa9ddfbfe4db6.tar.bz2
binman: Support expanding entries
It is useful to have entries which can grow automatically to fill available space. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/_testing.py')
-rw-r--r--tools/binman/etype/_testing.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/binman/etype/_testing.py b/tools/binman/etype/_testing.py
index 02c165c..3e345bd 100644
--- a/tools/binman/etype/_testing.py
+++ b/tools/binman/etype/_testing.py
@@ -48,6 +48,8 @@ class Entry__testing(Entry):
'return-unknown-contents')
self.bad_update_contents = fdt_util.GetBool(self._node,
'bad-update-contents')
+ self.return_contents_once = fdt_util.GetBool(self._node,
+ 'return-contents-once')
# Set to True when the entry is ready to process the FDT.
self.process_fdt_ready = False
@@ -68,12 +70,15 @@ class Entry__testing(Entry):
EntryArg('test-existing-prop', str)], self.require_args)
if self.force_bad_datatype:
self.GetEntryArgsOrProps([EntryArg('test-bad-datatype-arg', bool)])
+ self.return_contents = True
def ObtainContents(self):
- if self.return_unknown_contents:
+ if self.return_unknown_contents or not self.return_contents:
return False
self.data = 'a'
self.contents_size = len(self.data)
+ if self.return_contents_once:
+ self.return_contents = False
return True
def GetOffsets(self):