1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright (c) 2018 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
5 # Entry-type module for U-Boot ELF image
8 from binman.entry import Entry
9 from binman.etype.blob import Entry_blob
11 from dtoc import fdt_util
12 from patman import tools
14 class Entry_u_boot_elf(Entry_blob):
17 Properties / Entry arguments:
18 - filename: Filename of u-boot (default 'u-boot')
20 This is the U-Boot ELF image. It does not include a device tree but can be
21 relocated to any address for execution.
23 def __init__(self, section, etype, node):
24 Entry_blob.__init__(self, section, etype, node)
25 self._strip = fdt_util.GetBool(self._node, 'strip')
27 def ReadBlobContents(self):
29 uniq = self.GetUniqueName()
30 out_fname = tools.GetOutputFilename('%s.stripped' % uniq)
31 tools.WriteFile(out_fname, tools.ReadFile(self._pathname))
32 tools.Run('strip', out_fname)
33 self._pathname = out_fname
34 Entry_blob.ReadBlobContents(self)
37 def GetDefaultFilename(self):