]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
binman: Add an entry method for getting the default filename
authorSimon Glass <sjg@chromium.org>
Fri, 14 Sep 2018 10:57:18 +0000 (04:57 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 28 Sep 2018 17:09:01 +0000 (11:09 -0600)
Various entry implementations provide a way to obtain the default filename
for an entry. But at present there is no base-class implementation for
this function. Add one so that the API is defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/entry.py
tools/binman/entry_test.py

index e671a2ea09441a3e10928638739b0f17148abec8..ec3b22e9b312edec2cfc4d0d2a1532fb46bb92fe 100644 (file)
@@ -160,6 +160,9 @@ class Entry(object):
         self.align_end = fdt_util.GetInt(self._node, 'align-end')
         self.offset_unset = fdt_util.GetBool(self._node, 'offset-unset')
 
+    def GetDefaultFilename(self):
+        return None
+
     def AddMissingProperties(self):
         """Add new properties to the device tree as needed for this entry"""
         for prop in ['offset', 'size', 'image-pos']:
index 4100bcc3d3212f29eb23c20aee6cb83b08a623f6..69d85b4cedb13b23c64519a8e619e08cc51d0dbb 100644 (file)
@@ -65,6 +65,11 @@ class TestEntry(unittest.TestCase):
         sub_entry = entry.Entry(None, None, sub_node, read_node=False)
         self.assertEqual('root.subnode', sub_entry.GetUniqueName())
 
+    def testGetDefaultFilename(self):
+        """Trivial test for this base class function"""
+        import entry
+        base_entry = entry.Entry(None, None, None, read_node=False)
+        self.assertIsNone(base_entry.GetDefaultFilename())
 
 if __name__ == "__main__":
     unittest.main()