binman: Support an entry that holds text
[oweals/u-boot.git] / tools / binman / etype / blob.py
index def21640b56f8c0ae4ed1c2c04a07dd553833264..28e6651a935e4c171b2e26c7ada812128919b031 100644 (file)
@@ -1,8 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2016 Google, Inc
 # Written by Simon Glass <sjg@chromium.org>
 #
-# SPDX-License-Identifier:      GPL-2.0+
-#
 # Entry-type module for blobs, which are binary objects read from files
 #
 
@@ -11,8 +10,8 @@ import fdt_util
 import tools
 
 class Entry_blob(Entry):
-    def __init__(self, image, etype, node):
-        Entry.__init__(self, image, etype, node)
+    def __init__(self, section, etype, node):
+        Entry.__init__(self, section, etype, node)
         self._filename = fdt_util.GetString(self._node, "filename", self.etype)
 
     def ObtainContents(self):
@@ -29,8 +28,7 @@ class Entry_blob(Entry):
             # new Entry method which can read in chunks. Then we could copy
             # the data in chunks and avoid reading it all at once. For now
             # this seems like an unnecessary complication.
-            self.data = fd.read()
-            self.contents_size = len(self.data)
+            self.SetContents(fd.read())
         return True
 
     def GetDefaultFilename(self):